From 19fd7ac18460e3e5206496cf5f6bf629aff3e2a9 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 15 May 2013 16:20:41 +0100 Subject: Honour the global timeout period. The global configuration file, /etc/custodian/custodian.cfg, has a timeout=XX setting in it. Until now we've ignored it and used a fixed timeout of 20/30 seconds. Now we fully honour the specified value. --- lib/custodian/protocoltest/tcp.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/custodian/protocoltest/tcp.rb') diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb index a28ed33..30083cd 100644 --- a/lib/custodian/protocoltest/tcp.rb +++ b/lib/custodian/protocoltest/tcp.rb @@ -1,4 +1,5 @@ +require 'custodian/settings' require 'custodian/testfactory' require 'socket' require 'timeout' @@ -140,8 +141,15 @@ module Custodian # # def run_test_internal( host, port, banner = nil, do_read = true ) + + # + # Get the timeout period for this test. + # + settings = Custodian::Settings.instance() + period = settings.timeout() + begin - timeout(30) do + timeout(period) do begin socket = TCPSocket.new( host, port ) -- cgit v1.2.1