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: python-bindings: Fixes for Fedora CI
Date: Fri, 11 Sep 2026 13:19:17 GMT	[thread overview]
Message-ID: <178913275740.1.5639173362583042111.tests-selinux-f248ce123e75@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : tests/selinux
            Branch : pr775-checkpolicy-revdeps
            Commit : f248ce123e75f5f539893233771da0b3f3ca9c87
            Author : Petr Lautrbach <plautrba@redhat.com>
            Date   : 2021-07-29T11:25:51+02:00
            Stats  : +9/-8 in 2 file(s)
            URL    : https://src.fedoraproject.org/tests/selinux/c/f248ce123e75f5f539893233771da0b3f3ca9c87?branch=pr775-checkpolicy-revdeps

            Log:
            python-bindings: Fixes for Fedora CI

- fixed indentation

- the test requires python3-pip
Fixes:
    Running 'PipVersion=$(pip3 show selinux | grep Version)'
    /usr/share/beakerlib/testing.sh: line 891: pip3: command not found

- import sys
Fixes:
    Running 'python3 -c 'import selinux; rc = selinux.is_selinux_enabled(); sys.exit(rc)''
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    NameError: name 'sys' is not defined

---
diff --git a/libselinux/python-bindings/Makefile b/libselinux/python-bindings/Makefile
index f2068e4..9ba0613 100644
--- a/libselinux/python-bindings/Makefile
+++ b/libselinux/python-bindings/Makefile
@@ -53,7 +53,7 @@ $(METADATA): Makefile
 	@echo "Type:            Sanity" >> $(METADATA)
 	@echo "TestTime:        5m" >> $(METADATA)
 	@echo "RunFor:          libselinux" >> $(METADATA)
-	@echo "Requires:        python3-libselinux" >> $(METADATA)
+	@echo "Requires:        python3-libselinux python3-pip" >> $(METADATA)
 	@echo "Priority:        Normal" >> $(METADATA)
 	@echo "License:         GPLv2+" >> $(METADATA)
 	@echo "Confidential:    no" >> $(METADATA)

diff --git a/libselinux/python-bindings/runtest.sh b/libselinux/python-bindings/runtest.sh
index a8e9b11..dceb975 100755
--- a/libselinux/python-bindings/runtest.sh
+++ b/libselinux/python-bindings/runtest.sh
@@ -47,13 +47,14 @@ rlJournalStart
 
     rlPhaseStartTest "Import selinux module and try selinux.is_selinux_enabled()"
         rlRun "python3 -c 'import selinux'" 0
-	rlRun "python3 -c 'import selinux; rc = selinux.is_selinux_enabled(); sys.exit(rc)'" 0,1
-	rlRun "PYTHON_SELINUX_ENABLED=$?"
-	if selinuxenabled; then
-	    rlAssertEquals "SELinux is enabled" $PYTHON_SELINUX_ENABLED 1
-	else
-	    rlAssertNotEquals "SELinux is disabled" $PYTHON_SELINUX_ENABLED 0
-	fi
+        rlRun "python3 -c 'import selinux, sys; rc = selinux.is_selinux_enabled(); sys.exit(rc)'" 0,1
+
+        rlRun "PYTHON_SELINUX_ENABLED=$?"
+        if selinuxenabled; then
+            rlAssertEquals "SELinux is enabled" $PYTHON_SELINUX_ENABLED 1
+        else
+            rlAssertNotEquals "SELinux is disabled" $PYTHON_SELINUX_ENABLED 0
+        fi
     rlPhaseEnd
 
     rlPhaseStartCleanup

                 reply	other threads:[~2026-09-11 13:19 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=178913275740.1.5639173362583042111.tests-selinux-f248ce123e75@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