btrfs-progs: tests: add 020-extent-ref-cases
[platform/upstream/btrfs-progs.git] / tests / fsck-tests / 020-extent-ref-cases / test.sh
1 #!/bin/bash
2 # In order to confirm that btrfsck supports to check a variety of refs, add the
3 # following cases:
4 #
5 # * keyed_block_ref
6 # * keyed_data_ref
7 # * shared_block_ref
8 # * shared_data_ref
9 # * no_inline_ref (a extent item without inline ref)
10 # * no_skinny_ref
11
12 source $TOP/tests/common
13
14 check_prereq btrfs
15
16 for img in *.img
17 do
18         image=$(extract_image $img)
19         run_check_stdout $TOP/btrfs check "$image" 2>&1 |
20                 grep -q "Errors found in extent allocation tree or chunk allocation" &&
21                 _fail "unexpected error occurred when checking $img"
22         rm -f "$image"
23 done