summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-11-02 11:06:51 +0000
committerngie <ngie@FreeBSD.org>2015-11-02 11:06:51 +0000
commit14430a453153ace672f8971552ec4a514c1d30a2 (patch)
tree239da0da677f17342164bf76271ed600882c886d /usr.sbin
parent911491ae37893b2388109d6fbc258c96758a2216 (diff)
downloadFreeBSD-src-14430a453153ace672f8971552ec4a514c1d30a2.zip
FreeBSD-src-14430a453153ace672f8971552ec4a514c1d30a2.tar.gz
Add testcases for -t ffs -o version=[12]
Verify the filesystem type using dumpfs. Add preliminary support for NetBSD (needs to be validated) MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/makefs/tests/makefs_ffs_tests.sh67
1 files changed, 66 insertions, 1 deletions
diff --git a/usr.sbin/makefs/tests/makefs_ffs_tests.sh b/usr.sbin/makefs/tests/makefs_ffs_tests.sh
index 4dc2fd9..121c2a2 100755
--- a/usr.sbin/makefs/tests/makefs_ffs_tests.sh
+++ b/usr.sbin/makefs/tests/makefs_ffs_tests.sh
@@ -158,6 +158,70 @@ from_single_dir_cleanup()
common_cleanup
}
+atf_test_case o_flag_version_1 cleanup
+o_flag_version_1_body()
+{
+ ffs_version=1
+
+ platform=$(uname)
+ case "$platform" in
+ FreeBSD)
+ ffs_label=UFS${ffs_version}
+ ;;
+ NetBSD)
+ ffs_label=FFSv${ffs_version}
+ ;;
+ *)
+ atf_skip "Unsupported platform"
+ ;;
+ esac
+
+ create_test_inputs
+
+ atf_check -e empty -o not-empty -s exit:0 \
+ $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR
+
+ mount_image
+ atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR
+ check_ffs_image_contents
+}
+o_flag_version_1_cleanup()
+{
+ common_cleanup
+}
+
+atf_test_case o_flag_version_2 cleanup
+o_flag_version_2_body()
+{
+ ffs_version=2
+
+ platform=$(uname)
+ case "$platform" in
+ FreeBSD)
+ ffs_label=UFS${ffs_version}
+ ;;
+ NetBSD)
+ ffs_label=FFSv${ffs_version}
+ ;;
+ *)
+ atf_skip "Unsupported platform"
+ ;;
+ esac
+
+ create_test_inputs
+
+ atf_check -e empty -o not-empty -s exit:0 \
+ $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR
+
+ mount_image
+ atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR
+ check_ffs_image_contents
+}
+o_flag_version_2_cleanup()
+{
+ common_cleanup
+}
+
atf_init_test_cases()
{
@@ -168,5 +232,6 @@ atf_init_test_cases()
atf_add_test_case from_multiple_dirs
atf_add_test_case from_single_dir
-
+ atf_add_test_case o_flag_version_1
+ atf_add_test_case o_flag_version_2
}
OpenPOWER on IntegriCloud