summaryrefslogtreecommitdiffstats
path: root/t/Nagios-Plugin-Performance.t
diff options
context:
space:
mode:
Diffstat (limited to 't/Nagios-Plugin-Performance.t')
-rw-r--r--t/Nagios-Plugin-Performance.t10
1 files changed, 7 insertions, 3 deletions
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t
index 2fe2326..a00b2db 100644
--- a/t/Nagios-Plugin-Performance.t
+++ b/t/Nagios-Plugin-Performance.t
@@ -1,6 +1,6 @@
1 1
2use strict; 2use strict;
3use Test::More tests => 42; 3use Test::More tests => 43;
4BEGIN { use_ok('Nagios::Plugin::Performance') }; 4BEGIN { use_ok('Nagios::Plugin::Performance') };
5 5
6use Nagios::Plugin::Base; 6use Nagios::Plugin::Base;
@@ -21,8 +21,9 @@ cmp_ok( $p[1]->uom, 'eq', "MB", "uom okay");
21cmp_ok( $p[1]->threshold->warning->end, "==", 9443, "warn okay"); 21cmp_ok( $p[1]->threshold->warning->end, "==", 9443, "warn okay");
22cmp_ok( $p[1]->threshold->critical->end, "==", 9448, "crit okay"); 22cmp_ok( $p[1]->threshold->critical->end, "==", 9448, "crit okay");
23 23
24ok( ! defined Nagios::Plugin::Performance->parse_perfstring("rubbish"), "Errors correctly"); 24@p = Nagios::Plugin::Performance->parse_perfstring("rubbish");
25ok( ! defined Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string"); 25ok( ! @p, "Errors correctly");
26ok( ! Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string");
26 27
27@p = Nagios::Plugin::Performance->parse_perfstring( 28@p = Nagios::Plugin::Performance->parse_perfstring(
28 "time=0.001229s;0.000000;0.000000;0.000000;10.000000"); 29 "time=0.001229s;0.000000;0.000000;0.000000;10.000000");
@@ -49,6 +50,9 @@ cmp_ok( $p[0]->uom, "eq", "", "uom empty");
49cmp_ok( $p[0]->threshold->warning, 'eq', "20", "warn okay"); 50cmp_ok( $p[0]->threshold->warning, 'eq', "20", "warn okay");
50cmp_ok( $p[0]->threshold->critical, 'eq', "50", "crit okay"); 51cmp_ok( $p[0]->threshold->critical, 'eq', "50", "crit okay");
51 52
53@p = Nagios::Plugin::Performance->parse_perfstring( "users=4;20;50;0\n" );
54 ok( @p, "parse correctly with linefeed at end (nagiosgraph)");
55
52@p = Nagios::Plugin::Performance->parse_perfstring( 56@p = Nagios::Plugin::Performance->parse_perfstring(
53 "time=0.215300s;5.000000;10.000000;0.000000 size=426B;;;0" ); 57 "time=0.215300s;5.000000;10.000000;0.000000 size=426B;;;0" );
54cmp_ok( $p[0]->label, "eq", "time", "label okay"); 58cmp_ok( $p[0]->label, "eq", "time", "label okay");