bug-coreutils
[Top][All Lists]
Advanced

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

[PATCH] tests: fix a failure when running tail-2/wait as root


From: Pádraig Brady
Subject: [PATCH] tests: fix a failure when running tail-2/wait as root
Date: Fri, 4 Sep 2009 14:14:03 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

I misunderstood Giuesspe's previous fix,
so this should reinstate it.

cheers,
Pádraig.
>From 99e1135a74cc7342f4c2599d8bf34c725095983d Mon Sep 17 00:00:00 2001
From: =?utf-8?q?P=C3=A1draig=20Brady?= <address@hidden>
Date: Fri, 4 Sep 2009 14:01:42 +0100
Subject: [PATCH] tests: fix a failure when running tail-2/wait as root

* tests/tail-2/wait: Silently skip a portion of the test
when running as root, rather than failing the whole test.
This regression was introduced with commit 84b5844d, 2009-09-03,
"tests: simplify and fix a race in 2 tail --follow tests".
---
 tests/tail-2/wait |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/tail-2/wait b/tests/tail-2/wait
index eb04ac2..abe22d7 100755
--- a/tests/tail-2/wait
+++ b/tests/tail-2/wait
@@ -27,15 +27,16 @@ fi
 touch here || framework_failure
 touch k || framework_failure
 { touch unreadable && chmod a-r unreadable; } || framework_failure
-cat unreadable && framework_failure
 
 fail=0
 
 timeout 1 tail -s0.1 -f not_here
 test $? = 124 && fail=1
 
-timeout 1 tail -s0.1 -f unreadable
-test $? = 124 && fail=1
+if test ! -r unreadable; then # can't test this when root
+  timeout 1 tail -s0.1 -f unreadable
+  test $? = 124 && fail=1
+fi
 
 timeout 1 tail -s0.1 -f here 2>tail.err
 test $? = 124 || fail=1
@@ -45,8 +46,10 @@ test $? = 124 || fail=1
 timeout 1 tail -s0.1 -F here 2>>tail.err
 test $? = 124 || fail=1
 
-timeout 1 tail -s0.1 -F unreadable
-test $? = 124 || fail=1
+if test ! -r unreadable; then # can't test this when root
+  timeout 1 tail -s0.1 -F unreadable
+  test $? = 124 || fail=1
+fi
 
 timeout 1 tail -s0.1 -F not_here
 test $? = 124 || fail=1
-- 
1.6.2.5


reply via email to

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