diff options
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/tests/CLUSTER/complex/34_nfs_tickle_restart.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/INTEGRATION/database/basics.002.attach.sh | 6 | ||||
-rwxr-xr-x | ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh | 6 | ||||
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 15 | ||||
-rw-r--r-- | ctdb/tests/scripts/integration_local_daemons.bash | 28 | ||||
-rw-r--r-- | ctdb/tests/scripts/integration_real_cluster.bash | 23 |
6 files changed, 30 insertions, 50 deletions
diff --git a/ctdb/tests/CLUSTER/complex/34_nfs_tickle_restart.sh b/ctdb/tests/CLUSTER/complex/34_nfs_tickle_restart.sh index 04d87af1b2e..5ab8a34faec 100755 --- a/ctdb/tests/CLUSTER/complex/34_nfs_tickle_restart.sh +++ b/ctdb/tests/CLUSTER/complex/34_nfs_tickle_restart.sh @@ -59,7 +59,7 @@ rn=$(awk -F'|' -v test_node=$test_node \ '$2 != test_node { print $2 ; exit }' <<<"$listnodes_output") echo "Restarting CTDB on node ${rn}" -restart_ctdb_1 $rn +ctdb_nodes_restart "$rn" # In some theoretical world this is racy. In practice, the node will # take quite a while to become healthy, so this will beat any diff --git a/ctdb/tests/INTEGRATION/database/basics.002.attach.sh b/ctdb/tests/INTEGRATION/database/basics.002.attach.sh index b9ae9481d91..ae09741f980 100755 --- a/ctdb/tests/INTEGRATION/database/basics.002.attach.sh +++ b/ctdb/tests/INTEGRATION/database/basics.002.attach.sh @@ -86,7 +86,7 @@ testdb3="test_replicated.tdb" test_node="0" echo "Shutting down node $test_node" -stop_ctdb_1 "$test_node" +ctdb_nodes_stop "$test_node" sleep 1 wait_until_node_has_status 1 recovered try_command_on_node -v 1 $CTDB status @@ -110,7 +110,7 @@ done echo echo "Start node $test_node" -start_ctdb_1 "$test_node" +ctdb_nodes_start "$test_node" sleep 1 wait_until_ready @@ -124,7 +124,7 @@ check_db $test_node $testdb3 REPLICATED echo echo "Restarting node $test_node" -restart_ctdb_1 "$test_node" +ctdb_nodes_restart "$test_node" sleep 1 wait_until_ready diff --git a/ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh b/ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh index 4076047a8fe..fa934e8bef1 100755 --- a/ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh +++ b/ctdb/tests/INTEGRATION/simple/cluster.091.version_check.sh @@ -33,7 +33,7 @@ export CTDB_TEST_SAMBA_VERSION=$(( (major << 16) | minor )) printf '\nRestarting node %d with CTDB_TEST_SAMBA_VERSION=0x%08x\n' \ "$test_node" \ "$CTDB_TEST_SAMBA_VERSION" -restart_ctdb_1 "$test_node" +ctdb_nodes_restart "$test_node" wait_until_ready echo "GOOD: ctdbd restarted successfully on node ${test_node}" @@ -46,7 +46,7 @@ export CTDB_TEST_SAMBA_VERSION=$(( ((major + 1) << 16) | minor )) printf '\nRestarting node %d with CTDB_TEST_SAMBA_VERSION=0x%08x\n' \ "$test_node" \ "$CTDB_TEST_SAMBA_VERSION" -restart_ctdb_1 "$test_node" +ctdb_nodes_restart "$test_node" echo "Will use PID file ${pidfile} to check for ctdbd exit" wait_until 30 ! test -f "$pidfile" echo "GOOD: ctdbd exited early on node ${test_node}" @@ -56,7 +56,7 @@ export CTDB_TEST_SAMBA_VERSION=$(( (major << 16) | (minor + 1) )) printf '\nRestarting node %d with CTDB_TEST_SAMBA_VERSION=0x%08x\n' \ "$test_node" \ "$CTDB_TEST_SAMBA_VERSION" -start_ctdb_1 "$test_node" +ctdb_nodes_start "$test_node" echo "Will use PID file ${pidfile} to check for ctdbd exit" wait_until 30 ! test -f "$pidfile" echo "GOOD: ctdbd exited early on node ${test_node}" diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index 51e9c7cb822..adf8d0363cf 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -50,7 +50,7 @@ ctdb_test_exit () unset ctdb_test_exit_hook echo "Stopping cluster..." - ctdb_stop_all + ctdb_nodes_stop exit $status } @@ -92,7 +92,7 @@ ctdb_test_init () { trap "ctdb_test_exit" 0 - ctdb_stop_all >/dev/null 2>&1 || true + ctdb_nodes_stop >/dev/null 2>&1 || true echo "Configuring cluster..." setup_ctdb "$@" || exit 1 @@ -111,6 +111,13 @@ ctdb_test_skip_on_cluster () fi } + +ctdb_nodes_restart () +{ + ctdb_nodes_stop "$@" + ctdb_nodes_start "$@" +} + ######################################## # Sets: $out, $outfile @@ -568,9 +575,9 @@ wait_until_node_has_no_ips () ctdb_init () { - ctdb_stop_all >/dev/null 2>&1 || : + ctdb_nodes_stop >/dev/null 2>&1 || : - ctdb_start_all || ctdb_test_error "Cluster start failed" + ctdb_nodes_start || ctdb_test_error "Cluster start failed" wait_until_ready || ctdb_test_error "Cluster didn't become ready" diff --git a/ctdb/tests/scripts/integration_local_daemons.bash b/ctdb/tests/scripts/integration_local_daemons.bash index 9850ad2208c..a2b4e2aee67 100644 --- a/ctdb/tests/scripts/integration_local_daemons.bash +++ b/ctdb/tests/scripts/integration_local_daemons.bash @@ -45,34 +45,18 @@ setup_ctdb () fi } -start_ctdb_1 () +ctdb_nodes_start () { - local pnn="$1" + local nodespec="${1:-all}" - $ctdb_local_daemons start "$pnn" + $ctdb_local_daemons start "$nodespec" } -ctdb_start_all () +ctdb_nodes_stop () { - $ctdb_local_daemons start "all" -} - -stop_ctdb_1 () -{ - local pnn="$1" - - $ctdb_local_daemons stop "$pnn" -} + local nodespec="${1:-all}" -ctdb_stop_all () -{ - $ctdb_local_daemons stop "all" -} - -restart_ctdb_1 () -{ - stop_ctdb_1 "$1" - start_ctdb_1 "$1" + $ctdb_local_daemons stop "$nodespec" } onnode () diff --git a/ctdb/tests/scripts/integration_real_cluster.bash b/ctdb/tests/scripts/integration_real_cluster.bash index 455f1431b98..8d3f68a0b2c 100644 --- a/ctdb/tests/scripts/integration_real_cluster.bash +++ b/ctdb/tests/scripts/integration_real_cluster.bash @@ -39,26 +39,15 @@ _service_ctdb () } # Stop/start CTDB on all nodes. Override for local daemons. -ctdb_stop_all () +ctdb_nodes_stop () { - onnode -p all "$CTDB_TEST_WRAPPER" _service_ctdb stop -} -ctdb_start_all () -{ - onnode -p all "$CTDB_TEST_WRAPPER" _service_ctdb start -} + local nodespec="${1:-all}" -start_ctdb_1 () -{ - onnode "$1" "$CTDB_TEST_WRAPPER" _service_ctdb start + onnode -p "$nodespec" "$CTDB_TEST_WRAPPER" _service_ctdb stop } - -stop_ctdb_1 () +ctdb_nodes_start () { - onnode "$1" "$CTDB_TEST_WRAPPER" _service_ctdb stop -} + local nodespec="${1:-all}" -restart_ctdb_1 () -{ - onnode "$1" "$CTDB_TEST_WRAPPER" _service_ctdb restart + onnode -p "$nodespec" "$CTDB_TEST_WRAPPER" _service_ctdb start } |