1 #! /usr/bin/perl -w -I ..
3 # Logged in Users Tests via check_users
5 # Trick: This ckeck requires at least 1 user logged in. These commands should
6 # leave a session open forever in the background:
8 # $ ssh -tt localhost </dev/null >/dev/null 2>/dev/null &
16 BEGIN {$tests = 8; 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/';
23 $t += checkCmd( "./check_users 1000 1000", 0, $successOutput );
24 $t += checkCmd( "./check_users 0 0", 2, $failureOutput );
25 $t += checkCmd( "./check_users -w 0:1000 -c 0:1000", 0, $successOutput );
26 $t += checkCmd( "./check_users -w 0:0 -c 0:0", 2, $failureOutput );
28 exit(0) if defined($Test::Harness::VERSION);