From c31a047c7ecf949b3cf8369985946f563957bf0a Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Thu, 16 Apr 2015 16:14:06 +0100 Subject: 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. --- lib/custodian/protocoltest/dnsbl.rb | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'lib/custodian/protocoltest/dnsbl.rb') 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 -- cgit v1.2.1