Skip to contentSkip to conversation

master - tests: do not break teardown on failing losetup

PATCH Zdenek Kabelac 1 participant 1 message Apr 6, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=307ab2c179073d28d1c9ec9f995f2849aeab07c6
Commit:        307ab2c179073d28d1c9ec9f995f2849aeab07c6
Parent:        07c25429e2b1eb08bb208a6bae015870c7ae635a
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Apr 1 09:36:23 2016 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Apr 6 11:54:37 2016 +0200

tests: do not break teardown on failing losetup

Ignore failing 'losetup -d' - i.e. device may have disappeared...

---
 test/lib/aux.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
test/lib/aux.sh +1 -1
index 9fd1922..c8985ed 100644
@@ -431,7 +431,7 @@ teardown_devs() {
 		test ${#stray_loops[@]} -eq 0 || {
 			teardown_devs_prefixed "$COMMON_PREFIX" 1
 			echo "Removing stray loop devices containing $COMMON_PREFIX: ${stray_loops[@]}"
-			for i in "${stray_loops[@]}" ; do test ! -b $i || losetup -d $i ; done
+			for i in "${stray_loops[@]}" ; do test ! -b $i || losetup -d $i || true ; done
 			# Leave test when udev processed all removed devices
 			udev_wait
 		}