forked from samba-team/samba
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(This used to be ctdb commit 79172330d10ae0d5a7e5bf724959c9e5784716b4)
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/bin/bash | ||
|
||
test_info() | ||
{ | ||
cat <<EOF | ||
Verify that 'ctdb setvar NoIPTakeover 1' stops ip addresses from being failed | ||
over onto the node. | ||
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. Use 'ctdb ip' on one of the nodes to list the IP addresses being | ||
served. | ||
3. Use 'ctdb moveip' to move an address from one node to another. | ||
4. Verify that the IP is no longer being hosted by the first node and is now being hosted by the second node. | ||
Expected results: | ||
* 'ctdb moveip' allows an IP address to be moved between cluster nodes. | ||
EOF | ||
} | ||
|
||
. ctdb_test_functions.bash | ||
|
||
ctdb_test_init "$@" | ||
|
||
cluster_is_healthy | ||
|
||
# Reset configuration | ||
ctdb_restart_when_done | ||
|
||
try_command_on_node 0 "$CTDB listnodes | wc -l" | ||
num_nodes="$out" | ||
echo "There are $num_nodes nodes..." | ||
|
||
if [ $num_nodes -lt 2 ] ; then | ||
echo "Less than 2 nodes!" | ||
exit 1 | ||
fi | ||
|
||
|
||
echo "Wait until the ips are reallocated" | ||
sleep 30 | ||
try_command_on_node -q 0 "$CTDB ipreallocate" | ||
|
||
num=`try_command_on_node -v 1 "$CTDB ip" | grep -v Public | egrep " 1$" | wc -l` | ||
echo "Number of addresses on node 1 : $num" | ||
|
||
|
||
echo "Turning on NoIPTakeover on node 1" | ||
try_command_on_node -q 1 "$CTDB setvar NoIPTakeover 1" | ||
try_command_on_node -q 1 "$CTDB ipreallocate" | ||
|
||
echo Disable node 1 | ||
try_command_on_node -q 1 "$CTDB disable" | ||
try_command_on_node -q 1 "$CTDB ipreallocate" | ||
num=`try_command_on_node -v 1 "$CTDB ip" | grep -v Public | egrep " 1$" | wc -l` | ||
echo "Number of addresses on node 1 : $num" | ||
[ "$num" != "0" ] && { | ||
echo "BAD: node 1 still hosts ip addresses" | ||
exit 1 | ||
} | ||
|
||
|
||
echo "Enable node 1 again" | ||
try_command_on_node -q 1 "$CTDB enable" | ||
sleep 30 | ||
try_command_on_node -q 1 "$CTDB ipreallocate" | ||
try_command_on_node -q 1 "$CTDB ipreallocate" | ||
num=`try_command_on_node -v 1 "$CTDB ip" | grep -v Public | egrep " 1$" | wc -l` | ||
echo "Number of addresses on node 1 : $num" | ||
[ "$num" != "0" ] && { | ||
echo "BAD: node took over ip addresses" | ||
exit 1 | ||
} | ||
|
||
|
||
echo "OK. ip addresses were not taken over" | ||
exit 0 |