master - test: add make check_lvmlockd_test
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=161ae36363f5fa1b1469fd3a42c096c878002b31 Commit: 161ae36363f5fa1b1469fd3a42c096c878002b31 Parent: ed5e5c38b5ac4b7c8cb7e809d9d35c72f087e29e Author: David Teigland <[email protected]> AuthorDate: Thu Jan 14 16:12:46 2016 -0600 Committer: David Teigland <[email protected]> CommitterDate: Mon Feb 22 09:36:35 2016 -0600
test: add make check_lvmlockd_test
Which runs lvmlockd in --test mode, without
any lock manager.
Also make some adjustments to the check_lvmlockd
variations using the lock managds.
--- daemons/lvmlockd/lvmlockd-core.c | 5 ++ test/Makefile.in | 21 +++---- test/lib/flavour-udev-lvmlockd-test.sh | 6 ++ test/lib/test-sanlock-conf | 2 +- test/shell/aa-lvmlockd-dlm-prepare.sh | 90 +++++++++++++++++++++++++++++ test/shell/aa-lvmlockd-sanlock-prepare.sh | 85 +++++++++++++++++++++++++++ test/shell/aa-lvmlockd-test-prepare.sh | 44 ++++++++++++++ test/shell/dlm-prepare.sh | 90 ----------------------------- test/shell/dlm-remove.sh | 24 -------- test/shell/lvmlockd-lv-types.sh | 6 ++ test/shell/sanlock-prepare.sh | 87 ---------------------------- test/shell/sanlock-remove.sh | 39 ------------ test/shell/zz-lvmlockd-dlm-remove.sh | 24 ++++++++ test/shell/zz-lvmlockd-sanlock-remove.sh | 41 +++++++++++++ test/shell/zz-lvmlockd-test-remove.sh | 23 +++++++ 15 files changed, 334 insertions(+), 253 deletions(-)
daemons/lvmlockd/lvmlockd-core.c +5 -0
@@ -3365,6 +3365,11 @@ static void *worker_thread_main(void *arg_in)int run_sanlock =lm_is_running_sanlock ();int run_dlm =lm_is_running_dlm (); +if (daemon_test) { + run_sanlock = gl_use_sanlock; + run_dlm = gl_use_dlm; + } +if (run_sanlock && run_dlm) act->result = -EXFULL ;else if (!run_sanlock && !run_dlm)
test/Makefile.in +9 -12
@@ -74,6 +74,7 @@ help: @echo " check_lvmpolld Run tests with lvmpolld daemon." @echo " check_lvmlockd_sanlock Run tests with lvmlockd and sanlock." @echo " check_lvmlockd_dlm Run tests with lvmlockd and dlm." + @echo " check_lvmlockd_test Run tests with lvmlockd --test." @echo " clean Clean dir." @echo " help Display callable targets." @echo -e "\nSupported variables:"
@@ -146,26 +147,21 @@ ifeq ("@BUILD_LVMLOCKD@", "yes") check_lvmlockd_sanlock: .tests-stamp VERBOSE=$(VERBOSE) ./lib/runner \ --testdir . --outdir results \ - --flavours udev-lvmlockd-sanlock --only shell/sanlock-prepare.sh - VERBOSE=$(VERBOSE) ./lib/runner \ - --testdir . --outdir results \ - --flavours udev-lvmlockd-sanlock --only $(T) --skip $(S) - VERBOSE=$(VERBOSE) ./lib/runner \ - --testdir . --outdir results \ - --flavours udev-lvmlockd-sanlock --only shell/sanlock-remove.sh + --flavours udev-lvmlockd-sanlock --only shell/aa-lvmlockd-sanlock-prepare.sh,$(T),shell/zz-lvmlockd-sanlock-remove.sh --skip $(S) endif ifeq ("@BUILD_LVMLOCKD@", "yes") check_lvmlockd_dlm: .tests-stamp VERBOSE=$(VERBOSE) ./lib/runner \ --testdir . --outdir results \ - --flavours udev-lvmlockd-dlm --only shell/dlm-prepare.sh - VERBOSE=$(VERBOSE) ./lib/runner \ - --testdir . --outdir results \ - --flavours udev-lvmlockd-dlm --only $(T) --skip $(S) + --flavours udev-lvmlockd-dlm --only shell/aa-lvmlockd-dlm-prepare.sh,$(T),shell/zz-lvmlockd-dlm-remove.sh --skip $(S) +endif + +ifeq ("@BUILD_LVMLOCKD@", "yes") +check_lvmlockd_test: .tests-stamp VERBOSE=$(VERBOSE) ./lib/runner \ --testdir . --outdir results \ - --flavours udev-lvmlockd-dlm --only shell/dlm-remove.sh + --flavours udev-lvmlockd-test --only shell/aa-lvmlockd-test-prepare.sh,$(T),shell/zz-lvmlockd-test-remove.sh --skip $(S) endif DATADIR = $(datadir)/lvm2-testsuite
@@ -185,6 +181,7 @@ LIB_FLAVOURS = \ flavour-udev-lvmpolld\ flavour-udev-lvmlockd-sanlock\ flavour-udev-lvmlockd-dlm\ + flavour-udev-lvmlockd-test\ flavour-udev-vanilla LIB_LVMLOCKD_CONF = \
test/lib/flavour-udev-lvmlockd-test.sh new file +6 -0
@@ -0,0 +1,6 @@ +export LVM_TEST_LOCKING=1 +export LVM_TEST_LVMETAD=1 +export LVM_TEST_LVMPOLLD=1 +export LVM_TEST_LVMLOCKD=1 +export LVM_TEST_LVMLOCKD_TEST=1 +export LVM_TEST_DEVDIR=/dev
test/lib/test-sanlock-conf +1 -1
@@ -1,2 +1,2 @@ # created by lvm test suite -SANLOCKOPTS="-U sanlock -G sanlock -w 0" +use_watchdog=0
test/shell/aa-lvmlockd-dlm-prepare.sh new file +90 -0
90 lines not on this page · raw message
test/shell/aa-lvmlockd-sanlock-prepare.sh new file +85 -0
85 lines not on this page · raw message
test/shell/aa-lvmlockd-test-prepare.sh new file +44 -0
44 lines not on this page · raw message
test/shell/dlm-prepare.sh deleted +0 -90
90 lines not on this page · raw message
test/shell/dlm-remove.sh deleted +0 -24
@@ -1,24 +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='Remove the dlm test setup' - -. lib/inittest - -[ -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/lvmlockd-lv-types.sh +6 -0
@@ -27,6 +27,12 @@ LOCKARGS2="dlm" LOCKARGS3="dlm" fi +if test -n "$LVM_TEST_LVMLOCKD_TEST" ; then +LOCKARGS1="dlm" +LOCKARGS2="dlm" +LOCKARGS3="dlm" +fi + aux prepare_devs 5 vgcreate --shared $vg "$dev1" "$dev2" "$dev3" "$dev4" "$dev5"
test/shell/sanlock-prepare.sh deleted +0 -87
87 lines not on this page · raw message
test/shell/sanlock-remove.sh deleted +0 -39
@@ -1,39 +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='Remove the sanlock test setup' - -. lib/inittest - -[ -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 - -killall -9 lvmlockd -killall -9 sanlock - -# FIXME: dmsetup remove LVMTEST*-lvmlock - -dmsetup remove glvg-lvmlock || true -dmsetup remove GL_DEV || true -
test/shell/zz-lvmlockd-dlm-remove.sh new file +24 -0
@@ -0,0 +1,24 @@ +#!/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='Remove the dlm test setup' + +. lib/inittest + +[ -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/zz-lvmlockd-sanlock-remove.sh new file +41 -0
41 lines not on this page · raw message
test/shell/zz-lvmlockd-test-remove.sh new file +23 -0
@@ -0,0 +1,23 @@ +#!/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 +