diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/custodian/protocoltest/smtp.rb | 12 | ||||
-rw-r--r-- | lib/custodian/protocoltest/ssh.rb | 15 | ||||
-rw-r--r-- | lib/custodian/protocoltest/tcp.rb | 18 |
3 files changed, 43 insertions, 2 deletions
diff --git a/lib/custodian/protocoltest/smtp.rb b/lib/custodian/protocoltest/smtp.rb index fd5f6fd..3a38f5a 100644 --- a/lib/custodian/protocoltest/smtp.rb +++ b/lib/custodian/protocoltest/smtp.rb @@ -46,6 +46,8 @@ class SMTPTest < TCPTest end + + # # Helper for development. # @@ -54,6 +56,8 @@ class SMTPTest < TCPTest end + + # # Run the TCP-protocol test. # @@ -66,6 +70,8 @@ class SMTPTest < TCPTest end + + # # If the test fails then report the error. # @@ -73,6 +79,12 @@ class SMTPTest < TCPTest @error end + + + register_test_type "smtp" + + + end diff --git a/lib/custodian/protocoltest/ssh.rb b/lib/custodian/protocoltest/ssh.rb index 73f23da..ec7752f 100644 --- a/lib/custodian/protocoltest/ssh.rb +++ b/lib/custodian/protocoltest/ssh.rb @@ -7,10 +7,11 @@ ### foo.vm.bytemark.co.uk must run ssh on 22 otherwise 'ssh fail'. ### # -# The specification of the port is mandatory. +# The specification of the port is optional. # class SSHTest < TCPTest + # # The host to test against. # @@ -46,6 +47,8 @@ class SSHTest < TCPTest end + + # # Helper for development. # @@ -54,6 +57,8 @@ class SSHTest < TCPTest end + + # # Run the TCP-protocol test. # @@ -66,6 +71,8 @@ class SSHTest < TCPTest end + + # # If the test fails then report the error. # @@ -73,6 +80,12 @@ class SSHTest < TCPTest @error end + + + register_test_type "ssh" + + + end diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb index 115bf6a..9e141fe 100644 --- a/lib/custodian/protocoltest/tcp.rb +++ b/lib/custodian/protocoltest/tcp.rb @@ -84,6 +84,8 @@ class TCPTest < ProtocolTest end + + # # Run the TCP-protocol test. # @@ -96,10 +98,16 @@ class TCPTest < ProtocolTest end + + # + # Run the connection test - optionally matching against the banner. # + # If the banner is nil then we're merely testing we can connect and + # send the string "quit". # - def run_test_internal( host, port, banner ) + # + def run_test_internal( host, port, banner = nil ) begin timeout(30) do begin @@ -141,6 +149,8 @@ class TCPTest < ProtocolTest end + + # # If the test fails then report the error. # @@ -148,6 +158,12 @@ class TCPTest < ProtocolTest @error end + + + register_test_type "tcp" + + + end |