1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/ctdb/tests/eventscripts/statd-callout.005.sh
Martin Schwenke af93ae1a54 ctdb-tests: New function ctdb_set_pnn() to change PNN
ctdb_get_pnn() incorrectly caches to the same file regardless of what
node is selected via FAKE_CTDB_PNN.

Instead, set the PNN using new function ctdb_get_pnn(), which also
makes CTDB_VARDIR point to a node-specific subdirectory.  This means
that ctdb_get_pnn() will correctly cache to the node-specific
directory.

Fake tickle and TDB files/directories used by the ctdb stub need to be
the same across all PNNs, so change these to use
$EVENTSCRIPTS_TESTS_VAR_DIR instead of node-specific $CTDB_VARDIR.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-04-27 03:32:10 +02:00

28 lines
456 B
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "2 x add-client to different nodes, notify on 1"
setup_ctdb
FAKE_DATE_OUTPUT="1234565789"
ok_null
simple_test_event "add-client" "192.168.123.45"
simple_test_event "update"
ctdb_set_pnn 1
ok_null
simple_test_event "add-client" "192.168.123.46"
simple_test_event "update"
ctdb_set_pnn 0
check_statd_callout_smnotify "192.168.123.45"
ctdb_set_pnn 1
check_ctdb_tdb_statd_state "192.168.123.46"