Skip to contentSkip to conversation

master - tests: updates for check_lvmlockd

PATCH David Teigland 1 participant 1 message Feb 23, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0236a34224d31a6ad7b48e451183672e907b15d3
Commit:        0236a34224d31a6ad7b48e451183672e907b15d3
Parent:        42da7a6c38ece2a9dca6492af1ba66ebaa9b6231
Author:        David Teigland <[email protected]>
AuthorDate:    Tue Feb 23 13:58:22 2016 -0600
Committer:     David Teigland <[email protected]>
CommitterDate: Tue Feb 23 14:00:28 2016 -0600

tests: updates for check_lvmlockd

Move the lvmlockd-related setup functions into aux.

For check_lvmlockd_test, start a new instance of
lvmlockd --test for each shell test.

---
 test/Makefile.in                          |    2 +-
 test/lib/aux.sh                           |  137 +++++++++++++++++++++++++++++
 test/lib/inittest.sh                      |    9 ++
 test/shell/aa-lvmlockd-dlm-prepare.sh     |   73 +---------------
 test/shell/aa-lvmlockd-sanlock-prepare.sh |   45 +---------
 test/shell/aa-lvmlockd-test-prepare.sh    |   44 ---------
 test/shell/dlm-hello-world.sh             |   27 ------
 test/shell/lvmlockd-hello-world.sh        |   25 +++++
 test/shell/sanlock-hello-world.sh         |   27 ------
 test/shell/zz-lvmlockd-test-remove.sh     |   23 -----
 10 files changed, 176 insertions(+), 236 deletions(-)
test/Makefile.in +1 -1
index 19a0214..6ed9b9e 100644
@@ -161,7 +161,7 @@ ifeq ("@BUILD_LVMLOCKD@", "yes")
 check_lvmlockd_test: .tests-stamp
 	VERBOSE=$(VERBOSE) ./lib/runner \
 		--testdir . --outdir results \
-		--flavours udev-lvmlockd-test --only shell/aa-lvmlockd-test-prepare.sh,$(T),shell/zz-lvmlockd-test-remove.sh --skip $(S)
+		--flavours udev-lvmlockd-test --only $(T) --skip $(S)
 endif
 
 DATADIR = $(datadir)/lvm2-testsuite
test/lib/aux.sh +137 -0

149 lines not on this page · raw message

test/lib/inittest.sh +9 -0
index 4531e66..a2dcf01 100644
@@ -128,9 +128,18 @@ if test -n "$LVM_TEST_LVMLOCKD" ; then
 	if test -n "$LVM_TEST_LOCK_TYPE_SANLOCK" ; then
 		aux lvmconf 'local/host_id = 1'
 	fi
+
 	export SHARED="--shared"
 fi
 
+# for check_lvmlockd_test, lvmlockd is restarted for each shell test.
+# for check_lvmlockd_{sanlock,dlm}, lvmlockd is started once by
+# aa-lvmlockd-{sanlock,dlm}-prepare.sh and left running for all shell tests.
+
+if test -n "$LVM_TEST_LVMLOCKD_TEST" ; then
+	aux prepare_lvmlockd
+fi
+
 echo "<======== Processing test: \"$TESTNAME\" ========>"
 
 set -vx
test/shell/aa-lvmlockd-dlm-prepare.sh +2 -71

77 lines not on this page · raw message

test/shell/aa-lvmlockd-sanlock-prepare.sh +2 -43

57 lines not on this page · raw message

test/shell/aa-lvmlockd-test-prepare.sh deleted +0 -44

44 lines not on this page · raw message

test/shell/dlm-hello-world.sh deleted +0 -27
deleted file mode 100644
index 9ee3b14..0000000
@@ -1,27 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved.
-#
-# This copyrighted material is made available to anyone wishing to use,
-# modify, copy, or redistribute it subject to the terms and conditions
-# of the GNU General Public License v.2.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-test_description='Hello world for vgcreate with lvmlockd and dlm'
-
-. lib/inittest
-
-[ -z "$LVM_TEST_LOCK_TYPE_DLM" ] && skip;
-
-aux prepare_devs 1
-
-vgcreate $SHARED $vg "$dev1"
-
-vgs -o+locktype,lockargs $vg
-
-check vg_field $vg vg_locktype dlm
-
-vgremove $vg
-
test/shell/lvmlockd-hello-world.sh new file +25 -0
new file mode 100644
index 0000000..01e1c56
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+test_description='Hello world for vgcreate with lvmlockd and sanlock'
+
+. lib/inittest
+
+[ -z "$LVM_TEST_LVMLOCKD" ] && skip;
+
+aux prepare_pvs 1
+
+vgcreate $SHARED $vg "$dev1"
+
+vgs -o+locktype,lockargs $vg
+
+vgremove $vg
+
test/shell/sanlock-hello-world.sh deleted +0 -27
deleted file mode 100644
index fb95faa..0000000
@@ -1,27 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved.
-#
-# This copyrighted material is made available to anyone wishing to use,
-# modify, copy, or redistribute it subject to the terms and conditions
-# of the GNU General Public License v.2.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-test_description='Hello world for vgcreate with lvmlockd and sanlock'
-
-. lib/inittest
-
-[ -z "$LVM_TEST_LOCK_TYPE_SANLOCK" ] && skip;
-
-aux prepare_pvs 1
-
-vgcreate $SHARED $vg "$dev1"
-
-vgs -o+locktype,lockargs $vg
-
-check vg_field $vg vg_locktype sanlock
-
-vgremove $vg
-
test/shell/zz-lvmlockd-test-remove.sh deleted +0 -23
deleted file mode 100644
index 44749f0..0000000
@@ -1,23 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2008-2012 Red Hat, Inc. All rights reserved.
-#
-# This copyrighted material is made available to anyone wishing to use,
-# modify, copy, or redistribute it subject to the terms and conditions
-# of the GNU General Public License v.2.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-test_description='Remove the dlm test setup'
-
-. lib/inittest
-
-[ -z "$LVM_TEST_LVMLOCKD_TEST" ] && skip;
-
-killall lvmlockd
-sleep 1
-killall lvmlockd || true
-sleep 1
-killall -9 lvmlockd || true
-