commit: 9b149add94e2c19bae371094c310e427d7ac0c05
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 22 09:46:57 2026 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Jan 22 09:51:43 2026 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9b149add
tests: reduce valgrind masking to gpgme usage
run valgrind with qmanifest as well, for tests that don't use gpgme
in such a way that both get in a fight
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
tests/init.sh.in | 4 +--
tests/qmanifest/dotest | 6 ++++-
tests/valgrind-wrapper/valgrind.ignore | 47 +++++++++++++++++++++-------------
3 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/tests/init.sh.in b/tests/init.sh.in
index 2b0a65f..861257e 100644
--- a/tests/init.sh.in
+++ b/tests/init.sh.in
@@ -31,10 +31,8 @@ export TZ='UTC 0'
# create symlinks for applets
q -i -q
-# inject valgrind wrapper if necessary, unfortunately valgrind on Ubuntu
-# causes qmanifest to print stuff double, so skip it for that applet
+# inject valgrind wrapper if necessary
dovalgrind=${Q_RUN_WITH_VALGRIND}
-[[ ${RUNNER_OS}:${as##*/} == Linux:qmanifest ]] && dovalgrind=
if [[ -n ${dovalgrind} ]] ; then
chmod 755 "@abs_top_srcdir@/tests/valgrind-wrapper/qvalgrind"
for f in @abs_top_builddir@/q?* ; do
diff --git a/tests/qmanifest/dotest b/tests/qmanifest/dotest
index e7f6d05..c3d1e94 100755
--- a/tests/qmanifest/dotest
+++ b/tests/qmanifest/dotest
@@ -70,8 +70,12 @@ gpg_import() {
# - Ubuntu uses old/ancient gnupg which doesn't grok arguments and key (Travis)
# - HOME (T) may be too long to hold a socket, especially on Linux this
# pathlength is very short, Portage's T may be too long by default
+# valgrind really messes with gpgme, and the other way around, so
+# unfortunately cannot run this when valgrind is active either
set +e
-if gpg_import "${as}"/key.gpg qmanifest ; then
+if [[ -z ${Q_RUN_WITH_VALGRIND} ]] && \
+ gpg_import "${as}"/key.gpg qmanifest
+then
set -e
tend 0 "gpg import key"
diff --git a/tests/valgrind-wrapper/valgrind.ignore
b/tests/valgrind-wrapper/valgrind.ignore
index 8291ca1..f46ab9a 100644
--- a/tests/valgrind-wrapper/valgrind.ignore
+++ b/tests/valgrind-wrapper/valgrind.ignore
@@ -1,29 +1,40 @@
# suppressions for known false-positives
{
- Solaris_libc_printf_buf
+ Solaris_libc_FILE_findbuf
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:_findbuf
- fun:_ndoprnt
- fun:printf
}
{
- Solaris_libc_puts_buf
- Memcheck:Leak
- match-leak-kinds: possible
- fun:malloc
- fun:_findbuf
- fun:_wrtchk
- fun:puts
+ GPGME_global_state_pipe
+ CoreError:FdNotClosed
+ fun:pipe2
+ fun:_gpgme_io_pipe
+ fun:read_gpgconf_dirs
+ fun:get_gpgconf_item
+ fun:gpgme_get_engine_info
+ fun:_gpgme_engine_info_copy
}
{
- Solaris_libc_fwrite_buf
- Memcheck:Leak
- match-leak-kinds: possible
- fun:malloc
- fun:_findbuf
- fun:_wrtchk
- fun:_fwrite_unlocked
- fun:fwrite
+ GPGME_global_state_dirty_close
+ CoreError:FdBadClose
+ fun:__close
+ fun:closefrom
+ fun:_gpgme_io_spawn
+ fun:read_gpgconf_dirs
+ fun:get_gpgconf_item
+ fun:gpgme_get_engine_info
+ fun:_gpgme_engine_info_copy
+}
+{
+ GPGME_global_subsystem_fd
+ CoreError:FdNotClosed
+ fun:_syscall6
+ fun:open
+ fun:_gpgrt_fopen
+ fun:set_file_fd
+ fun:_gpgme_debug_subsystem_init
+ fun:gpgme_check_version
+ fun:gpgme_check_version_internal
}