GNU bug report logs - #5945
[PATCH] tests: avoid spurious failure of root-only ls/capability test

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Wed, 14 Apr 2010 13:53:01 UTC

Severity: normal

Tags: patch

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5945 in the body.
You can then email your comments to 5945 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5945; Package coreutils. (Wed, 14 Apr 2010 13:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Meyering <jim <at> meyering.net>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 14 Apr 2010 13:53:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: bug-coreutils <at> gnu.org
Subject: [PATCH] tests: avoid spurious failure of root-only ls/capability test
Date: Wed, 14 Apr 2010 15:52:19 +0200
Hmm... you can tell I haven't been running the root-only tests
on capability-enabled systems.  This showed up as a root-only failure:

  $ sudo env PATH="$PATH" NON_ROOT_USERNAME=$USER make -k check-root
  PASS: chown/basic
  ...
  PASS: install/install-C-root
  FAIL: ls/capability           <<<<==== oops
  PASS: ls/nameless-uid
  ...
  PASS: touch/now-owned-by-other

Here's the fix:

From 05bee6f116d81084f5796b2ab1ec12135fb72fc2 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering <at> redhat.com>
Date: Wed, 14 Apr 2010 15:48:31 +0200
Subject: [PATCH] tests: avoid spurious failure of root-only ls/capability test

* tests/ls/capability: Adjust this test not to expect the no-op escape
sequence that was removed from all other tests by 2010-01-30 commit
5d43617e, "ls --color: don't emit a final no-op escape sequence".
---
 tests/ls/capability |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/ls/capability b/tests/ls/capability
index df91aa5..3997c73 100755
--- a/tests/ls/capability
+++ b/tests/ls/capability
@@ -59,7 +59,7 @@ for ex in '' ex=:; do
 dir:
 \e[${code}mcap_neg\e[0m
 cap_pos
-\e[m" > out_ok || framework_failure
+" > out_ok || framework_failure

   compare out out_ok || fail=1
 done
--
1.7.1.rc1.248.gcefbb





Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#5945; Package coreutils. (Wed, 14 Apr 2010 14:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 5945 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Jim Meyering <jim <at> meyering.net>
Cc: 5945 <at> debbugs.gnu.org
Subject: Re: bug#5945: [PATCH] tests: avoid spurious failure of root-only
	ls/capability test
Date: Wed, 14 Apr 2010 15:37:50 +0100
On 14/04/10 14:52, Jim Meyering wrote:
> tests: avoid spurious failure of root-only ls/capability test

Here's another ls test failure that happens on SELinux enabled systems.
I'll push the following shortly.

From 2d9e9408f74f39f4c2817ea028a7a6ad64fb4b45 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?P=C3=A1draig=20Brady?= <P <at> draigBrady.com>
Date: Wed, 14 Apr 2010 15:32:27 +0100
Subject: [PATCH] tests: avoid spurious failure of ls/color-norm test

* tests/ls/color-norm: Ensure that the file size is output
consistently as 1 block.  Previously we used "empty" files which
could have some space allocated depending on whether SELinux was
enabled for example.
---
 tests/ls/color-norm |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/tests/ls/color-norm b/tests/ls/color-norm
index 16ffa22..75c7b82 100755
--- a/tests/ls/color-norm
+++ b/tests/ls/color-norm
@@ -28,9 +28,15 @@ fi
 # Don't let a different umask perturb the results.
 umask 22

-touch exe || framework_failure
+# Use a large block size so that file sizes (which are printed
+# with "normal" formatting), are normalized to 1 block.
+# Note we can't use 0 sized files as on some systems "empty"
+# files can use some allocation (like with SELinux enabled for example).
+export LS_BLOCK_SIZE=1048576
+
+echo > exe || framework_failure
 chmod u+x exe || framework_failure
-touch nocolor || framework_failure
+echo > nocolor || framework_failure

 # Non coloured files inherit NORMAL attributes
 LS_COLORS=no=7      ls -s1U --color exe nocolor >> out || fail=1
@@ -58,21 +64,21 @@ cat -A out > out.display || framework_failure
 mv out.display out || framework_failure

 cat <<\EOF > exp || framework_failure
-^[[0m^[[7m0 ^[[m^[[01;32mexe^[[0m$
-^[[7m0 nocolor^[[0m$
-^[[0m^[[7m0 ^[[m^[[01;32mexe^[[0m  ^[[7m0 nocolor^[[0m$
-^[[0m^[[7m0 nocolor^[[0m$
-^[[7m0 ^[[m^[[01;32mexe^[[0m$
-^[[0m^[[7m0 nocolor^[[0m  ^[[7m0 ^[[m^[[01;32mexe^[[0m$
-^[[0m^[[7m0 ^[[m^[[1mnocolor^[[0m$
-^[[7m0 ^[[m^[[01;32mexe^[[0m$
-^[[0m^[[7m0 ^[[m^[[mnocolor^[[0m$
-^[[7m0 ^[[m^[[01;32mexe^[[0m$
-^[[0m^[[7m0 ^[[m^[[0mnocolor^[[0m$
-^[[7m0 ^[[m^[[01;32mexe^[[0m$
+^[[0m^[[7m1 ^[[m^[[01;32mexe^[[0m$
+^[[7m1 nocolor^[[0m$
+^[[0m^[[7m1 ^[[m^[[01;32mexe^[[0m  ^[[7m1 nocolor^[[0m$
+^[[0m^[[7m1 nocolor^[[0m$
+^[[7m1 ^[[m^[[01;32mexe^[[0m$
+^[[0m^[[7m1 nocolor^[[0m  ^[[7m1 ^[[m^[[01;32mexe^[[0m$
+^[[0m^[[7m1 ^[[m^[[1mnocolor^[[0m$
+^[[7m1 ^[[m^[[01;32mexe^[[0m$
+^[[0m^[[7m1 ^[[m^[[mnocolor^[[0m$
+^[[7m1 ^[[m^[[01;32mexe^[[0m$
+^[[0m^[[7m1 ^[[m^[[0mnocolor^[[0m$
+^[[7m1 ^[[m^[[01;32mexe^[[0m$
 ^[[0m^[[7mnocolor^[[0m, ^[[7m^[[m^[[01;32mexe^[[0m*$
-0 nocolor$
-0 exe$
+1 nocolor$
+1 exe$
 EOF

 compare out exp || fail=1
-- 
1.6.2.5




Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Thu, 15 Apr 2010 23:52:02 GMT) Full text and rfc822 format available.

Notification sent to Jim Meyering <jim <at> meyering.net>:
bug acknowledged by developer. (Thu, 15 Apr 2010 23:52:02 GMT) Full text and rfc822 format available.

Message #13 received at 5945-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: 5945-done <at> debbugs.gnu.org
Subject: Re: bug#5945: [PATCH] tests: avoid spurious failure of root-only
	ls/capability test
Date: Fri, 16 Apr 2010 00:51:12 +0100
On 14/04/10 15:37, Pádraig Brady wrote:
> On 14/04/10 14:52, Jim Meyering wrote:
>> tests: avoid spurious failure of root-only ls/capability test
> 
> Here's another ls test failure that happens on SELinux enabled systems.
> I'll push the following shortly.
> 
>>From 2d9e9408f74f39f4c2817ea028a7a6ad64fb4b45 Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?P=C3=A1draig=20Brady?= <P <at> draigBrady.com>
> Date: Wed, 14 Apr 2010 15:32:27 +0100
> Subject: [PATCH] tests: avoid spurious failure of ls/color-norm test
> 
> * tests/ls/color-norm: Ensure that the file size is output
> consistently as 1 block.  Previously we used "empty" files which
> could have some space allocated depending on whether SELinux was
> enabled for example.

I actually pused a different method to fix ls/color-norm since
I was worried that a 1 byte file might not use extra
allocation on some file systems. Instead I output a specific
time string to test the normal style attribute.

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=3a1595a3

I'm marking these ls test issues as done.

cheers,
Pádraig.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 14 May 2010 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 98 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.