🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.gentoo.dev
Article #92

[gentoo-dev] [PATCH 10/10] net-misc/kea: use eclass to skip tests

#92
From: Alfred Wingate
Date: Thu, 05 Nov 2026 04:00
382 lines
13141 bytes
From: Alfred Wingate <parona@protonmail.com>

Signed-off-by: Alfred Wingate <parona@protonmail.com>
---
 net-misc/kea/kea-3.0.3-r1.ebuild | 38 ++++++++----------------------
 net-misc/kea/kea-3.2.0-r1.ebuild | 40 ++++++++------------------------
 net-misc/kea/kea-3.2.0.ebuild    | 38 ++++++++----------------------
 net-misc/kea/kea-9999.ebuild     | 40 ++++++++------------------------
 4 files changed, 40 insertions(+), 116 deletions(-)

diff --git a/net-misc/kea/kea-3.0.3-r1.ebuild b/net-misc/kea/kea-3.0.3-r1.ebuild
index 9ec5d52f7d70d..71356d05fe8aa 100644
--- a/net-misc/kea/kea-3.0.3-r1.ebuild
+++ b/net-misc/kea/kea-3.0.3-r1.ebuild
@@ -161,28 +161,14 @@ src_compile() {
 }
 
 src_test() {
-	# Get list of all test suites into an associative array
-	# the meson test --list returns either "kea / test_suite", "kea:shell-tests / test_suite" or
-	# "kea:python-tests / test_suite"
-	# Note: In meson >= 1.10 the format has changed to
-	# the meson test --list returns either "kea:test_suite", "shell-tests - kea:test_suite" or
-	# "python-tests - kea:test_suite"
-	#
-	# Discard the shell tests as we can't run shell tests in sandbox
-
-	pushd "${BUILD_DIR}" || die
-	local -A TEST_SUITES
-
-	while IFS="/: " read -a words ; do
-		if [[ "${words[0]}" != "shell-tests" ]] && [[ "${words[2]}" != "shell-tests" ]]; then
-			TEST_SUITES["${words[-1]}"]=1
-		fi
-	done < <(meson test --list || die)
-	popd
+	local -a EMESON_SKIP_TEST_SUITES=(
+		# Discard the shell tests as we can't run shell tests in sandbox
+		shell-tests
+	)
 
 	# Some other tests will fail for interface access restrictions, we have to remove the test suites those tests
 	# belong to
-	local SKIP_TESTS=(
+	local -a EMESON_SKIP_TESTS=(
 		dhcp-radius-tests
 		kea-log-buffer_logger_test.sh
 		kea-log-console_test.sh
@@ -194,7 +180,7 @@ src_test() {
 
 	# skip shell tests that require a running instance of MySQL
 	if use mysql; then
-		SKIP_TESTS+=(
+		EMESON_SKIP_TESTS+=(
 			kea-mysql-tests
 			dhcp-mysql-lib-tests
 			dhcp-forensic-log-libloadtests
@@ -203,7 +189,7 @@ src_test() {
 
 	# skip shell tests that require a running instance of PgSQL
 	if use postgres; then
-		SKIP_TESTS+=(
+		EMESON_SKIP_TESTS+=(
 			kea-pgsql-tests
 			dhcp-pgsql-lib-tests
 			dhcp-forensic-log-libloadtests
@@ -211,14 +197,14 @@ src_test() {
 	fi
 
 	if use kerberos; then
-		SKIP_TESTS+=(
+		EMESON_SKIP_TESTS+=(
 			ddns-gss-tsig-tests
 		)
 	fi
 
 	if [[ $(tc-get-ptr-size) -eq 4 ]]; then
 		# see https://bugs.gentoo.org/958171 for reason for skipping these tests
-		SKIP_TESTS+=(
+		EMESON_SKIP_TESTS+=(
 			kea-util-tests
 			kea-dhcpsrv-tests
 			dhcp-ha-lib-tests
@@ -226,11 +212,7 @@ src_test() {
 		)
 	fi
 
-	for SKIP in ${SKIP_TESTS[@]}; do
-		unset TEST_SUITES["${SKIP}"]
-	done
-
-	meson_src_test ${!TEST_SUITES[@]}
+	meson_src_test
 }
 
 install_shell() {
diff --git a/net-misc/kea/kea-3.2.0-r1.ebuild b/net-misc/kea/kea-3.2.0-r1.ebuild
index e51ea0831aaf5..aef7e5a0047ed 100644
--- a/net-misc/kea/kea-3.2.0-r1.ebuild
+++ b/net-misc/kea/kea-3.2.0-r1.ebuild
@@ -157,29 +157,14 @@ src_compile() {
 }
 
 src_test() {
-	# Get list of all test suites into an associative array
-	# the meson test --list returns either "kea / test_suite", "kea:shell-tests / test_suite" or
-	# "kea:python-tests / test_suite"
-	# Note: In meson >= 1.10 the format has changed to
-	# the meson test --list returns either "kea:test_suite", "shell-tests - kea:test_suite" or
-	# "python-tests - kea:test_suite"
-	#
-	# Discard the shell tests as we can't run shell tests in sandbox
-
-	pushd "${BUILD_DIR}" || die
-
-	local -A test_suites
-	local -a words
-	while IFS="/: " read -ra words ; do
-		if [[ "${words[0]}" != "shell-tests" ]] && [[ "${words[2]}" != "shell-tests" ]]; then
-			test_suites["${words[-1]}"]=1
-		fi
-	done < <(meson test --list || die)
-	popd || die
+	local -a EMESON_SKIP_TEST_SUITES=(
+		# Discard the shell tests as we can't run shell tests in sandbox
+		shell-tests
+	)
 
 	# Some other tests will fail for interface access restrictions, we have to remove the test suites those tests
 	# belong to
-	local -a skip_tests=(
+	local -a EMESON_SKIP_TESTS=(
 		dhcp-radius-tests
 		kea-log-buffer_logger_test.sh
 		kea-log-console_test.sh
@@ -191,7 +176,7 @@ src_test() {
 
 	# skip shell tests that require a running instance of MySQL
 	if use mysql; then
-		skip_tests+=(
+		EMESON_SKIP_TESTS+=(
 			kea-mysql-tests
 			dhcp-mysql-lib-tests
 			dhcp-forensic-log-libload-tests
@@ -200,7 +185,7 @@ src_test() {
 
 	# skip shell tests that require a running instance of PgSQL
 	if use postgres; then
-		skip_tests+=(
+		EMESON_SKIP_TESTS+=(
 			kea-pgsql-tests
 			dhcp-pgsql-lib-tests
 			dhcp-forensic-log-libload-tests
@@ -208,14 +193,14 @@ src_test() {
 	fi
 
 	if use kerberos; then
-		skip_tests+=(
+		EMESON_SKIP_TESTS+=(
 			ddns-gss-tsig-tests
 		)
 	fi
 
 	if [[ $(tc-get-ptr-size) -eq 4 ]]; then
 		# see https://bugs.gentoo.org/958171 for reason for skipping these tests
-		skip_tests+=(
+		EMESON_SKIP_TESTS+=(
 			kea-util-tests
 			kea-dhcpsrv-tests
 			dhcp-ha-lib-tests
@@ -223,12 +208,7 @@ src_test() {
 		)
 	fi
 
-	local name
-	for name in ${skip_tests[@]}; do
-		unset -v 'test_suites[${name}]'
-	done
-
-	meson_src_test "${!test_suites[@]}"
+	meson_src_test
 }
 
 install_shell() {
diff --git a/net-misc/kea/kea-3.2.0.ebuild b/net-misc/kea/kea-3.2.0.ebuild
index d42b39b2970d1..5dd6f0a4fec83 100644
--- a/net-misc/kea/kea-3.2.0.ebuild
+++ b/net-misc/kea/kea-3.2.0.ebuild
@@ -157,28 +157,14 @@ src_compile() {
 }
 
 src_test() {
-	# Get list of all test suites into an associative array
-	# the meson test --list returns either "kea / test_suite", "kea:shell-tests / test_suite" or
-	# "kea:python-tests / test_suite"
-	# Note: In meson >= 1.10 the format has changed to
-	# the meson test --list returns either "kea:test_suite", "shell-tests - kea:test_suite" or
-	# "python-tests - kea:test_suite"
-	#
-	# Discard the shell tests as we can't run shell tests in sandbox
-
-	pushd "${BUILD_DIR}" || die
-	local -A TEST_SUITES
-
-	while IFS="/: " read -a words ; do
-		if [[ "${words[0]}" != "shell-tests" ]] && [[ "${words[2]}" != "shell-tests" ]]; then
-			TEST_SUITES["${words[-1]}"]=1
-		fi
-	done < <(meson test --list || die)
-	popd
+	local -a EMESON_SKIP_TEST_SUITES=(
+		# Discard the shell tests as we can't run shell tests in sandbox
+		shell-tests
+	)
 
 	# Some other tests will fail for interface access restrictions, we have to remove the test suites those tests
 	# belong to
-	local SKIP_TESTS=(
+	local -a EMESON_SKIP_TESTS=(
 		dhcp-radius-tests
 		kea-log-buffer_logger_test.sh
 		kea-log-console_test.sh
@@ -190,7 +176,7 @@ src_test() {
 
 	# skip shell tests that require a running instance of MySQL
 	if use mysql; then
-		SKIP_TESTS+=(
+		EMESON_SKIP_TESTS+=(
 			kea-mysql-tests
 			dhcp-mysql-lib-tests
 			dhcp-forensic-log-libloadtests
@@ -199,7 +185,7 @@ src_test() {
 
 	# skip shell tests that require a running instance of PgSQL
 	if use postgres; then
-		SKIP_TESTS+=(
+		EMESON_SKIP_TESTS+=(
 			kea-pgsql-tests
 			dhcp-pgsql-lib-tests
 			dhcp-forensic-log-libload-tests
@@ -207,14 +193,14 @@ src_test() {
 	fi
 
 	if use kerberos; then
-		SKIP_TESTS+=(
+		EMESON_SKIP_TESTS+=(
 			ddns-gss-tsig-tests
 		)
 	fi
 
 	if [[ $(tc-get-ptr-size) -eq 4 ]]; then
 		# see https://bugs.gentoo.org/958171 for reason for skipping these tests
-		SKIP_TESTS+=(
+		EMESON_SKIP_TESTS+=(
 			kea-util-tests
 			kea-dhcpsrv-tests
 			dhcp-ha-lib-tests
@@ -222,11 +208,7 @@ src_test() {
 		)
 	fi
 
-	for SKIP in ${SKIP_TESTS[@]}; do
-		unset TEST_SUITES["${SKIP}"]
-	done
-
-	meson_src_test ${!TEST_SUITES[@]}
+	meson_src_test
 }
 
 install_shell() {
diff --git a/net-misc/kea/kea-9999.ebuild b/net-misc/kea/kea-9999.ebuild
index 806a81494baca..ee132ca674b67 100644
--- a/net-misc/kea/kea-9999.ebuild
+++ b/net-misc/kea/kea-9999.ebuild
@@ -164,29 +164,14 @@ src_compile() {
 }
 
 src_test() {
-	# Get list of all test suites into an associative array
-	# the meson test --list returns either "kea / test_suite", "kea:shell-tests / test_suite" or
-	# "kea:python-tests / test_suite"
-	# Note: In meson >= 1.10 the format has changed to
-	# the meson test --list returns either "kea:test_suite", "shell-tests - kea:test_suite" or
-	# "python-tests - kea:test_suite"
-	#
-	# Discard the shell tests as we can't run shell tests in sandbox
-
-	pushd "${BUILD_DIR}" || die
-
-	local -A test_suites
-	local -a words
-	while IFS="/: " read -ra words ; do
-		if [[ "${words[0]}" != "shell-tests" ]] && [[ "${words[2]}" != "shell-tests" ]]; then
-			test_suites["${words[-1]}"]=1
-		fi
-	done < <(meson test --list || die)
-	popd || die
+	local -a EMESON_SKIP_TEST_SUITES=(
+		# Discard the shell tests as we can't run shell tests in sandbox
+		shell-tests
+	)
 
 	# Some other tests will fail for interface access restrictions, we have to remove the test suites those tests
 	# belong to
-	local -a skip_tests=(
+	local -a EMESON_SKIP_TESTS=(
 		dhcp-radius-tests
 		kea-log-buffer_logger_test.sh
 		kea-log-console_test.sh
@@ -198,7 +183,7 @@ src_test() {
 
 	# skip shell tests that require a running instance of MySQL
 	if use mysql; then
-		skip_tests+=(
+		EMESON_SKIP_TESTS+=(
 			kea-mysql-tests
 			dhcp-mysql-lib-tests
 			dhcp-forensic-log-libload-tests
@@ -207,7 +192,7 @@ src_test() {
 
 	# skip shell tests that require a running instance of PgSQL
 	if use postgres; then
-		skip_tests+=(
+		EMESON_SKIP_TESTS+=(
 			kea-pgsql-tests
 			dhcp-pgsql-lib-tests
 			dhcp-forensic-log-libload-tests
@@ -215,14 +200,14 @@ src_test() {
 	fi
 
 	if use kerberos; then
-		skip_tests+=(
+		EMESON_SKIP_TESTS+=(
 			ddns-gss-tsig-tests
 		)
 	fi
 
 	if [[ $(tc-get-ptr-size) -eq 4 ]]; then
 		# see https://bugs.gentoo.org/958171 for reason for skipping these tests
-		skip_tests+=(
+		EMESON_SKIP_TESTS+=(
 			kea-util-tests
 			kea-dhcpsrv-tests
 			dhcp-ha-lib-tests
@@ -230,12 +215,7 @@ src_test() {
 		)
 	fi
 
-	local name
-	for name in ${skip_tests[@]}; do
-		unset -v 'test_suites[${name}]'
-	done
-
-	meson_src_test "${!test_suites[@]}"
+	meson_src_test
 }
 
 install_shell() {
-- 
2.56.0
Technical Details
Message-ID: <NVWNP-9V7G-9@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
References: <NVWE9-9V4a-1@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From: Alfred Wingate <parona@protonmail.com>
Newsgroups: linux.gentoo.dev
Subject: [gentoo-dev] [PATCH 10/10] net-misc/kea: use eclass to skip tests
Date: Thu, 05 Nov 2026 05:00:01 +0100
Message-ID: <NVWNP-9V7G-9@gated-at.bofh.it>
References: <NVWE9-9V4a-1@gated-at.bofh.it>
X-Original-To: "gentoo-dev@lists.gentoo.org" <gentoo-dev@lists.gentoo.org>
Feedback-ID: 25092314:user:proton
X-Pm-Message-ID: 94c80fbca6e99eb4e5effa9e6e9a3511c33aa819
List-ID: Gentoo Linux mail <gentoo-dev.gentoo.org>
Reply-To: gentoo-dev@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Approved: robomod@news.nic.it
Lines: 382
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Cc: "base-system@gentoo.org" <base-system@gentoo.org>, "sam@gentoo.org" <sam@gentoo.org>, "eschwartz@gentoo.org" <eschwartz@gentoo.org>, "inbox@peterleese.org" <inbox@peterleese.org>, "gstreamer@gentoo.org" <gstreamer@gentoo.org>, "chewi@gentoo.org" <chewi@gentoo.org>, Alfred Wingate <parona@protonmail.com>
X-Original-Date: Thu, 05 Nov 2026 03:49:47 +0000
X-Original-Message-ID: <20261105034814.1035529-11-parona@protonmail.com>
X-Original-References: <20261105034814.1035529-1-parona@protonmail.com>