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/ssl.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/custodian/protocoltest/ssl.rb') diff --git a/lib/custodian/protocoltest/ssl.rb b/lib/custodian/protocoltest/ssl.rb index f2baf67..cc36652 100644 --- a/lib/custodian/protocoltest/ssl.rb +++ b/lib/custodian/protocoltest/ssl.rb @@ -162,7 +162,7 @@ class SSLCheck # Setup a hostname for SNI-purposes. begin s.hostname = uri.host - rescue NoMethodError => err + rescue NoMethodError => _err # SNI isn't possible, as the SSL library is too old. end @@ -391,7 +391,7 @@ module Custodian # If the line disables us then return early # if @line =~ /no_ssl_check/ - return true + return Custodian::TestResult::TEST_PASSED end @@ -405,7 +405,7 @@ module Custodian # if hour < 10 || hour > 17 puts("Outside office hours - Not running SSL-Verification of #{@host}") - return true + return Custodian::TestResult::TEST_SKIPPED end # @@ -413,7 +413,7 @@ module Custodian # if ! @host =~ /^https:\/\// puts('Not an SSL URL') - return true + return Custodian::TestResult::TEST_SKIPPED end s = SSLCheck.new(@host) @@ -421,15 +421,15 @@ module Custodian if true == result puts("SSL Verification succeeded for #{@host}") - return true + return Custodian::TestResult::TEST_PASSED elsif result.nil? puts("SSL Verification returned no result (timeout?) #{@host}") - return true + return Custodian::TestResult::TEST_PASSED else puts("SSL Verification for #{@host} has failed.") @error = "SSL Verification for #{@host} failed: " @error += s.errors.join("\n") - return false + return Custodian::TestResult::TEST_FAILED end end -- cgit v1.2.1