diff options
| author | Greg Cox <gcox@fibbsbozza.local> | 2014-07-29 18:52:12 -0400 |
|---|---|---|
| committer | Greg Cox <gcox@fibbsbozza.local> | 2014-07-29 18:52:12 -0400 |
| commit | 4273dd06ff3e52094d6b267d00e8c51dd74de364 (patch) | |
| tree | 425d127da5dbec7013999ed01b469fc3f72992d9 /plugins/tests/check_procs.t | |
| parent | f05e7016320f4671fbf86cc5abc277efea20f79e (diff) | |
| parent | 6f3d5825b203b75aef8d68bf0d117e7a1a4c0616 (diff) | |
| download | monitoring-plugins-4273dd06ff3e52094d6b267d00e8c51dd74de364.tar.gz | |
Merge remote-tracking branch 'upstream/master'
Conflicts:
plugins/netutils.c
Diffstat (limited to 'plugins/tests/check_procs.t')
| -rwxr-xr-x | plugins/tests/check_procs.t | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/plugins/tests/check_procs.t b/plugins/tests/check_procs.t index 1ad2c2f1..54d43d9b 100755 --- a/plugins/tests/check_procs.t +++ b/plugins/tests/check_procs.t | |||
| @@ -48,21 +48,26 @@ SKIP: { | |||
| 48 | like( $result->output, '/^PROCS OK: 1 process with command name \'launchd\', UID = 501 (.*)$/', "Output correct" ); | 48 | like( $result->output, '/^PROCS OK: 1 process with command name \'launchd\', UID = 501 (.*)$/', "Output correct" ); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | $result = NPTest->testCmd( "$command -u -2 -w 2:2" ); | 51 | SKIP: { |
| 52 | is( $result->return_code, 1, "Checking processes with userid=-2" ); | 52 | skip 'user with uid -2 required', 8 unless getpwuid(-2); |
| 53 | like( $result->output, '/^PROCS WARNING: 3 processes with UID = -2 \(nobody\)$/', "Output correct" ); | 53 | skip 'uid -2 must have name "nobody"', 8 unless getpwuid(-2) eq 'nobody'; |
| 54 | |||
| 55 | $result = NPTest->testCmd( "$command -u -2 -w 2:2" ); | ||
| 56 | is( $result->return_code, 1, "Checking processes with userid=-2" ); | ||
| 57 | like( $result->output, '/^PROCS WARNING: 3 processes with UID = -2 \(nobody\)$/', "Output correct" ); | ||
| 54 | 58 | ||
| 55 | $result = NPTest->testCmd( "$command -u -2 -w 3:3" ); | 59 | $result = NPTest->testCmd( "$command -u -2 -w 3:3" ); |
| 56 | is( $result->return_code, 0, "Checking processes with userid=-2 past threshold" ); | 60 | is( $result->return_code, 0, "Checking processes with userid=-2 past threshold" ); |
| 57 | like( $result->output, '/^PROCS OK: 3 processes with UID = -2 \(nobody\)$/', "Output correct" ); | 61 | like( $result->output, '/^PROCS OK: 3 processes with UID = -2 \(nobody\)$/', "Output correct" ); |
| 58 | 62 | ||
| 59 | $result = NPTest->testCmd( "$command -u -2 -a usb" ); | 63 | $result = NPTest->testCmd( "$command -u -2 -a usb" ); |
| 60 | is( $result->return_code, 0, "Checking processes with userid=-2 and usb in arguments" ); | 64 | is( $result->return_code, 0, "Checking processes with userid=-2 and usb in arguments" ); |
| 61 | like( $result->output, '/^PROCS OK: 1 process with UID = -2 \(nobody\), args \'usb\'/', "Output correct" ); | 65 | like( $result->output, '/^PROCS OK: 1 process with UID = -2 \(nobody\), args \'usb\'/', "Output correct" ); |
| 62 | 66 | ||
| 63 | $result = NPTest->testCmd( "$command -u -2 -a UsB" ); | 67 | $result = NPTest->testCmd( "$command -u -2 -a UsB" ); |
| 64 | is( $result->return_code, 0, "Checking case sensitivity of args" ); | 68 | is( $result->return_code, 0, "Checking case sensitivity of args" ); |
| 65 | like( $result->output, '/^PROCS OK: 0 processes with UID = -2 \(nobody\), args \'UsB\'/', "Output correct" ); | 69 | like( $result->output, '/^PROCS OK: 0 processes with UID = -2 \(nobody\), args \'UsB\'/', "Output correct" ); |
| 70 | }; | ||
| 66 | 71 | ||
| 67 | $result = NPTest->testCmd( "$command --ereg-argument-array='mdworker.*501'" ); | 72 | $result = NPTest->testCmd( "$command --ereg-argument-array='mdworker.*501'" ); |
| 68 | is( $result->return_code, 0, "Checking regexp search of arguments" ); | 73 | is( $result->return_code, 0, "Checking regexp search of arguments" ); |
