[Nagiosplug-checkins] Nagios-Plugin/t Nagios-Plugin-Performance.t, 1.1.1.1, 1.2
Ton Voon
tonvoon at users.sourceforge.net
Fri Jun 9 12:53:24 CEST 2006
Update of /cvsroot/nagiosplug/Nagios-Plugin/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv19688/t
Modified Files:
Nagios-Plugin-Performance.t
Log Message:
Fixed problems parsing in nagiosgraph
Index: Nagios-Plugin-Performance.t
===================================================================
RCS file: /cvsroot/nagiosplug/Nagios-Plugin/t/Nagios-Plugin-Performance.t,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- Nagios-Plugin-Performance.t 8 Jun 2006 12:27:44 -0000 1.1.1.1
+++ Nagios-Plugin-Performance.t 9 Jun 2006 10:53:22 -0000 1.2
@@ -1,6 +1,6 @@
use strict;
-use Test::More tests => 42;
+use Test::More tests => 43;
BEGIN { use_ok('Nagios::Plugin::Performance') };
use Nagios::Plugin::Base;
@@ -21,8 +21,9 @@
cmp_ok( $p[1]->threshold->warning->end, "==", 9443, "warn okay");
cmp_ok( $p[1]->threshold->critical->end, "==", 9448, "crit okay");
-ok( ! defined Nagios::Plugin::Performance->parse_perfstring("rubbish"), "Errors correctly");
-ok( ! defined Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string");
+ at p = Nagios::Plugin::Performance->parse_perfstring("rubbish");
+ok( ! @p, "Errors correctly");
+ok( ! Nagios::Plugin::Performance->parse_perfstring(""), "Errors on empty string");
@p = Nagios::Plugin::Performance->parse_perfstring(
"time=0.001229s;0.000000;0.000000;0.000000;10.000000");
@@ -49,6 +50,9 @@
cmp_ok( $p[0]->threshold->warning, 'eq', "20", "warn okay");
cmp_ok( $p[0]->threshold->critical, 'eq', "50", "crit okay");
+ at p = Nagios::Plugin::Performance->parse_perfstring( "users=4;20;50;0\n" );
+ ok( @p, "parse correctly with linefeed at end (nagiosgraph)");
+
@p = Nagios::Plugin::Performance->parse_perfstring(
"time=0.215300s;5.000000;10.000000;0.000000 size=426B;;;0" );
cmp_ok( $p[0]->label, "eq", "time", "label okay");
More information about the Commits
mailing list