diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-14 08:25:06 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-14 08:25:06 +0000 |
commit | fc9d38f1412729d7e900f8771cca1c6d1fc1abfb (patch) | |
tree | 5840dc27b1959d0a3e7180a054e8a8838c950baf | |
parent | f3b0bca5c95f217c0b9dd2ffc621d2316d34abb4 (diff) |
Ensure we reset the error before re-testing a failure case.
-rwxr-xr-x | lib/custodian/protocol-tests/dns.rb | 5 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/ftp.rb | 6 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/http.rb | 5 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/https.rb | 5 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/jabber.rb | 7 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/ldap.rb | 4 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/ping.rb | 6 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/rsync.rb | 6 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/smtp.rb | 5 | ||||
-rwxr-xr-x | lib/custodian/protocol-tests/ssh.rb | 6 |
10 files changed, 46 insertions, 9 deletions
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 @@ -66,6 +66,11 @@ class DNSTest def run_test # + # Reset state from previous test. + # + @error = nil + + # # Get the nameserver to resolve with # nameserver = @test_data["target_host"] 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 # @@ -62,6 +61,11 @@ class FTPTest def run_test # + # Reset state from previous test. + # + @error = nil + + # # Get the hostname & port to test against. # host = @test_data["target_host"] 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 @@ -59,6 +59,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 @@ -60,6 +60,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. |