Skip to contentSkip to conversation

master - tests: try more advanced clean

PATCH Zdenek Kabelac 1 participant 1 message Apr 24, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d7888e83169ac1a7a962ffd66502995792879244
Commit:        d7888e83169ac1a7a962ffd66502995792879244
Parent:        066d0a4e1949afac055a7dc92bedd0f45f519124
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri Apr 24 11:12:55 2015 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sat Apr 25 00:39:43 2015 +0200

tests: try more advanced clean

When test is executed on real device - lets try a more complete cleanup - discard whole device first and try to wipe any headers it might be left from previous test.

---
 test/lib/aux.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
test/lib/aux.sh +2 -1
index 4e6961a..cc3718c 100644
@@ -431,7 +431,8 @@ prepare_devs() {
 
 	# non-ephemeral devices need to be cleared between tests
 	test -f LOOP || for d in ${DEVICES[@]}; do
-		dd if=/dev/zero of=$d bs=64K count=1
+		blkdiscard "$d" 2>/dev/null || true
+		wipefs -a "$d" 2>/dev/null || dd if=/dev/zero of="$d" bs=64K count=1
 	done
 
 	#for i in `seq 1 $n`; do