Commit graph

152 commits

Author SHA1 Message Date
Jiri Jaburek
affc7c2cfc use epel/epel instead of distribution/epel library
The README on

  https://github.com/beakerlib/distribution/tree/master/epel

states that

  This is a compatibility layer to overcome a transitional
  phase from distribution/epel to epel/epel.

So use epel/epel instead.

Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
2026-05-14 08:38:48 +00:00
Ondrej Mosnacek
a011b35f36
Add a test for unexpected denials from sysctl -a
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2026-03-12 13:22:29 +01:00
Ondrej Mosnacek
35144ba78d
kernel/CVE-2025-71085: fix netlabel setup
The original reproducer would break network traffic outside IPv6
localhost- make sure there are default rules for unlabeled traffic so
that the machine doesn't lose network connectivity during test.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2026-02-24 11:35:17 +01:00
Ondrej Mosnacek
0d794bfa99 Add test for CVE-2025-71085
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2026-02-24 08:32:32 +00:00
Ondrej Mosnacek
dc54730c66
Add test for unexpected fanotify denials on anonymous pipes
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2026-02-16 10:13:08 +01:00
Vit Mojzis
caa904c01f Fix "adjust" statements
Whenever a key is defined in the tmt hierarchy and some child also
defines that key, the child's will overwrite the previous one. The "+"
changes the operation to "append", so the content of key+ in the child
is added to the existing key.

Meaning that any "adjust" statement in a test plan using a test that
defines it's own "adjust:" is ignored.

Since we are expecting other statements to be appended to the "adjust"
sections, the content of each section needs to be a single list item as
opposed to a set of key-value pairs (first line needs to start with a
hyphen).

- Replace all "adjust:" sections with "adjust+:" in order to honor any
  adjustments further up the tree (parent tests, or test plans).
- Fix malformed "adjust" sections (sets of key-value pairs)

Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
2025-10-09 20:22:22 +02:00
Milos Malik
1eb61b3a69 exclude unsuitable tests from image mode testing
Tests which are not suitable (various reasons) for image mode
testing will get the avoidImageMode tag. If their conditions improve,
the tag can be removed.
2025-09-26 14:45:52 +02:00
Milos Malik
0d14d2424a find tests which do reboots and tag them properly
These tests should have the 'reboot' tag. The tag can then be used
as a filter for running tests.
2025-09-25 19:48:11 +02:00
Milos Malik
d2d1130211 inform the framework to expect SELinux denials
Some tests intentionally trigger SELinux denials during their run
and there is no need to fail because of them. The default value
of avc check is not suitable for these tests.
2025-09-04 11:35:02 +02:00
Ondrej Mosnacek
0c58cf0a60
kernel: make flamegraph generation opt-in
To avoid running code from untrusted repositories, make the generation
of flamegraphs optional (via a test parameter) and disabled by default.
The test parameter should only be set to 1 as needed when running the
test manually and kept disabled in automated test runs.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2025-07-24 17:05:11 +02:00
Ondrej Mosnacek
f0131ccaca
kernel/selinux-testsuite: bump upstream ref
The only important commit is 72e60b601832 ("policy/test_secretmem.te:
add anon_inode perms required in Linux v6.16-rc5"), which fixes the
testsuite to work on 6.16-rc5+ kernels.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2025-07-09 11:38:04 +02:00
Ondrej Mosnacek
27ab7e5e8a
kernel/selinux-testsuite: bump ustream commit ref
Mainly to pull "tests/inet_socket: properly detect IPSEC support", which
makes the testsuite run successfully on automotive RHEL again.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2025-06-23 15:57:12 +02:00
Ondrej Mosnacek
1b68d30d64
kernel/selinux-testsuite: bump ustream commit ref
This pulls various fixes and new tests.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2025-06-10 15:43:30 +02:00
Ondrej Mosnacek
b873a41d17
kernel/selinux-testsuite: apply patch series to cover cap2_userns
We need to ensure that at least one cap2_userns permission has test
coverage to check a formal box somewhere. Apply an upstream patch series
that adds this coverage.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2025-06-06 16:04:20 +02:00
Jan Onderka
07867a3e8f add uniq ID and fusa tag to tests 2025-05-13 18:10:23 +00:00
Milos Malik
5ea123d59e add FMF id for the selinux-testsuite 2025-04-15 14:26:28 +02:00
Milos Malik
a7b41e8ca1 separate failing tests from no-tier tests
Apply the failinfedora tag to the tests which fail on Fedora rawhide.
Add a special test plan for regular runs of these failing tests.

Make sure that the no-tier test plan contains tests which succeed on
Fedora rawhide.
2025-04-01 08:28:41 +02:00
Ondrej Mosnacek
9dce63b31d
kernel/selinux-testsuite: apply patch to fix hang on CS10
This applies the following patch that fixes behavior with the latest
RHEL-10 kernels:
https://lore.kernel.org/all/20250131152122.1452103-1-omosnace@redhat.com/

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2025-01-31 16:26:12 +01:00
Ondrej Mosnacek
2401e40bac
kernel: improve kernel pkg name detection
When kernel-uk-virt is installed, the rpm query returns more than one
result, leading to (non-fatal) errors in the Setup phase. Query for the
kernel image path instead to avoid this.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-09-09 11:29:40 +02:00
Ondrej Mosnacek
5e03405ed4 Add a test for two-way SCTP association setup
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-08-29 10:06:21 +00:00
Ondrej Mosnacek
6efe97887e
kernel/selinux-testsuite: apply a patch for ELN/EL10 compatibility
Fedora ELN / RHEL-10 has disabled CONFIG_NET_KEY, so apply a patch that
allows the testsuite to succeed by skipping the key_socket test when it
is not supported.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-08-28 15:18:33 +02:00
Ondrej Mosnacek
e1d2c9835a
kernel/xfrm-refcount-overflow: fix kernel pkg name detection
Do it the same way as in commit 3e8824e0aa ("kernel/selinux-testsuite:
fix kernel pkg name detection").

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-06-07 11:24:58 +02:00
Ondrej Mosnacek
9e9a717326
kernel/...: fix --skip-broken detection for DNF5
The detection of this flag is broken with DNF5, because it now only
appears under `dnf install --help`. Also, DNF5 now implements the logic
we want (skipping packages that are not available, rather than "broken")
under a new --skip-unavailable flag.

Therefore, detect both using `dnf install --help` and also check for
--skip-unavailable first.

Without this fix the tests try to install each package one by one with
DNF5, which is suboptimal.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-06-07 09:58:36 +02:00
Ondrej Mosnacek
ed0073cc4c Add a test for problematic NOP options left behind by NetLabel
When NetLabel is configured to send unlabeled traffic, it should fully
remove CIPSO options from the IP packets. This test verifies that they
are indeed removed (and not just replaced with IPOPT_NOP or IPOPT_END).

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-04-18 17:18:54 +00:00
Ondrej Mosnacek
4024dfa46f
kernel/selinux-testsuite: another hotfix for install_t workaround
I can't believe I got it wrong AGAIN... I missed the ! operator.... Now
it should be correct, as was finally able to test it.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-03-11 10:12:42 +01:00
Ondrej Mosnacek
d95d39273f
kernel/selinux-testsuite: hotfix for install_t workaround
The version comparison is wrong. Fix it.

Fixes: 485e8279b7 ("kernel/selinux-testsuite: remove install_t references on RHEL6")
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-03-08 09:26:56 +01:00
Ondrej Mosnacek
586855095d
Add a test for XFRM refcount underflow
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-03-04 13:40:26 +01:00
Ondrej Mosnacek
485e8279b7
kernel/selinux-testsuite: remove install_t references on RHEL6
Otherwise the policy fails to build there.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-02-29 16:12:35 +01:00
Ondrej Mosnacek
e1ad035bde
kernel/selinux-testsuite: add workaround for CONFIG_QFMT_V2=n
This is needed for the testsuite to be runnable on RH automotive
kernels.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-02-28 10:38:41 +01:00
Ondrej Mosnacek
87346d0760
kernel/selinux-testsuite: add workaround for CONFIG_SCSI_ISCSI_ATTRS=n
This is needed for the testsuite to be runnable on RH automotive
kernels.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-02-26 20:02:10 +01:00
Ondrej Mosnacek
3e8824e0aa
kernel/selinux-testsuite: fix kernel pkg name detection
The directory may also be owned by <name>-modules-core rather than
<name>-core in some cases. Use the "config" file as the reference
instead.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-02-26 20:02:10 +01:00
Ondrej Mosnacek
2b69b8c347
kernel/selinux-testsuite: hotfix for RHEL-6
The install_t workaround for rpm-ostree doesn't work on RHEL-6, so make
it conditional on /run/ostree-booted, so that it is only applied when
necessary.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-02-15 14:22:25 +01:00
Ondrej Mosnacek
1a3d30f8dd kernel/selinux-testsuite: add a fix and a workaround for rpm-ostree
1. Bump the upstream commit to pull in [1].
2. Apply a workaround to compensate for [2] not yet being applied
   everywhere where it matters.

[1] f9f4a604b5
[2] https://github.com/fedora-selinux/selinux-policy/pull/2029

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2024-02-13 08:46:14 +00:00
bgrech
4119cf83ed Add support for rpm-ostree as a package manager for installDeps 2024-02-07 16:01:30 +00:00
Ondrej Mosnacek
a695917478
kernel/selinux-testsuite: fix kernel package detection
There is no /lib/modules/.../vmlinuz file on RHEL-7 kernels, so just use
the parent directory, which should be owned by the same package.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-08-03 17:54:43 +02:00
Ondrej Mosnacek
5ab7ce1a0c
kernel/selinux-testsuite: improve kernel package detection
Instead of relying on the existing kernel package naming and versioning
conventions, which are subject to change in RHEL, determine the main
kernel package name via `rpm -qf "/lib/modules/$(uname -r)/vmlinuz"` and
derive the rest from that.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-07-21 13:36:10 +02:00
Ondrej Mosnacek
2b3d261501
kernel/selinux-testsuite: enable SCTP peeloff tests on RHEL-9 as appropriate
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-07-21 12:56:13 +02:00
Ondrej Mosnacek
9bcbe2e024
kernel/selinux-testsuite: bump ustream commit ref
This mainly pulls in the new inet_socket/mptcp subtest that provides
coverage for the MPTCP protocol.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-07-04 13:10:50 +02:00
Ondrej Mosnacek
bdffd24e92
kernel/labeling_before_policy_load: misc tweaks
- ensure the current booted kernel is set as default
  (fixes the case where a newer kernel package has been installed since
   boot)
- add Beaker compat workaround
- add descriptions to most rlRun asserts
- run zipl also after the cleanup `dracut -f` invocation

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-05-18 16:19:56 +02:00
Ondrej Mosnacek
f6cb99446a
kernel/mount-options-memleak: run zipl if it's installed
On s390x zipl needs to be run after grubby for the settings to be
applied correctly.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-05-17 11:29:47 +02:00
Ondrej Mosnacek
a7e47a4b19
kernel/mount-options-memleak: print kernel cmdline after reboot
This may help diagnose unexpected issues with the test.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-05-17 11:29:00 +02:00
Ondrej Mosnacek
2dfd5cafcb
kernel/mount-options-memleak: fix REBOOTCOUNT variable name
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-05-17 10:30:48 +02:00
Ondrej Mosnacek
7ce3757ef6 Add a test for memory leak when SELinux mount options are used
Such memory leak was fixed upstream in the past. This test verifies that
it remains fixed.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-05-16 13:54:25 +00:00
Ondrej Mosnacek
a4390a7a1e
kernel/selinux-testsuite: bump upstream commit
Notable changes:
- fixed DH prime format in 'keys' test
- native quota support now used for ext4 when available
  - needs special exception on RHEL-7 where it is broken
- fixed stderr noise from 'yes' command
- fixed SIGIO tests to work under CONFIG_LEGACY_TIOCSTI=n

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2023-03-06 14:31:52 +01:00
Ondrej Mosnacek
96c98bb01d
kernel/selinux-testsuite: bump upstream commit
Effective changes:
- fix the policy to allow the new user_namespace::create permission
  where needed
- fix the code to build without warnings with latest SELinux userspace

The rest is various cleanups or changes not affecting Fedora/RHEL.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-12-12 16:19:39 +01:00
Ondrej Mosnacek
269502e64d
kernel/labeling_before_...: use --regenerate-all also during cleanup
Otheriwse older kernel entries would still have our injected scripts in
the initramfs after test execution.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-09-15 15:20:55 +02:00
Ondrej Mosnacek
ef2646911d
Port kernel tests from downstream
Forward-port of downstream kernel tests that haven't been upstreamed
yet, manually converted to TMT.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-09-13 14:24:47 +02:00
Ondrej Mosnacek
25176f01ce
kernel/genfs_fallback: use vfat instead of ramfs
ramfs is now treated as an xattr-supporting filesystem and has the
fs_use_trans directive in the base policy. Thus switch to vfat, which is
still genfs.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-09-13 11:06:41 +02:00
Ondrej Mosnacek
03bf3a0e70
kernel/selinux-testsuite: fail hard when PR/patch application fails
Replace the current soft fallback to raw GIT_BRANCH when a required PR
or Patchwork patch fails to merge/apply with a hoard failure, similar to
what we do when cloning the repo fails.

The main motivation is to not have CKI treat this situation as a
failure, but it also a good practice to ensure we either run the
intended version of the test or no test at all.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-08-31 10:23:41 +02:00
Ondrej Mosnacek
21a2855558
kernel/selinux-testsuite: bump upstream commit to c592d7f
Effective changes:
* fix for https://gitlab.com/redhat/centos-stream/tests/kernel/kernel-tests/-/issues/1352
* major testsuite policy refactoring
* various minor fixes/tweaks

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2022-08-30 20:18:33 +02:00