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 | 91713ef347d49dca7de7dd9360d42763dd961894 (patch) | |
tree | 99f8d3e0ff368cc7bb863cdf7910ffcc629774d4 /lib/custodian/protocoltest/dnsbl.rb | |
parent | 1b9654c79d6bd8e24134ddeef4bf44580a726178 (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 |