]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fuzzy: don't fail on compressed metadumps v2022.12.18
authorDarrick J. Wong <djwong@kernel.org>
Tue, 13 Dec 2022 19:45:33 +0000 (11:45 -0800)
committerZorro Lang <zlang@kernel.org>
Sat, 17 Dec 2022 10:38:34 +0000 (18:38 +0800)
This line in __scratch_xfs_fuzz_mdrestore:

test -e "${POPULATE_METADUMP}"

Breaks spectacularly on a setup that uses DUMP_COMPRESSOR to compress
the metadump files, because the metadump files get the compression
program added to the name (e.g. "${POPULATE_METADUMP}.xz").  The check
is wrong, and since the naming policy is an implementation detail of
_xfs_mdrestore, let's get rid of the -e test.

However, we still need a way to fail the test if the metadump cannot be
restored.  _xfs_mdrestore returns nonzero on failure, so use that
instead.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/fuzzy

index fad79124e5e9cad08a2648dd271eedba25cf2399..70213af5db9e1b974a8738052548eba00f3e526f 100644 (file)
@@ -156,10 +156,9 @@ __scratch_xfs_fuzz_unmount()
 # Restore metadata to scratch device prior to field-fuzzing.
 __scratch_xfs_fuzz_mdrestore()
 {
-       test -e "${POPULATE_METADUMP}" || _fail "Need to set POPULATE_METADUMP"
-
        __scratch_xfs_fuzz_unmount
-       _xfs_mdrestore "${POPULATE_METADUMP}" "${SCRATCH_DEV}"
+       _xfs_mdrestore "${POPULATE_METADUMP}" "${SCRATCH_DEV}" || \
+               _fail "${POPULATE_METADUMP}: Could not find metadump to restore?"
 }
 
 __fuzz_notify() {