From 5d2619774ea77b02e4642401fb3c1dbd02253011 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat, 4 Jun 2016 09:26:14 -0700 Subject: 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 --- tests/pgrep.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/pgrep.test') 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 -- cgit v1.2.3