Tests - eventscripts - new Samba tests to test TCP port checking
[sahlberg/ctdb.git] / tests / eventscripts / simple / 50.samba.monitor.109.sh
1 #!/bin/sh
2
3 . "${EVENTSCRIPTS_TESTS_DIR}/common.sh"
4
5 define_test "port 139 down, ctdb checktcpport not implemented, debug"
6
7 ctdb_not_implemented "checktcpport"
8
9 # This has to go before the setup, otherwise it will write a dud file.
10 export CTDB_DEBUGLEVEL=4
11
12 setup_nmap_output_filter
13
14 setup_samba
15 tcp_port_down 139
16
17 required_result 1 <<EOF
18 DEBUG: ctdb_check_ports - checker ctdb not implemented
19 DEBUG: output from checker was:
20 DEBUG: ctdb checktcpport 445 (exited with 0) with output:
21 $ctdb_not_implemented
22 ERROR: samba tcp port 139 is not responding
23 DEBUG: nmap -n -oG - -PS 127.0.0.1 -p 445,139 shows this output:
24 DEBUG: # Nmap 5.21 scan initiated DATE as: nmap -n -oG - -PS 127.0.0.1 -p 445,139
25 DEBUG: Host: 127.0.0.1 ()       Status: Up
26 DEBUG: Host: 127.0.0.1 ()       Ports: 445/open/tcp//microsoft-ds///, 139/closed/tcp//netbios-ssn///
27 DEBUG: # Nmap done at DATE -- 1 IP address (1 host up) scanned in 0.04 seconds
28 EOF
29
30 simple_test