Bug 556350

Summary: build tests depend on optional component
Product: [Fedora] Fedora Reporter: JW <ohtmvyyn>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: kdudka, ovasik, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: coreutils-8.4-4.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-05 16:34:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description JW 2010-01-18 02:10:57 UTC
Description of problem:
If one builds coreutils configure without "--enable-selinux" then the resultant ls utility does not contain the "--scontext" command-line option.  However, the test suite library (test-lib.sh) contains a function require_selinux_ which uses "ls --scontext" to attempt to determine whether selinux is enabled.  Unfortunately the said function does not account for the possibility that ls doesn't support that option ... it only acts on the ls output (either ? or unlabeled).

Version-Release number of selected component (if applicable):
coreutils-7.6-8

How reproducible:
Always

Steps to Reproduce:
1. build coreutils without configure option of '--enable-selinux'
  
Actual results:
1. Various tests fail because the require_selinux_ function fails in an unexpected manner

Expected results:
The require_selinux_ function should also invoke skip_test_ if ls exits with non-zero status.

Additional info:
selinux is unwanted, unnecessary, and pollutes the system by creating an overly complex and unmanageable mess.

Comment 1 JW 2010-01-18 02:23:04 UTC
It is in fact the fault of a patch: coreutils-6.10-configuration.patch

This patch replaces the 'ls -Z' in the test-lib.sh with 'ls --scontext' for some undocumented reason.

This is wrong because --scontext might not be compiled into ls. Chicken and egg.  You cannot use the output from a missing feature to test if a feature is missing!

The spec file groups the patch in "Our patches" so I figure that RedHat has introduced this bug.

Comment 2 Ondrej Vasik 2010-01-18 12:27:33 UTC
Thanks for report. You are right, it's caused by Red Hat patch and it has to be fixed.

That replacement is because previous coreutils Fedora/Red Hat maintainer added SELinux patch from NSA before it was accepted by upstream. Now it sometimes slightly differs from upstream and I have to keep those things as they might be in use in some Fedora/RHEL-4/5 scripts.

Comment 3 Ondrej Vasik 2010-02-05 16:34:05 UTC
Moved that test-lib.sh modification into selinux patch directly and built as coreutils-8.4-4.fc13 - closing RAWHIDE.