summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2023-03-21 12:54:02 +0000
committerPádraig Brady <P@draigBrady.com>2023-03-21 16:15:18 +0000
commiteeabb11eb6697a137894db066715a07550c6d82a (patch)
tree078c6333b547fc89519a439db13f1266d0818006
parentbdda9adb38bcc437d752e70bb83b4da1acda89df (diff)
downloadcoreutils-eeabb11eb6697a137894db066715a07550c6d82a.tar.gz
tests: skip some parts of tests/misc/tee.sh if run as root
Similarly to the fix to tests/rmdir/ignore.sh in c0e5f8c59, tee should not be expected to fail when run with read-only outputs when run as root. * tests/misc/tee.sh: Add uid_is_privileged_ guard around test for read-only outputs.
-rwxr-xr-xtests/misc/tee.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/misc/tee.sh b/tests/misc/tee.sh
index e01c27ecc..0b97a9ea3 100755
--- a/tests/misc/tee.sh
+++ b/tests/misc/tee.sh
@@ -79,9 +79,11 @@ test -f tee.exited || fail=1 ;;
esac
# Test with unwriteable files
-touch file.ro || framework_failure_
-chmod a-w file.ro || framework_failure_
-returns_ 1 tee -p </dev/null file.ro || fail=1
+if ! uid_is_privileged_; then # root does not get EPERM.
+ touch file.ro || framework_failure_
+ chmod a-w file.ro || framework_failure_
+ returns_ 1 tee -p </dev/null file.ro || fail=1
+fi
mkfifo_or_skip_ fifo