Code

check_http: check for and print the certificate cn
[nagiosplug.git] / plugins / t / check_users.t
1 #! /usr/bin/perl -w -I ..
2 #
3 # Logged in Users Tests via check_users
4 #
5 # Trick: This ckeck requires at least 1 user logged in. These commands should
6 #        leave a session open forever in the background:
7 #
8 #   $ ssh -tt localhost </dev/null >/dev/null 2>/dev/null &
9 #   $ disown %1
11 use strict;
12 use Test;
13 use NPTest;
15 use vars qw($tests);
16 BEGIN {$tests = 4; plan tests => $tests}
18 my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/';
19 my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/';
21 my $t;
23 $t += checkCmd( "./check_users 1000 1000", 0, $successOutput );
24 $t += checkCmd( "./check_users    0    0", 2, $failureOutput );
26 exit(0) if defined($Test::Harness::VERSION);
27 exit($tests - $t);