diff options
author | Elliott Hughes <enh@google.com> | 2016-06-04 09:26:14 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2016-06-04 16:57:18 -0500 |
commit | 5d2619774ea77b02e4642401fb3c1dbd02253011 (patch) | |
tree | b2f7cef9aa900111c6696d74e0feb54c38b2eff1 /tests/pgrep.test | |
parent | 5352bb64b619aad69598fda69cccc591e8f16710 (diff) | |
download | toybox-5d2619774ea77b02e4642401fb3c1dbd02253011.tar.gz |
Basic success/failure return from pgrep/pkill.
The man page says they also return 2 for syntax errors and 3 for "fatal
error: out of memory etc", but I don't know how to implement that and
don't need it (or have any reason to believe anyone needs it).
Bug: 29092208
Diffstat (limited to 'tests/pgrep.test')
-rwxr-xr-x | tests/pgrep.test | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/pgrep.test b/tests/pgrep.test index 753a55ab..3319c79a 100755 --- a/tests/pgrep.test +++ b/tests/pgrep.test @@ -29,5 +29,9 @@ testing "-o pattern" "pgrep -o yes" "$proc\n" "" "" testing "-s" "pgrep -s $session_id yes" "$proc\n" "" "" testing "-P" "pgrep -P $proc_parent yes" "$proc\n" "" "" +testing "return success" "pgrep yes && echo success" "$proc\nsuccess\n" "" "" +testing "return failure" "pgrep almost-certainly-not || echo failure" \ + "failure\n" "" "" + #Clean-up killall yes >/dev/null 2>&1 |