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
24 mkfsfeatures=${1:+-O ^$1}
28 run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $mkfsfeatures $TEST_DEV
29 if run_check_stdout $TOP/btrfs inspect-internal dump-super $TEST_DEV | \
30 grep -q "$sbflag"; then
31 _fail "FAIL: feature $sbflag must not be set on the base image"
33 run_check $TOP/btrfstune $tuneopt $TEST_DEV
34 if ! run_check_stdout $TOP/btrfs inspect-internal dump-super $TEST_DEV | \
35 grep -q "$sbflag"; then
36 _fail "FAIL: feature $sbflag not set"
38 run_check $SUDO_HELPER $TOP/btrfs check $TEST_DEV
41 test_feature extref -r EXTENDED_IREF
42 test_feature skinny-metadata -x SKINNY_METADATA
43 test_feature no-holes -n NO_HOLES
44 test_feature '' '-S 1' SEEDING