check_users.t 520 B

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