public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Vit Mojzis <vmojzis@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: policycoreutils/sctp_test: Fix a few minor issues
Date: Fri, 11 Sep 2026 13:17:35 GMT	[thread overview]
Message-ID: <178913265501.1.6742419331182671411.tests-selinux-34b485bf017d@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 34b485bf017da922307fc4a6b7cec0aaf3154284
            Author : Vit Mojzis <vmojzis@redhat.com>
            Date   : 2019-11-15T07:57:02+01:00
            Stats  : +11/-3 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/34b485bf017da922307fc4a6b7cec0aaf3154284?branch=pr775-checkpolicy-revdeps

            Log:
            policycoreutils/sctp_test: Fix a few minor issues

- userapp_t didn't have permission to write into temporary file which
caused failure of the test even when sctp_test worked properly
- Fix context of sctp_test during clean-up
- Add listing of the new portcons to check they have been properly added

Fixes: https://src.fedoraproject.org/tests/selinux/issue/21

---
diff --git a/policycoreutils/sctp_test/runtest.sh b/policycoreutils/sctp_test/runtest.sh
index d8f386c..a7e55c7 100755
--- a/policycoreutils/sctp_test/runtest.sh
+++ b/policycoreutils/sctp_test/runtest.sh
@@ -53,7 +53,6 @@ rlJournalStart
         rlRun "semodule -i userapp.cil" 0 "Loading custom policy module"
         rlRun "chcon -t userapp_exec_t `which sctp_test`" 0 "Change file context of sctp_test"
         OUTPUT_FILE=`mktemp`
-        rlRun "chcon -t tmp_t ${OUTPUT_FILE}"
         rlRun "setenforce 1"
         rlRun "sestatus"
     rlPhaseEnd
@@ -61,16 +60,24 @@ rlJournalStart
     rlPhaseStartTest
         rlRun "semanage port -a -t ${PORT_TYPE} -p sctp ${SERVER_PORT}" 0
         rlRun "semanage port -a -t ${PORT_TYPE} -p sctp ${CLIENT_PORT}" 0
+        rlRun "semanage port -l 2>&1 > ${OUTPUT_FILE}" 0
+        rlRun "grep -E \"${PORT_TYPE}.+sctp.+${CLIENT_PORT}\" ${OUTPUT_FILE}"
+        if [ $? -ne 0 ]; then cat ${OUTPUT_FILE}; fi
+        rlRun "semanage port -l -C 2>&1 > ${OUTPUT_FILE}" 0
+        rlRun "grep -E \"${PORT_TYPE}.+sctp.+${SERVER_PORT}\" ${OUTPUT_FILE}"
+        if [ $? -ne 0 ]; then cat ${OUTPUT_FILE}; fi
         rlRun "sctp_test -H localhost -P ${SERVER_PORT} -l 2>&1 > ${OUTPUT_FILE} &" 0
         rlRun "sctp_test -H localhost -P ${CLIENT_PORT} -h localhost -p ${SERVER_PORT} -s" 0
-        rlAssertGrep "recvmsg" ${OUTPUT_FILE} -i
+        rlRun "grep 'recvmsg' ${OUTPUT_FILE} -i" 0
+        if [ $? -ne 0 ]; then cat ${OUTPUT_FILE}; fi
     rlPhaseEnd
 
     rlPhaseStartCleanup
-        rlRun "rm ${OUTPUT_FILE}"
+        rlRun "rm -f ${OUTPUT_FILE}"
         rlRun "killall sctp_test"
         rlRun "semanage port -D"
         rlRun "semodule -r userapp"
+        rlRun "restorecon -Rv `which sctp_test`"
     rlPhaseEnd
 rlJournalPrintText
 rlJournalEnd

diff --git a/policycoreutils/sctp_test/userapp.cil b/policycoreutils/sctp_test/userapp.cil
index 88e065e..4a5114a 100644
--- a/policycoreutils/sctp_test/userapp.cil
+++ b/policycoreutils/sctp_test/userapp.cil
@@ -36,5 +36,6 @@
 (allow userapp_t userapp_exec_t (file (map)))
 (allow userapp_t userapp_exec_t (file (entrypoint execute read)))
 (allow userapp_t kernel_t (system (module_request)))
+(allow userapp_t user_tmp_t (file (getattr open write append)))
 
 

                 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=178913265501.1.6742419331182671411.tests-selinux-34b485bf017d@fedoraproject.org \
    --to=vmojzis@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