diff options
author | Martin Schwenke <martin@meltin.net> | 2008-12-12 17:25:38 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2008-12-12 17:25:38 +1100 |
commit | 6c6fd475282300ad870eaeeb0bc98befc7901cf1 (patch) | |
tree | 29c9371449e8de5ceba9057ef9fa2a7f884ba133 /ctdb/tests | |
parent | ae5e576d32fb971a3af4baf26c981ca4e6485c17 (diff) | |
download | samba-6c6fd475282300ad870eaeeb0bc98befc7901cf1.tar.gz samba-6c6fd475282300ad870eaeeb0bc98befc7901cf1.tar.xz samba-6c6fd475282300ad870eaeeb0bc98befc7901cf1.zip |
Rename $CTDB_NUM_NODES to $CTDB_TEST_NUM_DAEMONS and only set it if
$CTDB_TEST_REAL_CLUSTER is not set. After a ctdb restart, force a
recovery to attempt to help tests that follows.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 497c40f69e06776861a780500da1952eb7ea8fc1)
Diffstat (limited to 'ctdb/tests')
-rwxr-xr-x | ctdb/tests/scripts/ctdb_test_env | 6 | ||||
-rw-r--r-- | ctdb/tests/scripts/ctdb_test_functions.bash | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/ctdb/tests/scripts/ctdb_test_env b/ctdb/tests/scripts/ctdb_test_env index bb7a14af67..82aa3da9f5 100755 --- a/ctdb/tests/scripts/ctdb_test_env +++ b/ctdb/tests/scripts/ctdb_test_env @@ -3,8 +3,6 @@ export CTDB_DIR=$(cd $(dirname $(dirname $(dirname $0))) ; pwd) var_dir=$CTDB_DIR/tests/var -export CTDB_NUM_NODES=3 - ###################################################################### ctdb_bin_dir=$CTDB_DIR/bin @@ -23,8 +21,10 @@ fi export CTDB_TEST_WRAPPER if [ ! -n "$CTDB_TEST_REAL_CLUSTER" ] ; then + export CTDB_TEST_NUM_DAEMONS=3 + export CTDB_NODES_SOCKETS="" - for i in $(seq 0 $(($CTDB_NUM_NODES -1))) ; do + for i in $(seq 0 $(($CTDB_TEST_NUM_DAEMONS -1))) ; do CTDB_NODES_SOCKETS="${CTDB_NODES_SOCKETS}${CTDB_NODES_SOCKETS:+ }${var_dir}/sock.${i}" done diff --git a/ctdb/tests/scripts/ctdb_test_functions.bash b/ctdb/tests/scripts/ctdb_test_functions.bash index 02fbf986a1..4e9e7316bb 100644 --- a/ctdb/tests/scripts/ctdb_test_functions.bash +++ b/ctdb/tests/scripts/ctdb_test_functions.bash @@ -479,7 +479,7 @@ _restart_ctdb () setup_ctdb () { if [ -n "$CTDB_NODES_SOCKETS" ] ; then - daemons_setup $CTDB_NUM_NODES + daemons_setup $CTDB_TEST_NUM_DAEMONS fi } @@ -487,7 +487,7 @@ restart_ctdb () { if [ -n "$CTDB_NODES_SOCKETS" ] ; then daemons_stop - daemons_start $CTDB_NUM_NODES + daemons_start $CTDB_TEST_NUM_DAEMONS else onnode -pq all $CTDB_TEST_WRAPPER _restart_ctdb fi || return 1 @@ -497,6 +497,12 @@ restart_ctdb () echo "Setting RerecoveryTimeout to 1" onnode -pq all "ctdb setvar RerecoveryTimeout 1" + # In recent versions of CTDB, forcing a recovery like this blocks + # until the recovery is complete. Hopefully this will help the + # cluster to stabilise before a subsequent test. + echo "Forcing a recovery..." + onnode -q 0 ctdb recover + #echo "Sleeping to allow ctdb to settle..." #sleep_for 10 |