2008-11-20 20:40:01 +11:00
#!/bin/bash
2008-11-24 17:47:09 +11:00
test_info( )
{
cat <<EOF
Verify the operation of 'ctdb disable' .
This is a superficial test of the 'ctdb disable' command. It trusts
information from CTDB that indicates that the IP failover has happened
correctly. Another test should check that the failover has actually
happened at the networking level.
Prerequisites:
* An active CTDB cluster with at least 2 active nodes.
Steps:
1. Verify that the status on all of the ctdb nodes is 'OK' .
2. Disable one of the nodes using 'ctdb disable -n <node>' .
3. Verify that the status of the node changes to 'disabled' .
4. Verify that the IP addreses served by the disabled node are failed
over to other nodes.
Expected results:
* The status of the disabled node changes as expected and IP addresses
failover as expected.
EOF
}
2008-11-20 20:40:01 +11:00
2012-04-18 14:55:21 +10:00
. " ${ TEST_SCRIPTS_DIR } /integration.bash "
2008-11-20 20:40:01 +11:00
2008-11-24 17:47:09 +11:00
ctdb_test_init " $@ "
2008-11-20 20:40:01 +11:00
set -e
2009-07-06 17:52:11 +10:00
cluster_is_healthy
# Reset configuration
ctdb_restart_when_done
2008-11-20 20:40:01 +11:00
2009-07-08 13:37:52 +10:00
select_test_node_and_ips
2008-11-20 20:40:01 +11:00
2008-12-10 16:13:42 +11:00
echo " Disabling node $test_node "
2008-11-20 20:40:01 +11:00
2009-01-08 17:12:03 +11:00
try_command_on_node 1 $CTDB disable -n $test_node
2008-11-20 20:40:01 +11:00
# Avoid a potential race condition...
2009-09-11 15:55:53 +10:00
wait_until_node_has_status $test_node disabled
2008-11-20 20:40:01 +11:00
2014-09-12 13:34:51 +10:00
if wait_until_ips_are_on_node '!' $test_node $test_node_ips ; then
2008-11-20 20:40:01 +11:00
echo "All IPs moved."
else
echo "Some IPs didn't move."
testfailures = 1
fi