public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Milos Malik <mmalik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: add a basic test of the getpolicyload program
Date: Fri, 11 Sep 2026 13:21:12 GMT	[thread overview]
Message-ID: <178913287289.1.2131725129836841853.tests-selinux-bc9e323cd441@fedoraproject.org> (raw)

            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
+

                 reply	other threads:[~2026-09-11 13:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178913287289.1.2131725129836841853.tests-selinux-bc9e323cd441@fedoraproject.org \
    --to=mmalik@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox