public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/selinux] pr775-checkpolicy-revdeps: python-bindings: Fixes for Fedora CI
@ 2026-09-11 13:19 Petr Lautrbach
0 siblings, 0 replies; only message in thread
From: Petr Lautrbach @ 2026-09-11 13:19 UTC (permalink / raw)
To: git-commits
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 13:19 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:19 [tests/selinux] pr775-checkpolicy-revdeps: python-bindings: Fixes for Fedora CI Petr Lautrbach
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox