diff options
author | Sam Kottler <shk@linux.com> | 2014-07-10 19:25:50 (GMT) |
---|---|---|
committer | Sam Kottler <shk@linux.com> | 2014-07-10 19:25:50 (GMT) |
commit | 222c1d45c0abfc8aae6aa3bad9dd5d4e9398b75a (patch) | |
tree | 4d158b23339b383c374ab3ad43072e6d9999c8b0 /plugins/t/check_procs.t | |
parent | 43b66c06a921b878ba4de2a246a219cca94dd498 (diff) | |
parent | f54d10fe9ba202415c2001b1ec7c6eb4697c3d10 (diff) | |
download | monitoring-plugins-222c1d45c0abfc8aae6aa3bad9dd5d4e9398b75a.tar.gz |
Merge pull request #1272 from mfalkvidd/master
check_procs: Add delay after forking in test
Diffstat (limited to 'plugins/t/check_procs.t')
-rw-r--r-- | plugins/t/check_procs.t | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/t/check_procs.t b/plugins/t/check_procs.t index ca4acdd..abe7284 100644 --- a/plugins/t/check_procs.t +++ b/plugins/t/check_procs.t | |||
@@ -26,7 +26,7 @@ $result = NPTest->testCmd( "./check_procs -w 100000 -c 100000 -s Z" ); | |||
26 | is( $result->return_code, 0, "Checking less than 100000 zombie processes" ); | 26 | is( $result->return_code, 0, "Checking less than 100000 zombie processes" ); |
27 | like( $result->output, '/^PROCS OK: [0-9]+ process(es)? with /', "Output correct" ); | 27 | like( $result->output, '/^PROCS OK: [0-9]+ process(es)? with /', "Output correct" ); |
28 | 28 | ||
29 | if(fork() == 0) { exec("sleep 7"); } # fork a test process | 29 | if(fork() == 0) { exec("sleep 7"); } else { sleep(1) } # fork a test process in child and give child time to fork in parent |
30 | $result = NPTest->testCmd( "./check_procs -a 'sleep 7'" ); | 30 | $result = NPTest->testCmd( "./check_procs -a 'sleep 7'" ); |
31 | is( $result->return_code, 0, "Parent process is ignored" ); | 31 | is( $result->return_code, 0, "Parent process is ignored" ); |
32 | like( $result->output, '/^PROCS OK: 1 process?/', "Output correct" ); | 32 | like( $result->output, '/^PROCS OK: 1 process?/', "Output correct" ); |