ctdb-tests: Ensure some event scripts are enabled for cluster tests
authorMartin Schwenke <martin@meltin.net>
Sat, 7 Jul 2018 12:07:54 +0000 (22:07 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 11 Jul 2018 09:48:39 +0000 (11:48 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/complex/00_ctdb_init.sh [new file with mode: 0755]
ctdb/tests/scripts/integration.bash
ctdb/tests/simple/00_ctdb_init.sh

diff --git a/ctdb/tests/complex/00_ctdb_init.sh b/ctdb/tests/complex/00_ctdb_init.sh
new file mode 100755 (executable)
index 0000000..f4905e8
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+test_info()
+{
+    cat <<EOF
+Restart the ctdbd daemons of a CTDB cluster.
+
+Ensure that event script reequired for cluster tests are enabled.
+EOF
+}
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+ctdb_test_init "$@"
+
+set -e
+
+ctdb_test_check_real_cluster
+
+ctdb_stop_all >/dev/null 2>&1 || true
+
+ctdb_enable_cluster_test_event_scripts
+
+ctdb_start_all
index 96762813b74736d68c6db1abf5d5df248dfd36da..c3c573c96223bf4c26517b15e438eabdda02f9c7 100644 (file)
@@ -735,6 +735,26 @@ db_ctdb_tstore_dbseqnum ()
 
 #######################################
 
+# Enables all of the event scripts used in cluster tests, except for
+# the mandatory scripts
+ctdb_enable_cluster_test_event_scripts ()
+{
+       local scripts="
+                      06.nfs
+                      10.interface
+                      49.winbind
+                      50.samba
+                      60.nfs
+                     "
+
+       local s
+       for s in $scripts ; do
+               try_command_on_node all ctdb event script enable legacy "$s"
+       done
+}
+
+########################################
+
 # Make sure that $CTDB is set.
 : ${CTDB:=ctdb}
 
index 66b42ddc561ff33e12d723b3995e03bbcb606e66..26b2615a0bfcb1bc4af57ce3db2689b3fc9dd632 100755 (executable)
@@ -30,6 +30,10 @@ set -e
 
 ctdb_stop_all >/dev/null 2>&1 || true
 
+if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
+       ctdb_enable_cluster_test_event_scripts
+fi
+
 setup_ctdb
 
 ctdb_start_all