From b418181dfe80dd75169b6e8a619ac1932155dea2 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Mon, 20 Jan 2014 00:54:34 +0100 Subject: renamed module into Monitoring::Plugin since the complete monitoring team has been renamed, we also rename this module. Signed-off-by: Sven Nierlein --- t/Nagios-Plugin-01.t | 72 ---------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 t/Nagios-Plugin-01.t (limited to 't/Nagios-Plugin-01.t') diff --git a/t/Nagios-Plugin-01.t b/t/Nagios-Plugin-01.t deleted file mode 100644 index 947a704..0000000 --- a/t/Nagios-Plugin-01.t +++ /dev/null @@ -1,72 +0,0 @@ -# Nagios::Plugin original test cases - -use strict; -use Test::More tests => 15; - -BEGIN { use_ok('Nagios::Plugin') }; - -use Nagios::Plugin::Functions; -Nagios::Plugin::Functions::_fake_exit(1); - -diag "\nusing Nagios::Plugin revision ". $Nagios::Plugin::VERSION . "\n" - if $ENV{TEST_VERBOSE}; - -my $p = Nagios::Plugin->new(); -isa_ok( $p, "Nagios::Plugin"); - -$p->shortname("PAGESIZE"); -is($p->shortname, "PAGESIZE", "shortname explicitly set correctly"); - -$p = Nagios::Plugin->new(); -is($p->shortname, "NAGIOS-PLUGIN-01", "shortname should default on new"); - -$p = Nagios::Plugin->new( shortname => "SIZE", () ); -is($p->shortname, "SIZE", "shortname set correctly on new"); - -$p = Nagios::Plugin->new( plugin => "check_stuff", () ); -is($p->shortname, "STUFF", "shortname uses plugin name as default"); - -$p = Nagios::Plugin->new( shortname => "SIZE", plugin => "check_stuff", () ); -is($p->shortname, "SIZE", "shortname is not overriden by default"); - -diag "warn if < 10, critical if > 25 " if $ENV{TEST_VERBOSE}; -my $t = $p->set_thresholds( warning => "10:25", critical => "~:25" ); - -use Data::Dumper; -#diag "dumping p: ". Dumper $p; -#diag "dumping perfdata: ". Dumper $p->perfdata; - - -$p->add_perfdata( - label => "size", - value => 1, - uom => "kB", - threshold => $t, - ); - -cmp_ok( $p->all_perfoutput, 'eq', "size=1kB;10:25;~:25", "Perfdata correct"); -#diag "dumping perfdata: ". Dumper ($p->perfdata); - -$p->add_perfdata( - label => "time", - value => "3.52", - threshold => $t, - ); - -is( $p->all_perfoutput, "size=1kB;10:25;~:25 time=3.52;10:25;~:25", "Perfdata correct when no uom specified"); - -my $expected = {qw( - -1 WARNING - 1 WARNING - 20 OK - 25 OK - 26 CRITICAL - 30 CRITICAL - )}; - -foreach (sort {$a<=>$b} keys %$expected) { - like $p->die( return_code => $t->get_status($_), message => "page size at http://... was ${_}kB" ), - qr/$expected->{$_}/, - "Output okay. $_ = $expected->{$_}" ; -} - -- cgit v1.2.3-74-g34f1