summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-04-22 11:03:31 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-04-22 11:18:31 +0200
commit7a64a157e13154a9b6a37a12a8d50a8e63f51478 (patch)
tree0a241ca05343d50680af6f70ad482295e9a28fe9
parent7f8d942268161abcb56700c027f82a87f20f0abf (diff)
downloadlvm2-7a64a157e13154a9b6a37a12a8d50a8e63f51478.tar.gz
tests: simplify teardown
If TESTNAME has not been created yet, avoid running complex teardown.
-rw-r--r--test/lib/aux.sh4
-rw-r--r--test/lib/utils.sh2
2 files changed, 5 insertions, 1 deletions
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 737050d51..15a689ad5 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -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
diff --git a/test/lib/utils.sh b/test/lib/utils.sh
index 87152a434..a6106323f 100644
--- a/test/lib/utils.sh
+++ b/test/lib/utils.sh
@@ -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