Imported Upstream version 1.4.5
This commit is contained in:
parent
62d1e7d5fe
commit
6a280f6f24
412 changed files with 168642 additions and 0 deletions
26
plugins/t/check_load.t
Normal file
26
plugins/t/check_load.t
Normal file
|
@ -0,0 +1,26 @@
|
|||
#! /usr/bin/perl -w -I ..
|
||||
#
|
||||
# Load Average Tests via check_load
|
||||
#
|
||||
# $Id: check_load.t,v 1.6 2006/10/02 12:09:18 tonvoon Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
use Test::More;
|
||||
use NPTest;
|
||||
|
||||
my $res;
|
||||
|
||||
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]+/';
|
||||
|
||||
plan tests => 4;
|
||||
|
||||
$res = NPTest->testCmd( "./check_load -w 100,100,100 -c 100,100,100" );
|
||||
cmp_ok( $res->return_code, 'eq', 0, "load not over 100");
|
||||
like( $res->output, $successOutput, "Output OK");
|
||||
|
||||
$res = NPTest->testCmd( "./check_load -w 0,0,0 -c 0,0,0" );
|
||||
cmp_ok( $res->return_code, 'eq', 2, "Load over 0");
|
||||
like( $res->output, $failureOutput, "Output OK");
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue