Skip to contentSkip to conversation

master - tests: simplify teardown

PATCH Zdenek Kabelac 1 participant 1 message Apr 22, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7a64a157e13154a9b6a37a12a8d50a8e63f51478
Commit:        7a64a157e13154a9b6a37a12a8d50a8e63f51478
Parent:        7f8d942268161abcb56700c027f82a87f20f0abf
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Apr 22 11:03:31 2015 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Apr 22 11:18:31 2015 +0200

tests: simplify teardown

If TESTNAME has not been created yet, avoid running complex teardown.

---
 test/lib/aux.sh   |    4 ++++
 test/lib/utils.sh |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
test/lib/aux.sh +4 -0
index 737050d..15a689a 100644
@@ -254,6 +254,8 @@ kill_listed_processes() {
 teardown() {
 	echo -n "## teardown..."
 
+	if test -f TESTNAME ; then
+
 	kill_listed_processes
 
 	kill_sleep_kill_ LOCAL_LVMETAD ${LVM_VALGRIND_LVMETAD:-0}
@@ -277,6 +279,8 @@ teardown() {
 
 	echo -n .
 
+	fi
+
 	test -n "$TESTDIR" && {
 		cd "$TESTOLDPWD"
 		rm -rf "$TESTDIR" || echo BLA
test/lib/utils.sh +1 -1
index 87152a4..a610632 100644
@@ -134,7 +134,7 @@ STACKTRACE() {
 
 	test -f SKIP_THIS_TEST && exit 200
 
-	test -z "$LVM_TEST_NODEBUG" && {
+	test -z "$LVM_TEST_NODEBUG" -a -f TESTNAME && {
 		local name
 		local idx
 		for i in debug.log* ; do