diff options
Diffstat (limited to 'plugins/tests/check_http.t')
-rwxr-xr-x | plugins/tests/check_http.t | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t index f5c570ac..fe65325c 100755 --- a/plugins/tests/check_http.t +++ b/plugins/tests/check_http.t | |||
@@ -4,13 +4,13 @@ | |||
4 | # | 4 | # |
5 | # To create the https server certificate: | 5 | # To create the https server certificate: |
6 | # openssl req -new -x509 -keyout server-key.pem -out server-cert.pem -days 3650 -nodes | 6 | # openssl req -new -x509 -keyout server-key.pem -out server-cert.pem -days 3650 -nodes |
7 | # Country Name (2 letter code) [AU]:UK | 7 | # Country Name (2 letter code) [AU]:DE |
8 | # State or Province Name (full name) [Some-State]:Derbyshire | 8 | # State or Province Name (full name) [Some-State]:Bavaria |
9 | # Locality Name (eg, city) []:Belper | 9 | # Locality Name (eg, city) []:Munich |
10 | # Organization Name (eg, company) [Internet Widgits Pty Ltd]:Monitoring Plugins | 10 | # Organization Name (eg, company) [Internet Widgits Pty Ltd]:Monitoring Plugins |
11 | # Organizational Unit Name (eg, section) []: | 11 | # Organizational Unit Name (eg, section) []: |
12 | # Common Name (eg, YOUR name) []:Ton Voon | 12 | # Common Name (e.g. server FQDN or YOUR name) []:Monitoring Plugins |
13 | # Email Address []:tonvoon@mac.com | 13 | # Email Address []:devel@monitoring-plugins.org |
14 | 14 | ||
15 | use strict; | 15 | use strict; |
16 | use Test::More; | 16 | use Test::More; |
@@ -197,16 +197,16 @@ SKIP: { | |||
197 | 197 | ||
198 | $result = NPTest->testCmd( "$command -p $port_https -S -C 14" ); | 198 | $result = NPTest->testCmd( "$command -p $port_https -S -C 14" ); |
199 | is( $result->return_code, 0, "$command -p $port_https -S -C 14" ); | 199 | is( $result->return_code, 0, "$command -p $port_https -S -C 14" ); |
200 | is( $result->output, 'OK - Certificate \'Ton Voon\' will expire on Sun Mar 3 21:41:28 2019 +0000.', "output ok" ); | 200 | is( $result->output, "OK - Certificate 'Monitoring Plugins' will expire on Fri Feb 16 15:31:44 2029 +0000.", "output ok" ); |
201 | 201 | ||
202 | $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" ); | 202 | $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" ); |
203 | is( $result->return_code, 1, "$command -p $port_https -S -C 14000" ); | 203 | is( $result->return_code, 1, "$command -p $port_https -S -C 14000" ); |
204 | like( $result->output, '/WARNING - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(Sun Mar 3 21:41:28 2019 \+0000\)./', "output ok" ); | 204 | like( $result->output, '/WARNING - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(Fri Feb 16 15:31:44 2029 \+0000\)./', "output ok" ); |
205 | 205 | ||
206 | # Expired cert tests | 206 | # Expired cert tests |
207 | $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" ); | 207 | $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" ); |
208 | is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" ); | 208 | is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" ); |
209 | like( $result->output, '/CRITICAL - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(Sun Mar 3 21:41:28 2019 \+0000\)./', "output ok" ); | 209 | like( $result->output, '/CRITICAL - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(Fri Feb 16 15:31:44 2029 \+0000\)./', "output ok" ); |
210 | 210 | ||
211 | $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" ); | 211 | $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" ); |
212 | is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" ); | 212 | is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" ); |