summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts/50.samba.monitor.110.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb/tests/eventscripts/50.samba.monitor.110.sh')
-rwxr-xr-xctdb/tests/eventscripts/50.samba.monitor.110.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/ctdb/tests/eventscripts/50.samba.monitor.110.sh b/ctdb/tests/eventscripts/50.samba.monitor.110.sh
new file mode 100755
index 00000000000..639cc515fe4
--- /dev/null
+++ b/ctdb/tests/eventscripts/50.samba.monitor.110.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "port 139 down, ctdb checktcpport/nmap not implemented, debug"
+
+ctdb_not_implemented "checktcpport"
+export FAKE_NMAP_NOT_FOUND="yes"
+
+# This has to go before the setup, otherwise it will write a dud file.
+export CTDB_DEBUGLEVEL=4
+
+setup_nmap_output_filter
+
+setup_samba
+tcp_port_down 139
+
+required_result 1 <<EOF
+DEBUG: ctdb_check_ports - checker ctdb not implemented
+DEBUG: output from checker was:
+DEBUG: ctdb checktcpport 445 (exited with 1) with output:
+$ctdb_not_implemented
+DEBUG: ctdb_check_ports - checker nmap not implemented
+DEBUG: output from checker was:
+DEBUG: sh: nmap: command not found
+ERROR: samba tcp port 139 is not responding
+DEBUG: netstat -l -t -n shows this output:
+DEBUG: Active Internet connections (servers only)
+DEBUG: Proto Recv-Q Send-Q Local Address Foreign Address State
+DEBUG: tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN
+EOF
+
+simple_test