summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/tests/UNIT/shellcheck/tests.sh1
-rwxr-xr-xctdb/tests/scripts/cluster.bash18
-rw-r--r--ctdb/wscript1
3 files changed, 20 insertions, 0 deletions
diff --git a/ctdb/tests/UNIT/shellcheck/tests.sh b/ctdb/tests/UNIT/shellcheck/tests.sh
index 1877f629dca..088e15c5368 100755
--- a/ctdb/tests/UNIT/shellcheck/tests.sh
+++ b/ctdb/tests/UNIT/shellcheck/tests.sh
@@ -24,5 +24,6 @@ shellcheck_test -s sh \
"${TEST_SCRIPTS_DIR}/script_install_paths.sh"
shellcheck_test -s bash \
+ "${TEST_SCRIPTS_DIR}/cluster.bash" \
"${TEST_SCRIPTS_DIR}/integration_local_daemons.bash" \
"${TEST_SCRIPTS_DIR}/integration_real_cluster.bash"
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
diff --git a/ctdb/wscript b/ctdb/wscript
index 2c09fe6ea5e..05137c64fdd 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -1067,6 +1067,7 @@ def build(bld):
# Install tests/scripts directory, excluding files that need munging
test_scripts = [
+ 'cluster.bash',
'common.sh',
'integration.bash',
'integration_local_daemons.bash',