Page MenuHome GnuPG

gnupg-2.3.1: 'make check' on all tests tries to use installed 'keyboxd'
Closed, ResolvedPublic

Description

I am currently trying following build steps for latest gnupg-2.3.1 on macOS 11.2.3:

$ ./configure --enable-all-tests ...
$ make
$ make check

The make check fails on tests/openpgp as it tries to use the (not-yet) installed keyboxd rather than the locally built binary (See Logs at bottom).

I was able to get make check to work by setting the --keyboxd-program option to local binary via common.conf as shown in next section.

Not too sure if there is a reason this wasn't done or if there is another way to solve this.

Possible patch to get all tests working
--- a/tests/openpgp/defs.scm
+++ b/tests/openpgp/defs.scm
@@ -338,6 +338,7 @@
   (create-file "common.conf"
               (if (flag "--use-keyboxd" *args*)
                   "use-keyboxd" "#use-keyboxd")
+               (string-append "keyboxd-program " (tool 'keyboxd))
               )

   (create-file "gpg.conf"

I guess this could also be restricted with flag "--use-keyboxd" or installed? check.

Logs
("/private/tmp/gnupg-20210420-10317-42rjmr/gnupg-2.3.1/g10/gpg" --no-permission-warning --always-trust --yes --import "/private/tmp/gnupg-20210420-10317-42rjmr/gnupg-2.3.1/tests/openpgp/pubdemo.asc") failed: gpg: error running '/usr/local/Cellar/gnupg/2.3.1/libexec/keyboxd': probably not installed
gpg: failed to start keyboxd '/usr/local/Cellar/gnupg/2.3.1/libexec/keyboxd': Configuration error
gpg: can't connect to the keyboxd: Configuration error
gpg: error opening key DB: No Keybox daemon running
gpg: key 2D727CC768697734: public key not found: Input/output error
gpg: error reading '/private/tmp/gnupg-20210420-10317-42rjmr/gnupg-2.3.1/tests/openpgp/pubdemo.asc': Input/output error
gpg: import from '/private/tmp/gnupg-20210420-10317-42rjmr/gnupg-2.3.1/tests/openpgp/pubdemo.asc' failed: Input/output error
gpg: Total number processed: 0

FAIL: <use-keyboxd>tests/openpgp/setup.scm
Setup failed.
make[2]: *** [xcheck] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1

Details

Version
2.3.1

Event Timeline

werner changed the task status from Open to Testing.Apr 22 2021, 8:49 AM
werner added a subscriber: werner.

You are right. The problem is that in a development version we use an envvar to locate the programs, so there is usually no problem because the software has already been installed and the final test doesn't catch this. We should add a version check to all components to catch such problems.

You patch is correct, I applied it. Thanks.

werner claimed this task.

I'm seeing something just like this when attempting to install gnupg-2.3.6 on Ubuntu 22.04 LTS (running under WSL 2, if it matters).

The end of the output for make check looks like this:

("/home/dschulman/Downloads/gnupg-2.3.6/bin/gpg" --no-permission-warning --always-trust --yes --import "/home/dschulman/Downloads/gnupg-2.3.6/tests/openpgp/pubdemo.asc") failed: gpg: error running '/home/dschulman/Downloads/gnupg-2.3.6/libexec/keyboxd': probably not installed
gpg: failed to start keyboxd '/home/dschulman/Downloads/gnupg-2.3.6/libexec/keyboxd': Configuration error
gpg: can't connect to the keyboxd: Configuration error
gpg: error opening key DB: No Keybox daemon running
gpg: key 2D727CC768697734: public key not found: Input/output error
gpg: error reading '/home/dschulman/Downloads/gnupg-2.3.6/tests/openpgp/pubdemo.asc': Input/output error
gpg: import from '/home/dschulman/Downloads/gnupg-2.3.6/tests/openpgp/pubdemo.asc' failed: Input/output error
gpg: Total number processed: 0

FAIL: <use-keyboxd>tests/openpgp/setup.scm
Setup failed.
make: *** [Makefile:931: xcheck] Error 1
make[2]: Leaving directory '/home/dschulman/Downloads/gnupg-2.3.6/tests/openpgp'
make[1]: *** [Makefile:517: check-recursive] Error 1
make[1]: Leaving directory '/home/dschulman/Downloads/gnupg-2.3.6/tests'
make: *** [Makefile:629: check-recursive] Error 1

My tests/openpgp/defs.scm file looks exactly like the patch described in T5406, and the I/O error seems to be saying that the first demo key listed in tests/openpgp/pubdemo.asc (the one for Alpha Test <alpha@example.net>) couldn't be found.

I've added use-keyboxd into my ~/.gnupg/common.conf, and gnupg-2.3.6/kbx/kbxutil --stats ~/.gnupg/pubring.kbx appears to work as expected, for what it's worth. Any ideas how to get that daemon installed and running, or what else I'm missing here?