Bug 868211 - upstream test suite for libsemanage fails
upstream test suite for libsemanage fails
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libsemanage (Show other bugs)
7.0
All Linux
high Severity medium
: rc
: 7.0
Assigned To: Miroslav Grepl
Milos Malik
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-19 05:35 EDT by Michal Trunecka
Modified: 2015-03-16 16:58 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-16 16:58:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michal Trunecka 2012-10-19 05:35:23 EDT
Filed from caserun https://beaker.engineering.redhat.com/tasks/executed?task=/CoreOS/libsemanage/Sanity/bz576816-upstream-test-suite&job_id=318509

CUnit tests failed.

Version-Release number of selected component (if applicable):
RHEL6.4-20121015.n.1
CUnit-2.1-0.tar.gz
libsemanage-2.0.43-4.2.el6

Steps to Reproduce: 
Run CUnit tests for libsemanage
Implemented in RHTS /CoreOS/libsemanage/Sanity/bz576816-upstream-test-suite


Actual results: 
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 (core dumped)
make[1]: Leaving directory `/root/rpmbuild/BUILD/libsemanage/tests'


Expected results:
Tests pass
Comment 2 Miroslav Grepl 2012-11-15 16:31:51 EST

*** This bug has been marked as a duplicate of bug 591451 ***
Comment 3 Milos Malik 2013-04-11 04:57:28 EDT
# rpm -qa | grep -e libselinux -e libsepol -e libsemanage -e checkpolicy | sort
checkpolicy-2.1.12-3.el7.x86_64
libselinux-2.1.13-13.el7.x86_64
libselinux-devel-2.1.13-13.el7.x86_64
libselinux-python-2.1.13-13.el7.x86_64
libselinux-ruby-2.1.13-13.el7.x86_64
libselinux-static-2.1.13-13.el7.x86_64
libselinux-utils-2.1.13-13.el7.x86_64
libsemanage-2.1.10-2.el7.x86_64
libsemanage-devel-2.1.10-2.el7.x86_64
libsemanage-python-2.1.10-2.el7.x86_64
libsemanage-static-2.1.10-2.el7.x86_64
libsepol-2.1.9-1.el7.x86_64
libsepol-devel-2.1.9-1.el7.x86_64
libsepol-static-2.1.9-1.el7.x86_64
# 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 ... passed
Suite: semanage_utilities
  Test: semanage_is_prefix ... passed
  Test: semanage_split_on_space ... passed
  Test: semanage_split ... passed
  Test: semanage_list ... passed
  Test: semanage_str_count ... passed
  Test: semanage_rtrim ... passed
  Test: semanage_findval ... passed
  Test: slurp_file_filter ... passed

--Run Summary: Type      Total     Ran  Passed  Failed
               suites        2       2     n/a       0
               tests        11      11      10       1
               asserts      80      80      73       7
make[1]: Leaving directory `/root/rpmbuild/BUILD/libsemanage/tests'
#
Comment 5 Daniel Walsh 2013-04-11 13:13:48 EDT
 libsemanage-2.1.10-3.el7 this package required a fix to rebuild the test and works on F19.  I could not build the test package on the previous build so I am not sure what test program you are running with.  We might need to rebuild it for the current code.
Comment 6 Michal Trunecka 2013-05-27 04:01:52 EDT
Still the same results with the newest versions.

# rpm -qa | grep -e libselinux -e libsepol -e libsemanage -e checkpolicy | sort
checkpolicy-2.1.12-3.el7.x86_64
libselinux-2.1.13-15.el7.x86_64
libselinux-devel-2.1.13-15.el7.x86_64
libselinux-python-2.1.13-15.el7.x86_64
libselinux-utils-2.1.13-15.el7.x86_64
libsemanage-2.1.10-4.el7.x86_64
libsemanage-devel-2.1.10-4.el7.x86_64
libsemanage-python-2.1.10-4.el7.x86_64
libsepol-2.1.9-1.el7.x86_64
libsepol-devel-2.1.9-1.el7.x86_64
libsepol-static-2.1.9-1.el7.x86_64


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 ... passed
Suite: semanage_utilities
  Test: semanage_is_prefix ... passed
  Test: semanage_split_on_space ... passed
  Test: semanage_split ... passed
  Test: semanage_list ... passed
  Test: semanage_str_count ... passed
  Test: semanage_rtrim ... passed
  Test: semanage_findval ... passed
  Test: slurp_file_filter ... passed

--Run Summary: Type      Total     Ran  Passed  Failed
               suites        2       2     n/a       0
               tests        11      11      10       1
               asserts      80      80      73       7
make[1]: Leaving directory `/root/rpmbuild/BUILD/libsemanage/tests'
Comment 11 Daniel Walsh 2014-12-16 09:05:50 EST
While this should be fixed it does not need to be fixed in a RHEL update.
Comment 13 Petr Lautrbach 2015-03-16 16:58:41 EDT
The testsuite is not supposed to be run with root privileges:

$ head -n 5 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.

Note You need to log in before you can comment on or make changes to this bug.