diff options
author | Martin Schwenke <martin@meltin.net> | 2011-08-22 16:10:44 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-08-30 16:51:55 +1000 |
commit | 7fc7ebb5acf36aff258f914b522e1345802a5413 (patch) | |
tree | b478165f45a1be973df53894201911cfcfbd342b | |
parent | 764b425a965eee0be6a2a9b91774590533ff7070 (diff) | |
download | samba-7fc7ebb5acf36aff258f914b522e1345802a5413.tar.gz samba-7fc7ebb5acf36aff258f914b522e1345802a5413.tar.xz samba-7fc7ebb5acf36aff258f914b522e1345802a5413.zip |
Tests - eventscripts - new Samba tests to test TCP port checking
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 9e3e6ab3edf0f79d5973eb39ed843d3c369c665d)
3 files changed, 63 insertions, 0 deletions
diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.107.sh b/ctdb/tests/eventscripts/simple/50.samba.monitor.107.sh new file mode 100755 index 0000000000..e4151f3743 --- /dev/null +++ b/ctdb/tests/eventscripts/simple/50.samba.monitor.107.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" + +define_test "port 139 down, default tcp checker, debug" + +# This has to go before the setup, otherwise it will write a dud file. +export CTDB_DEBUGLEVEL=4 + +setup_samba +tcp_port_down 139 + +required_result 1 <<EOF +ERROR: samba tcp port 139 is not responding +DEBUG: "ctdb checktcpport 139" was able to bind to port +EOF + +simple_test diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.108.sh b/ctdb/tests/eventscripts/simple/50.samba.monitor.108.sh new file mode 100755 index 0000000000..d06a16f90a --- /dev/null +++ b/ctdb/tests/eventscripts/simple/50.samba.monitor.108.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" + +define_test "port 139 down, ctdb checktcpport not implemented" + +# TODO: create nmap stub +export CTDB_NOT_IMPLEMENTED="checktcpport" + +setup_samba +tcp_port_down 139 + +required_result 1 "ERROR: samba tcp port 139 is not responding" + +simple_test diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.109.sh b/ctdb/tests/eventscripts/simple/50.samba.monitor.109.sh new file mode 100755 index 0000000000..b913741325 --- /dev/null +++ b/ctdb/tests/eventscripts/simple/50.samba.monitor.109.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" + +define_test "port 139 down, ctdb checktcpport not implemented, debug" + +ctdb_not_implemented "checktcpport" + +# 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 0) with output: +$ctdb_not_implemented +ERROR: samba tcp port 139 is not responding +DEBUG: nmap -n -oG - -PS 127.0.0.1 -p 445,139 shows this output: +DEBUG: # Nmap 5.21 scan initiated DATE as: nmap -n -oG - -PS 127.0.0.1 -p 445,139 +DEBUG: Host: 127.0.0.1 () Status: Up +DEBUG: Host: 127.0.0.1 () Ports: 445/open/tcp//microsoft-ds///, 139/closed/tcp//netbios-ssn/// +DEBUG: # Nmap done at DATE -- 1 IP address (1 host up) scanned in 0.04 seconds +EOF + +simple_test |