[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: coreutils 6.12 test-suite failure
From: |
Jim Meyering |
Subject: |
Re: coreutils 6.12 test-suite failure |
Date: |
Thu, 19 Jun 2008 09:42:13 +0200 |
Jarod Wilson <address@hidden> wrote:
...
> Finally got around to running a new build with your follow-up patch.
Thanks for the feedback!
>> FAIL: misc/runcon-no-reorder.log (exit: 1)
>> ==========================================
>> ...
> As expected, this one still triggers.
I've changed the test to also accept that diagnostic.
Patch below.
>> FAIL: cp/cp-a-selinux.log (exit: 1)
>> ===================================
...
> This one is indeed skipped.
Good!
>> FAIL: cp/preserve-gid.log (exit: 1)
>> ===================================
>> ...
>> This one was trickier. I think it must be the case that
>> root's primary group is 103. The test requires that it be 0.
>> Can you confirm? (i.e., run id -g -- or better, id -a to get all of them)
>> I'll either adapt the test or make it skip in that case.
>
> Ah, here we go... In this case, I'm doing a build in a mock chroot, as the
> user 'mockbuild', who (within the chroot) has a uid of 0, gid of 101:
>
> mockbuild::0:101::/builddir:/bin/bash
Good. That's easy to accommodate.
>> FAIL: rm/fail-2eperm.log (exit: 1)
>> ==================================
...
> But yeah, this one doesn't trigger anymore.
Thanks again.
These two just-pushed patches should solve those two remaining problems.
>From 2a113b5760306a611d4b7c9886eb13e7b521e889 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 19 Jun 2008 08:52:08 +0200
Subject: [PATCH] tests: avoid root-only test failure when run in a chroot
* tests/misc/runcon-no-reorder: Accept the diagnostic that is
produced when running in a chroot without /selinux/context.
Reported by Jarod Wilson. Details in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837
---
tests/misc/runcon-no-reorder | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/tests/misc/runcon-no-reorder b/tests/misc/runcon-no-reorder
index 07dd081..c1705e5 100755
--- a/tests/misc/runcon-no-reorder
+++ b/tests/misc/runcon-no-reorder
@@ -23,9 +23,8 @@ fi
. $srcdir/test-lib.sh
-cat <<\EOF > exp || framework_failure
-runcon: runcon may be used only on a SELinux kernel
-EOF
+diag='runcon: runcon may be used only on a SELinux kernel'
+echo "$diag" > exp || framework_failure
fail=0
@@ -35,6 +34,14 @@ fail=0
# about -j being an invalid option.
runcon $(id -Z) true -j 2> out && : > exp
+# When run on a system with no /selinux/context (i.e., in a chroot),
+# it chcon fails with this: "runcon: invalid context: \
+# root:system_r:unconfined_t:s0-s0:c0.c1023: No such file or directory"
+# That diagnostic is ok, too, so map it to the more common one.
+case `cat out` in
+ 'runcon: invalid context: '*) echo "$diag" > out;;
+esac
+
compare out exp || fail=1
(exit $fail); exit $fail
--
1.5.6.rc3.22.g4b97c8
>From f236d5e355e23dabad7c4ef412d099b1e6f405d8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 19 Jun 2008 09:03:41 +0200
Subject: [PATCH] tests: avoid test failure when root's primary group-ID is not 0
* tests/cp/preserve-gid: Expect a cp-without-`-p'-created file to
have a group ID of $(id -g). Reported by Jarod Wilson. Details in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837
---
tests/cp/preserve-gid | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid
index a999322..d7f86e0 100755
--- a/tests/cp/preserve-gid
+++ b/tests/cp/preserve-gid
@@ -19,6 +19,10 @@
. $srcdir/test-lib.sh
require_root_
+# Record primary group number, usually 0.
+# This is the group ID used when cp (without -p) creates a new file.
+primary_group_num=$(id -g)
+
create() {
echo "$1" > "$1" || exit 1
chown "+$2:+$3" "$1" || exit 1
@@ -34,7 +38,7 @@ t0() {
if test "x$s" != "x$u $g"; then
# Allow the actual group to match that of the parent directory
# (it was set to 0 above).
- if test "x$s" = "x$u 0"; then
+ if test "x$s" = "x$u $primary_group_num"; then
:
else
echo "$0: $* $f b: $u $g != $s" 1>&2
--
1.5.6.rc3.22.g4b97c8