From: Dave Chinner Date: Tue, 26 Nov 2024 20:41:49 +0000 (+1100) Subject: fstests: per-test dmdust instances X-Git-Tag: v2024.12.08~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aaa1327774761890928463c584d1f6e694730068;p=xfstests-dev.git fstests: per-test dmdust instances We can't run two tests that use dmdust at the same time because the device name is the same. hence they interfere with each other. Give dmdust devices their own per-test names to avoid this problem. Signed-off-by: Dave Chinner Reviewed-by: Zorro lang Signed-off-by: Zorro Lang --- diff --git a/common/dmdust b/common/dmdust index 56fcc0e0..37bb865c 100644 --- a/common/dmdust +++ b/common/dmdust @@ -4,12 +4,14 @@ # # common functions for setting up and tearing down a dmdust device +export DUST_NAME="dust-test.$seq" + _init_dust() { local DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - DUST_DEV=/dev/mapper/dust-test + DUST_DEV=/dev/mapper/$DUST_NAME DUST_TABLE="0 $DEV_SIZE dust $SCRATCH_DEV 0 512" - _dmsetup_create dust-test --table "$DUST_TABLE" || \ + _dmsetup_create $DUST_NAME --table "$DUST_TABLE" || \ _fatal "failed to create dust device" } @@ -29,7 +31,7 @@ _cleanup_dust() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang - $DMSETUP_PROG resume dust-test > /dev/null 2>&1 + $DMSETUP_PROG resume $DUST_NAME > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove dust-test + _dmsetup_remove $DUST_NAME }