2 # Regression test for case btrfs-find-root may print no result on a
3 # recent fs or balanced fs, whose metadata chunk is the first chunk
4 # and the only metadata chunk
6 source "$TEST_TOP/common"
8 check_prereq btrfs-find-root
9 check_prereq btrfs-image
11 run_check $TOP/btrfs-image -r first_meta_chunk.btrfs-image test.img || \
12 _fail "failed to extract first_meta_chunk.btrfs-image"
14 result=$(run_check_stdout $TOP/btrfs-find-root test.img | sed '/^Superblock/d')
16 if [ -z "$result" ]; then
17 _fail "btrfs-find-root failed to find tree root"
20 if ! echo "$result" | grep -q 'Found tree root at'; then
21 _fail "btrfs-find-root failed to find tree root, unexpected output"