public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Ondrej Mosnacek <omosnace@redhat.com>
To: git-commits@fedoraproject.org
Subject: [tests/selinux] pr775-checkpolicy-revdeps: selinux-testsuite: Move RHEL-specific hacks under one conditional
Date: Fri, 11 Sep 2026 13:18:23 GMT	[thread overview]
Message-ID: <178913270380.1.12751483704124565128.tests-selinux-8f418f8a190d@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 8f418f8a190d7b5fb363ff4c1483657a4ad0bb93
            Author : Ondrej Mosnacek <omosnace@redhat.com>
            Date   : 2020-10-30T16:39:57+01:00
            Stats  : +38/-39 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/8f418f8a190d7b5fb363ff4c1483657a4ad0bb93?branch=pr775-checkpolicy-revdeps

            Log:
            selinux-testsuite: Move RHEL-specific hacks under one conditional

Put all the RHEL-specific checks/workarounds under one common rlIsRHEL
conditional to make it clear that they apply to RHEL.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>

---
diff --git a/kernel/selinux-testsuite/runtest.sh b/kernel/selinux-testsuite/runtest.sh
index e7e69e0..9e8707a 100755
--- a/kernel/selinux-testsuite/runtest.sh
+++ b/kernel/selinux-testsuite/runtest.sh
@@ -308,16 +308,6 @@ rlJournalStart
             rlRun "sed -i 's/3.18/3.9/' $file" 0 \
                 "Fix up kernel version in nnp test"
         done
-        if rlIsRHEL ; then
-            if kver_ge 4.18; then
-                force_tests+=" sctp"
-            fi
-            if kver_ge 4.18.0-80.19; then
-                force_tests+=" cgroupfs_label"
-            fi
-            # CONFIG_KEYS_DH_COMPUTE not enabled on RHEL-8 :(
-            exclude_tests+=" keys"
-        fi
         if rlIsRHEL 5 ; then
             rlRun "sed -i '/unconfined_devpts_t/d' policy/test_policy.if" 0
 
@@ -346,39 +336,48 @@ rlJournalStart
         rlRun "sed -i 's/tm\.tv_sec = [0-9]*;/tm.tv_sec = $NETWORK_TIMEOUT;/' ./tests/*/*.c" 0 \
             "Tweak timeout in networking tests" # 2 secs is too little for SCTP test
 
-        if kver_lt "3.10" || rlIsRHEL '<7.4'; then
-            # filesystem tests don't work well on RHEL <7.4
-            exclude_tests+=" filesystem"
-        fi
+        if rlIsRHEL; then
+            if kver_lt "3.10" || rlIsRHEL '<7.4'; then
+                # filesystem tests don't work well on RHEL <7.4
+                exclude_tests+=" filesystem"
+            fi
 
-        if kver_lt "3.10.0-349"; then
-            # c4684bbdac07 [security] selinux: Permit bounded transitions under NO_NEW_PRIVS or NOSUID
-            # da74590f6501 [security] selinux: reject setexeccon() on MNT_NOSUID applications with -EACCES
-            exclude_tests+=" nnp_nosuid"
-        fi
+            if kver_lt "3.10.0-349"; then
+                # c4684bbdac07 [security] selinux: Permit bounded transitions under NO_NEW_PRIVS or NOSUID
+                # da74590f6501 [security] selinux: reject setexeccon() on MNT_NOSUID applications with -EACCES
+                exclude_tests+=" nnp_nosuid"
+            fi
 
-        if kver_lt "3.10.0-693"; then
-            # I don't know when exactly this test starts passing, so I'm just
-            # disabling it for anything below the RHEL-7.4 kernel...
-            exclude_tests+=" inet_socket"
-        fi
+            if kver_lt "3.10.0-693"; then
+                # I don't know when exactly this test starts passing, so I'm just
+                # disabling it for anything below the RHEL-7.4 kernel...
+                exclude_tests+=" inet_socket"
+            fi
 
-        if kver_lt "3.10.0-875"; then
-            rlLog "No xperms support => disable xperms testing"
-            rlRun "sed -i '/TARGETS += test_ioctl_xperms\.te/d' policy/Makefile"
-            rlRun "sed -i 's/\$kernver >= 30/\$kernver >= 999999/' tests/ioctl/test"
-        fi
-        # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1613056
-        # (if running kernel version sorts inside the known-bug window, then
-        # we need to apply the workaround)
-        if kver_ge "3.10.0-875" && kver_lt "3.10.0-972"; then
-            rlLog "Applying workaround for BZ 1613056..."
-            rlRun "cat >>policy/test_ipc.te <<<'allow_map(ipcdomain, tmpfs_t, file)'"
-            rlRun "cat >>policy/test_mmap.te <<<'allow_map(test_execmem_t, tmpfs_t, file)'"
-            rlRun "cat >>policy/test_mmap.te <<<'allow_map(test_no_execmem_t, tmpfs_t, file)'"
-        fi
+            if kver_lt "3.10.0-875"; then
+                rlLog "No xperms support => disable xperms testing"
+                rlRun "sed -i '/TARGETS += test_ioctl_xperms\.te/d' policy/Makefile"
+                rlRun "sed -i 's/\$kernver >= 30/\$kernver >= 999999/' tests/ioctl/test"
+            fi
+            # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1613056
+            # (if running kernel version sorts inside the known-bug window, then
+            # we need to apply the workaround)
+            if kver_ge "3.10.0-875" && kver_lt "3.10.0-972"; then
+                rlLog "Applying workaround for BZ 1613056..."
+                rlRun "cat >>policy/test_ipc.te <<<'allow_map(ipcdomain, tmpfs_t, file)'"
+                rlRun "cat >>policy/test_mmap.te <<<'allow_map(test_execmem_t, tmpfs_t, file)'"
+                rlRun "cat >>policy/test_mmap.te <<<'allow_map(test_no_execmem_t, tmpfs_t, file)'"
+            fi
+
+            if kver_ge 4.18; then
+                force_tests+=" sctp"
+            fi
+            if kver_ge 4.18.0-80.19; then
+                force_tests+=" cgroupfs_label"
+            fi
+            # CONFIG_KEYS_DH_COMPUTE not enabled on RHEL-8 :(
+            exclude_tests+=" keys"
 
-        if rlIsRHEL; then
             # Needs:
             # e4cfa05e9bfe ("selinux: Add xfs quota command types")
             # (not backported to any RHEL at this point - TODO update the check once it is)

                 reply	other threads:[~2026-09-11 13:18 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=178913270380.1.12751483704124565128.tests-selinux-8f418f8a190d@fedoraproject.org \
    --to=omosnace@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