summaryrefslogtreecommitdiffstats
path: root/plugins/t/check_users.t
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2023-11-12 02:31:24 +0100
committerGitHub <noreply@github.com>2023-11-12 02:31:24 +0100
commitf1e91405c3b51641b02228672c47e2b4aa1dd5f1 (patch)
tree6fc8a80d365a05066a7a4b4640acb54c2cac1fd8 /plugins/t/check_users.t
parent928654756b278531928cd7595fee737e32bf2ca3 (diff)
parent5db26484651753e3a2f0568b0b9d64aa49381533 (diff)
downloadmonitoring-plugins-f1e9140.tar.gz
Merge pull request #1958 from RincewindsHat/check_users_fix_segfault
check_users: fix segfault
Diffstat (limited to 'plugins/t/check_users.t')
-rw-r--r--plugins/t/check_users.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/t/check_users.t b/plugins/t/check_users.t
index 9ebc2fc6..21c3e53d 100644
--- a/plugins/t/check_users.t
+++ b/plugins/t/check_users.t
@@ -13,10 +13,11 @@ use Test;
13use NPTest; 13use NPTest;
14 14
15use vars qw($tests); 15use vars qw($tests);
16BEGIN {$tests = 8; plan tests => $tests} 16BEGIN {$tests = 12; plan tests => $tests}
17 17
18my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/'; 18my $successOutput = '/^USERS OK - [0-9]+ users currently logged in/';
19my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/'; 19my $failureOutput = '/^USERS CRITICAL - [0-9]+ users currently logged in/';
20my $wrongOptionOutput = '/Usage:/';
20 21
21my $t; 22my $t;
22 23
@@ -24,6 +25,8 @@ $t += checkCmd( "./check_users 1000 1000", 0, $successOutput );
24$t += checkCmd( "./check_users 0 0", 2, $failureOutput ); 25$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:1000 -c 0:1000", 0, $successOutput );
26$t += checkCmd( "./check_users -w 0:0 -c 0:0", 2, $failureOutput ); 27$t += checkCmd( "./check_users -w 0:0 -c 0:0", 2, $failureOutput );
28$t += checkCmd( "./check_users -w 0:1000", 3, $wrongOptionOutput);
29$t += checkCmd( "./check_users", 3, $wrongOptionOutput);
27 30
28exit(0) if defined($Test::Harness::VERSION); 31exit(0) if defined($Test::Harness::VERSION);
29exit($tests - $t); 32exit($tests - $t);