mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-03-26 20:33:26 -04:00
Complete rewrite of the original testing infrastructure and all test cases (to use the new infrastructure) See NPTest.pm and issue 1185704 for more details. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1207 f882894a-f735-0410-b71e-b25c423dba1c
25 lines
605 B
Perl
25 lines
605 B
Perl
#! /usr/bin/perl -w -I ..
|
|
#
|
|
# Load Average Tests via check_load
|
|
#
|
|
# $Id$
|
|
#
|
|
|
|
use strict;
|
|
use Test;
|
|
use NPTest;
|
|
|
|
use vars qw($tests);
|
|
BEGIN {$tests = 4; plan tests => $tests}
|
|
|
|
my $successOutput = '/^OK - load average: [0-9]\.?[0-9]+, [0-9]\.?[0-9]+, [0-9]\.?[0-9]+/';
|
|
my $failureOutput = '/^CRITICAL - load average: [0-9]\.?[0-9]+, [0-9]\.?[0-9]+, [0-9]\.?[0-9]+/';
|
|
|
|
my $t;
|
|
|
|
$t += checkCmd( "./check_load -w 100,100,100 -c 100,100,100", 0, $successOutput );
|
|
$t += checkCmd( "./check_load -w 0,0,0 -c 0,0,0", 2, $failureOutput );
|
|
|
|
exit(0) if defined($Test::Harness::VERSION);
|
|
exit($tests - $t);
|
|
|