diff options
Diffstat (limited to 'plugins/tests/check_curl.t')
-rwxr-xr-x | plugins/tests/check_curl.t | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/tests/check_curl.t b/plugins/tests/check_curl.t index 29cb03f2..aa72ef67 100755 --- a/plugins/tests/check_curl.t +++ b/plugins/tests/check_curl.t | |||
@@ -228,23 +228,25 @@ SKIP: { | |||
228 | skip "HTTP::Daemon::SSL not installed", $common_tests + $ssl_only_tests if ! exists $servers->{https}; | 228 | skip "HTTP::Daemon::SSL not installed", $common_tests + $ssl_only_tests if ! exists $servers->{https}; |
229 | run_common_tests( { command => "$command -p $port_https", ssl => 1 } ); | 229 | run_common_tests( { command => "$command -p $port_https", ssl => 1 } ); |
230 | 230 | ||
231 | my $expiry = "Thu Nov 28 21:02:11 2030 +0000"; | ||
232 | |||
231 | $result = NPTest->testCmd( "$command -p $port_https -S -C 14" ); | 233 | $result = NPTest->testCmd( "$command -p $port_https -S -C 14" ); |
232 | is( $result->return_code, 0, "$command -p $port_https -S -C 14" ); | 234 | is( $result->return_code, 0, "$command -p $port_https -S -C 14" ); |
233 | is( $result->output, "OK - Certificate 'Monitoring Plugins' will expire on Fri Feb 16 15:31:44 2029 +0000.", "output ok" ); | 235 | is( $result->output, "OK - Certificate 'Monitoring Plugins' will expire on $expiry.", "output ok" ); |
234 | 236 | ||
235 | $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" ); | 237 | $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" ); |
236 | is( $result->return_code, 1, "$command -p $port_https -S -C 14000" ); | 238 | is( $result->return_code, 1, "$command -p $port_https -S -C 14000" ); |
237 | like( $result->output, '/WARNING - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(Fri Feb 16 15:31:44 2029 \+0000\)./', "output ok" ); | 239 | like( $result->output, '/WARNING - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(' . quotemeta($expiry) . '\)./', "output ok" ); |
238 | 240 | ||
239 | # Expired cert tests | 241 | # Expired cert tests |
240 | $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" ); | 242 | $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" ); |
241 | is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" ); | 243 | is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" ); |
242 | like( $result->output, '/CRITICAL - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(Fri Feb 16 15:31:44 2029 \+0000\)./', "output ok" ); | 244 | like( $result->output, '/CRITICAL - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(' . quotemeta($expiry) . '\)./', "output ok" ); |
243 | 245 | ||
244 | $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" ); | 246 | $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" ); |
245 | is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" ); | 247 | is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" ); |
246 | is( $result->output, | 248 | is( $result->output, |
247 | 'CRITICAL - Certificate \'Monitoring Plugins\' expired on Wed Jan 2 11:00:26 2008 +0000.', | 249 | 'CRITICAL - Certificate \'Monitoring Plugins\' expired on Wed Jan 2 12:00:00 2008 +0000.', |
248 | "output ok" ); | 250 | "output ok" ); |
249 | 251 | ||
250 | } | 252 | } |