aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-02-06 18:19:08 -0800
committerZorro Lang <zlang@kernel.org>2024-02-09 13:27:17 +0800
commit9c01c6997c3016017d101a0ddcfa0cc271654926 (patch)
tree7d90bc82f0c2298c8fe8f8e43c13f402075a8446
parent31238f2b0f50eaa181d595fe58ef81938476434f (diff)
downloadxfstests-dev-9c01c6997c3016017d101a0ddcfa0cc271654926.tar.gz
xfs/{129,234,253,605}: disable metadump v1 testing with external devices
The metadump v1 format does not support capturing content from log devices or realtime devices. Hence it does not make sense to test these scenarios. Create predicates to decide if we want to test a particular metadump format, then convert existing tests to check formats explicitly. Signed-off-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zorro Lang <zlang@kernel.org>
-rw-r--r--common/metadump25
-rwxr-xr-xtests/xfs/6059
2 files changed, 20 insertions, 14 deletions
diff --git a/common/metadump b/common/metadump
index 4b576f045e..3373edfe92 100644
--- a/common/metadump
+++ b/common/metadump
@@ -37,6 +37,24 @@ _xfs_cleanup_verify_metadump()
fi
}
+# Can xfs_metadump snapshot the fs metadata to a v1 metadump file?
+_scratch_xfs_can_metadump_v1()
+{
+ # metadump v1 does not support log devices
+ [ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_LOGDEV" ] && return 1
+
+ # metadump v1 does not support realtime devices
+ [ "$USE_EXTERNAL" = yes ] && [ -n "$SCRATCH_RTDEV" ] && return 1
+
+ return 0
+}
+
+# Can xfs_metadump snapshot the fs metadata to a v2 metadump file?
+_scratch_xfs_can_metadump_v2()
+{
+ test "$MAX_XFS_METADUMP_VERSION" -ge 2
+}
+
# Create a metadump in v1 format, restore it to fs image files, then mount the
# images and fsck them.
_xfs_verify_metadump_v1()
@@ -129,9 +147,6 @@ _xfs_verify_metadump_v2()
# Verify both metadump formats if possible
_xfs_verify_metadumps()
{
- _xfs_verify_metadump_v1 "$@"
-
- if [[ $MAX_XFS_METADUMP_FORMAT == 2 ]]; then
- _xfs_verify_metadump_v2 "$@"
- fi
+ _scratch_xfs_can_metadump_v1 && _xfs_verify_metadump_v1 "$@"
+ _scratch_xfs_can_metadump_v2 && _xfs_verify_metadump_v2 "$@"
}
diff --git a/tests/xfs/605 b/tests/xfs/605
index 13cf065495..78458c7665 100755
--- a/tests/xfs/605
+++ b/tests/xfs/605
@@ -40,15 +40,6 @@ testfile=${SCRATCH_MNT}/testfile
echo "Format filesystem on scratch device"
_scratch_mkfs >> $seqres.full 2>&1
-external_log=0
-if [[ $USE_EXTERNAL = yes && -n "$SCRATCH_LOGDEV" ]]; then
- external_log=1
-fi
-
-if [[ $MAX_XFS_METADUMP_FORMAT == 1 && $external_log == 1 ]]; then
- _notrun "metadump v1 does not support external log device"
-fi
-
echo "Initialize and mount filesystem on flakey device"
_init_flakey
_load_flakey_table $FLAKEY_ALLOW_WRITES