summaryrefslogtreecommitdiff
path: root/worker/tests
diff options
context:
space:
mode:
Diffstat (limited to 'worker/tests')
-rwxr-xr-xworker/tests/ftp.rb2
-rwxr-xr-xworker/tests/http.rb6
-rwxr-xr-xworker/tests/https.rb6
3 files changed, 7 insertions, 7 deletions
diff --git a/worker/tests/ftp.rb b/worker/tests/ftp.rb
index 30b89d5..f5eccbb 100755
--- a/worker/tests/ftp.rb
+++ b/worker/tests/ftp.rb
@@ -48,7 +48,7 @@ class FTPTest
host = @test_data["target_host"]
port = @test_data["test_port"]
- puts "FTP testing host #{host}:#{port}"
+ puts "FTP testing host #{host}:#{port}" if ( @test_data['verbose'] )
begin
timeout(3) do
diff --git a/worker/tests/http.rb b/worker/tests/http.rb
index d1faa4d..5ad69cd 100755
--- a/worker/tests/http.rb
+++ b/worker/tests/http.rb
@@ -62,7 +62,7 @@ class HTTPTest
# Do we need to test for a HTTP status code?
#
if ( @test_data["http_status"] )
- puts "Testing for HTTP status code: #{@test_data['http_status']}"
+ puts "Testing for HTTP status code: #{@test_data['http_status']}" if ( @test_data['verbose'] )
if ( @status != @test_data['http_status'].to_i)
@error = "#{@error} status code was #{@status} not #{@test_data['http_status']}"
@@ -73,7 +73,7 @@ class HTTPTest
# Do we need to search for text in the body of the reply?
#
if ( @test_data['http_text'] )
- puts "Testing for text in the response: #{@test_data['http_text']}"
+ puts "Testing for text in the response: #{@test_data['http_text']}" if ( @test_data['verbose'] )
if (! @body.match(/#{@test_data['http_text']}/i) )
@error = "#{@error} The respond did not contain #{test_data['http_text']}"
@@ -172,7 +172,7 @@ if __FILE__ == $0 then
puts "TEST OK"
else
puts "TEST FAILED"
- puts http.get_details()
+ puts http.error()
end
end
diff --git a/worker/tests/https.rb b/worker/tests/https.rb
index 77739d1..fcc716b 100755
--- a/worker/tests/https.rb
+++ b/worker/tests/https.rb
@@ -62,7 +62,7 @@ class HTTPSTest
# Do we need to test for a HTTP status code?
#
if ( @test_data["http_status"] )
- puts "Testing for HTTP status code: #{@test_data['http_status']}"
+ puts "Testing for HTTP status code: #{@test_data['http_status']}" if ( @test_data['verbose'] )
if ( @status != @test_data['http_status'].to_i)
@error = "#{@error} status code was #{@status} not #{@test_data['http_status']}"
@@ -73,7 +73,7 @@ class HTTPSTest
# Do we need to search for text in the body of the reply?
#
if ( @test_data['http_text'] )
- puts "Testing for text in the response: #{@test_data['http_text']}"
+ puts "Testing for text in the response: #{@test_data['http_text']}" if ( @test_data['verbose'] )
if (! @body.match(/#{@test_data['http_text']}/i) )
@error = "#{@error} The respond did not contain #{test_data['http_text']}"
@@ -156,8 +156,8 @@ if __FILE__ == $0 then
test = {
"target_host" => "http://www.steve.org.uk/",
"test_type" => "http",
- "test_port" => 80,
"verbose" => 1,
+ "test_port" => 80,
"test_alert" => "Steve's website is unavailable",
"http_text" => "Steve Kemp",
"http_status" => "200"