From: Alasdair Kergon Date: Thu, 30 Jun 2011 00:57:29 +0000 (+0000) Subject: test attempt to remove stray loop devs X-Git-Tag: v2_02_91~783 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1a3d96757ef3f4b0ee0728f46bfc76298206b8a9;p=lvm2.git test attempt to remove stray loop devs --- 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