2 # test btrfstune options that enable filesystem features
4 source "$TEST_TOP/common"
6 check_prereq mkfs.btrfs
13 # test whether fsck can rebuild a corrupted extent tree
15 # - option for mkfs.btrfs -O, empty for defaults
16 # - option for btrfstune
17 # - string representing the feature in dump-super output
28 run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f \
29 ${mkfsfeatures:+-O ^"$mkfsfeatures"} "$TEST_DEV"
30 if run_check_stdout "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV" | \
31 grep -q "$sbflag"; then
32 _fail "FAIL: feature $sbflag must not be set on the base image"
34 run_check "$TOP/btrfstune" "$tuneopt" "$TEST_DEV"
35 if ! run_check_stdout "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV" | \
36 grep -q "$sbflag"; then
37 _fail "FAIL: feature $sbflag not set"
39 run_check $SUDO_HELPER "$TOP/btrfs" check "$TEST_DEV"
42 test_feature extref -r EXTENDED_IREF
43 test_feature skinny-metadata -x SKINNY_METADATA
44 test_feature no-holes -n NO_HOLES
45 test_feature '' '-S 1' SEEDING