btrfs-progs: introduce TEST_TOP and INTERNAL_BIN for tests
[platform/upstream/btrfs-progs.git] / tests / fuzz-tests / 003-multi-check-unmounted / test.sh
1 #!/bin/bash
2
3 # iterate over all fuzzed images and run 'btrfs check', try various options to
4 # get more code coverage
5
6 source "$TEST_TOP/common"
7
8 setup_root_helper
9 check_prereq btrfs
10
11 # redefine the one provided by common
12 check_image() {
13         local image
14
15         image=$1
16         run_mayfail $TOP/btrfs check -s 1 "$image"
17         run_mayfail $TOP/btrfs check --init-csum-tree "$image"
18         run_mayfail $TOP/btrfs check --init-extent-tree "$image"
19         run_mayfail $TOP/btrfs check --check-data-csum "$image"
20         run_mayfail $TOP/btrfs check --subvol-extents "$image"
21         run_mayfail $TOP/btrfs check --repair "$image"
22 }
23
24 check_all_images $TEST_TOP/fuzz-tests/images
25
26 exit 0