From 9b84a00d9578a0103a3325260c31d91981d0f946 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 15 May 2013 14:17:29 +0100 Subject: The TCP-test now uses a regexp. Each test has been updated to pass a regexp object to the tcp.rb primitive which actually does the socket connection. This closes #4036 --- lib/custodian/protocoltest/pop3.rb | 2 +- lib/custodian/protocoltest/rsync.rb | 2 +- lib/custodian/protocoltest/smtp.rb | 2 +- lib/custodian/protocoltest/ssh.rb | 2 +- lib/custodian/protocoltest/tcp.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/custodian') diff --git a/lib/custodian/protocoltest/pop3.rb b/lib/custodian/protocoltest/pop3.rb index 838d838..a96762c 100644 --- a/lib/custodian/protocoltest/pop3.rb +++ b/lib/custodian/protocoltest/pop3.rb @@ -76,7 +76,7 @@ module Custodian # reset the error, in case we were previously executed. @error = nil - run_test_internal( @host, @port, "+OK" ) + run_test_internal( @host, @port, /\+OK/i ) end diff --git a/lib/custodian/protocoltest/rsync.rb b/lib/custodian/protocoltest/rsync.rb index 3d38d3a..544fb66 100644 --- a/lib/custodian/protocoltest/rsync.rb +++ b/lib/custodian/protocoltest/rsync.rb @@ -78,7 +78,7 @@ module Custodian # reset the error, in case we were previously executed. @error = nil - run_test_internal( @host, @port, "@RSYNCD" ) + run_test_internal( @host, @port, /^@RSYNCD/ ) end diff --git a/lib/custodian/protocoltest/smtp.rb b/lib/custodian/protocoltest/smtp.rb index 89e2b24..f769c27 100644 --- a/lib/custodian/protocoltest/smtp.rb +++ b/lib/custodian/protocoltest/smtp.rb @@ -74,7 +74,7 @@ module Custodian # reset the error, in case we were previously executed. @error = nil - run_test_internal( @host, @port, "SMTP" ) + run_test_internal( @host, @port, /^220/ ) end diff --git a/lib/custodian/protocoltest/ssh.rb b/lib/custodian/protocoltest/ssh.rb index 0d64911..02916ea 100644 --- a/lib/custodian/protocoltest/ssh.rb +++ b/lib/custodian/protocoltest/ssh.rb @@ -76,7 +76,7 @@ module Custodian # reset the error, in case we were previously executed. @error = nil - run_test_internal( @host, @port, "SSH" ) + run_test_internal( @host, @port, /SSH/i ) end diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb index 822b82c..a28ed33 100644 --- a/lib/custodian/protocoltest/tcp.rb +++ b/lib/custodian/protocoltest/tcp.rb @@ -160,7 +160,7 @@ module Custodian return true else # test for banner - if ( ( !read.nil? ) && ( read =~ /#{banner}/i ) ) + if ( ( !read.nil? ) && ( banner.match(read) ) ) return true end -- cgit v1.2.1