diff options
-rwxr-xr-x | plugins/tests/check_procs.t | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/plugins/tests/check_procs.t b/plugins/tests/check_procs.t index 1ad2c2f1..b153d5d2 100755 --- a/plugins/tests/check_procs.t +++ b/plugins/tests/check_procs.t | |||
@@ -48,21 +48,25 @@ 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 | |
54 | $result = NPTest->testCmd( "$command -u -2 -w 2:2" ); | ||
55 | is( $result->return_code, 1, "Checking processes with userid=-2" ); | ||
56 | like( $result->output, '/^PROCS WARNING: 3 processes with UID = -2 \(nobody\)$/', "Output correct" ); | ||
54 | 57 | ||
55 | $result = NPTest->testCmd( "$command -u -2 -w 3:3" ); | 58 | $result = NPTest->testCmd( "$command -u -2 -w 3:3" ); |
56 | is( $result->return_code, 0, "Checking processes with userid=-2 past threshold" ); | 59 | 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" ); | 60 | like( $result->output, '/^PROCS OK: 3 processes with UID = -2 \(nobody\)$/', "Output correct" ); |
58 | 61 | ||
59 | $result = NPTest->testCmd( "$command -u -2 -a usb" ); | 62 | $result = NPTest->testCmd( "$command -u -2 -a usb" ); |
60 | is( $result->return_code, 0, "Checking processes with userid=-2 and usb in arguments" ); | 63 | 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" ); | 64 | like( $result->output, '/^PROCS OK: 1 process with UID = -2 \(nobody\), args \'usb\'/', "Output correct" ); |
62 | 65 | ||
63 | $result = NPTest->testCmd( "$command -u -2 -a UsB" ); | 66 | $result = NPTest->testCmd( "$command -u -2 -a UsB" ); |
64 | is( $result->return_code, 0, "Checking case sensitivity of args" ); | 67 | 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" ); | 68 | like( $result->output, '/^PROCS OK: 0 processes with UID = -2 \(nobody\), args \'UsB\'/', "Output correct" ); |
69 | }; | ||
66 | 70 | ||
67 | $result = NPTest->testCmd( "$command --ereg-argument-array='mdworker.*501'" ); | 71 | $result = NPTest->testCmd( "$command --ereg-argument-array='mdworker.*501'" ); |
68 | is( $result->return_code, 0, "Checking regexp search of arguments" ); | 72 | is( $result->return_code, 0, "Checking regexp search of arguments" ); |