ctdb-tests: Add a test for configuring the recovery lock as a command
authorMartin Schwenke <martin@meltin.net>
Mon, 21 Jan 2019 01:15:33 +0000 (12:15 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 25 Feb 2019 01:12:17 +0000 (02:12 +0100)
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>
ctdb/tests/simple/01_ctdb_reclock_command.sh [new file with mode: 0755]
ctdb/tests/simple/scripts/local_daemons.bash

diff --git a/ctdb/tests/simple/01_ctdb_reclock_command.sh b/ctdb/tests/simple/01_ctdb_reclock_command.sh
new file mode 100755 (executable)
index 0000000..34f82e9
--- /dev/null
@@ -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!"
index 5d07b1f63988ebbc30668fdc64e16d2c6fb87d60..5da900288b29c55681814a27251ec343e77b771e 100644 (file)
@@ -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