[SCM] CTDB repository - branch master updated - ctdb-1.13-62-g7917233

Ronnie Sahlberg sahlberg at samba.org
Wed Apr 11 19:02:56 MDT 2012


The branch, master has been updated
       via  79172330d10ae0d5a7e5bf724959c9e5784716b4 (commit)
      from  83aea6488002aa75dd25752fa0d164afb8b4f300 (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 79172330d10ae0d5a7e5bf724959c9e5784716b4
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Apr 12 10:31:17 2012 +1000

    Add test for NoIPTakeover

-----------------------------------------------------------------------

Summary of changes:
 tests/simple/73_tunable_NoIPTakeover.sh |   83 +++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 0 deletions(-)
 create mode 100755 tests/simple/73_tunable_NoIPTakeover.sh


Changeset truncated at 500 lines:

diff --git a/tests/simple/73_tunable_NoIPTakeover.sh b/tests/simple/73_tunable_NoIPTakeover.sh
new file mode 100755
index 0000000..2f44ce4
--- /dev/null
+++ b/tests/simple/73_tunable_NoIPTakeover.sh
@@ -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


-- 
CTDB repository


More information about the samba-cvs mailing list