summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t')
-rw-r--r--plugins/t/check_by_ssh.t10
-rw-r--r--plugins/t/check_http.t6
-rw-r--r--plugins/t/check_tcp.t4
3 files changed, 14 insertions, 6 deletions
diff --git a/plugins/t/check_by_ssh.t b/plugins/t/check_by_ssh.t
index cca72c96..8d1b1904 100644
--- a/plugins/t/check_by_ssh.t
+++ b/plugins/t/check_by_ssh.t
@@ -27,11 +27,11 @@ plan skip_all => "SSH_HOST and SSH_IDENTITY must be defined" unless ($ssh_servic
27plan tests => 42; 27plan tests => 42;
28 28
29# Some random check strings/response 29# Some random check strings/response
30my @responce = ('OK: Everything is fine!', 30my @responce = ('OK: Everything is fine',
31 'WARNING: Hey, pick me, pick me!', 31 'WARNING: Hey, pick me, pick me',
32 'CRITICAL: Shit happens...', 32 'CRITICAL: Shit happens',
33 'UNKNOWN: What can I do for ya?', 33 'UNKNOWN: What can I do for ya',
34 'WOOPS: What did I smoke?', 34 'WOOPS: What did I smoke',
35); 35);
36my @responce_re; 36my @responce_re;
37my @check; 37my @check;
diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index 55a5a530..0a25c775 100644
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
@@ -8,7 +8,7 @@ use strict;
8use Test::More; 8use Test::More;
9use NPTest; 9use NPTest;
10 10
11plan tests => 26; 11plan tests => 28;
12 12
13my $successOutput = '/OK.*HTTP.*second/'; 13my $successOutput = '/OK.*HTTP.*second/';
14 14
@@ -105,6 +105,10 @@ SKIP: {
105 like ( $res->output, "/Certificate 'www.verisign.com' will expire on/", "Output OK" ); 105 like ( $res->output, "/Certificate 'www.verisign.com' will expire on/", "Output OK" );
106 my $saved_cert_output = $res->output; 106 my $saved_cert_output = $res->output;
107 107
108 $res = NPTest->testCmd( "./check_http -C 8000,1 --ssl www.verisign.com" );
109 cmp_ok( $res->return_code, '==', 1, "Checking certificate for www.verisign.com");
110 like ( $res->output, qr/WARNING - Certificate 'www.verisign.com' expires in \d+ day/, "Output Warning" );
111
108 $res = NPTest->testCmd( "./check_http www.verisign.com -C 1" ); 112 $res = NPTest->testCmd( "./check_http www.verisign.com -C 1" );
109 is( $res->return_code, 0, "Old syntax for cert checking okay" ); 113 is( $res->return_code, 0, "Old syntax for cert checking okay" );
110 is( $res->output, $saved_cert_output, "Same output as new syntax" ); 114 is( $res->output, $saved_cert_output, "Same output as new syntax" );
diff --git a/plugins/t/check_tcp.t b/plugins/t/check_tcp.t
index fd2b5dd9..75c1e5fb 100644
--- a/plugins/t/check_tcp.t
+++ b/plugins/t/check_tcp.t
@@ -30,6 +30,10 @@ $t += checkCmd( "./check_tcp $host_tcp_http -p 80 -wt 300 -ct 600", 0
30$t += checkCmd( "./check_tcp $host_tcp_http -p 81 -wt 0 -ct 0 -to 1", 2 ); # use invalid port for this test 30$t += checkCmd( "./check_tcp $host_tcp_http -p 81 -wt 0 -ct 0 -to 1", 2 ); # use invalid port for this test
31$t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -wt 0 -ct 0 -to 1", 2 ); 31$t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -wt 0 -ct 0 -to 1", 2 );
32$t += checkCmd( "./check_tcp $hostname_invalid -p 80 -wt 0 -ct 0 -to 1", 2 ); 32$t += checkCmd( "./check_tcp $hostname_invalid -p 80 -wt 0 -ct 0 -to 1", 2 );
33$t += checkCmd( "./check_tcp -S -D 1 -H www.verisign.com -p 443", 0 );
34$t += checkCmd( "./check_tcp -S -D 9000,1 -H www.verisign.com -p 443", 0 );
35$t += checkCmd( "./check_tcp -S -D 9000 -H www.verisign.com -p 443", 1 );
36$t += checkCmd( "./check_tcp -S -D 9000,8999 -H www.verisign.com -p 443", 2 );
33 37
34# Need the \r\n to make it more standards compliant with web servers. Need the various quotes 38# Need the \r\n to make it more standards compliant with web servers. Need the various quotes
35# so that perl doesn't interpret the \r\n and is passed onto command line correctly 39# so that perl doesn't interpret the \r\n and is passed onto command line correctly