summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctdb/tests/scripts/integration.bash6
-rwxr-xr-xctdb/tests/simple/99_daemons_shutdown.sh6
-rw-r--r--ctdb/tests/simple/scripts/local_daemons.bash7
3 files changed, 16 insertions, 3 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash
index c13ee1f602..4d22f4150f 100644
--- a/ctdb/tests/scripts/integration.bash
+++ b/ctdb/tests/scripts/integration.bash
@@ -518,6 +518,12 @@ restart_ctdb ()
return 1
}
+# Does nothing on cluster and should be overridden for local daemons
+maybe_stop_ctdb ()
+{
+ :
+}
+
ctdb_restart_when_done ()
{
ctdb_test_restart_scheduled=true
diff --git a/ctdb/tests/simple/99_daemons_shutdown.sh b/ctdb/tests/simple/99_daemons_shutdown.sh
index 3583828b71..42ea1f4031 100755
--- a/ctdb/tests/simple/99_daemons_shutdown.sh
+++ b/ctdb/tests/simple/99_daemons_shutdown.sh
@@ -18,6 +18,6 @@ EOF
# Do not call ctdb_test_init() here. It will setup ctdb_test_exit()
# to run and that will find the daemons missing and restart them!
-if [ -n "$TEST_LOCAL_DAEMONS" ] && $TEST_CLEANUP ; then
- daemons_stop
-fi
+# We only want to consider stopping CTDB if we're running local
+# daemons. This function will do the right thing.
+maybe_stop_ctdb
diff --git a/ctdb/tests/simple/scripts/local_daemons.bash b/ctdb/tests/simple/scripts/local_daemons.bash
index b286b4d5b5..6bd2138a82 100644
--- a/ctdb/tests/simple/scripts/local_daemons.bash
+++ b/ctdb/tests/simple/scripts/local_daemons.bash
@@ -120,3 +120,10 @@ daemons_start ()
daemons_start_1 $i "$@"
done
}
+
+maybe_stop_ctdb ()
+{
+ if $TEST_CLEANUP ; then
+ daemons_stop
+ fi
+}