public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: add a basic test of the getpolicyload program
@ 2026-09-11 13:21 Milos Malik
0 siblings, 0 replies; only message in thread
From: Milos Malik @ 2026-09-11 13:21 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : tests/selinux
Branch : pr775-checkpolicy-revdeps
Commit : bc9e323cd44129e3693a8c2fa6616b912bd8aaaa
Author : Milos Malik <mmalik@redhat.com>
Date : 2023-11-21T10:00:21+01:00
Stats : +48/-0 in 2 file(s)
URL : https://src.fedoraproject.org/tests/selinux/c/bc9e323cd44129e3693a8c2fa6616b912bd8aaaa?branch=pr775-checkpolicy-revdeps
Log:
add a basic test of the getpolicyload program
SELinux user-space version 3.6 introduced a new program called
getpolicyload. Unfortunately, there is no man page which would
describe the program.
Purpose of this automated test is to test the basic function of
the getpolicyload program that is obvious from its behavior.
---
diff --git a/libselinux/getpolicyload/main.fmf b/libselinux/getpolicyload/main.fmf
new file mode 100644
index 0000000..4fb2496
--- /dev/null
+++ b/libselinux/getpolicyload/main.fmf
@@ -0,0 +1,21 @@
+summary: basic test for the getpolicyload program
+test: ./runtest.sh
+framework: beakerlib
+component:
+ - libselinux
+recommends:
+ - libselinux
+ - libselinux-utils
+ - policycoreutils
+duration: 5m
+enabled: true
+link:
+ - relates: https://issues.redhat.com/browse/RHEL-16233
+adjust:
+ - enabled: false
+ when: distro == rhel-4, rhel-5, rhel-6, rhel-7, rhel-8
+ because: the getpolicyload program is not available there
+ - enabled: false
+ when: distro < fedora-40
+ because: the getpolicyload program is not available there
+
diff --git a/libselinux/getpolicyload/runtest.sh b/libselinux/getpolicyload/runtest.sh
new file mode 100755
index 0000000..1954763
--- /dev/null
+++ b/libselinux/getpolicyload/runtest.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+. /usr/share/beakerlib/beakerlib.sh || exit 1
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlAssertRpm libselinux
+ rlAssertRpm libselinux-utils
+ rlAssertRpm policycoreutils
+ rlRun "sestatus"
+ rlPhaseEnd
+
+ rlPhaseStartTest
+ for CMD in "semodule -R" "semodule -B" "semodule --refresh" "load_policy" "load_policy -i" ; do
+ BEFORE=`getpolicyload`
+ rlRun "getpolicyload"
+ rlRun "${CMD}"
+ AFTER=`getpolicyload`
+ rlRun "getpolicyload"
+ rlAssertGreater "the number of policy loads increased" ${AFTER} ${BEFORE}
+ done
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ rlPhaseEnd
+rlJournalEnd
+
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 13:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:21 [tests/selinux] pr775-checkpolicy-revdeps: add a basic test of the getpolicyload program Milos Malik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox