summaryrefslogtreecommitdiffstats
path: root/plugins/tests/check_http.t
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2019-02-19 16:35:28 +0100
committerSven Nierlein <sven@nierlein.de>2019-02-19 16:35:28 +0100
commit8442ed5b41a68f6623492235b132c21735d51897 (patch)
tree295376487ac259b18cac3f0bfd0942e4fa5c5910 /plugins/tests/check_http.t
parentc40babbb6a4307a97564ef2591af25bc51675526 (diff)
downloadmonitoring-plugins-8442ed5b41a68f6623492235b132c21735d51897.tar.gz
renew test certificates
Signed-off-by: Sven Nierlein <sven@nierlein.de>
Diffstat (limited to 'plugins/tests/check_http.t')
-rwxr-xr-xplugins/tests/check_http.t16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/tests/check_http.t b/plugins/tests/check_http.t
index d6d31de1..006f1339 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
15use strict; 15use strict;
16use Test::More; 16use Test::More;
@@ -194,16 +194,16 @@ SKIP: {
194 194
195 $result = NPTest->testCmd( "$command -p $port_https -S -C 14" ); 195 $result = NPTest->testCmd( "$command -p $port_https -S -C 14" );
196 is( $result->return_code, 0, "$command -p $port_https -S -C 14" ); 196 is( $result->return_code, 0, "$command -p $port_https -S -C 14" );
197 is( $result->output, 'OK - Certificate \'Ton Voon\' will expire on Sun Mar 3 21:41:28 2019 +0000.', "output ok" ); 197 is( $result->output, "OK - Certificate 'Monitoring Plugins' will expire on Fri Feb 16 15:31:44 2029 +0000.", "output ok" );
198 198
199 $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" ); 199 $result = NPTest->testCmd( "$command -p $port_https -S -C 14000" );
200 is( $result->return_code, 1, "$command -p $port_https -S -C 14000" ); 200 is( $result->return_code, 1, "$command -p $port_https -S -C 14000" );
201 like( $result->output, '/WARNING - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(Sun Mar 3 21:41:28 2019 \+0000\)./', "output ok" ); 201 like( $result->output, '/WARNING - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(Fri Feb 16 15:31:44 2029 \+0000\)./', "output ok" );
202 202
203 # Expired cert tests 203 # Expired cert tests
204 $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" ); 204 $result = NPTest->testCmd( "$command -p $port_https -S -C 13960,14000" );
205 is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" ); 205 is( $result->return_code, 2, "$command -p $port_https -S -C 13960,14000" );
206 like( $result->output, '/CRITICAL - Certificate \'Ton Voon\' expires in \d+ day\(s\) \(Sun Mar 3 21:41:28 2019 \+0000\)./', "output ok" ); 206 like( $result->output, '/CRITICAL - Certificate \'Monitoring Plugins\' expires in \d+ day\(s\) \(Fri Feb 16 15:31:44 2029 \+0000\)./', "output ok" );
207 207
208 $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" ); 208 $result = NPTest->testCmd( "$command -p $port_https_expired -S -C 7" );
209 is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" ); 209 is( $result->return_code, 2, "$command -p $port_https_expired -S -C 7" );