summaryrefslogtreecommitdiffstats
path: root/plugins/t/check_http.t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t/check_http.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