public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Petr Lautrbach <plautrba@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: semanage-port-add-delete-problems: Check for MAC_POLICY_LOAD after semanage
Date: Fri, 11 Sep 2026 13:17:31 GMT	[thread overview]
Message-ID: <178913265112.1.8775931011829809811.tests-selinux-9d4050e61ea3@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 9d4050e61ea31c063a37359d3bc276643d5ec06c
            Author : Petr Lautrbach <plautrba@redhat.com>
            Date   : 2019-03-13T16:33:04+01:00
            Stats  : +4/-10 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/9d4050e61ea31c063a37359d3bc276643d5ec06c?branch=pr775-checkpolicy-revdeps

            Log:
            semanage-port-add-delete-problems: Check for MAC_POLICY_LOAD after semanage

We need to check whether a new policy is loaded after 'semanage port -a ...'.
The best way to do it is to check whether kernel reported MAC_POLICY_LOAD.

The original check was error prone.

Fixes:
[   PASS   ] :: Command 'ausearch -m user_avc -ts 03/13/2019 08:10:47 > /tmp/tmp.3RAR6INhvL' (Expected 0,1, got 0)
[  BEGIN   ] :: Running 'cat /tmp/tmp.3RAR6INhvL'
----
time->Wed Mar 13 08:10:53 2019
type=USER_AVC msg=audit(1552479053.819:1407): pid=698 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  received policyload notice (seqno=65)  exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'
[   FAIL   ] :: number of lines in /tmp/tmp.3RAR6INhvL should be 0 (Assert: expected 0, got 3)

---
diff --git a/policycoreutils/semanage-port-add-delete-problems/runtest.sh b/policycoreutils/semanage-port-add-delete-problems/runtest.sh
index 2bd9c9a..ef13e5f 100755
--- a/policycoreutils/semanage-port-add-delete-problems/runtest.sh
+++ b/policycoreutils/semanage-port-add-delete-problems/runtest.sh
@@ -82,11 +82,8 @@ rlJournalStart
         rlRun "semanage port -a -p tcp -t $PORT_TYPE 5005"
         sleep 2
 
-        # Check for user_avc
-        rlRun "ausearch -m user_avc -ts ${START_DATE_TIME} > ${OUTPUT_FILE}" 0,1
-        LINE_COUNT=`wc -l < ${OUTPUT_FILE}`
-        rlRun "cat ${OUTPUT_FILE}"
-        rlAssert0 "number of lines in ${OUTPUT_FILE} should be 0" ${LINE_COUNT}
+        # Check for MAC_POLICY_LOAD
+        rlRun "ausearch -m MAC_POLICY_LOAD -ts ${START_DATE_TIME}" 0
 
         # deleting a port number from a type
         START_DATE_TIME=`date "+%m/%d/%Y %T"`
@@ -94,11 +91,8 @@ rlJournalStart
         rlRun "semanage port -d -p tcp -t $PORT_TYPE 5005"
         sleep 2
 
-        # Check for user_avc
-        rlRun "ausearch -m user_avc -ts ${START_DATE_TIME} > ${OUTPUT_FILE}" 0,1
-        LINE_COUNT=`wc -l < ${OUTPUT_FILE}`
-        rlRun "cat ${OUTPUT_FILE}"
-        rlAssert0 "number of lines in ${OUTPUT_FILE} should be 0" ${LINE_COUNT}
+        # Check for MAC_POLICY_LOAD
+        rlRun "ausearch -m MAC_POLICY_LOAD -ts ${START_DATE_TIME}" 0
     rlPhaseEnd
     fi
 

                 reply	other threads:[~2026-09-11 13:17 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=178913265112.1.8775931011829809811.tests-selinux-9d4050e61ea3@fedoraproject.org \
    --to=plautrba@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