Skip to contentSkip to conversation

LVM2/test/lib aux.sh test.sh

PATCH [email protected] 1 participant 1 message Jun 30, 2011

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2011-06-30 00:57:29

Modified files:
test/lib : aux.sh test.sh

Log message:
test attempt to remove stray loop devs

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/lib/aux.sh.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/lib/test.sh.diff?cvsroot=lvm2&r1=1.3&r2=1.4

test/lib/aux.sh +3 -1
@@ -90,7 +90,9 @@
 	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
 }
 
test/lib/test.sh +3 -1
@@ -19,11 +19,13 @@
 . 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