summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/t
diff options
context:
space:
mode:
authorJonas Genannt <jonas@brachium-system.net>2014-09-23 10:51:55 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-10-06 18:16:00 (GMT)
commit3b02d7fafba6ef35cac9af47ce046f9c7a6fc510 (patch)
tree6ef6f29b759aa1bccd5b982a68a9963b37b072a4 /plugins-scripts/t
parent849eb5725c28acabab5d08266a4ee8b905c81a0c (diff)
downloadmonitoring-plugins-3b02d7fafba6ef35cac9af47ce046f9c7a6fc510.tar.gz
check_file_age: Provide performance data
Diffstat (limited to 'plugins-scripts/t')
-rw-r--r--plugins-scripts/t/check_file_age.t8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins-scripts/t/check_file_age.t b/plugins-scripts/t/check_file_age.t
index a515649..50a2e69 100644
--- a/plugins-scripts/t/check_file_age.t
+++ b/plugins-scripts/t/check_file_age.t
@@ -5,13 +5,14 @@
5# 5#
6 6
7use strict; 7use strict;
8use Test::More tests => 16; 8use Test::More tests => 17;
9use NPTest; 9use NPTest;
10 10
11my $successOutput = '/^FILE_AGE OK: /'; 11my $successOutput = '/^FILE_AGE OK: /';
12my $warningOutput = '/^FILE_AGE WARNING: /'; 12my $warningOutput = '/^FILE_AGE WARNING: /';
13my $criticalOutput = '/^FILE_AGE CRITICAL: /'; 13my $criticalOutput = '/^FILE_AGE CRITICAL: /';
14my $unknownOutput = '/^FILE_AGE UNKNOWN: /'; 14my $unknownOutput = '/^FILE_AGE UNKNOWN: /';
15my $performanceOutput = '/ \| age=[0-9]+s;[0-9]+;[0-9]+ size=[0-9]+B;[0-9]+;[0-9]+;0$/';
15 16
16my $result; 17my $result;
17my $temp_file = "/tmp/check_file_age.tmp"; 18my $temp_file = "/tmp/check_file_age.tmp";
@@ -58,6 +59,11 @@ $result = NPTest->testCmd(
58cmp_ok( $result->return_code, '==', 0, "Checking file size" ); 59cmp_ok( $result->return_code, '==', 0, "Checking file size" );
59 60
60$result = NPTest->testCmd( 61$result = NPTest->testCmd(
62 "./check_file_age -f $temp_file -c 1000 -W 100"
63 );
64like( $result->output, $performanceOutput, "Checking for performance Output" );
65
66$result = NPTest->testCmd(
61 "./check_file_age -f /non/existent --ignore-missing" 67 "./check_file_age -f /non/existent --ignore-missing"
62 ); 68 );
63cmp_ok( $result->return_code, '==', 0, "Honours --ignore-missing" ); 69cmp_ok( $result->return_code, '==', 0, "Honours --ignore-missing" );