check_users.t 527 B

12345678910111213141516171819202122232425
  1. #! /usr/bin/perl -w -I ..
  2. #
  3. # Logged in Users Tests via check_users
  4. #
  5. # $Id$
  6. #
  7. use strict;
  8. use Test;
  9. use NPTest;
  10. use vars qw($tests);
  11. BEGIN {$tests = 4; plan tests => $tests}
  12. my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/';
  13. my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/';
  14. my $t;
  15. $t += checkCmd( "./check_users 1000 1000", 0, $successOutput );
  16. $t += checkCmd( "./check_users 0 0", 2, $failureOutput );
  17. exit(0) if defined($Test::Harness::VERSION);
  18. exit($tests - $t);