summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-11-09 09:20:01 +0000
committerngie <ngie@FreeBSD.org>2015-11-09 09:20:01 +0000
commitb57d6dcae3729ccf1fe7cfe7704e1b09f747c6bc (patch)
treebc0c50586e8da26dccc930b0bf15c0521590634a /usr.sbin
parentcc0f248e7c26f7dbcb533306fcf7bb7b058819ad (diff)
downloadFreeBSD-src-b57d6dcae3729ccf1fe7cfe7704e1b09f747c6bc.zip
FreeBSD-src-b57d6dcae3729ccf1fe7cfe7704e1b09f747c6bc.tar.gz
MFC r290265,r290267,r290270:
r290265: Add testcases for -t cd9660 -o isolevel=[1-3] -- -o isolevel=1 currently fails because of path comparison issues, so mark it as an expected failure. -- -o isolevel=3 is not implemented, so expect it to fail as an out of bounds value [*]. PR: 203645 Sponsored by: EMC / Isilon Storage Division r290267: Clean up mtree keyword support a slight bit and add a few more default keywords - Parameterize the mtree keywords as $DEFAULT_MTREE_KEYWORDS - Test with the extra mtree keywords, `mode,gid,uid`. - Add a note about mtrees with time support not working with makefs right now Sponsored by: EMC / Isilon Storage Division r290270: Add testcases for -t ffs -o version=[12] Verify the filesystem type using dumpfs. Add preliminary support for NetBSD (needs to be validated) Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/makefs/tests/makefs_cd9660_tests.sh60
-rwxr-xr-xusr.sbin/makefs/tests/makefs_ffs_tests.sh69
-rwxr-xr-xusr.sbin/makefs/tests/makefs_tests_common.sh9
3 files changed, 134 insertions, 4 deletions
diff --git a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
index e476cf1..161b56b 100755
--- a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
+++ b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
@@ -113,7 +113,7 @@ from_mtree_spec_file_body()
create_test_inputs
atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \
- mtree -c -k type,link,size -p $TEST_INPUTS_DIR
+ mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR
cd $TEST_INPUTS_DIR
atf_check -e empty -o empty -s exit:0 \
$MAKEFS $TEST_IMAGE $TEST_SPEC_FILE
@@ -208,6 +208,61 @@ o_flag_allow_max_name_cleanup()
common_cleanup
}
+atf_test_case o_flag_isolevel_1 cleanup
+o_flag_isolevel_1_body()
+{
+ atf_expect_fail "this testcase needs work; the filenames generated seem incorrect/corrupt"
+
+ create_test_inputs
+
+ atf_check -e empty -o empty -s exit:0 \
+ $MAKEFS -o isolevel=1 $TEST_IMAGE $TEST_INPUTS_DIR
+
+ mount_image
+ check_base_iso9660_image_contents
+}
+o_flag_isolevel_1_cleanup()
+{
+ common_cleanup
+}
+
+atf_test_case o_flag_isolevel_2 cleanup
+o_flag_isolevel_2_body()
+{
+ create_test_inputs
+
+ atf_check -e empty -o empty -s exit:0 \
+ $MAKEFS -o isolevel=2 $TEST_IMAGE $TEST_INPUTS_DIR
+
+ mount_image
+ check_base_iso9660_image_contents
+}
+o_flag_isolevel_2_cleanup()
+{
+ common_cleanup
+}
+
+atf_test_case o_flag_isolevel_3 cleanup
+o_flag_isolevel_3_body()
+{
+ create_test_inputs
+
+ # XXX: isolevel=3 isn't implemented yet. See FreeBSD bug # 203645
+ if true; then
+ atf_check -e match:'makefs: ISO Level 3 is greater than 2\.' -o empty -s not-exit:0 \
+ $MAKEFS -o isolevel=3 $TEST_IMAGE $TEST_INPUTS_DIR
+ else
+ atf_check -e empty -o empty -s exit:0 \
+ $MAKEFS -o isolevel=3 $TEST_IMAGE $TEST_INPUTS_DIR
+ mount_image
+ check_base_iso9660_image_contents
+ fi
+}
+o_flag_isolevel_3_cleanup()
+{
+ common_cleanup
+}
+
atf_test_case o_flag_preparer
o_flag_preparer_body()
{
@@ -308,6 +363,9 @@ atf_init_test_cases()
atf_add_test_case o_flag_allow_deep_trees
atf_add_test_case o_flag_allow_max_name
+ atf_add_test_case o_flag_isolevel_1
+ atf_add_test_case o_flag_isolevel_2
+ atf_add_test_case o_flag_isolevel_3
atf_add_test_case o_flag_preparer
atf_add_test_case o_flag_publisher
atf_add_test_case o_flag_rockridge
diff --git a/usr.sbin/makefs/tests/makefs_ffs_tests.sh b/usr.sbin/makefs/tests/makefs_ffs_tests.sh
index 4bc3f5c..121c2a2 100755
--- a/usr.sbin/makefs/tests/makefs_ffs_tests.sh
+++ b/usr.sbin/makefs/tests/makefs_ffs_tests.sh
@@ -105,7 +105,7 @@ from_mtree_spec_file_body()
create_test_inputs
atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \
- mtree -c -k type,link,size -p $TEST_INPUTS_DIR
+ mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR
cd $TEST_INPUTS_DIR
atf_check -e empty -o not-empty -s exit:0 \
@@ -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
}
diff --git a/usr.sbin/makefs/tests/makefs_tests_common.sh b/usr.sbin/makefs/tests/makefs_tests_common.sh
index d0099fd..add0b88 100755
--- a/usr.sbin/makefs/tests/makefs_tests_common.sh
+++ b/usr.sbin/makefs/tests/makefs_tests_common.sh
@@ -29,6 +29,13 @@
KB=1024
: ${TMPDIR=/tmp}
+# TODO: add mtree `time` support; get a lot of errors like this right now when
+# passing generating disk images with keyword mtree support, like:
+#
+# `[...]/mtree.spec:8: error: time: invalid value '1446458503'`
+#
+#DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link,time"
+DEFAULT_MTREE_KEYWORDS="type,mode,gid,uid,size,link"
TEST_IMAGE="$TMPDIR/test.img"
TEST_INPUTS_DIR="$TMPDIR/inputs"
TEST_MD_DEVICE_FILE="$TMPDIR/md.output"
@@ -39,7 +46,7 @@ check_image_contents()
{
local directories=$TEST_INPUTS_DIR
local excludes mtree_excludes_arg mtree_file
- local mtree_keywords="type,link,size"
+ local mtree_keywords="$DEFAULT_MTREE_KEYWORDS"
while getopts "d:f:m:X:" flag; do
case "$flag" in
OpenPOWER on IntegriCloud