From c213f0dbec73b2d8c10dfb86e693c40414b6626e Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Mon, 2 Nov 2015 10:08:00 +0000 Subject: [PATCH] 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 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- usr.sbin/makefs/tests/makefs_cd9660_tests.sh | 2 +- usr.sbin/makefs/tests/makefs_ffs_tests.sh | 2 +- usr.sbin/makefs/tests/makefs_tests_common.sh | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh index 214ae2b4d133..161b56b12e7a 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 diff --git a/usr.sbin/makefs/tests/makefs_ffs_tests.sh b/usr.sbin/makefs/tests/makefs_ffs_tests.sh index 4bc3f5c25892..4dc2fd907baa 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 \ diff --git a/usr.sbin/makefs/tests/makefs_tests_common.sh b/usr.sbin/makefs/tests/makefs_tests_common.sh index d0099fd9c183..add0b88728e2 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