mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-03-02 13:20:54 -05: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
527 B
Perl
25 lines
527 B
Perl
#! /usr/bin/perl -w -I ..
|
|
#
|
|
# Logged in Users Tests via check_users
|
|
#
|
|
# $Id$
|
|
#
|
|
|
|
use strict;
|
|
use Test;
|
|
use NPTest;
|
|
|
|
use vars qw($tests);
|
|
BEGIN {$tests = 4; plan tests => $tests}
|
|
|
|
my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/';
|
|
my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/';
|
|
|
|
my $t;
|
|
|
|
$t += checkCmd( "./check_users 1000 1000", 0, $successOutput );
|
|
$t += checkCmd( "./check_users 0 0", 2, $failureOutput );
|
|
|
|
exit(0) if defined($Test::Harness::VERSION);
|
|
exit($tests - $t);
|
|
|