summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-01-21 12:15:33 +1100
committerAmitay Isaacs <amitay@samba.org>2019-02-25 02:12:17 +0100
commitebc082122fb34ffb8cbcafde9ad39bcc241d33ed (patch)
treef4e67a7b033ea6b20051d143f509b5848d83f98b /ctdb
parente74f5243fcb7594939769c16f3c79ab167dd1227 (diff)
downloadsamba-ebc082122fb34ffb8cbcafde9ad39bcc241d33ed.tar.gz
ctdb-tests: Add a test for configuring the recovery lock as a command
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13800 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/tests/simple/01_ctdb_reclock_command.sh28
-rw-r--r--ctdb/tests/simple/scripts/local_daemons.bash3
2 files changed, 31 insertions, 0 deletions
diff --git a/ctdb/tests/simple/01_ctdb_reclock_command.sh b/ctdb/tests/simple/01_ctdb_reclock_command.sh
new file mode 100755
index 00000000000..34f82e981a1
--- /dev/null
+++ b/ctdb/tests/simple/01_ctdb_reclock_command.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+test_info()
+{
+ cat <<EOF
+Check that CTDB operates correctly if the recovery lock is configured
+as a command.
+
+This test only does anything with local daemons. On a real cluster it
+has no way of updating configuration.
+EOF
+}
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+set -e
+
+if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
+ echo "SKIPPING this test - only runs against local daemons"
+ exit 0
+fi
+
+echo "Starting CTDB with recovery lock command configured..."
+ctdb_test_init --reclock-use-command
+
+cluster_is_healthy
+
+echo "Good, that seems to work!"
diff --git a/ctdb/tests/simple/scripts/local_daemons.bash b/ctdb/tests/simple/scripts/local_daemons.bash
index 5d07b1f6398..5da900288b2 100644
--- a/ctdb/tests/simple/scripts/local_daemons.bash
+++ b/ctdb/tests/simple/scripts/local_daemons.bash
@@ -22,10 +22,12 @@ setup_ctdb ()
local public_addresses=""
local no_event_scripts=false
local disable_failover=""
+ local reclock_use_command=""
case "$1" in
--no-public-addresses) public_addresses="/dev/null" ;;
--no-event-scripts) no_event_scripts=true ;;
--disable-failover) disable_failover="yes" ;;
+ --reclock-use-command) reclock_use_command="yes" ;;
esac
$ctdb_local_daemons setup \
@@ -33,6 +35,7 @@ setup_ctdb ()
${disable_failover:+-F} \
${public_addresses:+-P} ${public_addresses} \
${CTDB_USE_IPV6:+-6} \
+ ${reclock_use_command:+-R} \
${TEST_SOCKET_WRAPPER_SO_PATH:+-S} ${TEST_SOCKET_WRAPPER_SO_PATH}
if [ $? -ne 0 ] ; then
exit 1