1 # Hey Emacs, this is a -*- shell-script -*- !!! :-)
3 . "${TEST_SCRIPTS_DIR}/common.sh"
5 # If we're not running on a real cluster then we need a local copy of
6 # ctdb (and other stuff) in $PATH and we will use local daemons.
7 if [ -n "$TEST_LOCAL_DAEMONS" ] ; then
8 export CTDB_NODES_SOCKETS=""
9 for i in $(seq 0 $(($TEST_LOCAL_DAEMONS - 1))) ; do
10 CTDB_NODES_SOCKETS="${CTDB_NODES_SOCKETS}${CTDB_NODES_SOCKETS:+ }${TEST_VAR_DIR}/sock.${i}"
13 # Use in-tree binaries if running against local daemons.
14 # Otherwise CTDB need to be installed on all nodes.
15 if [ -n "$ctdb_dir" -a -d "${ctdb_dir}/bin" ] ; then
16 PATH="${ctdb_dir}/bin:${PATH}"
17 export CTDB_LOCK_HELPER="${ctdb_dir}/bin/ctdb_lock_helper"
20 export CTDB_NODES="${TEST_VAR_DIR}/nodes.txt"
23 ######################################################################
25 export CTDB_TIMEOUT=60
27 if [ -n "$CTDB_TEST_REMOTE_DIR" ] ; then
28 CTDB_TEST_WRAPPER="${CTDB_TEST_REMOTE_DIR}/test_wrap"
30 _d=$(cd ${TEST_SCRIPTS_DIR}; echo $PWD)
31 CTDB_TEST_WRAPPER="$_d/test_wrap"
33 export CTDB_TEST_WRAPPER
35 # If $VALGRIND is set then use it whenever ctdb is called, but only if
36 # $CTDB is not already set.
37 [ -n "$CTDB" ] || export CTDB="${VALGRIND}${VALGRIND:+ }ctdb"
40 PATH="${TEST_SCRIPTS_DIR}:${PATH}"
42 ######################################################################
44 ctdb_check_time_logs ()
53 out=$(onnode all tail -n 20 "${TEST_VAR_DIR}/ctdb.test.time.log" 2>&1)
55 if [ $? -eq 0 ] ; then
60 node="${line#>> NODE: }"
67 if [ -n "$ds_prev" ] && \
68 [ $(($ds_curr - $ds_prev)) -ge $threshold ] ; then
69 echo "Node $node had time jump of $(($ds_curr - $ds_prev))ds between $(date +'%T' -d @${ds_prev%?}) and $(date +'%T' -d @${ds_curr%?})"
78 echo Error getting time logs
81 echo "Check time sync (test client first):"
84 echo "Information from test client:"
87 echo "Information from cluster nodes:"
88 onnode all "top -b -n 1 ; echo '/proc/slabinfo' ; cat /proc/slabinfo"
98 [ $(($testfailures+0)) -eq 0 -a $status -ne 0 ] && testfailures=$status
99 status=$(($testfailures+0))
101 # Avoid making a test fail from this point onwards. The test is
105 echo "*** TEST COMPLETED (RC=$status) AT $(date '+%F %T'), CLEANING UP..."
107 if [ -z "$TEST_LOCAL_DAEMONS" -a -n "$CTDB_TEST_TIME_LOGGING" -a \
108 $status -ne 0 ] ; then
112 eval "$ctdb_test_exit_hook" || true
113 unset ctdb_test_exit_hook
115 if $ctdb_test_restart_scheduled || ! cluster_is_healthy ; then
119 # This could be made unconditional but then we might get
120 # duplication from the recovery in restart_ctdb. We want to
121 # leave the recovery in restart_ctdb so that future tests that
122 # might do a manual restart mid-test will benefit.
123 echo "Forcing a recovery..."
124 onnode 0 $CTDB recover
130 ctdb_test_exit_hook_add ()
132 ctdb_test_exit_hook="${ctdb_test_exit_hook}${ctdb_test_exit_hook:+ ; }$*"
137 scriptname=$(basename "$0")
139 ctdb_test_restart_scheduled=false
141 trap "ctdb_test_exit" 0
144 ########################################
147 try_command_on_node ()
149 local nodespec="$1" ; shift
154 while [ "${nodespec#-}" != "$nodespec" ] ; do
155 if [ "$nodespec" = "-v" ] ; then
158 onnode_opts="$nodespec"
160 nodespec="$1" ; shift
165 out=$(onnode -q $onnode_opts "$nodespec" "$cmd" 2>&1) || {
167 echo "Failed to execute \"$cmd\" on node(s) \"$nodespec\""
173 echo "Output of \"$cmd\":"
178 sanity_check_output ()
181 local regexp="$2" # Should be anchored as necessary.
186 local num_lines=$(echo "$output" | wc -l)
187 echo "There are $num_lines lines of output"
188 if [ $num_lines -lt $min_lines ] ; then
189 echo "BAD: that's less than the required number (${min_lines})"
194 local unexpected # local doesn't pass through status of command on RHS.
195 unexpected=$(echo "$output" | egrep -v "$regexp") || status=$?
197 # Note that this is reversed.
198 if [ $status -eq 0 ] ; then
199 echo "BAD: unexpected lines in output:"
200 echo "$unexpected" | cat -A
203 echo "Output lines look OK"
211 local ips="$1" # list of "ip node" lines
213 echo "Sanity checking IPs..."
217 while read x ipp ; do
218 [ "$ipp" = "-1" ] && break
219 if [ -n "$prev" -a "$ipp" != "$prev" ] ; then
226 echo "BAD: a node was -1 or IPs are only assigned to one node"
227 echo "Are you running an old version of CTDB?"
231 # This returns a list of "ip node" lines in $out
235 try_command_on_node $node "$CTDB ip -Y -n all | cut -d ':' -f1-3 | sed -e '1d' -e 's@^:@@' -e 's@:@ @g'"
238 _select_test_node_and_ips ()
242 test_node="" # this matches no PNN
245 while read ip pnn ; do
246 if [ -z "$test_node" -a "$pnn" != "-1" ] ; then
249 if [ "$pnn" = "$test_node" ] ; then
250 test_node_ips="${test_node_ips}${test_node_ips:+ }${ip}"
252 done <<<"$out" # bashism to avoid problem setting variable in pipeline.
254 echo "Selected node ${test_node} with IPs: ${test_node_ips}."
255 test_ip="${test_node_ips%% *}"
257 [ -n "$test_node" ] || return 1
260 select_test_node_and_ips ()
263 while ! _select_test_node_and_ips ; do
264 echo "Unable to find a test node with IPs assigned"
265 if [ $timeout -le 0 ] ; then
266 echo "BAD: Too many attempts"
270 timeout=$(($timeout - 1))
276 #######################################
278 # Wait until either timeout expires or command succeeds. The command
279 # will be tried once per second.
282 local timeout="$1" ; shift # "$@" is the command...
285 if [ "$1" = "!" ] ; then
290 echo -n "<${timeout}|"
292 while [ $t -gt 0 ] ; do
295 if { ! $negate && [ $rc -eq 0 ] ; } || \
296 { $negate && [ $rc -ne 0 ] ; } ; then
297 echo "|$(($timeout - $t))|"
314 for i in $(seq 1 $1) ; do
321 _cluster_is_healthy ()
323 local out x count line
325 out=$($CTDB -Y status 2>/dev/null) || return 1
331 # We need to see valid lines if we're going to be healthy.
332 [ "${line#:[0-9]}" != "$line" ] && count=$(($count + 1))
333 # A line indicating a node is unhealthy causes failure.
334 [ "${line##:*:*:*1:}" != "$line" ] && return 1
336 [ $count -gt 0 ] && return $?
337 } <<<"$out" # Yay bash!
340 cluster_is_healthy ()
342 if onnode 0 $CTDB_TEST_WRAPPER _cluster_is_healthy ; then
343 echo "Cluster is HEALTHY"
346 echo "Cluster is UNHEALTHY"
347 if ! ${ctdb_test_restart_scheduled:-false} ; then
348 echo "DEBUG AT $(date '+%F %T'):"
350 for i in "onnode -q 0 $CTDB status" "onnode -q 0 onnode all $CTDB scriptstatus" ; do
359 wait_until_healthy ()
361 local timeout="${1:-120}"
363 echo "Waiting for cluster to become healthy..."
365 wait_until 120 _cluster_is_healthy
368 # This function is becoming nicely overloaded. Soon it will collapse! :-)
374 local bits fpat mpat rpat
376 (unhealthy) bits="?:?:?:1:*" ;;
377 (healthy) bits="?:?:?:0:*" ;;
378 (disconnected) bits="1:*" ;;
379 (connected) bits="0:*" ;;
380 (banned) bits="?:1:*" ;;
381 (unbanned) bits="?:0:*" ;;
382 (disabled) bits="?:?:1:*" ;;
383 (enabled) bits="?:?:0:*" ;;
384 (stopped) bits="?:?:?:?:1:*" ;;
385 (notstopped) bits="?:?:?:?:0:*" ;;
386 (frozen) fpat='^[[:space:]]+frozen[[:space:]]+1$' ;;
387 (unfrozen) fpat='^[[:space:]]+frozen[[:space:]]+0$' ;;
388 (monon) mpat='^Monitoring mode:ACTIVE \(0\)$' ;;
389 (monoff) mpat='^Monitoring mode:DISABLED \(1\)$' ;;
390 (recovered) rpat='^Recovery mode:NORMAL \(0\)$' ;;
392 echo "node_has_status: unknown status \"$status\""
396 if [ -n "$bits" ] ; then
399 out=$($CTDB -Y status 2>&1) || return 1
404 # This needs to be done in 2 steps to avoid false matches.
405 local line_bits="${line#:${pnn}:*:}"
406 [ "$line_bits" = "$line" ] && continue
407 [ "${line_bits#${bits}}" != "$line_bits" ] && return 0
410 } <<<"$out" # Yay bash!
411 elif [ -n "$fpat" ] ; then
412 $CTDB statistics -n "$pnn" | egrep -q "$fpat"
413 elif [ -n "$mpat" ] ; then
414 $CTDB getmonmode -n "$pnn" | egrep -q "$mpat"
415 elif [ -n "$rpat" ] ; then
416 $CTDB status -n "$pnn" | egrep -q "$rpat"
418 echo 'node_has_status: unknown mode, neither $bits nor $fpat is set'
423 wait_until_node_has_status ()
427 local timeout="${3:-30}"
428 local proxy_pnn="${4:-any}"
430 echo "Waiting until node $pnn has status \"$status\"..."
432 if ! wait_until $timeout onnode $proxy_pnn $CTDB_TEST_WRAPPER node_has_status "$pnn" "$status" ; then
433 for i in "onnode -q any $CTDB status" "onnode -q any onnode all $CTDB scriptstatus" ; do
443 # Useful for superficially testing IP failover.
444 # IPs must be on nodes matching nodeglob.
445 # If the first argument is '!' then the IPs must not be on nodes
447 ips_are_on_nodeglob ()
450 if [ "$1" = "!" ] ; then
451 negating=true ; shift
453 local nodeglob="$1" ; shift
460 for check in $ips ; do
461 while read ip pnn ; do
462 if [ "$check" = "$ip" ] ; then
464 ($nodeglob) if $negating ; then return 1 ; fi ;;
465 (*) if ! $negating ; then return 1 ; fi ;;
467 ips="${ips/${ip}}" # Remove from list
470 # If we're negating and we didn't see the address then it
471 # isn't hosted by anyone!
473 ips="${ips/${check}}"
475 done <<<"$out" # bashism to avoid problem setting variable in pipeline.
478 ips="${ips// }" # Remove any spaces.
482 wait_until_ips_are_on_nodeglob ()
484 echo "Waiting for IPs to fail over..."
486 wait_until 60 ips_are_on_nodeglob "$@"
497 while read ip pnn ; do
498 if [ "$node" = "$pnn" ] ; then
501 done <<<"$out" # bashism to avoid problem setting variable in pipeline.
506 wait_until_node_has_some_ips ()
508 echo "Waiting for node to have some IPs..."
510 wait_until 60 node_has_some_ips "$@"
517 ip addr show to "$_ip" | awk '$1 == "inet" { print $2 }'
520 #######################################
524 echo "Attempting to politely shutdown daemons..."
525 onnode 1 $CTDB shutdown -n all || true
527 echo "Sleeping for a while..."
530 local pat="ctdbd --socket=.* --nlist .* --nopublicipcheck"
531 if pgrep -f "$pat" >/dev/null ; then
532 echo "Killing remaining daemons..."
535 if pgrep -f "$pat" >/dev/null ; then
536 echo "Once more with feeling.."
541 rm -rf "${TEST_VAR_DIR}/test.db"
546 mkdir -p "${TEST_VAR_DIR}/test.db/persistent"
548 local public_addresses_all="${TEST_VAR_DIR}/public_addresses_all"
549 local no_public_addresses="${TEST_VAR_DIR}/no_public_addresses.txt"
550 rm -f $CTDB_NODES $public_addresses_all $no_public_addresses
552 # If there are (strictly) greater than 2 nodes then we'll randomly
553 # choose a node to have no public addresses.
554 local no_public_ips=-1
555 [ $TEST_LOCAL_DAEMONS -gt 2 ] && no_public_ips=$(($RANDOM % $TEST_LOCAL_DAEMONS))
556 echo "$no_public_ips" >$no_public_addresses
558 # When running certain tests we add and remove eventscripts, so we
559 # need to be able to modify the events.d/ directory. Therefore,
560 # we use a temporary events.d/ directory under $TEST_VAR_DIR. We
561 # copy the actual test eventscript(s) in there from the original
562 # events.d/ directory that sits alongside $TEST_SCRIPT_DIR.
563 local top=$(dirname "$TEST_SCRIPTS_DIR")
564 local events_d="${top}/events.d"
565 mkdir -p "${TEST_VAR_DIR}/events.d"
566 cp -p "${events_d}/"* "${TEST_VAR_DIR}/events.d/"
569 for i in $(seq 1 $TEST_LOCAL_DAEMONS) ; do
570 if [ "${CTDB_USE_IPV6}x" != "x" ]; then
571 echo ::$i >>"$CTDB_NODES"
572 ip addr add ::$i/128 dev lo
574 echo 127.0.0.$i >>"$CTDB_NODES"
575 # 2 public addresses on most nodes, just to make things interesting.
576 if [ $(($i - 1)) -ne $no_public_ips ] ; then
577 echo "192.168.234.$i/24 lo" >>"$public_addresses_all"
578 echo "192.168.234.$(($i + $TEST_LOCAL_DAEMONS))/24 lo" >>"$public_addresses_all"
587 shift # "$@" gets passed to ctdbd
589 local public_addresses_all="${TEST_VAR_DIR}/public_addresses_all"
590 local public_addresses_mine="${TEST_VAR_DIR}/public_addresses.${pnn}"
591 local no_public_addresses="${TEST_VAR_DIR}/no_public_addresses.txt"
593 local no_public_ips=-1
594 [ -r $no_public_addresses ] && read no_public_ips <$no_public_addresses
596 if [ "$no_public_ips" = $pnn ] ; then
597 echo "Node $no_public_ips will have no public IPs."
600 local node_ip=$(sed -n -e "$(($pnn + 1))p" "$CTDB_NODES")
601 local ctdb_options="--reclock=${TEST_VAR_DIR}/rec.lock --nlist $CTDB_NODES --nopublicipcheck --listen=${node_ip} --event-script-dir=${TEST_VAR_DIR}/events.d --logfile=${TEST_VAR_DIR}/daemon.${pnn}.log -d 3 --log-ringbuf-size=10000 --dbdir=${TEST_VAR_DIR}/test.db --dbdir-persistent=${TEST_VAR_DIR}/test.db/persistent --dbdir-state=${TEST_VAR_DIR}/test.db/state"
603 if [ -n "$TEST_LOCAL_DAEMONS" ] ; then
604 ctdb_options="$ctdb_options --public-interface=lo"
607 if [ $pnn -eq $no_public_ips ] ; then
608 ctdb_options="$ctdb_options --public-addresses=/dev/null"
610 cp "$public_addresses_all" "$public_addresses_mine"
611 ctdb_options="$ctdb_options --public-addresses=$public_addresses_mine"
614 # We'll use "pkill -f" to kill the daemons with
615 # "--socket=.* --nlist .* --nopublicipcheck" as context.
616 $VALGRIND ctdbd --socket="${TEST_VAR_DIR}/sock.$pnn" $ctdb_options "$@" ||return 1
621 # "$@" gets passed to ctdbd
623 echo "Starting $TEST_LOCAL_DAEMONS ctdb daemons..."
625 for i in $(seq 0 $(($TEST_LOCAL_DAEMONS - 1))) ; do
626 daemons_start_1 $i "$@"
629 if [ -L /tmp/ctdb.socket -o ! -S /tmp/ctdb.socket ] ; then
630 ln -sf "${TEST_VAR_DIR}/sock.0" /tmp/ctdb.socket || return 1
634 #######################################
636 _ctdb_hack_options ()
638 local ctdb_options="$*"
640 # We really just want to pass CTDB_OPTIONS but on RH
641 # /etc/sysconfig/ctdb can, and frequently does, set that variable.
642 # So instead, we hack badly. We'll add these as we use them.
643 # Note that these may still be overridden by the above file... but
644 # we tend to use the exotic options here... so that is unlikely.
646 case "$ctdb_options" in
647 *--start-as-stopped*)
648 export CTDB_START_AS_STOPPED="yes"
654 _ctdb_hack_options "$@"
656 if [ -e /etc/redhat-release ] ; then
659 /etc/init.d/ctdb restart
665 _ctdb_hack_options "$@"
667 /etc/init.d/ctdb start
672 if [ -n "$CTDB_NODES_SOCKETS" ] ; then
677 # Common things to do after starting one or more nodes.
680 onnode -q 1 $CTDB_TEST_WRAPPER wait_until_healthy || return 1
682 echo "Setting RerecoveryTimeout to 1"
683 onnode -pq all "$CTDB setvar RerecoveryTimeout 1"
685 # In recent versions of CTDB, forcing a recovery like this blocks
686 # until the recovery is complete. Hopefully this will help the
687 # cluster to stabilise before a subsequent test.
688 echo "Forcing a recovery..."
689 onnode -q 0 $CTDB recover
691 echo "Forcing a recovery..."
692 onnode -q 0 $CTDB recover
697 # This assumes that ctdbd is not running on the given node.
701 shift # "$@" is passed to ctdbd start.
703 echo -n "Starting CTDB on node ${pnn}..."
705 if [ -n "$CTDB_NODES_SOCKETS" ] ; then
706 daemons_start_1 $pnn "$@"
708 onnode $pnn $CTDB_TEST_WRAPPER _ctdb_start "$@"
711 # If we're starting only 1 node then we're doing something weird.
712 ctdb_restart_when_done
717 # "$@" is passed to ctdbd start.
719 echo -n "Restarting CTDB"
720 if $ctdb_test_restart_scheduled ; then
721 echo -n " (scheduled)"
726 for i in $(seq 1 5) ; do
727 if [ -n "$CTDB_NODES_SOCKETS" ] ; then
731 onnode -p all $CTDB_TEST_WRAPPER _restart_ctdb "$@"
733 echo "Restart failed. Trying again in a few seconds..."
738 onnode -q 1 $CTDB_TEST_WRAPPER wait_until_healthy || {
739 echo "Cluster didn't become healthy. Restarting..."
743 echo "Setting RerecoveryTimeout to 1"
744 onnode -pq all "$CTDB setvar RerecoveryTimeout 1"
746 # In recent versions of CTDB, forcing a recovery like this
747 # blocks until the recovery is complete. Hopefully this will
748 # help the cluster to stabilise before a subsequent test.
749 echo "Forcing a recovery..."
750 onnode -q 0 $CTDB recover
752 echo "Forcing a recovery..."
753 onnode -q 0 $CTDB recover
755 # Cluster is still healthy. Good, we're done!
756 if ! onnode 0 $CTDB_TEST_WRAPPER _cluster_is_healthy ; then
757 echo "Cluster became UNHEALTHY again [$(date)]"
758 onnode -p all ctdb status -Y 2>&1
759 onnode -p all ctdb scriptstatus 2>&1
764 echo "Doing a sync..."
765 onnode -q 0 $CTDB sync
771 echo "Cluster UNHEALTHY... too many attempts..."
772 onnode -p all ctdb status -Y 2>&1
773 onnode -p all ctdb scriptstatus 2>&1
775 # Try to make the calling test fail
780 ctdb_restart_when_done ()
782 ctdb_test_restart_scheduled=true
785 get_ctdbd_command_line_option ()
790 try_command_on_node "$pnn" "$CTDB getpid" || \
791 die "Unable to get PID of ctdbd on node $pnn"
793 local pid="${out#*:}"
794 try_command_on_node "$pnn" "ps -p $pid -o args hww" || \
795 die "Unable to get command-line of PID $pid"
797 # Strip everything up to and including --option
798 local t="${out#*--${option}}"
799 # Strip leading '=' or space if present
802 # Strip any following options and print
806 #######################################
808 install_eventscript ()
810 local script_name="$1"
811 local script_contents="$2"
813 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
814 # The quoting here is *very* fragile. However, we do
815 # experience the joy of installing a short script using
816 # onnode, and without needing to know the IP addresses of the
818 onnode all "f=\"\${CTDB_BASE:-/etc/ctdb}/events.d/${script_name}\" ; echo \"Installing \$f\" ; echo '${script_contents}' > \"\$f\" ; chmod 755 \"\$f\""
820 f="${TEST_VAR_DIR}/events.d/${script_name}"
821 echo "$script_contents" >"$f"
826 uninstall_eventscript ()
828 local script_name="$1"
830 if [ -z "$TEST_LOCAL_DAEMONS" ] ; then
831 onnode all "rm -vf \"\${CTDB_BASE:-/etc/ctdb}/events.d/${script_name}\""
833 rm -vf "${TEST_VAR_DIR}/events.d/${script_name}"
837 #######################################
839 # This section deals with the 99.ctdb_test eventscript.
841 # Metafunctions: Handle a ctdb-test file on a node.
843 ctdb_test_eventscript_file_create ()
848 try_command_on_node $pnn touch "/tmp/ctdb-test-${type}.${pnn}"
851 ctdb_test_eventscript_file_remove ()
856 try_command_on_node $pnn rm -f "/tmp/ctdb-test-${type}.${pnn}"
859 ctdb_test_eventscript_file_exists ()
864 try_command_on_node $pnn test -f "/tmp/ctdb-test-${type}.${pnn}" >/dev/null 2>&1
868 # Handle a flag file on a node that is removed by 99.ctdb_test on the
870 ctdb_test_eventscript_flag ()
876 ctdb_test_eventscript_file_${cmd} "$pnn" "flag-${event}"
880 # Handle a trigger that causes 99.ctdb_test to fail it's monitor
882 ctdb_test_eventscript_unhealthy_trigger ()
887 ctdb_test_eventscript_file_${cmd} "$pnn" "unhealthy-trigger"
890 # Handle the file that 99.ctdb_test created to show that it has marked
891 # a node unhealthy because it detected the above trigger.
892 ctdb_test_eventscript_unhealthy_detected ()
897 ctdb_test_eventscript_file_${cmd} "$pnn" "unhealthy-detected"
900 # Handle a trigger that causes 99.ctdb_test to timeout it's monitor
901 # event. This should cause the node to be banned.
902 ctdb_test_eventscript_timeout_trigger ()
908 ctdb_test_eventscript_file_${cmd} "$pnn" "${event}-timeout"
911 # Note that the eventscript can't use the above functions!
912 ctdb_test_eventscript_install ()
915 local script='#!/bin/sh
919 rm -vf "/tmp/ctdb-test-flag-${1}.${pnn}"
921 trigger="/tmp/ctdb-test-unhealthy-trigger.${pnn}"
922 detected="/tmp/ctdb-test-unhealthy-detected.${pnn}"
923 timeout_trigger="/tmp/ctdb-test-${1}-timeout.${pnn}"
926 if [ -e "$trigger" ] ; then
927 echo "${0}: Unhealthy because \"$trigger\" detected"
930 elif [ -e "$detected" -a ! -e "$trigger" ] ; then
931 echo "${0}: Healthy again, \"$trigger\" no longer detected"
937 if [ -e "$timeout_trigger" ] ; then
938 echo "${0}: Sleeping for a long time because \"$timeout_trigger\" detected"
948 install_eventscript "99.ctdb_test" "$script"
951 ctdb_test_eventscript_uninstall ()
953 uninstall_eventscript "99.ctdb_test"
956 # Note that this only works if you know all other monitor events will
957 # succeed. You also need to install the eventscript before using it.
958 wait_for_monitor_event ()
962 echo "Waiting for a monitor event on node ${pnn}..."
963 ctdb_test_eventscript_flag create $pnn "monitor"
965 wait_until 120 ! ctdb_test_eventscript_flag exists $pnn "monitor"
969 # Make sure that $CTDB is set.
972 local="${TEST_SUBDIR}/scripts/local.bash"
973 if [ -r "$local" ] ; then