1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

$PATH only inludes $CTDB_DIR/bin if we're using local sockets. Rename

$TEST_WRAP to $CTDB_TEST_WRAPPER - value now set using
$CTDB_TEST_REMOTE_SCRIPTS_DIR if that is set.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit a69545d7dec78eefb85a1598e5db4667cc210bf9)
This commit is contained in:
Martin Schwenke 2008-12-03 15:48:24 +11:00
parent a04094659c
commit 3cdc0cb708
24 changed files with 54 additions and 54 deletions

View File

@ -7,21 +7,30 @@ export CTDB_NUM_NODES=3
######################################################################
ctdb_bin_dir=$CTDB_DIR/bin
ctdb_tools_dir=$CTDB_DIR/tools
ctdb_test_scripts_dir=$(cd $(dirname $0) ; pwd)
PATH="${ctdb_test_scripts_dir}:${ctdb_tools_dir}:${PATH}"
######################################################################
if [ -n "$CTDB_TEST_REMOTE_SCRIPTS_DIR" ] ; then
CTDB_TEST_WRAPPER="${CTDB_TEST_REMOTE_SCRIPTS_DIR}/test_wrap"
else
CTDB_TEST_WRAPPER="${ctdb_test_scripts_dir}/test_wrap"
fi
export CTDB_TEST_WRAPPER
if [ ! -n "$CTDB_TEST_REAL_CLUSTER" ] ; then
export CTDB_NODES_SOCKETS=""
for i in $(seq 1 $CTDB_NUM_NODES) ; do
CTDB_NODES_SOCKETS="${CTDB_NODES_SOCKETS}${CTDB_NODES_SOCKETS:+ }${var_dir}/sock.${i}"
done
PATH="${ctdb_bin_dir}:${PATH}"
fi
######################################################################
ctdb_bin_dir=$CTDB_DIR/bin
ctdb_tools_dir=$CTDB_DIR/tools
ctdb_test_scripts_dir=$(cd $(dirname $0) ; pwd)
PATH="${ctdb_test_scripts_dir}:${ctdb_bin_dir}:${ctdb_tools_dir}:${PATH}"
export TEST_WRAP="${ctdb_test_scripts_dir}/test_wrap"
"$@"

View File

@ -57,7 +57,7 @@ test_exit ()
ctdb_test_exit ()
{
if ! onnode 0 $TEST_WRAP cluster_is_healthy ; then
if ! onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy ; then
echo "Restarting ctdb on all nodes to get back into known state..."
restart_ctdb
fi
@ -429,10 +429,10 @@ restart_ctdb ()
stop_daemons
start_daemons $CTDB_NUM_NODES
else
onnode -pq all $TEST_WRAP _restart_ctdb
onnode -pq all $CTDB_TEST_WRAPPER _restart_ctdb
fi || return 1
onnode -q 1 $TEST_WRAP wait_until_healthy || return 1
onnode -q 1 $CTDB_TEST_WRAPPER wait_until_healthy || return 1
echo "Setting RerecoveryTimeout to 1"
onnode -pq all "ctdb setvar RerecoveryTimeout 1"

View File

@ -31,7 +31,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
rpm_ver_cmd="rpm -q ctdb"
ctdb_ver_cmd="ctdb version" ||true

View File

@ -31,7 +31,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 0 "ctdb listvars"

View File

@ -32,7 +32,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 0 "ctdb listvars"

View File

@ -36,7 +36,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
var="RecoverTimeout"

View File

@ -28,7 +28,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 0 "ctdb listnodes"

View File

@ -30,7 +30,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
# This is an attempt at being independent of the number of nodes
# reported by "ctdb getpid -n all".

View File

@ -34,7 +34,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
# Create a background process on node 2 that will last for 60 seconds.
# It should still be there when we check.

View File

@ -30,7 +30,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
cmd='ctdb isnotrecmaster || true'
try_command_on_node all "$cmd"

View File

@ -33,7 +33,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node -v 1 'ctdb ping -n 2'
@ -44,7 +44,7 @@ sanity_check_output \
try_command_on_node -v 0 'ctdb shutdown -n 2'
onnode 0 $TEST_WRAP wait_until_node_has_status 2 disconnected
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 disconnected
try_command_on_node 1 'ctdb ping -n 2'

View File

@ -29,7 +29,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
echo "Getting list of public IPs..."
try_command_on_node 1 ctdb ip -n all

View File

@ -28,7 +28,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 0 "ctdb listnodes | wc -l"
num_nodes="$out"

View File

@ -36,7 +36,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
get_debug ()
{

View File

@ -31,7 +31,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
pattern='^(CTDB version 1|Gathered statistics for [[:digit:]]+ nodes|[[:space:]]+[[:alpha:]_]+[[:space:]]+[[:digit:]]+|[[:space:]]+(node|client|timeouts)|[[:space:]]+[[:alpha:]_]+_latency[[:space:]]+[[:digit:]]+\.[[:digit:]]+[[:space:]]sec)$'

View File

@ -30,7 +30,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 0 "ctdb listnodes | wc -l"
num_nodes="$out"

View File

@ -40,7 +40,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
test_node=1

View File

@ -36,7 +36,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
test_node=1

View File

@ -34,7 +34,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
test_node=1
@ -42,7 +42,7 @@ echo "Freezing node $test_node"
try_command_on_node 0 ctdb freeze -n $test_node
onnode 0 $TEST_WRAP wait_until_node_has_status $test_node frozen
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node frozen
restart_ctdb

View File

@ -38,7 +38,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
test_node=1
@ -46,12 +46,12 @@ echo "Freezing node $test_node"
try_command_on_node 0 ctdb freeze -n $test_node
onnode 0 $TEST_WRAP wait_until_node_has_status $test_node frozen
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node frozen
echo "That worked! Now thawing node $test_node"
try_command_on_node 0 ctdb thaw -n $test_node
onnode 0 $TEST_WRAP wait_until_node_has_status $test_node unfrozen
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node unfrozen
ctdb_test_exit

View File

@ -35,7 +35,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 1 ctdb ip -n all
@ -53,7 +53,7 @@ echo "Disabling node 2"
try_command_on_node 1 ctdb disable -n 2
# Avoid a potential race condition...
onnode 0 $TEST_WRAP wait_until_node_has_status 2 disabled
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 disabled
if wait_until_ips_are_on_nodeglob '[!2]' $ips ; then
echo "All IPs moved."

View File

@ -60,7 +60,7 @@ wait_until_recovered_triggered ()
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 1 ctdb ip -n all
@ -79,7 +79,7 @@ echo "Disabling node 2"
try_command_on_node 1 ctdb disable -n 2
# Avoid a potential race condition...
onnode 0 $TEST_WRAP wait_until_node_has_status 2 disabled
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 disabled
if wait_until_ips_are_on_nodeglob '[!2]' $ips ; then
echo "All IPs moved."
@ -88,16 +88,10 @@ else
testfailures=1
fi
#echo "Waiting until cluster has recovered..."
#wait_until_recovered_triggered
#echo "Sleeping to avoid potential race..."
#sleep_for 3
echo "Reenabling node 2"
try_command_on_node 1 ctdb enable -n 2
onnode 0 $TEST_WRAP wait_until_node_has_status 2 enabled
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 enabled
# BUG: this is only guaranteed if DeterministicIPs is 1 and
# NoIPFailback is 0.
@ -113,9 +107,6 @@ fi
echo "Waiting until cluster has recovered..."
wait_until_recovered_triggered
#echo "Sleeping to avoid potential race..."
#sleep_for 10
echo "All done!"
ctdb_test_exit

View File

@ -39,7 +39,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 1 ctdb ip -n all
@ -58,7 +58,7 @@ echo "Banning node 2 for $ban_time seconds"
try_command_on_node 1 ctdb ban $ban_time -n 2
# Avoid a potential race condition...
onnode 0 $TEST_WRAP wait_until_node_has_status 2 banned
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 banned
if wait_until_ips_are_on_nodeglob '[!2]' $ips ; then
echo "All IPs moved."
@ -70,7 +70,7 @@ fi
echo "Sleeping until ban expires..."
sleep_for $ban_time
onnode 0 $TEST_WRAP wait_until_node_has_status 2 unbanned
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 unbanned
# BUG: this is only guaranteed if DeterministicIPs is 1 and
# NoIPFailback is 0.

View File

@ -39,7 +39,7 @@ ctdb_test_init "$@"
set -e
onnode 0 $TEST_WRAP cluster_is_healthy
onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
try_command_on_node 1 ctdb ip -n all
@ -58,7 +58,7 @@ echo "Banning node 2 for $ban_time seconds"
try_command_on_node 1 ctdb ban $ban_time -n 2
# Avoid a potential race condition...
onnode 0 $TEST_WRAP wait_until_node_has_status 2 banned
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 banned
if wait_until_ips_are_on_nodeglob '[!2]' $ips ; then
echo "All IPs moved."
@ -73,7 +73,7 @@ sleep_for 3
echo "Unbanning node 2"
try_command_on_node 1 ctdb unban -n 2
onnode 0 $TEST_WRAP wait_until_node_has_status 2 unbanned
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status 2 unbanned
# BUG: this is only guaranteed if DeterministicIPs is 1 and
# NoIPFailback is 0.