diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-04-16 16:14:06 +0100 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-04-16 16:14:06 +0100 |
commit | c31a047c7ecf949b3cf8369985946f563957bf0a (patch) | |
tree | daa4a5bc7db319540d31c873a32f7c58b411f8b3 /lib/custodian/protocoltest/dnsbl.rb | |
parent | 3d15acf163a514816f3d2e2d08730dfb708fe5fd (diff) |
Updated test-handler for new API.
This update consists of two changes:
* No longer return "true" or "false" instead return "TEST_FAILED", or "TEST_SUCCEEDED".
* Removed the testing of test-inversion from the class, now it lives in the base-class where it should have done all along.
Diffstat (limited to 'lib/custodian/protocoltest/dnsbl.rb')
-rw-r--r-- | lib/custodian/protocoltest/dnsbl.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/custodian/protocoltest/dnsbl.rb b/lib/custodian/protocoltest/dnsbl.rb index a16de0a..0e1459d 100644 --- a/lib/custodian/protocoltest/dnsbl.rb +++ b/lib/custodian/protocoltest/dnsbl.rb @@ -42,14 +42,6 @@ module Custodian @zones = 'zen.spamhaus.org' end - # - # Is this test inverted? - # - if line =~ /must\s+not\s+run\s+/ - @inverted = true - else - @inverted = false - end end @@ -58,7 +50,7 @@ module Custodian # Allow this test to be serialized. # def to_s - @line + @line end @@ -89,16 +81,16 @@ module Custodian if (!result.nil?) && (result.length > 0) @error = "IP #{@host} listed in blacklist #{zone}. Lookup of #{name} lead to result: #{result}" - return true + return Custodian::TestResult::TEST_PASSED end else - @error = "#{@host} wasn't an IP address" - return true + @error = "#{@host} wasn't an IP address" + return Custodian::TestResult::TEST_PASSED end end - false + Custodian::TestResult::TEST_FAILED end |