From 1a3d96757ef3f4b0ee0728f46bfc76298206b8a9 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 30 Jun 2011 00:57:29 +0000 Subject: [PATCH] test attempt to remove stray loop devs --- test/lib/aux.sh | 4 +++- test/lib/test.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/lib/aux.sh b/test/lib/aux.sh index 6f671855d..16a5d674c 100644 --- a/test/lib/aux.sh +++ b/test/lib/aux.sh @@ -90,7 +90,9 @@ teardown_devs() { rm -f DEVICES # devs is set in prepare_devs() rm -f LOOP - # Display any loop devices that failed to get torn down + # Remove any loop devices that failed to get torn down + losetup -a + echo losetup -d `losetup -a | grep $COMMON_PREFIX | cut -d: -f1` 2>/dev/null || true losetup -a } diff --git a/test/lib/test.sh b/test/lib/test.sh index ba1391b7e..b16c1d946 100644 --- a/test/lib/test.sh +++ b/test/lib/test.sh @@ -19,11 +19,13 @@ unset CDPATH . lib/utils OLDPWD="`pwd`" -PREFIX="LVMTEST$$" +COMMON_PREFIX="LVMTEST" +PREFIX="${COMMON_PREFIX}$$" TESTDIR=$(mkdtemp ${LVM_TEST_DIR-$(pwd)} $PREFIX.XXXXXXXXXX) \ || { echo "failed to create temporary directory in ${LVM_TEST_DIR-$(pwd)}"; exit 1; } +export COMMON_PREFIX export PREFIX export TESTDIR -- 2.43.5