summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Davies <jpds@protonmail.com>2021-07-07 14:16:06 +0100
committerSam James <sam@gentoo.org>2021-07-19 23:21:28 +0100
commitb49e9b2821afc2f102fd44879871718c31080c04 (patch)
tree703b28bbf3fbcacf7eeeebe14e46ba92a64bef41 /sys-apps
parentsys-devel/gcc: stable 9.4.0 for hppa, bug #800767 (diff)
downloadgentoo-b49e9b2821afc2f102fd44879871718c31080c04.tar.gz
gentoo-b49e9b2821afc2f102fd44879871718c31080c04.tar.bz2
gentoo-b49e9b2821afc2f102fd44879871718c31080c04.zip
sys-apps/selinux-python: Fixed tests, thanks to Arie Artrip.
Closes: https://bugs.gentoo.org/715924 Closes: https://bugs.gentoo.org/741930 Signed-off-by: Jonathan Davies <jpds@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/21550 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/selinux-python/selinux-python-3.2.ebuild23
-rw-r--r--sys-apps/selinux-python/selinux-python-9999.ebuild23
2 files changed, 46 insertions, 0 deletions
diff --git a/sys-apps/selinux-python/selinux-python-3.2.ebuild b/sys-apps/selinux-python/selinux-python-3.2.ebuild
index df7cfa14c519..bd9f2e663d86 100644
--- a/sys-apps/selinux-python/selinux-python-3.2.ebuild
+++ b/sys-apps/selinux-python/selinux-python-3.2.ebuild
@@ -7,6 +7,8 @@ PYTHON_REQ_USE="xml"
inherit python-r1 toolchain-funcs
+IUSE="test"
+RESTRICT="!test? ( test )"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
DESCRIPTION="SELinux core utilities"
@@ -29,6 +31,7 @@ DEPEND=">=sys-libs/libselinux-${PV}:=[python]
>=sys-libs/libsepol-${PV}:=
>=app-admin/setools-4.2.0[${PYTHON_USEDEP}]
>=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}]
+ test? ( >=sys-apps/secilc-${PV} )
${PYTHON_DEPS}"
RDEPEND="${DEPEND}"
@@ -49,6 +52,26 @@ src_compile() {
python_foreach_impl building
}
+src_test() {
+ testing() {
+ # The different subprojects have some interproject dependencies:
+ # - audit2allow depens on sepolgen
+ # - chcat depends on semanage
+ # and maybe others.
+ # Add all the modules of the individual subprojects to the
+ # PYTHONPATH, so they get actually found and used. In
+ # particular, already installed versions on the system are not
+ # used.
+ for dir in audit2allow chcat semanage sepolgen/src sepolicy ; do
+ PYTHONPATH="${BUILD_DIR}/${dir}:${PYTHONPATH}"
+ done
+ PYTHONPATH=${PYTHONPATH} \
+ emake -C "${BUILD_DIR}" \
+ test
+ }
+ python_foreach_impl testing
+}
+
src_install() {
installation() {
emake -C "${BUILD_DIR}" \
diff --git a/sys-apps/selinux-python/selinux-python-9999.ebuild b/sys-apps/selinux-python/selinux-python-9999.ebuild
index 2d1cc6d2b32b..52abfe449463 100644
--- a/sys-apps/selinux-python/selinux-python-9999.ebuild
+++ b/sys-apps/selinux-python/selinux-python-9999.ebuild
@@ -7,6 +7,8 @@ PYTHON_REQ_USE="xml"
inherit python-r1 toolchain-funcs
+IUSE="test"
+RESTRICT="!test? ( test )"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
DESCRIPTION="SELinux core utilities"
@@ -29,6 +31,7 @@ DEPEND=">=sys-libs/libselinux-${PV}:=[python]
>=sys-libs/libsepol-${PV}:=
>=app-admin/setools-4.2.0[${PYTHON_USEDEP}]
>=sys-process/audit-1.5.1[python,${PYTHON_USEDEP}]
+ test? ( >=sys-apps/secilc-${PV} )
${PYTHON_DEPS}"
RDEPEND="${DEPEND}"
@@ -49,6 +52,26 @@ src_compile() {
python_foreach_impl building
}
+src_test() {
+ testing() {
+ # The different subprojects have some interproject dependencies:
+ # - audit2allow depens on sepolgen
+ # - chcat depends on semanage
+ # and maybe others.
+ # Add all the modules of the individual subprojects to the
+ # PYTHONPATH, so they get actually found and used. In
+ # particular, already installed versions on the system are not
+ # used.
+ for dir in audit2allow chcat semanage sepolgen/src sepolicy ; do
+ PYTHONPATH="${BUILD_DIR}/${dir}:${PYTHONPATH}"
+ done
+ PYTHONPATH=${PYTHONPATH} \
+ emake -C "${BUILD_DIR}" \
+ test
+ }
+ python_foreach_impl testing
+}
+
src_install() {
installation() {
emake -C "${BUILD_DIR}" \