btrfs-progs: introduce TEST_TOP and INTERNAL_BIN for tests
[platform/upstream/btrfs-progs.git] / tests / fsck-tests / 021-partially-dropped-snapshot-case / test.sh
1 #!/bin/bash
2 # confirm whether 'btrfs check' supports check ing of a partially dropped
3 # snapshot
4
5 source "$TEST_TOP/common"
6
7 check_prereq btrfs
8
9 check_image()
10 {
11         local image
12
13         image=$1
14         run_check_stdout "$TOP/btrfs" check "$image" 2>&1 |
15                 grep -q "Errors found in extent allocation tree or chunk allocation"
16         if [ $? -eq 0 ]; then
17                 rm -f "$image"
18                 _fail "unexpected error occurred when checking $img"
19         fi
20 }
21
22 check_all_images