From: Dmitry V. Levin Date: Wed, 4 Apr 2018 21:36:07 +0000 (+0000) Subject: tests: robustify options-syntax.test against ash X-Git-Tag: v4.22~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4eeba4e60fde6291aa2cc9c37dd2e088a378f2b7;p=strace tests: robustify options-syntax.test against ash * tests/options-syntax.test: Do not assume that shell provides $UID, use "id -u" if it doesn't. --- diff --git a/tests/options-syntax.test b/tests/options-syntax.test index 7b4a620e..af7002b2 100755 --- a/tests/options-syntax.test +++ b/tests/options-syntax.test @@ -73,8 +73,9 @@ diff -u -- "$EXP" "$LOG" > /dev/null || { "zeroargc $STRACE $args output mismatch" } -if [ -n "${UID-}" ]; then - if [ "${UID-}" = 0 ]; then +uid="${UID:-`id -u`}" +if [ "$uid" -ge 0 ]; then + if [ "$uid" -eq 0 ]; then umsg="Cannot find user ':nosuchuser:'" else umsg='You must be root to use the -u option'