diff options
Diffstat (limited to 'plugins/t/check_http.t')
-rw-r--r-- | plugins/t/check_http.t | 12 |
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; | |||
9 | use Test::More; | 9 | use Test::More; |
10 | use NPTest; | 10 | use NPTest; |
11 | 11 | ||
12 | plan tests => 22; | 12 | plan tests => 26; |
13 | 13 | ||
14 | my $successOutput = '/OK.*HTTP.*second/'; | 14 | my $successOutput = '/OK.*HTTP.*second/'; |
15 | 15 | ||
@@ -68,6 +68,14 @@ cmp_ok( $res->return_code, '==', 0, "Checking certificate for www.verisign.com") | |||
68 | like ( $res->output, '/Certificate will expire on/', "Output OK" ); | 68 | like ( $res->output, '/Certificate will expire on/', "Output OK" ); |
69 | my $saved_cert_output = $res->output; | 69 | my $saved_cert_output = $res->output; |
70 | 70 | ||
71 | $res = NPTest->testCmd( "./check_http www.verisign.com -C 1" ); | ||
72 | is( $res->return_code, 0, "Old syntax for cert checking okay" ); | ||
73 | is( $res->output, $saved_cert_output, "Same output as new syntax" ); | ||
74 | |||
75 | $res = NPTest->testCmd( "./check_http -H www.verisign.com -C 1" ); | ||
76 | is( $res->return_code, 0, "Updated syntax for cert checking okay" ); | ||
77 | is( $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" ); |
72 | cmp_ok( $res->output, 'eq', $saved_cert_output, "--ssl option automatically added"); | 80 | cmp_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" ); |
97 | cmp_ok( $res->return_code, "==", 0, "And also when not found"); | 105 | cmp_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" ); |
100 | is( $res->return_code, 0, "Redirection based on location is okay"); | 108 | is( $res->return_code, 0, "Redirection based on location is okay"); |
101 | 109 | ||