public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: kernel/selinux-testsuite: work around CKI BTF issue
@ 2026-09-11 13:17 Ondrej Mosnacek
  0 siblings, 0 replies; only message in thread
From: Ondrej Mosnacek @ 2026-09-11 13:17 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : 292f0937bec9ce945bc622e4d753a6a938447e33
            Author : Ondrej Mosnacek <omosnace@redhat.com>
            Date   : 2020-06-01T19:17:25+02:00
            Stats  : +9/-0 in 1 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/292f0937bec9ce945bc622e4d753a6a938447e33?branch=pr775-checkpolicy-revdeps

            Log:
            kernel/selinux-testsuite: work around CKI BTF issue

The CKI kernels are cross-compiled on x86_64, so they generate an
invalid (little-endian) in-kernel BTF on big-endian systems. Work around
this by skipping the BPF test if little-endian BTF is detected on s390x.

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

---
diff --git a/kernel/selinux-testsuite/runtest.sh b/kernel/selinux-testsuite/runtest.sh
index 27c2969..5f18ed6 100755
--- a/kernel/selinux-testsuite/runtest.sh
+++ b/kernel/selinux-testsuite/runtest.sh
@@ -367,6 +367,15 @@ rlJournalStart
                 exclude_tests+=" module_load"
             fi
 
+            # CKI kernels are cross-compiled and generate invalid BTF for s390x
+            if [ "$(rlGetPrimaryArch)" = s390x ] && [ -r /sys/kernel/btf/vmlinux ]; then
+                # Check whether the magic number is stored big-endian
+                btf_head="$(head -c 2 /sys/kernel/btf/vmlinux | hexdump -e '/1 "%02x"')"
+                if [ "$btf_head" != eb9f ]; then
+                    exclude_tests+=" bpf"
+                fi
+            fi
+
             if [ -n "$exclude_tests" ] ; then
                 rlRun "sed -i '/^[^[:space:]]*:\(\| .*\)\$/i SUBDIRS:=\$(filter-out $exclude_tests, \$(SUBDIRS))' tests/Makefile" 0 \
                     "Exclude not applicable tests: $exclude_tests"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-11 13:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 13:17 [tests/selinux] pr775-checkpolicy-revdeps: kernel/selinux-testsuite: work around CKI BTF issue Ondrej Mosnacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox