coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: fix "shuf unreadable" test to work when run as root


From: Pádraig Brady
Subject: [PATCH] tests: fix "shuf unreadable" test to work when run as root
Date: Fri, 5 Jul 2013 02:45:46 +0100

* tests/misc/shuf.sh: Restrict the test to the significant
case where we can't in fact read the "unreadable" file.
---
 tests/misc/shuf.sh |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh
index 171b25a..3e33b61 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
-- 
1.7.7.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]