2016-08-25 05:21:01 +00:00
|
|
|
#!/bin/bash
|
2017-11-10 01:34:19 +00:00
|
|
|
# confirm whether 'btrfs check' supports check ing of a partially dropped
|
|
|
|
# snapshot
|
2016-08-25 05:21:01 +00:00
|
|
|
|
2018-02-08 06:34:19 +00:00
|
|
|
source "$TEST_TOP/common"
|
2016-08-25 05:21:01 +00:00
|
|
|
|
|
|
|
check_prereq btrfs
|
|
|
|
|
2017-11-10 01:34:19 +00:00
|
|
|
check_image()
|
|
|
|
{
|
|
|
|
local image
|
|
|
|
|
|
|
|
image=$1
|
2017-04-24 13:29:40 +00:00
|
|
|
run_check_stdout "$TOP/btrfs" check "$image" 2>&1 |
|
2016-08-25 05:21:01 +00:00
|
|
|
grep -q "Errors found in extent allocation tree or chunk allocation"
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
rm -f "$image"
|
|
|
|
_fail "unexpected error occurred when checking $img"
|
|
|
|
fi
|
2017-11-10 01:34:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
check_all_images
|