Mailing List Archive

[RFC PATCH 09/10] net-print/cups-browsed: restrict tests
The tests are newly created during the 2.x upgrade. They will hang
forever if they cannot run properly. And running them properly has hit a
wall. I'm not sure where to go on from here.

Even getting this far means stepping outside of what portage can
reasonably require. Avahi only runs as root, and doesn't seem to have a
mocking mode, and even if it is running, the sandbox prevents src_test
from seeing it.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
---
.../cups-browsed/cups-browsed-2.0.0.ebuild | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/net-print/cups-browsed/cups-browsed-2.0.0.ebuild b/net-print/cups-browsed/cups-browsed-2.0.0.ebuild
index 6baeb697f2cd..0232d57c8b51 100644
--- a/net-print/cups-browsed/cups-browsed-2.0.0.ebuild
+++ b/net-print/cups-browsed/cups-browsed-2.0.0.ebuild
@@ -29,6 +29,18 @@ BDEPEND="
virtual/pkgconfig
"

+# The tests are new since the split out of cups-filters. Actually running them
+# seems to be challenging. You need:
+# - cups tools that are USE-optional
+# - running avahi-daemon (as root!)
+# - disable portage's pid-sandbox, which interferes with avahi
+# - ipptool still fails to connect to port 8xxx
+#
+# If anything fails, a `while true` loop fails to successfully launch and break
+# out of the loop, leading to a hang. Until there's an obvious recipe for
+# successfully running the tests, restrict it.
+RESTRICT="test"
+
PATCHES=(
"${FILESDIR}"/0001-cups-browsed.c-Fix-build-with-avahi-disabled-20.patch
)
@@ -47,6 +59,13 @@ src_configure() {
econf "${myeconfargs[@]}"
}

+src_test() {
+ # Requires avahi running. Hangs forever if not available.
+ avahi-daemon --check 2>/dev/null || die "no running avahi daemon found, cannot run tests"
+
+ default
+}
+
src_install() {
default

--
2.41.0