From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A5FCC158041 for ; Thu, 7 Mar 2024 20:21:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4409BE29B3; Thu, 7 Mar 2024 20:21:33 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2C445E29B3 for ; Thu, 7 Mar 2024 20:21:33 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 609DC335DCC for ; Thu, 7 Mar 2024 20:21:32 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8325A14EF for ; Thu, 7 Mar 2024 20:21:30 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1709842863.54100ec0210ba43083d5b5c65792670674b80f10.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/keyutils/, sys-apps/keyutils/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/keyutils/files/keyutils-1.6.3-tests.patch sys-apps/keyutils/keyutils-1.6.3-r1.ebuild X-VCS-Directories: sys-apps/keyutils/ sys-apps/keyutils/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 54100ec0210ba43083d5b5c65792670674b80f10 X-VCS-Branch: master Date: Thu, 7 Mar 2024 20:21:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 692cce6d-6877-4226-8034-534588e8dfc9 X-Archives-Hash: d4699881bd97a8e4f5d7d434a34533de commit: 54100ec0210ba43083d5b5c65792670674b80f10 Author: Sam James gentoo org> AuthorDate: Thu Mar 7 20:20:00 2024 +0000 Commit: Sam James gentoo org> CommitDate: Thu Mar 7 20:21:03 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54100ec0 sys-apps/keyutils: backport test fix Closes: https://bugs.gentoo.org/926278 Signed-off-by: Sam James gentoo.org> sys-apps/keyutils/files/keyutils-1.6.3-tests.patch | 76 ++++++++++++++++++++++ sys-apps/keyutils/keyutils-1.6.3-r1.ebuild | 1 + 2 files changed, 77 insertions(+) diff --git a/sys-apps/keyutils/files/keyutils-1.6.3-tests.patch b/sys-apps/keyutils/files/keyutils-1.6.3-tests.patch new file mode 100644 index 000000000000..d9414e800a6c --- /dev/null +++ b/sys-apps/keyutils/files/keyutils-1.6.3-tests.patch @@ -0,0 +1,76 @@ +https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/commit/?id=c076dff259e99d84d3822b4d2ad7f3f66532f411 + +From c076dff259e99d84d3822b4d2ad7f3f66532f411 Mon Sep 17 00:00:00 2001 +From: Pavel Reichl +Date: Tue, 20 Dec 2022 14:13:29 +0100 +Subject: test: Fix test expectation based on kernel config + +Some test results are dependent on the kernel configuration option +CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE. + +Check the kernel configuration file for its presence and expect appropriate +test results. + +Function has_kernel_config is based on its xfstsests counterpart. + +Signed-off-by: Pavel Reichl +Signed-off-by: David Howells +--- a/tests/features/builtin_trusted/runtest.sh ++++ b/tests/features/builtin_trusted/runtest.sh +@@ -33,7 +33,11 @@ expect_error EACCES + create_key --fail user a a $stk + expect_error EOPNOTSUPP + create_key --fail user a a $blk +-expect_error EACCES ++if has_kernel_config "CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE"; then ++ expect_error EOPNOTSUPP ++else ++ expect_error EACCES ++fi + + # Try adding a key to the keyrings + marker "TRY ADDING ASYMMETRIC KEYS" +@@ -89,7 +93,11 @@ expect_error EACCES + create_key --fail -x asymmetric "" "$x509" $stk + expect_error ENOKEY + create_key --fail -x asymmetric "" "$x509" $blk +-expect_error EACCES ++if has_kernel_config "CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE"; then ++ expect_error EOPNOTSUPP ++else ++ expect_error EACCES ++fi + + echo "++++ FINISHED TEST: $result" >>$OUTPUTFILE + +--- a/tests/prepare.inc.sh ++++ b/tests/prepare.inc.sh +@@ -4,6 +4,26 @@ + includes=${BASH_SOURCE[0]} + includes=${includes%/*}/ + ++# Check if currently running kernel has option set ++function has_kernel_config() ++{ ++ local option=$1 ++ local uname=$(uname -r) ++ local config_list="$KCONFIG_PATH ++ /lib/modules/$uname/build/.config ++ /boot/config-$uname ++ /lib/kernel/config-$uname" ++ ++ for config in $config_list; do ++ [ ! -f $config ] && continue ++ grep -qE "^${option}=[my]" $config ++ return ++ done ++ ++ echo "Failed to find kernel configuration file" ++ return false ++} ++ + # --- need to run in own session keyring + watch_fd=0 + if [ "$1" != "--inside-test-session" ] +-- +cgit 1.2.3-korg diff --git a/sys-apps/keyutils/keyutils-1.6.3-r1.ebuild b/sys-apps/keyutils/keyutils-1.6.3-r1.ebuild index b0f539de7b97..c8d82212103a 100644 --- a/sys-apps/keyutils/keyutils-1.6.3-r1.ebuild +++ b/sys-apps/keyutils/keyutils-1.6.3-r1.ebuild @@ -23,6 +23,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.5.10-disable-tests.patch #519062 #522050 "${FILESDIR}"/${PN}-1.5.9-header-extern-c.patch "${FILESDIR}"/${PN}-1.6.3-fix-rpmspec-check.patch + "${FILESDIR}"/${P}-tests.patch ) pkg_setup() {