summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-12-20 22:33:29 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2006-12-20 22:33:29 (GMT)
commit68fbbb6d638c827afbc567b03e5488a476a9b1b6 (patch)
tree2c1a54fa08eaa28551a946df75e5ba192479a701 /plugins/t
parent958162b45fb77dcacb302e6c65cc5fb45df47692 (diff)
downloadmonitoring-plugins-68fbbb6d638c827afbc567b03e5488a476a9b1b6.tar.gz
Removed unused timestamp variable (Matthias Eble)
Fixed redirection test. Added extra tests for funny syntax when checking certificates, updated help for more common syntax git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1555 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/t')
-rw-r--r--plugins/t/check_http.t12
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index 21ac0f7..5b67886 100644
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
@@ -9,7 +9,7 @@ use strict;
9use Test::More; 9use Test::More;
10use NPTest; 10use NPTest;
11 11
12plan tests => 22; 12plan tests => 26;
13 13
14my $successOutput = '/OK.*HTTP.*second/'; 14my $successOutput = '/OK.*HTTP.*second/';
15 15
@@ -68,6 +68,14 @@ cmp_ok( $res->return_code, '==', 0, "Checking certificate for www.verisign.com")
68like ( $res->output, '/Certificate will expire on/', "Output OK" ); 68like ( $res->output, '/Certificate will expire on/', "Output OK" );
69my $saved_cert_output = $res->output; 69my $saved_cert_output = $res->output;
70 70
71$res = NPTest->testCmd( "./check_http www.verisign.com -C 1" );
72is( $res->return_code, 0, "Old syntax for cert checking okay" );
73is( $res->output, $saved_cert_output, "Same output as new syntax" );
74
75$res = NPTest->testCmd( "./check_http -H www.verisign.com -C 1" );
76is( $res->return_code, 0, "Updated syntax for cert checking okay" );
77is( $res->output, $saved_cert_output, "Same output as new syntax" );
78
71$res = NPTest->testCmd( "./check_http -C 1 www.verisign.com" ); 79$res = NPTest->testCmd( "./check_http -C 1 www.verisign.com" );
72cmp_ok( $res->output, 'eq', $saved_cert_output, "--ssl option automatically added"); 80cmp_ok( $res->output, 'eq', $saved_cert_output, "--ssl option automatically added");
73 81
@@ -96,6 +104,6 @@ like ( $res->output, "/pattern found/", "Error message says 'pattern found'");
96$res = NPTest->testCmd( "./check_http -H altinity.com -r 'nAGiOs' --invert-regex" ); 104$res = NPTest->testCmd( "./check_http -H altinity.com -r 'nAGiOs' --invert-regex" );
97cmp_ok( $res->return_code, "==", 0, "And also when not found"); 105cmp_ok( $res->return_code, "==", 0, "And also when not found");
98 106
99$res = NPTest->testCmd( "./check_http -H www.worldfirefoxday.com -f follow" ); 107$res = NPTest->testCmd( "./check_http -H www.mozilla.com -u /firefox -f follow" );
100is( $res->return_code, 0, "Redirection based on location is okay"); 108is( $res->return_code, 0, "Redirection based on location is okay");
101 109