Imported Upstream version 2.1

This commit is contained in:
Jan Wagner 2014-10-15 14:48:52 +02:00
parent 0841b5c7c7
commit 060ec72678
47 changed files with 1718 additions and 1420 deletions

View file

@ -90,7 +90,7 @@ SKIP: {
SKIP: {
skip "no non responsive host defined", 1 if ( ! $host_nonresponsive );
$res = NPTest->testCmd( "./$plugin -H $host_nonresponsive -s np_foobar ");
cmp_ok( $res->return_code, '==', 3, "Exit UNKNOWN with non responsive host" );
cmp_ok( $res->return_code, '>=', 2, "Exit CRITICAL/UNKNOWN with non responsive host" );
}
}

View file

@ -5,13 +5,14 @@
#
use strict;
use Test::More tests => 16;
use Test::More tests => 17;
use NPTest;
my $successOutput = '/^FILE_AGE OK: /';
my $warningOutput = '/^FILE_AGE WARNING: /';
my $criticalOutput = '/^FILE_AGE CRITICAL: /';
my $unknownOutput = '/^FILE_AGE UNKNOWN: /';
my $performanceOutput = '/ \| age=[0-9]+s;[0-9]+;[0-9]+ size=[0-9]+B;[0-9]+;[0-9]+;0$/';
my $result;
my $temp_file = "/tmp/check_file_age.tmp";
@ -57,6 +58,11 @@ $result = NPTest->testCmd(
);
cmp_ok( $result->return_code, '==', 0, "Checking file size" );
$result = NPTest->testCmd(
"./check_file_age -f $temp_file -c 1000 -W 100"
);
like( $result->output, $performanceOutput, "Checking for performance Output" );
$result = NPTest->testCmd(
"./check_file_age -f /non/existent --ignore-missing"
);