Page MenuHome GnuPG

GPGME: Unit test suite failure with gpg 2.0.24
Closed, ResolvedPublic


Currently the test suite of gpgme 1.8.0 fails with gpg 2.0.24, as shown in the
build log for openSUSE Leap 42.3 (see

This prevents inclusion of a newer gpgme in the distribution (test failure is treated as build

Some snippets from the failing tests:

[ 110s] GNUPGHOME=/home/abuild/rpmbuild/BUILD/gpgme-1.8.0/lang/python/tests
LC_ALL=C GPG_AGENT_INFO= top_srcdir=../../.. srcdir=.
LD_LIBRARY_PATH="../../../src/.libs:" /usr/bin/python3 ./ \
[ 110s] --interpreters="/usr/bin/python /usr/bin/python3" --srcdir=. \
[ 110s] t- t-
[ 110s] starting gpg-agent
[ 110s] error starting gpg-agent
[ 110s] Traceback (most recent call last):
[ 110s] File "./", line 30, in <module>
[ 110s] "tests", "start-stop-agent"), "--start"])
[ 110s] File "/usr/lib64/python2.7/", line 541, in check_call
[ 110s] raise CalledProcessError(retcode, cmd)
[ 110s] subprocess.CalledProcessError: Command '[u'../../../tests/start-stop-
agent', u'--start']' returned non-zero exit status 1
[ 110s] Traceback (most recent call last):
[ 110s] File "./", line 42, in <module>
[ 110s] c.op_encrypt([], 0, source, sink)
[ 110s] File "/home/abuild/rpmbuild/BUILD/gpgme-
1.8.0/lang/python/build/lib.linux-x86_64-2.7/gpg/", line 151, in wrapper
[ 110s] return _funcwrap(self, *args)
[ 110s] File "/home/abuild/rpmbuild/BUILD/gpgme-
1.8.0/lang/python/build/lib.linux-x86_64-2.7/gpg/", line 135, in
[ 110s] return errorcheck(result, "Invocation of " + name)
[ 110s] File "/home/abuild/rpmbuild/BUILD/gpgme-
1.8.0/lang/python/build/lib.linux-x86_64-2.7/gpg/", line 62, in
[ 110s] raise GPGMEError(retval, extradata)
[ 110s] gpg.errors.GPGMEError: Invocation of gpgme_op_encrypt: GPGME: Bad
[ 110s] Traceback (most recent call last):
[ 110s] File "./", line 53, in <module>
[ 110s] recipients=[c.get_key(support.encrypt_only, False)],
[ 110s] File "/home/abuild/rpmbuild/BUILD/gpgme-
1.8.0/lang/python/build/lib.linux-x86_64-2.7/gpg/", line 693, in get_key
[ 110s] raise errors.KeyNotFound(fpr)
[ 110s] gpg.errors.KeyNotFound: F52770D5C4DB41408D918C9F920572769B9FE19C

Event Timeline

einar77 set Version to 1.8.0.
einar77 set External Link to
einar77 added a subscriber: einar77.
werner added a project: gpgme.
werner added a subscriber: justus.
werner added a subscriber: werner.

So this is about the new Python binding.
I would suggest not to build tye python support on systems with the old 2.0.24.
Note that 2.0 will reach EOL in 9 months.

justus added a project: Restricted Project.Mar 20 2017, 4:45 PM

FYI this is:
Skip tests if GnuPG is too old.
Use 'gpg-agent --allow-loopback-pinentry' if applicable.

Unfortunately I'm unable to test this properly, because the patches can't be
applied properly to 1.8.0 (I need to add them to the package).

I've rebased the patches against 1.8.0 but I still saw 22 failing python tests
with 2.0.26

Master fails for me even harder with 36 tests failing.

The gpg-connect-agent call's fail because --agent-program is not supported. In
master we even have --debug-quick-random which is even more recent (but which we
would also need in random starved environments like build daemons)

My preferred solution at this point would be to just say for 2.0.x the python
tests are unsupported and disabled completely. All the problems are with our
agent setup regarding the test suite and not really with functionality.

I concur. We should disable the Python tests for gnupg versions < 2.1.12 (which
is about a year old)

As of 348da58fe0c3656e6177c98fef6b4c4331326c8e all Python tests are skipped with
GnuPG < 2.1.12.

Unfortunately 1.9.0 doesn't address fully the issues:

[ 108s] Traceback (most recent call last):
[ 108s] File "./", line 27, in <module>
[ 108s] err = c.assuan_transact('nop')
[ 108s] File "/home/abuild/rpmbuild/BUILD/gpgme-1.9.0/lang/python/python2.7-gpg/build/lib.linux-
x86_64-2.7/gpg/", line 790, in assuan_transact
[ 108s] errorcheck(err)
[ 108s] File "/home/abuild/rpmbuild/BUILD/gpgme-1.9.0/lang/python/python2.7-gpg/build/lib.linux-
x86_64-2.7/gpg/", line 62, in errorcheck
[ 108s] raise GPGMEError(retval, extradata)
[ 108s] gpg.errors.GPGMEError: GPGME: IPC connect call failed

Two tests fail.

Indeed. We did not address the issues at all, we decided to skip all tests and
some fell through the cracks.

aheinecke removed a project: Restricted Project.Mar 30 2017, 12:57 PM

Then please fix that. TBH I find it annoying that you did not check that your
commit actually solves the problem. I mean just using the "stable" branch would
have been enough to see that.

It's important that GPGME builds / runs against all versions of GnuPG and most
distros treat test failures as build failures. Now 1.9 will again need patches
or the python bindings disabled which is creating unnecessary work downstream
which already had enough work with the recent releases.

Well, if you ask *this* nicely, then I will most certainly get *right* to it.

You know what I find annoying? Me writing tests, and then on the first sight of
trouble, we back them out or disable them.