From 65fbf9fcb7c30ee19b69bff8909aee5bdc1bc60a Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 14 Nov 2012 08:25:06 +0000 Subject: Ensure we reset the error before re-testing a failure case. --- lib/custodian/protocol-tests/dns.rb | 5 +++++ lib/custodian/protocol-tests/ftp.rb | 6 +++++- lib/custodian/protocol-tests/http.rb | 5 +++++ lib/custodian/protocol-tests/https.rb | 5 +++++ lib/custodian/protocol-tests/jabber.rb | 7 +++++-- lib/custodian/protocol-tests/ldap.rb | 4 ++-- lib/custodian/protocol-tests/ping.rb | 6 +++++- lib/custodian/protocol-tests/rsync.rb | 6 +++++- lib/custodian/protocol-tests/smtp.rb | 5 ++++- lib/custodian/protocol-tests/ssh.rb | 6 +++++- 10 files changed, 46 insertions(+), 9 deletions(-) (limited to 'lib/custodian/protocol-tests') diff --git a/lib/custodian/protocol-tests/dns.rb b/lib/custodian/protocol-tests/dns.rb index 0adac2f..905abc8 100755 --- a/lib/custodian/protocol-tests/dns.rb +++ b/lib/custodian/protocol-tests/dns.rb @@ -65,6 +65,11 @@ class DNSTest # def run_test + # + # Reset state from previous test. + # + @error = nil + # # Get the nameserver to resolve with # diff --git a/lib/custodian/protocol-tests/ftp.rb b/lib/custodian/protocol-tests/ftp.rb index 686d53d..c528c84 100755 --- a/lib/custodian/protocol-tests/ftp.rb +++ b/lib/custodian/protocol-tests/ftp.rb @@ -30,7 +30,6 @@ class FTPTest @test_data = data @error = nil - # # Ensure we have a host to probe # @@ -61,6 +60,11 @@ class FTPTest # def run_test + # + # Reset state from previous test. + # + @error = nil + # # Get the hostname & port to test against. # diff --git a/lib/custodian/protocol-tests/http.rb b/lib/custodian/protocol-tests/http.rb index c7910c5..3f2ec8d 100755 --- a/lib/custodian/protocol-tests/http.rb +++ b/lib/custodian/protocol-tests/http.rb @@ -58,6 +58,11 @@ class HTTPTest # def run_test + # + # Reset state from previous test. + # + @error = nil + # # Do the fetch, if this success then we'll have the # @status + @text setup diff --git a/lib/custodian/protocol-tests/https.rb b/lib/custodian/protocol-tests/https.rb index 0935ebb..8b9c805 100755 --- a/lib/custodian/protocol-tests/https.rb +++ b/lib/custodian/protocol-tests/https.rb @@ -59,6 +59,11 @@ class HTTPSTest # def run_test + # + # Reset state from previous test. + # + @error = nil + # # Do the fetch, if this success then we'll have the # @status + @text setup diff --git a/lib/custodian/protocol-tests/jabber.rb b/lib/custodian/protocol-tests/jabber.rb index c7adf88..1769eb8 100755 --- a/lib/custodian/protocol-tests/jabber.rb +++ b/lib/custodian/protocol-tests/jabber.rb @@ -31,7 +31,6 @@ class JABBERTest @test_data = data @error = nil - # # Ensure we have a host to probe # @@ -61,7 +60,11 @@ class JABBERTest # If the test fails the details should be retrieved from "error()". # def run_test - @error = "" + + # + # Reset state from previous test. + # + @error = nil # # Get the hostname & port to test against. diff --git a/lib/custodian/protocol-tests/ldap.rb b/lib/custodian/protocol-tests/ldap.rb index e1157d1..cec146b 100755 --- a/lib/custodian/protocol-tests/ldap.rb +++ b/lib/custodian/protocol-tests/ldap.rb @@ -61,9 +61,9 @@ class LDAPTest def run_test # - # Until the test runs we have no error. + # Reset state from previous test. # - @error = "" + @error = nil # # Get the hostname & port to test against. diff --git a/lib/custodian/protocol-tests/ping.rb b/lib/custodian/protocol-tests/ping.rb index 90d6cd7..f99de3b 100755 --- a/lib/custodian/protocol-tests/ping.rb +++ b/lib/custodian/protocol-tests/ping.rb @@ -41,7 +41,11 @@ class PINGTest # If the test fails the details should be retrieved from "error()". # def run_test - @error = "" + + # + # Reset state from previous test. + # + @error = nil # diff --git a/lib/custodian/protocol-tests/rsync.rb b/lib/custodian/protocol-tests/rsync.rb index 53bc32d..d5382bd 100755 --- a/lib/custodian/protocol-tests/rsync.rb +++ b/lib/custodian/protocol-tests/rsync.rb @@ -59,7 +59,11 @@ class RSYNCTest # If the test fails the details should be retrieved from "error()". # def run_test - @error = "" + + # + # Reset state from previous test. + # + @error = nil # # Get the hostname & port to test against. diff --git a/lib/custodian/protocol-tests/smtp.rb b/lib/custodian/protocol-tests/smtp.rb index 0017aa5..8ed19e8 100755 --- a/lib/custodian/protocol-tests/smtp.rb +++ b/lib/custodian/protocol-tests/smtp.rb @@ -60,7 +60,10 @@ class SMTPTest # If the test fails the details should be retrieved from "error". # def run_test - @error = "" + # + # Reset state from previous test. + # + @error = nil # # Get the hostname & port to test against. diff --git a/lib/custodian/protocol-tests/ssh.rb b/lib/custodian/protocol-tests/ssh.rb index b7c630a..b563aad 100755 --- a/lib/custodian/protocol-tests/ssh.rb +++ b/lib/custodian/protocol-tests/ssh.rb @@ -58,7 +58,11 @@ class SSHTest # If the test fails the details should be retrieved from "error". # def run_test - @error = "" + + # + # Reset state from previous test. + # + @error = nil # # Get the hostname & port to test against. -- cgit v1.2.1