summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2015-07-01 16:00:35 -0500
committerDavid Teigland <teigland@redhat.com>2015-07-01 16:20:39 -0500
commit83c925b13115871074b8bf105eba6055e9de9af3 (patch)
tree0dc6c0e9b5a77625357781f9231cc59ba9d2a15e
parentfebcdf11f660ac44fd044cc1e82fa699fe598a54 (diff)
downloadlvm2-83c925b13115871074b8bf105eba6055e9de9af3.tar.gz
test suite changes for lvmlockd
-rw-r--r--test/lib/inittest.sh2
-rw-r--r--test/shell/dlm-hello-world.sh27
-rw-r--r--test/shell/process-each-lv.sh16
-rw-r--r--test/shell/process-each-vg.sh74
-rw-r--r--test/shell/sanlock-hello-world.sh4
-rw-r--r--test/shell/sanlock-prepare.sh7
-rw-r--r--test/shell/sanlock-remove.sh2
7 files changed, 80 insertions, 52 deletions
diff --git a/test/lib/inittest.sh b/test/lib/inittest.sh
index e509ae425..a5eeb57ab 100644
--- a/test/lib/inittest.sh
+++ b/test/lib/inittest.sh
@@ -110,7 +110,7 @@ if test -n "$LVM_TEST_LVMLOCKD" ; then
if test -n "$LVM_TEST_LOCK_TYPE_SANLOCK" ; then
aux lvmconf 'local/host_id = 1'
fi
-#alias vgcreate='vgcreate --shared'
+ export SHARED="--shared"
fi
echo "<======== Processing test: \"$TESTNAME\" ========>"
diff --git a/test/shell/dlm-hello-world.sh b/test/shell/dlm-hello-world.sh
new file mode 100644
index 000000000..a1d6925fa
--- /dev/null
+++ b/test/shell/dlm-hello-world.sh
@@ -0,0 +1,27 @@
+#!/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='Hello world for vgcreate with lvmlockd and dlm'
+
+. lib/inittest
+
+[ -z "$LVM_TEST_LOCK_TYPE_DLM" ] && skip;
+
+aux prepare_devs 1 1024
+
+vgcreate $SHARED $vg "$dev1"
+
+vgs -o+locktype,lockargs $vg
+
+check vg_field $vg vg_locktype dlm
+
+vgremove $vg
+
diff --git a/test/shell/process-each-lv.sh b/test/shell/process-each-lv.sh
index 78eb14ec5..fca7a6d76 100644
--- a/test/shell/process-each-lv.sh
+++ b/test/shell/process-each-lv.sh
@@ -16,9 +16,7 @@ export LVM_TEST_LVMETAD_DEBUG_OPTS=${LVM_TEST_LVMETAD_DEBUG_OPTS-}
. lib/inittest
-test -e LOCAL_LVMPOLLD && skip
-
-aux prepare_devs 10
+aux prepare_devs 10 1024
#
# process_each_lv is used by a number of lv commands:
@@ -43,11 +41,11 @@ aux prepare_devs 10
prepare_vgs_() {
# set up vgs/lvs that we will remove
- vgcreate $vg1 "$dev1" "$dev2"
- vgcreate $vg2 "$dev3" "$dev4"
- vgcreate $vg3 "$dev5" "$dev6"
- vgcreate $vg4 "$dev7" "$dev8"
- vgcreate $vg5 "$dev9" "$dev10"
+ vgcreate $SHARED $vg1 "$dev1" "$dev2"
+ vgcreate $SHARED $vg2 "$dev3" "$dev4"
+ vgcreate $SHARED $vg3 "$dev5" "$dev6"
+ vgcreate $SHARED $vg4 "$dev7" "$dev8"
+ vgcreate $SHARED $vg5 "$dev9" "$dev10"
lvcreate -Zn -an -l 2 -n $lv1 $vg1
lvcreate -Zn -an -l 2 -n $lv1 $vg2
lvcreate -Zn -an -l 2 -n $lv2 $vg2
@@ -656,3 +654,5 @@ not grep $vg5-$lv2 err
not grep $vg5-$lv3 err
not grep $vg5-$lv4 err
not grep $vg5-$lv5 err
+
+vgremove -f $vg1 $vg2 $vg3 $vg4 $vg5
diff --git a/test/shell/process-each-vg.sh b/test/shell/process-each-vg.sh
index f93acdae9..0dca90434 100644
--- a/test/shell/process-each-vg.sh
+++ b/test/shell/process-each-vg.sh
@@ -13,9 +13,7 @@ test_description='Exercise toollib process_each_vg'
. lib/inittest
-test -e LOCAL_LVMPOLLD && skip
-
-aux prepare_devs 6
+aux prepare_devs 6 1024
#
# process_each_vg is used by a number of vg commands;
@@ -28,16 +26,16 @@ aux prepare_devs 6
#
# set up four vgs that we will remove
#
-vgcreate $vg1 "$dev1"
-vgcreate $vg2 "$dev2"
-vgcreate $vg3 "$dev3"
-vgcreate $vg4 "$dev4"
+vgcreate $SHARED $vg1 "$dev1"
+vgcreate $SHARED $vg2 "$dev2"
+vgcreate $SHARED $vg3 "$dev3"
+vgcreate $SHARED $vg4 "$dev4"
# these two vgs will not be removed
-vgcreate $vg5 "$dev5"
+vgcreate $SHARED $vg5 "$dev5"
vgchange --addtag tagvg5 $vg5
lvcreate -l 4 -n $lv1 $vg5
-vgcreate $vg6 "$dev6"
+vgcreate $SHARED $vg6 "$dev6"
lvcreate -l 4 -n $lv2 $vg6
# should fail without any arg
@@ -67,10 +65,10 @@ not vgs $vg4
#
# set up four vgs that we will remove
#
-vgcreate --addtag tagfoo $vg1 "$dev1"
-vgcreate --addtag tagfoo $vg2 "$dev2"
-vgcreate --addtag tagfoo2 $vg3 "$dev3"
-vgcreate --addtag tagbar $vg4 "$dev4"
+vgcreate $SHARED --addtag tagfoo $vg1 "$dev1"
+vgcreate $SHARED --addtag tagfoo $vg2 "$dev2"
+vgcreate $SHARED --addtag tagfoo2 $vg3 "$dev3"
+vgcreate $SHARED --addtag tagbar $vg4 "$dev4"
vgchange --addtag foo $vg4
# should do nothing and fail
@@ -95,10 +93,10 @@ not vgs $vg4
#
# set up four vgs that we will remove
#
-vgcreate --addtag tagfoo $vg1 "$dev1"
-vgcreate --addtag tagfoo $vg2 "$dev2"
-vgcreate --addtag tagfoo2 $vg3 "$dev3"
-vgcreate --addtag tagbar $vg4 "$dev4"
+vgcreate $SHARED --addtag tagfoo $vg1 "$dev1"
+vgcreate $SHARED --addtag tagfoo $vg2 "$dev2"
+vgcreate $SHARED --addtag tagfoo2 $vg3 "$dev3"
+vgcreate $SHARED --addtag tagbar $vg4 "$dev4"
vgchange --addtag foo $vg4
vgremove @tagfoo
@@ -113,10 +111,10 @@ not vgs $vg4
#
# set up four vgs that we will remove
#
-vgcreate --addtag tagfoo $vg1 "$dev1"
-vgcreate --addtag tagfoo $vg2 "$dev2"
-vgcreate --addtag tagfoo2 $vg3 "$dev3"
-vgcreate --addtag tagbar $vg4 "$dev4"
+vgcreate $SHARED --addtag tagfoo $vg1 "$dev1"
+vgcreate $SHARED --addtag tagfoo $vg2 "$dev2"
+vgcreate $SHARED --addtag tagfoo2 $vg3 "$dev3"
+vgcreate $SHARED --addtag tagbar $vg4 "$dev4"
vgchange --addtag foo $vg4
vgremove $vg1 @tagfoo2
@@ -131,10 +129,10 @@ not vgs $vg4
#
# set up four vgs that we will remove
#
-vgcreate --addtag tagfoo $vg1 "$dev1"
-vgcreate --addtag tagfoo $vg2 "$dev2"
-vgcreate --addtag tagfoo2 $vg3 "$dev3"
-vgcreate --addtag tagbar $vg4 "$dev4"
+vgcreate $SHARED --addtag tagfoo $vg1 "$dev1"
+vgcreate $SHARED --addtag tagfoo $vg2 "$dev2"
+vgcreate $SHARED --addtag tagfoo2 $vg3 "$dev3"
+vgcreate $SHARED --addtag tagbar $vg4 "$dev4"
vgchange --addtag foo $vg4
vgremove @foo @tagfoo2 $vg1 $vg2
@@ -147,10 +145,10 @@ not vgs $vg4
#
# set up four vgs that we will remove
#
-vgcreate --addtag tagfoo $vg1 "$dev1"
-vgcreate --addtag tagfoo $vg2 "$dev2"
-vgcreate --addtag tagfoo2 $vg3 "$dev3"
-vgcreate --addtag tagbar $vg4 "$dev4"
+vgcreate $SHARED --addtag tagfoo $vg1 "$dev1"
+vgcreate $SHARED --addtag tagfoo $vg2 "$dev2"
+vgcreate $SHARED --addtag tagfoo2 $vg3 "$dev3"
+vgcreate $SHARED --addtag tagbar $vg4 "$dev4"
vgchange --addtag foo $vg4
vgremove @tagfoo $vg1 @tagfoo @tagfoo2 $vg3 @tagbar
@@ -163,10 +161,10 @@ not vgs $vg4
#
# set up four vgs that we will remove
#
-vgcreate --addtag tagfoo $vg1 "$dev1"
-vgcreate --addtag tagfoo $vg2 "$dev2"
-vgcreate --addtag tagfoo2 $vg3 "$dev3"
-vgcreate --addtag tagbar $vg4 "$dev4"
+vgcreate $SHARED --addtag tagfoo $vg1 "$dev1"
+vgcreate $SHARED --addtag tagfoo $vg2 "$dev2"
+vgcreate $SHARED --addtag tagfoo2 $vg3 "$dev3"
+vgcreate $SHARED --addtag tagbar $vg4 "$dev4"
vgchange --addtag foo $vg4
not vgremove garbage $vg1
@@ -198,10 +196,10 @@ not vgs $vg6
#
# set up four vgs that we will report
#
-vgcreate --addtag tagfoo $vg1 "$dev1"
-vgcreate --addtag tagfoo $vg2 "$dev2"
-vgcreate --addtag tagfoo2 $vg3 "$dev3"
-vgcreate --addtag tagbar $vg4 "$dev4"
+vgcreate $SHARED --addtag tagfoo $vg1 "$dev1"
+vgcreate $SHARED --addtag tagfoo $vg2 "$dev2"
+vgcreate $SHARED --addtag tagfoo2 $vg3 "$dev3"
+vgcreate $SHARED --addtag tagbar $vg4 "$dev4"
vgchange --addtag foo $vg4
vgs >err
@@ -264,3 +262,5 @@ not grep $vg1 err
not grep $vg2 err
not grep $vg3 err
+vgremove -f $vg1 $vg2 $vg3 $vg4
+
diff --git a/test/shell/sanlock-hello-world.sh b/test/shell/sanlock-hello-world.sh
index f9578ec0c..ab08ba1c8 100644
--- a/test/shell/sanlock-hello-world.sh
+++ b/test/shell/sanlock-hello-world.sh
@@ -9,7 +9,7 @@
# 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='Hello world for vgcreate with sanlock'
+test_description='Hello world for vgcreate with lvmlockd and sanlock'
. lib/inittest
@@ -17,7 +17,7 @@ test_description='Hello world for vgcreate with sanlock'
aux prepare_pvs 1 1024
-vgcreate --shared $vg "$dev1"
+vgcreate $SHARED $vg "$dev1"
vgs -o+locktype,lockargs $vg
diff --git a/test/shell/sanlock-prepare.sh b/test/shell/sanlock-prepare.sh
index 7cd91ea4e..289a48169 100644
--- a/test/shell/sanlock-prepare.sh
+++ b/test/shell/sanlock-prepare.sh
@@ -43,15 +43,16 @@ prepare_lvmlockd_sanlock() {
create_sanlock_conf
- # FIXME: use 'systemctl start sanlock' once sysconfig options work
- sanlock daemon -U sanlock -G sanlock -w 0
+ # FIXME: use 'systemctl start sanlock' once we can pass options
+ sanlock daemon -U sanlock -G sanlock -w 0 -e testhostname
sleep 1
if ! pgrep sanlock; then
echo "Failed to start sanlock"
exit 1
fi
- lvmlockd
+ # FIXME: use 'systemctl start lvm2-lvmlockd' once we can pass -o 2
+ lvmlockd -o 2
sleep 1
if ! pgrep lvmlockd; then
echo "Failed to start lvmlockd"
diff --git a/test/shell/sanlock-remove.sh b/test/shell/sanlock-remove.sh
index a8ea9a720..47487d68e 100644
--- a/test/shell/sanlock-remove.sh
+++ b/test/shell/sanlock-remove.sh
@@ -25,4 +25,4 @@ killall lvmlockd
killall sanlock
dmsetup remove GL_DEV
-dmsetup remove glvg-lvmlock
+# dmsetup remove glvg-lvmlock