[SCM] CTDB repository - branch master updated -
ctdb-1.0.86-29-gb67946a
Ronnie Sahlberg
sahlberg at samba.org
Tue Jul 7 23:51:59 GMT 2009
The branch, master has been updated
via b67946a6f6b185a7920bf1e560988417c8c4d87d (commit)
via 3f7a4afa0fcc5825beb89267973939df8cde4999 (commit)
via 8d12fe61eb59a4a611dd5950506d14bd4891075d (commit)
via aa9f79e4b3e077b48a8a16903d2236c284617e49 (commit)
via 52e1cd7e9217cfa521850a9a9a9daddcce011f27 (commit)
via 7c27c493a6de92544754e42f2a8f227b3d663c73 (commit)
via da87914ab47fe5786b620587464b58853e98dd7e (commit)
via 56ece515e047a54f33e8b07726e52ba21a1d67e1 (commit)
via bebb21f18e3026cb78a306104e92ee005d1077b2 (commit)
from 5e3b590e384bacfbebab1dd85e89cd87b63c620e (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b67946a6f6b185a7920bf1e560988417c8c4d87d
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Jul 6 17:52:11 2009 +1000
Test suite: better debug info when the cluster is unexpectedly unhealthy.
cluster_is_healthy() is now run locally in tests and internally causes
_cluster_is_healthy() to be run on node 0. When it detects that the
cluster is unhealthy and $ctdb_test_restart_scheduled is not true,
debug information is printed. This replaces the previous use of
$CTDB_TEST_CLEANING_UP.
To avoid spurious debug on expected restarts, added scheduled
restarts to several tests.
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit 3f7a4afa0fcc5825beb89267973939df8cde4999
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Jul 6 16:40:31 2009 +1000
Make ctdbd restarts in tests more reliable.
This works around potential race conditions in the init script where
the restart operation is not necessarily reliable. It just wraps the
actual restart in a loop and tries for a successful restart up to 5
times.
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit 8d12fe61eb59a4a611dd5950506d14bd4891075d
Author: Martin Schwenke <martin at meltin.net>
Date: Mon Jul 6 16:39:08 2009 +1000
When testing make the time taken for some operations more obvious.
If wait_until() does not timeout, print the time taken for the command
to succeed.
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit aa9f79e4b3e077b48a8a16903d2236c284617e49
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Jul 3 20:55:02 2009 +1000
New tests for different aspects of failover.
3 separate tests:
* Check that gratuitous ARPs are received and take effect.
* Check that ping still works after failover.
* Check, via SSH, that the hostname changes after failover.
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit 52e1cd7e9217cfa521850a9a9a9daddcce011f27
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Jul 3 20:44:55 2009 +1000
Updates to TCP tickle tests and supporting functions.
* Removed a race from tpcdump_start(). It seems impossible to tell
when tcpdump is actually ready to capture packets. So this function
now generates some dummy ping packets and waits until it sees them
in the output file.
* tcpdump_start() sets $tcpdump_filter. This is the default filter
for tcpdump_wait() and tcpdump_show(), but other filters may be
passed to those functions.
* New functions tcptickle_sniff_start() and
tcptickle_sniff_wait_show() handle capturing TCP tickle packets.
These are used by complex/31_nfs_tickle.sh and
complex/32_cifs_tickle.sh.
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit 7c27c493a6de92544754e42f2a8f227b3d663c73
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Jul 3 18:01:29 2009 +1000
Add an extra ctdb recovery to test function restart_ctdb().
There are still very rare cases where IPs haven't been reallocated
before the beginning of the next test, so this adds a sleep and an
extra call to "ctdb recover" to restart_ctdb().
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit da87914ab47fe5786b620587464b58853e98dd7e
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Jul 3 17:58:38 2009 +1000
Fix the run_tests script so that the number of columns is never 0.
Sometimes "stty size" reports 0, for example when running in a shell
under Emacs. In this case, we just change it to 80.
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit 56ece515e047a54f33e8b07726e52ba21a1d67e1
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Jul 3 17:40:16 2009 +1000
Separate test cleanup code in output and clean up ctdb restart code.
* ctdb_restart_when_done() now schedules a restart by setting an
explicit variable that is respected in ctdb_test_exit(), rather than
adding a restart to $ctdb_test_exit_hook. This means that restarts
are all done in one place.
* ctdb_test_exit() turns off "set -e" to make sure that all cleanup
happens.
* ctdb_test_exit() now prints a clear message indicating where the
test ends and the cleanup begins. This message also includes the
return code of the test.
* Add debug in cluster_is_healthy to try to capture information about
unexpected unhealthiness when a test starts.
* Simplify simple/07_ctdb_process_exists.sh so that the exit code is
generated more obviously.
* Remove redundant calls to ctdb_test_exit at the end of tests, since
they're done automatically via a trap. Also remove any preceding
warnings of restarts or final hints about test success/failure.
* Allow multi-digit debug levels in simple/12_ctdb_getdebug.sh and
simple/13_ctdb_setdebug.sh.
Signed-off-by: Martin Schwenke <martin at meltin.net>
commit bebb21f18e3026cb78a306104e92ee005d1077b2
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Jul 7 13:45:19 2009 +1000
Initscript cleanups.
* Move building of CTDB_OPTIONS to new function build_ctdb_options()
and have it use a helper function for readability.
* New functions check_persistent_databases() and set_ctdb_variables().
* Remove valgrind-specific stop code, since the general pkill should
kill ctdbd when running under valgrind.
* Remove some bash-isms (e.g. >& /dev/null) since the script is /bin/sh.
* Make indentation consistent.
* Minor clean-ups.
Signed-off-by: Martin Schwenke <martin at meltin.net>
Conflicts:
config/ctdb.init
-----------------------------------------------------------------------
Summary of changes:
config/ctdb.init | 316 +++++++++++---------
tests/complex/31_nfs_tickle.sh | 17 +-
tests/complex/32_cifs_tickle.sh | 17 +-
tests/complex/33_gratuitous_arp.sh | 107 +++++++
tests/complex/41_failover_ping_discrete.sh | 88 ++++++
tests/complex/42_failover_ssh_hostname.sh | 98 ++++++
tests/scripts/ctdb_test_functions.bash | 158 ++++++++---
tests/scripts/run_tests | 2 +-
tests/simple/00_ctdb_init.sh | 1 -
tests/simple/01_ctdb_version.sh | 4 +-
tests/simple/02_ctdb_listvars.sh | 4 +-
tests/simple/03_ctdb_getvar.sh | 6 +-
tests/simple/04_ctdb_setvar.sh | 6 +-
tests/simple/05_ctdb_listnodes.sh | 4 +-
tests/simple/06_ctdb_getpid.sh | 4 +-
tests/simple/07_ctdb_process_exists.sh | 16 +-
tests/simple/08_ctdb_isnotrecmaster.sh | 4 +-
tests/simple/09_ctdb_ping.sh | 11 +-
tests/simple/11_ctdb_ip.sh | 4 +-
tests/simple/12_ctdb_getdebug.sh | 8 +-
tests/simple/13_ctdb_setdebug.sh | 6 +-
tests/simple/14_ctdb_statistics.sh | 4 +-
tests/simple/15_ctdb_statisticsreset.sh | 4 +-
tests/simple/16_ctdb_config_add_ip.sh | 4 +-
tests/simple/17_ctdb_config_delete_ip.sh | 4 +-
tests/simple/18_ctdb_freeze.sh | 6 +-
tests/simple/19_ctdb_thaw.sh | 4 +-
tests/simple/20_ctdb_getmonmode.sh | 6 +-
tests/simple/21_ctdb_disablemonitor.sh | 6 +-
tests/simple/22_ctdb_enablemonitor.sh | 6 +-
tests/simple/23_ctdb_moveip.sh | 6 +-
tests/simple/24_ctdb_getdbmap.sh | 6 +-
tests/simple/25_dumpmemory.sh | 4 +-
..._ctdb_config_check_error_on_unreachable_ctdb.sh | 9 +-
tests/simple/31_ctdb_disable.sh | 9 +-
tests/simple/32_ctdb_enable.sh | 6 +-
tests/simple/41_ctdb_ban.sh | 4 +-
tests/simple/42_ctdb_unban.sh | 4 +-
tests/simple/51_ctdb_bench.sh | 5 +-
tests/simple/52_ctdb_fetch.sh | 4 +-
tests/simple/53_ctdb_transaction.sh | 4 +-
tests/simple/61_ctdb_persistent_safe.sh | 4 +-
tests/simple/62_ctdb_persistent_unsafe.sh | 4 +-
43 files changed, 644 insertions(+), 350 deletions(-)
create mode 100755 tests/complex/33_gratuitous_arp.sh
create mode 100755 tests/complex/41_failover_ping_discrete.sh
create mode 100755 tests/complex/42_failover_ssh_hostname.sh
Changeset truncated at 500 lines:
diff --git a/config/ctdb.init b/config/ctdb.init
index ec71361..95e8ccc 100755
--- a/config/ctdb.init
+++ b/config/ctdb.init
@@ -21,9 +21,9 @@
# Source function library.
if [ -f /etc/init.d/functions ] ; then
- . /etc/init.d/functions
+ . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
- . /etc/rc.d/init.d/functions
+ . /etc/rc.d/init.d/functions
fi
[ -f /etc/rc.status ] && {
@@ -43,205 +43,231 @@ unset TMPDIR
loadconfig network
loadconfig ctdb
-# check networking is up (for redhat)
-[ "${NETWORKING}" = "no" ] && exit 0
-
[ -z "$CTDB_RECOVERY_LOCK" ] && {
echo "No recovery lock specified. Starting CTDB without split brain prevention"
}
-# build up CTDB_OPTIONS variable from optional parameters
-[ -z "$CTDB_RECOVERY_LOCK" ] || CTDB_OPTIONS="$CTDB_OPTIONS --reclock=$CTDB_RECOVERY_LOCK"
-[ -z "$CTDB_LOGFILE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --logfile=$CTDB_LOGFILE"
-[ -z "$CTDB_NODES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --nlist=$CTDB_NODES"
-[ -z "$CTDB_SOCKET" ] || CTDB_OPTIONS="$CTDB_OPTIONS --socket=$CTDB_SOCKET"
-[ -z "$CTDB_PUBLIC_ADDRESSES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --public-addresses=$CTDB_PUBLIC_ADDRESSES"
-[ -z "$CTDB_PUBLIC_INTERFACE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --public-interface=$CTDB_PUBLIC_INTERFACE"
-[ -z "$CTDB_DBDIR" ] || CTDB_OPTIONS="$CTDB_OPTIONS --dbdir=$CTDB_DBDIR"
-[ -z "$CTDB_DBDIR_PERSISTENT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --dbdir-persistent=$CTDB_DBDIR_PERSISTENT"
-[ -z "$CTDB_EVENT_SCRIPT_DIR" ] || CTDB_OPTIONS="$CTDB_OPTIONS --event-script-dir $CTDB_EVENT_SCRIPT_DIR"
-[ -z "$CTDB_TRANSPORT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --transport $CTDB_TRANSPORT"
-[ -z "$CTDB_DEBUGLEVEL" ] || CTDB_OPTIONS="$CTDB_OPTIONS -d $CTDB_DEBUGLEVEL"
-[ -z "$CTDB_NOTIFY_SCRIPT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --notification-script=$CTDB_NOTIFY_SCRIPT"
-[ -z "$CTDB_START_AS_DISABLED" ] || [ "$CTDB_START_AS_DISABLED" != "yes" ] || {
- CTDB_OPTIONS="$CTDB_OPTIONS --start-as-disabled"
-}
-[ -z "$CTDB_CAPABILITY_RECMASTER" ] || [ "$CTDB_CAPABILITY_RECMASTER" != "no" ] || {
- CTDB_OPTIONS="$CTDB_OPTIONS --no-recmaster"
-}
-[ -z "$CTDB_CAPABILITY_LMASTER" ] || [ "$CTDB_CAPABILITY_LMASTER" != "no" ] || {
- CTDB_OPTIONS="$CTDB_OPTIONS --no-lmaster"
-}
-[ -z "$CTDB_LVS_PUBLIC_IP" ] || {
- CTDB_OPTIONS="$CTDB_OPTIONS --lvs --single-public-ip=$CTDB_LVS_PUBLIC_IP"
-}
-[ -z "$CTDB_SCRIPT_LOG_LEVEL" ] || {
- CTDB_OPTIONS="$CTDB_OPTIONS --script-log-level=$CTDB_SCRIPT_LOG_LEVEL"
-}
+# check networking is up (for redhat)
+[ "$NETWORKING" = "no" ] && exit 0
detect_init_style
export CTDB_INIT_STYLE
-if [ "x$CTDB_VALGRIND" = "xyes" ]; then
- init_style="valgrind"
+ctdbd=${CTDBD:-/usr/sbin/ctdbd}
+
+if [ "$CTDB_VALGRIND" = "yes" ]; then
+ init_style="valgrind"
else
- init_style="$CTDB_INIT_STYLE"
+ init_style="$CTDB_INIT_STYLE"
fi
+build_ctdb_options () {
+ [ -z "$CTDB_RECOVERY_LOCK" ] && {
+ echo "You must configure the location of the CTDB_RECOVERY_LOCK"
+ exit 1
+ }
+
+ maybe_set () {
+ # If the 2nd arg is null then return - don't set anything.
+ # Else if the 3rd arg is set and it doesn't match the 2nd arg
+ # then return
+ [ -z "$2" -o \( -n "$3" -a "$3" != "$2" \) ] && return
+
+ val="$2"
+ case "$1" in
+ --*) sep="=" ;;
+ -*) sep=" " ;;
+ esac
+ # For these options we're only passing a value-less flag.
+ [ -n "$3" ] && {
+ val=""
+ sep=""
+ }
+
+ CTDB_OPTIONS="${CTDB_OPTIONS}${CTDB_OPTIONS:+ }${1}${sep}${val}"
+ }
+
+ maybe_set "--reclock" "$CTDB_RECOVERY_LOCK"
+
+ # build up CTDB_OPTIONS variable from optional parameters
+ maybe_set "--logfile" "$CTDB_LOGFILE"
+ maybe_set "--nlist" "$CTDB_NODES"
+ maybe_set "--socket" "$CTDB_SOCKET"
+ maybe_set "--public-addresses" "$CTDB_PUBLIC_ADDRESSES"
+ maybe_set "--public-interface" "$CTDB_PUBLIC_INTERFACE"
+ maybe_set "--dbdir" "$CTDB_DBDIR"
+ maybe_set "--dbdir-persistent" "$CTDB_DBDIR_PERSISTENT"
+ maybe_set "--event-script-dir" "$CTDB_EVENT_SCRIPT_DIR"
+ maybe_set "--transport" "$CTDB_TRANSPORT"
+ maybe_set "-d" "$CTDB_DEBUGLEVEL"
+ maybe_set "--notification-script" "$CTDB_NOTIFY_SCRIPT"
+ maybe_set "--start-as-disabled" "$CTDB_START_AS_DISABLED" "yes"
+ maybe_set "--no-recmaster" "$CTDB_CAPABILITY_RECMASTER" "no"
+ maybe_set "--no-lmaster" "$CTDB_CAPABILITY_LMASTER" "no"
+ maybe_set "--lvs --single-public-ip" "$CTDB_LVS_PUBLIC_IP"
+ maybe_set "--script-log-level" "$CTDB_SCRIPT_LOG_LEVEL"
+}
+
+check_persistent_databases () {
+ PERSISTENT_DB_DIR="${CTDB_DBDIR:-/var/ctdb}/persistent"
+ mkdir -p $PERSISTENT_DB_DIR 2>/dev/null
+ for PDBASE in `ls $PERSISTENT_DB_DIR/*.tdb.[0-9] 2>/dev/null`; do
+ /usr/bin/tdbdump $PDBASE >/dev/null 2>/dev/null || {
+ echo "Persistent database $PDBASE is corrupted! CTDB will not start."
+ return 1
+ }
+ done
+}
+
+set_ctdb_variables () {
+ # set any tunables from the config file
+ set | grep ^CTDB_SET_ | cut -d_ -f3- |
+ while read v; do
+ varname=`echo $v | cut -d= -f1`
+ value=`echo $v | cut -d= -f2`
+ ctdb setvar $varname $value || RETVAL=1
+ done || exit 1
+}
+
set_retval() {
- return $1
+ return $1
}
ctdbd=${CTDBD:-/usr/sbin/ctdbd}
start() {
- echo -n $"Starting ctdbd service: "
-
- ctdb ping >& /dev/null
- if [ $? == "0" ] ; then
- echo $"CTDB is already running"
- RETVAL=1
- return $RETVAL
- fi
-
- # check all persistent databases that they look ok
- PERSISTENT_DB_DIR="/var/ctdb/persistent"
- [ -z "$CTDB_DBDIR" ] || {
- PERSISTENT_DB_DIR="$CTDB_DBDIR/persistent"
- }
- mkdir -p $PERSISTENT_DB_DIR 2>/dev/null
- for PDBASE in `ls $PERSISTENT_DB_DIR/*.tdb.[0-9] 2>/dev/null`; do
- /usr/bin/tdbdump $PDBASE >/dev/null 2>/dev/null || {
- echo "Persistent database $PDBASE is corrupted! CTDB will not start."
- return 1
- }
- done
+ echo -n $"Starting ctdbd service: "
+
+ ctdb ping >/dev/null 2>&1 && {
+ echo $"CTDB is already running"
+ return 1
+ }
+
+ build_ctdb_options
+
+ check_persistent_databases || return $?
+
+ case $init_style in
+ valgrind)
+ valgrind -q --log-file=/var/log/ctdb_valgrind \
+ $ctdbd --nosetsched $CTDB_OPTIONS
+ RETVAL=$?
+ echo
+ ;;
+ suse)
+ startproc $ctdbd $CTDB_OPTIONS
+ rc_status -v
+ RETVAL=$?
+ ;;
+ redhat)
+ daemon $ctdbd $CTDB_OPTIONS
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
+ ;;
+ ubuntu)
+ start-stop-daemon --start --quiet --background \
+ --exec $ctdbd -- $CTDB_OPTIONS
+ RETVAL=$?
+ ;;
+ esac
+
+ sleep 1
+
+ set_ctdb_variables
+
+ return $RETVAL
+}
+stop() {
+ echo -n $"Shutting down ctdbd service: "
+ pkill -0 -f $ctdbd || {
+ echo -n " Warning: ctdbd not running ! "
case $init_style in
- valgrind)
- valgrind -q --log-file=/var/log/ctdb_valgrind \
- $ctdbd --nosetsched $CTDB_OPTIONS
- RETVAL=0
- ;;
suse)
- startproc $ctdbd $CTDB_OPTIONS
rc_status -v
- RETVAL=$?
;;
redhat)
- daemon $ctdbd $CTDB_OPTIONS
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
- ;;
- ubuntu)
- start-stop-daemon --start --quiet --background \
- --exec $ctdbd -- $CTDB_OPTIONS
- RETVAL=$?
+ echo ""
;;
esac
-
+ return 0
+ }
+ ctdb shutdown >/dev/null 2>&1
+ RETVAL=$?
+ count=0
+ while pkill -0 -f $ctdbd ; do
sleep 1
- # set any tunables from the config file
- set | grep ^CTDB_SET_ | cut -d_ -f3- |
- while read v; do
- varname=`echo $v | cut -d= -f1`
- value=`echo $v | cut -d= -f2`
- ctdb setvar $varname $value || RETVAL=1
- done || exit 1
+ count=$(($count + 1))
+ [ $count -gt 10 ] && {
+ echo -n $"killing ctdbd "
+ pkill -9 -f $ctdbd
+ pkill -9 -f $CTDB_BASE/events.d/
+ }
+ done
+ case $init_style in
+ suse)
+ # re-set the return code to the recorded RETVAL in order
+ # to print the correct status message
+ set_retval $RETVAL
+ rc_status -v
+ ;;
+ redhat)
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ctdb
+ echo ""
+ ;;
+ esac
+ return $RETVAL
+}
- return $RETVAL
+restart() {
+ stop
+ start
}
-stop() {
- echo -n $"Shutting down ctdbd service: "
- pkill -0 -f $ctdbd || {
- echo -n " Warning: ctdbd not running ! "
- case $init_style in
- suse)
- rc_status -v
- ;;
- redhat)
- echo ""
- ;;
- esac
- return 0
- }
- ctdb shutdown >/dev/null 2>&1
+status() {
+ echo -n $"Checking for ctdbd service: "
+ ctdb ping >/dev/null 2>&1 || {
RETVAL=$?
- count=0
- while pkill -0 -f $ctdbd ; do
- sleep 1
- count=$(($count + 1))
- [ $count -gt 10 ] && {
- echo -n $"killing ctdbd "
- pkill -9 -f $ctdbd
- pkill -9 -f $CTDB_BASE/events.d/
- }
- done
+ echo -n " ctdbd not running. "
case $init_style in
suse)
- # re-set the return code to the recorded RETVAL
- # in order to print the correct status message
set_retval $RETVAL
rc_status -v
;;
redhat)
- echo
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ctdb
echo ""
;;
esac
return $RETVAL
-}
-
-restart() {
- stop
- start
-}
-
-status() {
- echo -n $"Checking for ctdbd service: "
- ctdb ping >& /dev/null || {
- RETVAL=$?
- echo -n " ctdbd not running. "
- case $init_style in
- suse)
- set_retval $RETVAL
- rc_status -v
- ;;
- redhat)
- echo ""
- ;;
- esac
- return $RETVAL
- }
- echo ""
- ctdb status
-}
+ }
+ echo ""
+ ctdb status
+}
case "$1" in
- start)
+ start)
start
;;
- stop)
+ stop)
stop
;;
- restart|reload)
+ restart|reload)
restart
;;
- status)
+ status)
status
;;
- condrestart)
+ condrestart)
ctdb status > /dev/null && restart || :
;;
- cron)
+ cron)
# used from cron to auto-restart ctdb
ctdb status > /dev/null || restart
;;
- *)
+ *)
echo $"Usage: $0 {start|stop|restart|status|cron|condrestart}"
exit 1
esac
diff --git a/tests/complex/31_nfs_tickle.sh b/tests/complex/31_nfs_tickle.sh
index 4961b7d..bbea663 100755
--- a/tests/complex/31_nfs_tickle.sh
+++ b/tests/complex/31_nfs_tickle.sh
@@ -47,7 +47,10 @@ ctdb_test_init "$@"
ctdb_test_check_real_cluster
-onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
+cluster_is_healthy
+
+# Reset configuration
+ctdb_restart_when_done
# We need this for later, so we know how long to sleep.
try_command_on_node 0 $CTDB getvar MonitorInterval
@@ -98,18 +101,10 @@ else
testfailures=1
fi
-filter="src host $test_ip and tcp src port $test_port and dst host ${src_socket%:*} and tcp dst port ${src_socket##*:} and tcp[tcpflags] & tcp-rst != 0"
-tcpdump_start "$filter"
+tcptickle_sniff_start $src_socket "${test_ip}:${test_port}"
echo "Disabling node $test_node"
try_command_on_node 1 $CTDB disable -n $test_node
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node disabled
-tcpdump_wait
-
-echo "GOOD: here's the tickle reset:"
-tcpdump -n -r $tcpdump_filename 2>/dev/null
-
-echo "Expect a restart..."
-
-ctdb_test_exit
+tcptickle_sniff_wait_show
diff --git a/tests/complex/32_cifs_tickle.sh b/tests/complex/32_cifs_tickle.sh
index 40230c1..d024e7f 100755
--- a/tests/complex/32_cifs_tickle.sh
+++ b/tests/complex/32_cifs_tickle.sh
@@ -46,7 +46,10 @@ ctdb_test_init "$@"
ctdb_test_check_real_cluster
-onnode 0 $CTDB_TEST_WRAPPER cluster_is_healthy
+cluster_is_healthy
+
+# Reset configuration
+ctdb_restart_when_done
# We need this for later, so we know how long to sleep.
try_command_on_node 0 $CTDB getvar MonitorInterval
@@ -95,18 +98,10 @@ else
testfailures=1
fi
-filter="src host $test_ip and tcp src port $test_port and dst host ${src_socket%:*} and tcp dst port ${src_socket##*:} and tcp[tcpflags] & tcp-rst != 0"
-tcpdump_start "$filter"
+tcptickle_sniff_start $src_socket "${test_ip}:${test_port}"
echo "Disabling node $test_node"
try_command_on_node 1 $CTDB disable -n $test_node
onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node disabled
-tcpdump_wait
-
-echo "GOOD: here's the tickle reset:"
-tcpdump -n -r $tcpdump_filename 2>/dev/null
-
-echo "Expect a restart..."
-
-ctdb_test_exit
+tcptickle_sniff_wait_show
diff --git a/tests/complex/33_gratuitous_arp.sh b/tests/complex/33_gratuitous_arp.sh
new file mode 100755
index 0000000..c5e8b81
--- /dev/null
+++ b/tests/complex/33_gratuitous_arp.sh
@@ -0,0 +1,107 @@
+#!/bin/bash
+
+test_info()
+{
+ cat <<EOF
+Verify that a gratuitous ARP is sent when a node is failed out.
+
+We ping a public IP and lookup the MAC address in the ARP table. We
+then disable the node and check the ARP table again - the MAC address
+should have changed. This test does NOT test connectivity after the
+failover.
+
+Prerequisites:
+
+* An active CTDB cluster with at least 2 nodes with public addresses.
+
+* Test must be run on a real or virtual cluster rather than against
+ local daemons.
+
+* Test must not be run from a cluster node.
+
+Steps:
+
+1. Verify that the cluster is healthy.
+2. Select a public address and its corresponding node.
+3. Remove any entries for the chosen address from the ARP table.
+4. Send a single ping request packet to the selected public address.
+5. Determine the MAC address corresponding to the public address by
+ checking the ARP table.
--
CTDB repository
More information about the samba-cvs
mailing list