Skip to contentSkip to conversation

master - tests: create/remove improvements for lvmlockd testing

PATCH David Teigland 1 participant 1 message Aug 21, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1f27c9f6a44cb893b6653641b35295e129531bf8
Commit:        1f27c9f6a44cb893b6653641b35295e129531bf8
Parent:        d310e1f90720e5ba387efe7ba0d7cc6266d9f844
Author:        David Teigland <[email protected]>
AuthorDate:    Thu Aug 20 16:10:36 2015 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Fri Aug 21 15:09:38 2015 -0500

tests: create/remove improvements for lvmlockd testing

---
 test/shell/dlm-remove.sh      |    4 ++++
 test/shell/sanlock-prepare.sh |    1 +
 test/shell/sanlock-remove.sh  |   15 +++++++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)
test/shell/dlm-remove.sh +4 -0
index d7af46f..3120d7f 100644
@@ -15,6 +15,10 @@ test_description='Remove the dlm test setup'
 
 [ -z "$LVM_TEST_LOCK_TYPE_DLM" ] && skip;
 
+# FIXME: collect debug logs (only if a test failed?)
+# lvmlockctl -d > lvmlockd-debug.txt
+# dlm_tool dump > dlm-debug.txt
+
 systemctl stop dlm
 systemctl stop corosync
 killall lvmlockd
test/shell/sanlock-prepare.sh +1 -0
index 401d6d7..c3a25bf 100644
@@ -73,6 +73,7 @@ prepare_lvmlockd_sanlock() {
 
 GL_DEV="/dev/mapper/GL_DEV"
 GL_FILE="$PWD/gl_file.img"
+dmsetup remove GL_DEV || true
 rm -f "$GL_FILE"
 dd if=/dev/zero of="$GL_FILE" bs=$((1024*1024)) count=1024 2> /dev/null
 GL_LOOP=$(losetup -f "$GL_FILE" --show)
test/shell/sanlock-remove.sh +13 -2
index 47487d6..19a2602 100644
@@ -15,14 +15,25 @@ test_description='Remove the sanlock test setup'
 
 [ -z "$LVM_TEST_LOCK_TYPE_SANLOCK" ] && skip;
 
+# FIMXME: get this to run after a test fails
+
 # Removes the VG with the global lock that was created by
 # the corresponding create script.
 
 vgremove --config 'devices { global_filter=["a|GL_DEV|", "r|.*|"] filter=["a|GL_DEV|", "r|.*|"]}' glvg
 
+# FIXME: collect debug logs (only if a test failed?)
+# lvmlockctl -d > lvmlockd-debug.txt
+# sanlock log_dump > sanlock-debug.txt
 
 killall lvmlockd
 killall sanlock
 
-dmsetup remove GL_DEV
-# dmsetup remove glvg-lvmlock
+killall -9 lvmlockd
+killall -9 sanlock
+
+# FIXME: dmsetup remove LVMTEST*-lvmlock
+
+dmsetup remove glvg-lvmlock || true
+dmsetup remove GL_DEV || true
+