summaryrefslogtreecommitdiff
path: root/ctdb/tests/scripts
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-09-11 15:44:20 +1000
committerAmitay Isaacs <amitay@samba.org>2019-10-04 09:41:28 +0000
commit653b35764a2b4e999dbe6a71c1de2c9554d6fc4d (patch)
tree3f38e7547160676e50c001696f33848cbcb4374f /ctdb/tests/scripts
parent5ad356c282044db251c395db06900b249ff07544 (diff)
downloadsamba-653b35764a2b4e999dbe6a71c1de2c9554d6fc4d.tar.gz
ctdb-tests: Add cluster.bash include file
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests/scripts')
-rwxr-xr-xctdb/tests/scripts/cluster.bash18
1 files changed, 18 insertions, 0 deletions
diff --git a/ctdb/tests/scripts/cluster.bash b/ctdb/tests/scripts/cluster.bash
new file mode 100755
index 00000000000..916fc843bad
--- /dev/null
+++ b/ctdb/tests/scripts/cluster.bash
@@ -0,0 +1,18 @@
+# Hey Emacs, this is a -*- shell-script -*- !!! :-)
+
+. "${TEST_SCRIPTS_DIR}/integration.bash"
+
+if ! ctdb_test_on_cluster ; then
+ # Do not run on local daemons
+ ctdb_test_error \
+ "ERROR: This test must be run against a real/virtual cluster"
+fi
+
+h=$(hostname)
+
+for i in $(onnode -q all hostname) ; do
+ if [ "$h" = "$i" ] ; then
+ ctdb_test_error \
+ "ERROR: This test must not be run from a cluster node"
+ fi
+done