Imported Upstream version 1.4.16

This commit is contained in:
Jan Wagner 2013-11-26 23:59:06 +01:00
parent 212b4b8677
commit e76be63abf
50 changed files with 11903 additions and 38608 deletions

View file

@ -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;

View file

@ -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" );

View file

@ -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