Page MenuHome GnuPG

gnupg2 tpm2d tests do not work
Closed, ResolvedPublic


At this moment, we do not build gnupg2 with tpm2 support and without tpm2d mostly because I was not able to make the tests in the tpm2dtests directory working. I already noticed that the release tarball is missing the setup.scm file, but even if I add it to the place, the tests keep failing with errors like this:

LC_ALL=C EXEEXT= PATH="../gpgscm:/builddir/.local/bin:/builddir/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin" abs_top_srcdir="/builddir/build/BUILD/gnupg-2.3.6" objdir="/builddir/build/BUILD/gnupg-2.3.6" TPMSERVER="" SWTPM="/bin/swtpm" SWTPM_IOCTL="" GNUPG_BUILD_ROOT="/builddir/build/BUILD/gnupg-2.3.6/tests" GPGSCM_PATH="/builddir/build/BUILD/gnupg-2.3.6/tests/gpgscm" /builddir/build/BUILD/gnupg-2.3.6/tests/gpgscm/gpgscm \
gpgscm: error running '/builddir/build/BUILD/gnupg-2.3.6/tests/tools/gpgconf': probably not installed
(wait-process "/builddir/build/BUILD/gnupg-2.3.6/tests/tools/gpgconf" 49511 #t): Configuration error

(note the path tests/tools/gpgconf to the gpgconf, which does not exist)


External Link
master, 2.3.6

Event Timeline

werner claimed this task.
werner triaged this task as Normal priority.

The provided change does not look like fixing the problem for me. The path to gpgconf is still wrong and I am getting the same error both with master and with the patched tarballs:

make[2]: Entering directory '/home/jjelen/devel/gnupg/tests/tpm2dtests'
LC_ALL=C EXEEXT= PATH="../gpgscm:/home/jjelen/.local/bin:/home/jjelen/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin" abs_top_srcdir="/home/jjelen/devel/gnupg" objdir="/home/jjelen/devel/gnupg" TPMSERVER="" SWTPM="/bin/swtpm" SWTPM_IOCTL="/bin/swtpm_ioctl" GNUPG_BUILD_ROOT="/home/jjelen/devel/gnupg/tests" GPGSCM_PATH="/home/jjelen/devel/gnupg/tests/gpgscm" /home/jjelen/devel/gnupg/tests/gpgscm/gpgscm \
gpgscm: error running '/home/jjelen/devel/gnupg/tests/tools/gpgconf': probably not installed
(wait-process "/home/jjelen/devel/gnupg/tests/tools/gpgconf" 2693795 #t): Configuration error

This still did not seem to help me in making the tests working on Fedora with git master. I am still getting wrong paths to the gpgconf

gpgscm: error running '/root/gnupg/tests/tools/gpgconf': probably not installed

There is a full reproducer and more complete log in

I pushed rG321f9c0a3f28: tests:tpm2dtests: Fix tests with TPM2D. and rG98dd6f7af6aa: tests:tpm2dtests: Fix tests with SWTPM. (and other small changes).
Now, it works with two cases:

  • tpm_server
  • swtpm, swtpm_ioctl, and tssstartup

I think that it is the original tpm2dtests was intended.

IIUC, the Fedora build doesn't use swtpm_ioctl and tssstartup. Let me investigate this case. I need to learn around swtpm things.

gniibe changed the task status from Open to Testing.Oct 5 2023, 3:28 AM

OK. I pushed: rG227b3b14f4be: tests:tpm2dtests: Modify tests with SWTPM and relax the condition.
... which doesn't require swtpm_ioctl and tssstartup any more.

I'll backport the changes to 2.4.

No test environment in our QA dept.