[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#5945: [PATCH] tests: avoid spurious failure of root-only ls/capabili
From: |
Pádraig Brady |
Subject: |
bug#5945: [PATCH] tests: avoid spurious failure of root-only ls/capability test |
Date: |
Wed, 14 Apr 2010 15:37:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
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?= <address@hidden>
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