diff mbox series

[08/28] check-parallel: add logwrite device support

Message ID 20250417031208.1852171-9-david@fromorbit.com (mailing list archive)
State New
Headers show
Series check-parallel: Running tests without check | expand

Commit Message

Dave Chinner April 17, 2025, 3 a.m. UTC
From: Dave Chinner <dchinner@redhat.com>

Every logwrite test will use the same /dev/mapper/<dev>
name for the logwrites device, so we also need to convert
common/dmlogwrite to use per-test device names as we have done for
other dm devices.

Then add a per-test-runner LOGWRITES_DEV so that all tests using
dm-logwrites now get run by check-parallel.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 check-parallel     | 4 ++++
 common/dmlogwrites | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/check-parallel b/check-parallel
index 0649a417f..5fee62f37 100755
--- a/check-parallel
+++ b/check-parallel
@@ -216,12 +216,14 @@  runner_go()
 	local me=$basedir/runner-$id
 	local _test=$me/test.img
 	local _scratch=$me/scratch.img
+	local _logwrites=$me/logwrites.img
 	local _results=$me/results-$2
 
 	mkdir -p $me
 
 	xfs_io -f -c 'truncate 2g' $_test
 	xfs_io -f -c 'truncate 8g' $_scratch
+	xfs_io -f -c 'truncate 1g' $_logwrites
 
 	mkfs.xfs -f $_test > /dev/null 2>&1
 
@@ -229,6 +231,7 @@  runner_go()
 	export TEST_DIR=$me/test
 	export SCRATCH_DEV=$(_create_loop_device $_scratch)
 	export SCRATCH_MNT=$me/scratch
+	export LOGWRITES_DEV=$(_create_loop_device $_logwrites)
 	export FSTYP=xfs
 	export RESULT_BASE=$_results
 
@@ -249,6 +252,7 @@  runner_go()
 	umount -R $SCRATCH_MNT 2> /dev/null
 	_destroy_loop_device $TEST_DEV
 	_destroy_loop_device $SCRATCH_DEV
+	_destroy_loop_device $LOGWRITES_DEV
 
 	grep -q Failures: $me/log
 	if [ $? -eq 0 ]; then
diff --git a/common/dmlogwrites b/common/dmlogwrites
index a27e1966a..7c3ad95c9 100644
--- a/common/dmlogwrites
+++ b/common/dmlogwrites
@@ -4,6 +4,9 @@ 
 #
 # common functions for setting up and tearing down a dm log-writes device
 
+LOGWRITES_NAME=logwrites-$seq
+LOGWRITES_DMDEV=/dev/mapper/$LOGWRITES_NAME
+
 _require_log_writes()
 {
 	[ -z "$LOGWRITES_DEV" -o ! -b "$LOGWRITES_DEV" ] && \
@@ -81,8 +84,6 @@  _log_writes_init()
 		BLK_DEV_SIZE=$((length / blksz))
 	fi
 
-	LOGWRITES_NAME=logwrites-test
-	LOGWRITES_DMDEV=/dev/mapper/$LOGWRITES_NAME
 	LOGWRITES_TABLE="0 $BLK_DEV_SIZE log-writes $blkdev $LOGWRITES_DEV"
 	_dmsetup_create $LOGWRITES_NAME --table "$LOGWRITES_TABLE" || \
 		_fail "failed to create log-writes device"