summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/simple
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2010-08-04 13:16:06 +1000
committerMartin Schwenke <martin@meltin.net>2010-08-04 13:16:06 +1000
commit7edcb89857caf18cc3dccc53a52be85575898544 (patch)
treef7b384c0bca638dd6a8bdc34d17279c22665687b /ctdb/tests/simple
parent1c6163935ace8f4f81f7663515c55c8e5bcdf3af (diff)
downloadsamba-7edcb89857caf18cc3dccc53a52be85575898544.tar.gz
samba-7edcb89857caf18cc3dccc53a52be85575898544.tar.xz
samba-7edcb89857caf18cc3dccc53a52be85575898544.zip
Test suite - try to make addip test more reliable and add some debugging.
This test is failing in some situations. The "ctdb addip" command works but the IP never appears in the "ctdb ip" output. Try restricting the last octet to be between 101-199. At the moment addresses like 10.0.2.1 are being chosen and these are often the address of the host machine in autocluster configurations... so might cause weirdness. Also add some debugging if checking for the IP address times out. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ae52cb63756bc60de8d32e01bac5d70975a1c7a0)
Diffstat (limited to 'ctdb/tests/simple')
-rwxr-xr-xctdb/tests/simple/16_ctdb_config_add_ip.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/ctdb/tests/simple/16_ctdb_config_add_ip.sh b/ctdb/tests/simple/16_ctdb_config_add_ip.sh
index 79849f2c5b6..5505e993879 100755
--- a/ctdb/tests/simple/16_ctdb_config_add_ip.sh
+++ b/ctdb/tests/simple/16_ctdb_config_add_ip.sh
@@ -73,7 +73,7 @@ add_ip=""
# loop through the possible IP addreses.
for i in $test_node_ips ; do
prefix="${i%.*}"
- for j in $(seq 1 254) ; do
+ for j in $(seq 101 199) ; do
try="${prefix}.${j}"
# Try to make sure it isn't used anywhere!
@@ -102,15 +102,19 @@ for i in $test_node_ips ; do
done
done
-if [ -n "$add_ip" ] ; then
- echo "Adding IP: ${add_ip/:/ on interface }"
- try_command_on_node $test_node $CTDB addip ${add_ip/:/ }
+if [ -z "$add_ip" ] ; then
+ echo "BAD: Unable to find IP address to add."
+ exit 1
+fi
- echo "Waiting for IP to be added..."
- wait_until 60 ips_are_on_nodeglob $test_node $test_node_ips ${add_ip%/*}
+echo "Adding IP: ${add_ip/:/ on interface }"
+try_command_on_node $test_node $CTDB addip ${add_ip/:/ }
+echo "Waiting for IP to be added..."
+if wait_until 60 ips_are_on_nodeglob $test_node $test_node_ips ${add_ip%/*} ; then
echo "That worked!"
else
- echo "BAD: Unable to find IP address to add."
- testfailures=1
+ echo "BAD: IP didn't get added."
+ try_command_on_node $test_node ctdb ip -n all
+ exit 1
fi