Commit graph

9 commits

Author SHA1 Message Date
Ondrej Mosnacek
596ec7fafe Make all relevancy expressions use comparison operators
Rather than enumerating RHEL versions, use comparison against
"known-good" version to make the expressions easier to read and
understand.

Also convert users of '~<' to '<', as '~<' compares only minor versions
within the same major.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2020-12-15 12:38:32 +01:00
Milos Malik
15f6d6c612 update test relevancy based on packages availability
Relevancy changes are made based on recommendations from:
  tmt test lint --fix

Some packages are available for Fedoras only and are not available
for RHELs at all.
Some packages are available for latest RHEL major versions only.
2020-12-15 11:53:28 +01:00
Petr Lautrbach
8c7670c1e6 policycoreutils/modules: Use filesystem_type instead of fs_t
Sometime, /tmp can be tmpfs_t so we need to allow test_t to be associated to all
filesystem types.

Fixes:
:: [ 08:16:37 ] :: [  BEGIN   ] :: Running 'chcon -t test_t test_file'
chcon: failed to change context of 'test_file' to ‘unconfined_u:object_r:test_t:s0’: Permission denied
:: [ 08:16:37 ] :: [   FAIL   ] :: Command 'chcon -t test_t test_file' (Expected 0, got 1)

type=AVC msg=audit(1552392203.833:2467): avc:  denied  { associate } for  pid=571 comm="chcon" name="test_file" dev="tmpfs" ino=77668 scontext=unconfined_u:object_r:test_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=filesystem permissive=0
2019-03-12 13:37:06 +01:00
Petr Lautrbach
b41ff2e4c1 Fix path meta data
Commit 769880f7 added path meta data into .fmf files. As path's didn't have /
at the beginning test were not created correctly.

Fixes:
fatal: [fedora29]: FAILED! => {
    "msg": [
        "Tests failed: True",
        "Tests msg: FAIL selinuxselinux-policy/policy-rpm-macros",
        "FAIL selinuxcheckpolicy/checkpolicy",
        "FAIL selinuxlibsepol/sepol_check_context",
        "FAIL selinuxlibsemanage/verify-options-in-semanage-conf",
...

$ cat artifacts/FAIL_selinuxcheckpolicy-checkpolicy.log
FAIL test selinuxcheckpolicy/checkpolicy does not appear to be a file or directory
2018-10-14 21:52:42 +02:00
Petr Lautrbach
66a56a3e9b Revert "Fix path meta data"
This reverts commit 4cf575fc0b.

Some of paths were not correctly updated

Fixes:
        "FAIL selinux/olicycoreutils/booleans",
2018-10-14 21:48:49 +02:00
Petr Lautrbach
4cf575fc0b Fix path meta data
Commit 769880f7 added path meta data into .fmf files. As path's didn't have /
at the beginning test were not created correctly.

Fixes:
fatal: [fedora29]: FAILED! => {
    "msg": [
        "Tests failed: True",
        "Tests msg: FAIL selinuxselinux-policy/policy-rpm-macros",
        "FAIL selinuxcheckpolicy/checkpolicy",
        "FAIL selinuxlibsepol/sepol_check_context",
        "FAIL selinuxlibsemanage/verify-options-in-semanage-conf",
...

$ cat artifacts/FAIL_selinuxcheckpolicy-checkpolicy.log
FAIL test selinuxcheckpolicy/checkpolicy does not appear to be a file or directory
2018-10-14 21:31:10 +02:00
Petr Šplíchal
769880f739 Define path metadata for each test
Adding attribute "path" to each test according to the CI metadata
specification [1]. This also resolves problem with autodetecting
empty directories [2] which will be fixed in the next fmf release.

[1] https://fedoraproject.org/wiki/CI/Metadata#Path
[2] https://github.com/psss/fmf/pull/48
2018-10-11 10:45:08 +02:00
Petr Lautrbach
a93de8135b policycoreutils/modules: Use temporary directory instead of hardcoded "test" 2018-08-03 10:26:15 +02:00
Jan Zarsky
604c930344 test basic module functionality
The test compiles a TE module, loads it via semodule, and checks that
the rules are enforced. The same is done with a CIL module. Module
overriding using priorities and module disabling is also tested.

This test requires policycoreutils and selinux-policy-devel packages.
2018-07-31 21:22:12 +02:00