ctdb-tests: Add "ctdb listnodes" and "ctdb xpnn" stub tests
commit79d28000043bd463beecaeac47855d3a4970eaf2
authorMartin Schwenke <martin@meltin.net>
Mon, 17 Mar 2014 02:42:35 +0000 (17 13:42 +1100)
committerAmitay Isaacs <amitay@samba.org>
Sun, 23 Mar 2014 03:20:14 +0000 (23 04:20 +0100)
treeb15970341536986b5a047cae261b5feab457dac0
parent9bede494743f0ce13493fe718ed8f0c3c5f2959c
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>
ctdb/tests/src/ctdb_test.c
ctdb/tests/src/ctdb_test_stubs.c
ctdb/tests/tool/scripts/local.sh
ctdb/tests/tool/stubby.listnodes.001.sh [new file with mode: 0755]
ctdb/tests/tool/stubby.listnodes.002.sh [new file with mode: 0755]
ctdb/tests/tool/stubby.xpnn.001.sh [new file with mode: 0755]
ctdb/tests/tool/stubby.xpnn.002.sh [new file with mode: 0755]
ctdb/tests/tool/stubby.xpnn.003.sh [new file with mode: 0755]