[Top][All Lists]

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

Re: [PATCH] tests: skip some parts of tests/misc/ if run as root

From: Pádraig Brady
Subject: Re: [PATCH] tests: skip some parts of tests/misc/ if run as root
Date: Tue, 21 Mar 2023 16:16:33 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Thunderbird/109.0

On 21/03/2023 12:54, Nick Alcock wrote:
Similarly to the fix to tests/rmdir/ in c0e5f8c59,
tee should not be expected to fail when run with read-only outputs
when run as root.

* tests/rmdir/ Add uid_is_privileged_ guard around test for
read-only outputs.
  tests/misc/ | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/misc/ b/tests/misc/
index e01c27ecc..9f5eace8a 100755
--- a/tests/misc/
+++ b/tests/misc/
@@ -79,9 +79,11 @@ test -f tee.exited || fail=1 ;;
# Test with unwriteable files
-touch || framework_failure_
-chmod a-w || framework_failure_
-returns_ 1 tee -p </dev/null || fail=1
+if ! uid_is_privileged_; then  # root does not get EPERM.
+    touch || framework_failure_
+    chmod a-w || framework_failure_
+    returns_ 1 tee -p </dev/null || fail=1


I'll update release procedure to do a test run as root
(which is unusual / ill-advised TBH).


reply via email to

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