Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/fstyp/tests/fstyp_test.sh
| Show All 21 Lines | |||||
| # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
| # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
| # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
| # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
| # SUCH DAMAGE. | # SUCH DAMAGE. | ||||
| # $FreeBSD$ | # $FreeBSD$ | ||||
| atf_test_case bfs | |||||
| bfs_head() { | |||||
| atf_set "descr" "fstyp(8) can detect bfs and label filesystems" | |||||
rpokala: s/befs/BeFS/ | |||||
| } | |||||
| bfs_body() { | |||||
| bzcat $(atf_get_srcdir)/bfs.img.bz2 > bfs.img | |||||
| atf_check -s exit:0 -o inline:"bfs\n" fstyp bfs.img | |||||
| atf_check -s exit:0 -o inline:"bfs BeFS\n" fstyp -l bfs.img | |||||
| } | |||||
| atf_test_case cd9660 | atf_test_case cd9660 | ||||
| cd9660_head() { | cd9660_head() { | ||||
| atf_set "descr" "fstyp(8) should detect cd9660 filesystems" | atf_set "descr" "fstyp(8) should detect cd9660 filesystems" | ||||
| } | } | ||||
| cd9660_body() { | cd9660_body() { | ||||
| atf_check -s exit:0 mkdir -p dir/emptydir # makefs requires a nonempty directory | atf_check -s exit:0 mkdir -p dir/emptydir # makefs requires a nonempty directory | ||||
| atf_check -s exit:0 -o ignore makefs -t cd9660 -Z -s 64m cd9660.img dir | atf_check -s exit:0 -o ignore makefs -t cd9660 -Z -s 64m cd9660.img dir | ||||
| atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img | atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img | ||||
| ▲ Show 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | |||||
| zeros_head() { | zeros_head() { | ||||
| atf_set "descr" "fstyp(8) should fail on a zero-filled file" | atf_set "descr" "fstyp(8) should fail on a zero-filled file" | ||||
| } | } | ||||
| zeros_body() { | zeros_body() { | ||||
| atf_check -s exit:0 truncate -s 256m zeros | atf_check -s exit:0 truncate -s 256m zeros | ||||
| atf_check -s exit:1 -e match:"filesystem not recognized" fstyp zeros | atf_check -s exit:1 -e match:"filesystem not recognized" fstyp zeros | ||||
| } | } | ||||
| atf_test_case bfs | |||||
| bfs_head() { | |||||
| atf_set "descr" "fstyp(8) can detect bfs and label filesystems" | |||||
| } | |||||
| bfs_body() { | |||||
| bzcat $(atf_get_srcdir)/bfs.img.bz2 > bfs.img | |||||
| atf_check -s exit:0 -o inline:"bfs\n" fstyp bfs.img | |||||
| atf_check -s exit:0 -o inline:"bfs BeFS\n" fstyp -l bfs.img | |||||
| } | |||||
| atf_init_test_cases() { | atf_init_test_cases() { | ||||
| atf_add_test_case bfs | |||||
| atf_add_test_case cd9660 | atf_add_test_case cd9660 | ||||
| atf_add_test_case cd9660_label | atf_add_test_case cd9660_label | ||||
| atf_add_test_case dir | atf_add_test_case dir | ||||
| atf_add_test_case empty | atf_add_test_case empty | ||||
| atf_add_test_case exfat | atf_add_test_case exfat | ||||
| atf_add_test_case exfat_label | atf_add_test_case exfat_label | ||||
| atf_add_test_case ext2 | atf_add_test_case ext2 | ||||
| atf_add_test_case ext3 | atf_add_test_case ext3 | ||||
| atf_add_test_case ext4 | atf_add_test_case ext4 | ||||
| atf_add_test_case ext4_label | atf_add_test_case ext4_label | ||||
| atf_add_test_case fat12 | atf_add_test_case fat12 | ||||
| atf_add_test_case fat16 | atf_add_test_case fat16 | ||||
| atf_add_test_case fat32 | atf_add_test_case fat32 | ||||
| atf_add_test_case fat32_label | atf_add_test_case fat32_label | ||||
| atf_add_test_case ntfs | atf_add_test_case ntfs | ||||
| atf_add_test_case ntfs_with_label | atf_add_test_case ntfs_with_label | ||||
| atf_add_test_case ufs1 | atf_add_test_case ufs1 | ||||
| atf_add_test_case ufs2 | atf_add_test_case ufs2 | ||||
| atf_add_test_case ufs2_label | atf_add_test_case ufs2_label | ||||
| atf_add_test_case ufs_on_device | atf_add_test_case ufs_on_device | ||||
| atf_add_test_case bfs | |||||
| atf_add_test_case zeros | atf_add_test_case zeros | ||||
Done Inline ActionsThis seems to be slightly out of order. 0mp: This seems to be slightly out of order. | |||||
| } | } | ||||
s/befs/BeFS/