From: Pádraig Brady Date: Fri, 5 Jul 2013 01:43:22 +0000 (+0100) Subject: tests: fix "shuf unreadable" test to work when run as root X-Git-Tag: v8.22~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37c9ce40f3a851955916e5d54635566a5685ce23;p=thirdparty%2Fcoreutils.git tests: fix "shuf unreadable" test to work when run as root * tests/misc/shuf.sh: Restrict the test to the significant case where we can't in fact read the "unreadable" file. --- diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh index 171b25a1fd..3e33b61519 100755 --- a/tests/misc/shuf.sh +++ b/tests/misc/shuf.sh @@ -60,7 +60,9 @@ timeout 10 shuf -i1-$SIZE_MAX -n2 >/dev/null || # Ensure shuf -n0 doesn't read any input or open specified files touch unreadable || framework_failure_ chmod 0 unreadable || framework_failure_ -shuf -n0 unreadable || fail=1 -shuf -n1 unreadable && fail=1 +if ! test -r unreadable; then + shuf -n0 unreadable || fail=1 + shuf -n1 unreadable && fail=1 +fi Exit $fail