diff options
Diffstat (limited to 'plugins/t')
-rw-r--r-- | plugins/t/check_by_ssh.t | 10 | ||||
-rw-r--r-- | plugins/t/check_http.t | 6 | ||||
-rw-r--r-- | plugins/t/check_tcp.t | 4 |
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 plan tests => 42; # Some random check strings/response -my @responce = ('OK: Everything is fine!', - 'WARNING: Hey, pick me, pick me!', - 'CRITICAL: Shit happens...', - 'UNKNOWN: What can I do for ya?', - 'WOOPS: What did I smoke?', +my @responce = ('OK: Everything is fine', + 'WARNING: Hey, pick me, pick me', + 'CRITICAL: Shit happens', + 'UNKNOWN: What can I do for ya', + 'WOOPS: What did I smoke', ); my @responce_re; my @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; use Test::More; use NPTest; -plan tests => 26; +plan tests => 28; my $successOutput = '/OK.*HTTP.*second/'; @@ -105,6 +105,10 @@ SKIP: { like ( $res->output, "/Certificate 'www.verisign.com' will expire on/", "Output OK" ); my $saved_cert_output = $res->output; + $res = NPTest->testCmd( "./check_http -C 8000,1 --ssl www.verisign.com" ); + cmp_ok( $res->return_code, '==', 1, "Checking certificate for www.verisign.com"); + like ( $res->output, qr/WARNING - Certificate 'www.verisign.com' expires in \d+ day/, "Output Warning" ); + $res = NPTest->testCmd( "./check_http www.verisign.com -C 1" ); is( $res->return_code, 0, "Old syntax for cert checking okay" ); 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 $t += checkCmd( "./check_tcp $host_tcp_http -p 81 -wt 0 -ct 0 -to 1", 2 ); # use invalid port for this test $t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -wt 0 -ct 0 -to 1", 2 ); $t += checkCmd( "./check_tcp $hostname_invalid -p 80 -wt 0 -ct 0 -to 1", 2 ); +$t += checkCmd( "./check_tcp -S -D 1 -H www.verisign.com -p 443", 0 ); +$t += checkCmd( "./check_tcp -S -D 9000,1 -H www.verisign.com -p 443", 0 ); +$t += checkCmd( "./check_tcp -S -D 9000 -H www.verisign.com -p 443", 1 ); +$t += checkCmd( "./check_tcp -S -D 9000,8999 -H www.verisign.com -p 443", 2 ); # Need the \r\n to make it more standards compliant with web servers. Need the various quotes # so that perl doesn't interpret the \r\n and is passed onto command line correctly |