summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-06-09 10:53:22 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2006-06-09 10:53:22 +0000
commit4f0eadbd97ead5726b35843537dcce6d585b1164 (patch)
treec0d5e0f66f68e8996f2bbeddb7087103b1ff22ab /t
parent2c6651034f76e2bccb549a867485f8fabbf07cb1 (diff)
downloadmonitoring-plugin-perl-4f0eadbd97ead5726b35843537dcce6d585b1164.tar.gz
Fixed problems parsing in nagiosgraph
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1423 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to '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");