]> sourceware.org Git - lvm2.git/commitdiff
test attempt to remove stray loop devs
authorAlasdair Kergon <agk@redhat.com>
Thu, 30 Jun 2011 00:57:29 +0000 (00:57 +0000)
committerAlasdair Kergon <agk@redhat.com>
Thu, 30 Jun 2011 00:57:29 +0000 (00:57 +0000)
test/lib/aux.sh
test/lib/test.sh

index 6f671855d252ff0f570047153d4d92c0ad8456be..16a5d674c79496ff6fea41fccfd02423aafb29e1 100644 (file)
@@ -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
 }
 
index ba1391b7e6e223a91b7c903d1cf74fdd65644768..b16c1d946867bfcc96a242a8d46c8318dd611439 100644 (file)
@@ -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
 
This page took 0.03249 seconds and 5 git commands to generate.