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: test if semanage can import port definitions correctly
Date: Fri, 11 Sep 2026 13:20:06 GMT	[thread overview]
Message-ID: <178913280685.1.2338885332452341616.tests-selinux-09061d27391c@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 09061d27391c6f1e445b19d903ceb2f99aff0137
            Author : Milos Malik <mmalik@redhat.com>
            Date   : 2022-07-27T10:12:11+02:00
            Stats  : +41/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/09061d27391c6f1e445b19d903ceb2f99aff0137?branch=pr775-checkpolicy-revdeps

            Log:
            test if semanage can import port definitions correctly

Recent testing revealed that `semanage import` cannot import
SELinux port definitions correctly if `port -D` is present
among them. The TC reproduces the situation.

The TC covers BZ#2063353 and BZ#2108174.

---
diff --git a/policycoreutils/semanage-imports-port-defs/main.fmf b/policycoreutils/semanage-imports-port-defs/main.fmf
new file mode 100644
index 0000000..b06c827
--- /dev/null
+++ b/policycoreutils/semanage-imports-port-defs/main.fmf
@@ -0,0 +1,19 @@
+summary: Can semanage import SELinux port definitions correctly?
+test: ./test.sh
+contact: Milos Malik <mmalik@redhat.com>
+framework: beakerlib
+component:
+  - policycoreutils
+recommend:
+  - policycoreutils
+  - /usr/sbin/semanage
+duration: 10m
+enabled: true
+tier: 1
+link:
+  - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2063353
+  - verifies: https://bugzilla.redhat.com/show_bug.cgi?id=2108174
+adjust:
+  - enabled: false
+    when: distro == rhel-4, rhel-5, rhel-6
+    because: the test is not relevant there

diff --git a/policycoreutils/semanage-imports-port-defs/test.sh b/policycoreutils/semanage-imports-port-defs/test.sh
new file mode 100755
index 0000000..29a0ae3
--- /dev/null
+++ b/policycoreutils/semanage-imports-port-defs/test.sh
@@ -0,0 +1,22 @@
+#!/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 policycoreutils
+        rlRun "rpm -qf /usr/sbin/semanage"
+        rlRun "semanage port -a -t http_cache_port_t -r s0 -p tcp 3024"
+    rlPhaseEnd
+
+    rlPhaseStartTest "bz#2063353 + bz#2108174"
+        rlRun "semanage port -E"
+        rlRun "echo -e 'port -D\nport -a -t http_cache_port_t -r s0 -p tcp 3024'  | semanage import"
+        rlRun "semanage port -E"
+    rlPhaseEnd
+
+    rlPhaseStartCleanup
+        rlRun "semanage port -d -t http_cache_port_t -r s0 -p tcp 3024"
+    rlPhaseEnd
+rlJournalEnd
+

                 reply	other threads:[~2026-09-11 13:20 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=178913280685.1.2338885332452341616.tests-selinux-09061d27391c@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