[SCM] CTDB repository - branch master updated - ctdb-1.0.104-5-gb6bde17

Ronnie Sahlberg sahlberg at samba.org
Thu Nov 12 18:26:05 MST 2009


The branch, master has been updated
       via  b6bde176af69354ccfb00e6a3169f6b355a59d15 (commit)
       via  20a9d35933d89dc7eb710075f360686a49d78609 (commit)
       via  ffb911896704ddf6bd5a66e43ba2ae8c382e68de (commit)
       via  6ccb495d1110157c06596763c7e252f3182c251e (commit)
       via  39642e745254d93d74dde907787503854fe6ca4a (commit)
      from  5e13a25df5ccf184bd48595c99765a592bbc5969 (commit)

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


- Log -----------------------------------------------------------------
commit b6bde176af69354ccfb00e6a3169f6b355a59d15
Merge: 6ccb495d1110157c06596763c7e252f3182c251e 20a9d35933d89dc7eb710075f360686a49d78609
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Nov 13 12:25:31 2009 +1100

    Merge commit 'martins/master'

commit 20a9d35933d89dc7eb710075f360686a49d78609
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Nov 13 09:44:34 2009 +1100

    Test suite: Fix the NFS and CIFS tickle tests.
    
    The NFS test sleeps for MonitorInterval to give CTDB time to record an
    NFS tickle.  However, this isn't always long enough.  This changes the
    test to wait until a monitor event has actually occurred.
    
    The CIFS test assumes that Samba is able to register a tickle with
    CTDB before it notices that netstat has registered the tickle and can
    use onnode to ask CTDB about it.  That is an incorrect assumption -
    sometimes we can get to the point of asking CTDB about the tickle
    before Samba and CTDB have processed it.  This adds a timeout loop
    that makes the CIFS test wait until the tickle has been registered or
    fail after 10 seconds.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit ffb911896704ddf6bd5a66e43ba2ae8c382e68de
Merge: 39642e745254d93d74dde907787503854fe6ca4a 5e13a25df5ccf184bd48595c99765a592bbc5969
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Nov 11 12:16:30 2009 +1100

    Merge commit 'origin/master'

commit 6ccb495d1110157c06596763c7e252f3182c251e
Author: Mathieu Parent <math.parent at gmail.com>
Date:   Tue Nov 10 12:04:13 2009 +0100

    Fix bashism in events.d/11.natgw
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 39642e745254d93d74dde907787503854fe6ca4a
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Oct 28 13:02:18 2009 +1100

    Test suite: Regression fix - wait_until should not run command in sub-shell.
    
    Commit 25e82a8a667a54c6921ef076c63fdd738dd75d19 changed wait_until()
    to protect the command it runs from "set -e" by running it in a
    subshell.  This breaks uses where the command is expected to set
    global variables.  For example, wait_until_get_src_socket lost the
    value of $out from its call to get_src_socket().
    
    The fix is to not be lazy and use a sub-shell!
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

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

Summary of changes:
 config/events.d/11.natgw               |    2 +-
 tests/complex/31_nfs_tickle.sh         |    7 +++++--
 tests/complex/32_cifs_tickle.sh        |    9 ++++-----
 tests/scripts/ctdb_test_functions.bash |    4 ++--
 4 files changed, 12 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/11.natgw b/config/events.d/11.natgw
index 001b17b..4ef651d 100644
--- a/config/events.d/11.natgw
+++ b/config/events.d/11.natgw
@@ -43,7 +43,7 @@ case $cmd in
 	NATGWIP=`ctdb natgwlist | head -1 | sed -e "s/^[^ ]* *//"`
 
 	CTDB_NATGW_PUBLIC_IP_HOST=`echo $CTDB_NATGW_PUBLIC_IP | sed -e "s/\/.*/\/32/"`
-	if [ "$NATGWMASTER" == "-1" ]; then
+	if [ "$NATGWMASTER" = "-1" ]; then
 		echo "There is not NATGW master node"
 		exit 1
 	fi
diff --git a/tests/complex/31_nfs_tickle.sh b/tests/complex/31_nfs_tickle.sh
index b2c3964..eb6644b 100755
--- a/tests/complex/31_nfs_tickle.sh
+++ b/tests/complex/31_nfs_tickle.sh
@@ -52,6 +52,10 @@ cluster_is_healthy
 # Reset configuration
 ctdb_restart_when_done
 
+ctdb_test_exit_hook_add ctdb_test_eventscript_uninstall
+
+ctdb_test_eventscript_install
+
 # We need this for later, so we know how long to sleep.
 try_command_on_node 0 $CTDB getvar MonitorInterval
 monitor_interval="${out#*= }"
@@ -71,8 +75,7 @@ wait_until_get_src_socket "tcp" "${test_ip}:${test_port}" $nc_pid "nc"
 src_socket="$out"
 echo "Source socket is $src_socket"
 
-echo "Sleeping for MonitorInterval..."
-sleep_for $monitor_interval
+wait_for_monitor_event $test_node
 
 echo "Trying to determine NFS_TICKLE_SHARED_DIRECTORY..."
 f="/etc/sysconfig/nfs"
diff --git a/tests/complex/32_cifs_tickle.sh b/tests/complex/32_cifs_tickle.sh
index 2280e81..6f7d95b 100755
--- a/tests/complex/32_cifs_tickle.sh
+++ b/tests/complex/32_cifs_tickle.sh
@@ -70,11 +70,10 @@ wait_until_get_src_socket "tcp" "${test_ip}:${test_port}" $nc_pid "nc"
 src_socket="$out"
 echo "Source socket is $src_socket"
 
-# Right here we assume that Samba is able to register the tickle with
-# CTDB faster than it takes us to wait for netstat to register the
-# connection and then use onnode below to ask CTDB about it.
-
-try_command_on_node -v 0 ctdb gettickles $test_ip -n $test_node
+# This should happen as soon as connection is up... but unless we wait
+# we sometimes beat the registration.
+echo "Checking if CIFS connection is tracked by CTDB..."
+wait_until 10 try_command_on_node 0 ctdb gettickles $test_ip -n $test_node
 
 if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
     echo "GOOD: CIFS connection tracked OK by CTDB."
diff --git a/tests/scripts/ctdb_test_functions.bash b/tests/scripts/ctdb_test_functions.bash
index e554680..832a42b 100644
--- a/tests/scripts/ctdb_test_functions.bash
+++ b/tests/scripts/ctdb_test_functions.bash
@@ -297,8 +297,8 @@ wait_until ()
     echo -n "<${timeout}|"
     local t=$timeout
     while [ $t -gt 0 ] ; do
-	("$@")
-	local rc=$?
+	local rc=0
+	"$@" || rc=$?
 	if { ! $negate && [ $rc -eq 0 ] ; } || \
 	    { $negate && [ $rc -ne 0 ] ; } ; then
 	    echo "|$(($timeout - $t))|"


-- 
CTDB repository


More information about the samba-cvs mailing list