Bug 591451

Summary: upstream test suite for libsemanage fails
Product: Red Hat Enterprise Linux 6 Reporter: Milos Malik <mmalik>
Component: libsemanageAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: low Docs Contact:
Priority: low    
Version: 6.0CC: ksrot, mgrepl, plautrba
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libsemanage-2.0.43-5.1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 07:33:19 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 Milos Malik 2010-05-12 09:47:41 UTC
Description of problem:
Maybe the test suite is broken or libsemanage contains an error.

Version-Release number of selected component (if applicable):
checkpolicy-2.0.19-3.1.el6.i686
libselinux-2.0.90-3.el6.i686
libselinux-devel-2.0.90-3.el6.i686
libselinux-python-2.0.90-3.el6.i686
libselinux-utils-2.0.90-3.el6.i686
libsemanage-2.0.43-4.el6.i686
libsemanage-devel-2.0.43-4.el6.i686
libsemanage-python-2.0.43-4.el6.i686
libsepol-2.0.41-3.el6.i686
libsepol-devel-2.0.41-3.el6.i686
libsepol-static-2.0.41-3.el6.i686
selinux-policy-3.7.19-15.el6.noarch
selinux-policy-doc-3.7.19-15.el6.noarch
selinux-policy-minimum-3.7.19-15.el6.noarch
selinux-policy-mls-3.7.19-15.el6.noarch
selinux-policy-targeted-3.7.19-15.el6.noarch

How reproducible:
always

Steps to Reproduce:
# make >& /dev/null
# make test
make[1]: Entering directory `/root/rpmbuild/BUILD/libsemanage/tests'
./libsemanage-tests


     CUnit - A Unit testing framework for C - Version 2.1-0
     http://cunit.sourceforge.net/


Suite: semanage_store
  Test: semanage_store_access_check ... FAILED
    1. test_semanage_store.c:167  - err == -1
    2. test_semanage_store.c:178  - err == SEMANAGE_CAN_READ
    3. test_semanage_store.c:200  - err == 0
    4. test_semanage_store.c:211  - err == 0
    5. test_semanage_store.c:226  - err == -1
    6. test_semanage_store.c:237  - err == 0
    7. test_semanage_store.c:244  - err == SEMANAGE_CAN_READ
  Test: semanage_get_lock ... passed
  Test: semanage_nc_sort ... passedtest_semanage_findval: : Invalid argument
libsemanage-tests: TestRun.c:132: CU_assertImplementation: Assertion `((void *)0) != f_pCurTest' failed.
make[1]: *** [test] Aborted
make[1]: Leaving directory `/root/rpmbuild/BUILD/libsemanage/tests'

  
Actual results:
upstream test suite fails

Expected results:
upstream test suite passes

Comment 1 RHEL Program Management 2010-05-12 10:39:54 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 4 RHEL Program Management 2011-01-07 16:06:07 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 6 Miroslav Grepl 2012-11-15 21:31:51 UTC
*** Bug 868211 has been marked as a duplicate of this bug. ***

Comment 7 RHEL Program Management 2012-12-14 07:20:02 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 8 RHEL Program Management 2013-10-14 01:20:40 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 9 Petr Lautrbach 2015-02-26 15:39:01 UTC
There missing declaration for one symbol:

$ make DEBUG=1
..
direct_api.c: In function ‘semanage_direct_list’:
direct_api.c:1483: error: implicit declaration of function ‘semanage_module_enabled’


It's fixed in [1] which fixes also the other bug #872700

[1] https://github.com/fedora-selinux/selinux/commit/c1323f22c7ad93b975eb8b6a251b893bc88f240f

Comment 12 Petr Lautrbach 2015-03-13 16:34:41 UTC
The testsuite needs to be fixed to use char fname[] = "..."; instead of char fname[] = { ... };

I'll provide a patch and a respin.

Comment 13 Petr Lautrbach 2015-03-16 21:17:18 UTC
Note: the teststuite is not suitable to be run with root privileges:

$ head libsemanage-2.0.43.git/tests/README
Notes on tests
============================
The semanage_access_check test in the semanage_store suite simulates a
read-only filesystem by using DAC permissions. Consequently, these tests
will fail if run as root, as root can override DAC permissions.

Comment 17 errata-xmlrpc 2015-07-22 07:33:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1403.html