summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/tool/scripts
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-03-17 13:42:35 +1100
committerAmitay Isaacs <amitay@samba.org>2014-03-23 04:20:14 +0100
commit79d28000043bd463beecaeac47855d3a4970eaf2 (patch)
treeb15970341536986b5a047cae261b5feab457dac0 /ctdb/tests/tool/scripts
parent9bede494743f0ce13493fe718ed8f0c3c5f2959c (diff)
downloadsamba-79d28000043bd463beecaeac47855d3a4970eaf2.tar.gz
samba-79d28000043bd463beecaeac47855d3a4970eaf2.tar.xz
samba-79d28000043bd463beecaeac47855d3a4970eaf2.zip
ctdb-tests: Add "ctdb listnodes" and "ctdb xpnn" stub tests
Tests for xpnn need to implement a stub for ctdb_sys_have_ip(). The cheapest way of doing this is to read a fake nodemap using the existing code and check if the IP of the "current" node is the one being asked about. However, the fake state initialisation isn't currently available to without_daemon commands because it is meant to represent daemon state. However, it can be made available by moving the relevant code into a new stub for tevent_context_init(). The stub still needs to initialise a tevent context - this can be done by calling a lower level function. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests/tool/scripts')
-rw-r--r--ctdb/tests/tool/scripts/local.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/ctdb/tests/tool/scripts/local.sh b/ctdb/tests/tool/scripts/local.sh
index 6cad929e85..8d7d56c0c6 100644
--- a/ctdb/tests/tool/scripts/local.sh
+++ b/ctdb/tests/tool/scripts/local.sh
@@ -42,6 +42,17 @@ setup_natgw ()
cat >"$CTDB_NATGW_NODES"
}
+setup_nodes ()
+{
+ debug "Setting up CTDB_NODES"
+
+ # These will accumulate, 1 per test... but will be cleaned up at
+ # the end.
+ export CTDB_NODES=$(mktemp --tmpdir="$TEST_VAR_DIR")
+
+ cat >"$CTDB_NODES"
+}
+
simple_test ()
{
_out=$($VALGRIND $test_prog "$@" 2>&1)