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