summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-11-04 11:47:18 +1100
committerKarolin Seeger <kseeger@samba.org>2016-11-16 08:36:22 +0100
commite118001d52cb29132251499838eecbe0efc93e16 (patch)
treee5739283d06dd52a624e2a356c5dcbeebc7d019e /ctdb
parent9cc435fdd602a5e2dee26e106e874e5c2ae5b8b5 (diff)
downloadsamba-e118001d52cb29132251499838eecbe0efc93e16.tar.gz
ctdb-tests: Add tests for updated Debian style Samba start/stop
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12371 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Mon Nov 7 08:01:28 CET 2016 on sn-devel-144 (cherry picked from commit 5c53d50784b2d7883f3e1d9ac48bb1fd56ba7f42)
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/tests/eventscripts/50.samba.shutdown.011.sh15
-rwxr-xr-xctdb/tests/eventscripts/50.samba.startup.011.sh15
-rwxr-xr-xctdb/tests/eventscripts/etc-ctdb/rc.local2
-rw-r--r--ctdb/tests/eventscripts/scripts/local.sh4
4 files changed, 33 insertions, 3 deletions
diff --git a/ctdb/tests/eventscripts/50.samba.shutdown.011.sh b/ctdb/tests/eventscripts/50.samba.shutdown.011.sh
new file mode 100755
index 00000000000..f225e8f311e
--- /dev/null
+++ b/ctdb/tests/eventscripts/50.samba.shutdown.011.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "shutdown, Debian init style"
+
+setup_samba
+
+export EVENTSCRIPT_TESTS_INIT_STYLE="debian"
+
+ok <<EOF
+Stopping smbd: OK
+Stopping nmbd: OK
+EOF
+simple_test
diff --git a/ctdb/tests/eventscripts/50.samba.startup.011.sh b/ctdb/tests/eventscripts/50.samba.startup.011.sh
new file mode 100755
index 00000000000..320549785da
--- /dev/null
+++ b/ctdb/tests/eventscripts/50.samba.startup.011.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "shutdown, Debian init style"
+
+setup_samba
+
+export EVENTSCRIPT_TESTS_INIT_STYLE="debian"
+
+ok <<EOF
+Starting nmbd: OK
+Starting smbd: OK
+EOF
+simple_test
diff --git a/ctdb/tests/eventscripts/etc-ctdb/rc.local b/ctdb/tests/eventscripts/etc-ctdb/rc.local
index 3a55e5327b8..541474a8b73 100755
--- a/ctdb/tests/eventscripts/etc-ctdb/rc.local
+++ b/ctdb/tests/eventscripts/etc-ctdb/rc.local
@@ -58,5 +58,5 @@ background_with_logging ()
"$@" 2>&1 </dev/null | sed -e 's@^@\&@'
}
-CTDB_INIT_STYLE="redhat"
+CTDB_INIT_STYLE="${EVENTSCRIPT_TESTS_INIT_STYLE:-redhat}"
PATH="${EVENTSCRIPTS_PATH}:$PATH"
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index 61a033a1b6c..f90a5009444 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -806,7 +806,7 @@ setup_samba ()
eventscript_call ctdb_service_managed
# All possible service names for all known distros.
- for i in "smb" "nmb" "samba" ; do
+ for i in "smb" "nmb" "samba" "smbd" "nmbd" ; do
service "$i" force-started
done
@@ -826,7 +826,7 @@ setup_samba ()
eventscript_call ctdb_service_unmanaged
# All possible service names for all known distros.
- for i in "smb" "nmb" "samba" ; do
+ for i in "smb" "nmb" "samba" "smbd" "nmbd" ; do
service "$i" force-stopped
done