summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/tcp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/custodian/protocoltest/tcp.rb')
-rw-r--r--lib/custodian/protocoltest/tcp.rb24
1 files changed, 4 insertions, 20 deletions
diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb
index 1747f3f..684452b 100644
--- a/lib/custodian/protocoltest/tcp.rb
+++ b/lib/custodian/protocoltest/tcp.rb
@@ -40,13 +40,6 @@ module Custodian
#
attr_reader :port
-
- #
- # Is this test inverted?
- #
- attr_reader :inverted
-
-
#
# The banner to look for, may be nil.
#
@@ -73,15 +66,6 @@ module Custodian
@host = line.split(/\s+/)[0]
#
- # Is this test inverted?
- #
- if line =~ /must\s+not\s+run\s+/
- @inverted = true
- else
- @inverted = false
- end
-
- #
# Save the port
#
if line =~ /on\s+([0-9]+)/
@@ -213,7 +197,7 @@ module Custodian
end
rescue Timeout::Error => e
@error = "Timed-out performing DNS lookups: #{e}"
- return nil
+ return Custodian::TestResult::TEST_FAILED
end
@@ -222,7 +206,7 @@ module Custodian
#
if ips.empty?
@error = "#{@host} failed to resolve to either IPv4 or IPv6"
- return false
+ return Custodian::TestResult::TEST_FAILED
end
@@ -234,7 +218,7 @@ module Custodian
ips.each do |ip|
if !run_test_internal_real(ip, port, banner, do_read)
- return false
+ return Custodian::TestResult::TEST_FAILED
#
# @error will be already set.
#
@@ -246,7 +230,7 @@ module Custodian
# All was OK
#
@error = nil
- true
+ Custodian::TestResult::TEST_PASSED
end