Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | check_base_iso9660_image_contents() | ||||
# Symlinks are treated like files when rockridge support isn't | # Symlinks are treated like files when rockridge support isn't | ||||
# specified | # specified | ||||
check_image_contents "$@" -X c | check_image_contents "$@" -X c | ||||
atf_check -e empty -o empty -s exit:0 test -L $TEST_INPUTS_DIR/c | atf_check -e empty -o empty -s exit:0 test -L $TEST_INPUTS_DIR/c | ||||
atf_check -e empty -o empty -s exit:0 test -f $TEST_MOUNT_DIR/c | atf_check -e empty -o empty -s exit:0 test -f $TEST_MOUNT_DIR/c | ||||
} | } | ||||
check_cd9660_support() { | |||||
kldstat -m cd9660 || \ | |||||
atf_skip "Requires cd9660 filesystem support to be present in the kernel" | |||||
} | |||||
atf_test_case D_flag cleanup | atf_test_case D_flag cleanup | ||||
D_flag_body() | D_flag_body() | ||||
{ | { | ||||
atf_skip "makefs crashes with SIGBUS with dupe mtree entries; see FreeBSD bug # 192839" | atf_skip "makefs crashes with SIGBUS with dupe mtree entries; see FreeBSD bug # 192839" | ||||
create_test_inputs | create_test_inputs | ||||
atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ | atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ | ||||
Show All 14 Lines | |||||
D_flag_cleanup() | D_flag_cleanup() | ||||
{ | { | ||||
common_cleanup | common_cleanup | ||||
} | } | ||||
atf_test_case F_flag cleanup | atf_test_case F_flag cleanup | ||||
F_flag_body() | F_flag_body() | ||||
{ | { | ||||
check_cd9660_support | |||||
create_test_inputs | create_test_inputs | ||||
atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ | atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ | ||||
mtree -cp $TEST_INPUTS_DIR | mtree -cp $TEST_INPUTS_DIR | ||||
atf_check -e empty -o empty -s exit:0 \ | atf_check -e empty -o empty -s exit:0 \ | ||||
$MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR | $MAKEFS -F $TEST_SPEC_FILE -M 1m $TEST_IMAGE $TEST_INPUTS_DIR | ||||
mount_image | mount_image | ||||
check_base_iso9660_image_contents | check_base_iso9660_image_contents | ||||
} | } | ||||
F_flag_cleanup() | F_flag_cleanup() | ||||
{ | { | ||||
common_cleanup | common_cleanup | ||||
} | } | ||||
atf_test_case from_mtree_spec_file cleanup | atf_test_case from_mtree_spec_file cleanup | ||||
from_mtree_spec_file_body() | from_mtree_spec_file_body() | ||||
{ | { | ||||
check_cd9660_support | |||||
create_test_inputs | create_test_inputs | ||||
atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ | atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ | ||||
mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR | mtree -c -k "$DEFAULT_MTREE_KEYWORDS" -p $TEST_INPUTS_DIR | ||||
cd $TEST_INPUTS_DIR | cd $TEST_INPUTS_DIR | ||||
atf_check -e empty -o empty -s exit:0 \ | atf_check -e empty -o empty -s exit:0 \ | ||||
$MAKEFS $TEST_IMAGE $TEST_SPEC_FILE | $MAKEFS $TEST_IMAGE $TEST_SPEC_FILE | ||||
cd - | cd - | ||||
mount_image | mount_image | ||||
check_base_iso9660_image_contents | check_base_iso9660_image_contents | ||||
} | } | ||||
from_mtree_spec_file_cleanup() | from_mtree_spec_file_cleanup() | ||||
{ | { | ||||
common_cleanup | common_cleanup | ||||
} | } | ||||
atf_test_case from_multiple_dirs cleanup | atf_test_case from_multiple_dirs cleanup | ||||
from_multiple_dirs_body() | from_multiple_dirs_body() | ||||
{ | { | ||||
check_cd9660_support | |||||
test_inputs_dir2=$TMPDIR/inputs2 | test_inputs_dir2=$TMPDIR/inputs2 | ||||
create_test_inputs | create_test_inputs | ||||
atf_check -e empty -o empty -s exit:0 mkdir -p $test_inputs_dir2 | atf_check -e empty -o empty -s exit:0 mkdir -p $test_inputs_dir2 | ||||
atf_check -e empty -o empty -s exit:0 \ | atf_check -e empty -o empty -s exit:0 \ | ||||
touch $test_inputs_dir2/multiple_dirs_test_file | touch $test_inputs_dir2/multiple_dirs_test_file | ||||
atf_check -e empty -o empty -s exit:0 \ | atf_check -e empty -o empty -s exit:0 \ | ||||
$MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR $test_inputs_dir2 | $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR $test_inputs_dir2 | ||||
mount_image | mount_image | ||||
check_base_iso9660_image_contents -d $test_inputs_dir2 | check_base_iso9660_image_contents -d $test_inputs_dir2 | ||||
} | } | ||||
from_multiple_dirs_cleanup() | from_multiple_dirs_cleanup() | ||||
{ | { | ||||
common_cleanup | common_cleanup | ||||
} | } | ||||
atf_test_case from_single_dir cleanup | atf_test_case from_single_dir cleanup | ||||
from_single_dir_body() | from_single_dir_body() | ||||
{ | { | ||||
check_cd9660_support | |||||
create_test_inputs | create_test_inputs | ||||
atf_check -e empty -o empty -s exit:0 \ | atf_check -e empty -o empty -s exit:0 \ | ||||
$MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR | $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR | ||||
mount_image | mount_image | ||||
check_base_iso9660_image_contents | check_base_iso9660_image_contents | ||||
} | } | ||||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |