On Tue, Oct 31, 2017 at 02:07:57PM +0800, Qu Wenruo wrote:
> +++ b/tests/fsck-tests/027-tree-reloc-tree/test.sh
> @@ -0,0 +1,22 @@
> +#!/bin/bash
> +# Make sure btrfs check won't report any false alert for valid image with
> +# tree reloc tree.
> +#
> +# Also due to the short life spawn of tree reloc tree, save them as dump
> +# example for later usage.
> +
> +source "$TOP/tests/common"
> +
> +check_prereq btrfs
> +
> +for img in *.img.xz
> +do
> +     image=$(extract_image "$img")
> +     run_check_stdout "$TOP/btrfs" check "$image" 2>&1 |
> +             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
> +     rm -f "$image"
> +done

Please use the test script pattern with the redefinition of check_image
and followed by check_all_images. An example is in
fsck-tests/022-qgroup-rescan-halfway. If you copied that from
fsck-tests/020-extent-ref-cases, then this is a good candidate for a
cleanup. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to