[PATCH gnupg 0/2] Small fixes for running the tpm2dtests.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH gnupg 0/2] Small fixes for running the tpm2dtests.

GnuPG - Dev mailing list
Hi,

The following two patches fix two small issues with the build system
caused by the newly added TPM code and specifically the corresponding
tests.

The first one is that the test files are not properly distributed in the
generated tarball, causing `make distcheck` to fail if it is run on a
system where the tests *can* be run (e.g. if a software TPM is
detected).

The second is that the tpm2d tests requires tools from the IBM TSS,
which may not be present on the system even if a software TPM is
available (this was the case on my system, where I initially only had
the tools from the Intel TSS). The quick fix proposed here is to detect
the IBM TSS tools and only run the tpm2d tests if they are present. I
guess a better fix would be to adapt the start_sw_tpm.sh script to make
it usable with either the IBM TSS tools or the Intel TSS tools, but I do
not know either TSS well enough to do that (e.g. what is the equivalent
of tssstartup in the Intel TSS?).

- Damien

Damien Goutte-Gattat (2):
  build: Fix distcheck when tpm2dtests are run.
  build: Check for the IBM TSS tools to run the tpm2d tests.

 configure.ac                 | 3 ++-
 tests/tpm2dtests/Makefile.am | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

--
2.27.0


_______________________________________________
Gnupg-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH gnupg 1/2] build: Fix distcheck when tpm2dtests are run.

GnuPG - Dev mailing list
* tests/tpm2dtests/Makefile.am (EXTRA_DIST): Distribute test files.
(CLEANFILES): Make sure to remove log files.

Signed-off-by: Damien Goutte-Gattat <[hidden email]>
---
 tests/tpm2dtests/Makefile.am | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/tpm2dtests/Makefile.am b/tests/tpm2dtests/Makefile.am
index ced4a1f49..eeae39906 100644
--- a/tests/tpm2dtests/Makefile.am
+++ b/tests/tpm2dtests/Makefile.am
@@ -61,14 +61,15 @@ xcheck: tpm_server_found
 tpm_server_found:
  @if [ -z "$(TPMSERVER)" -a -z "$(SWTPM)" -a -z "$(FORCE)" ]; then echo "ERROR: No Software TPM has been found, cannot run TPM tests.  Set FORCE=1 to force using the physical TPM"; exit 1; fi
 
-EXTRA_DIST = defs.scm shell.scm all-tests.scm start_sw_tpm.sh
+EXTRA_DIST = defs.scm shell.scm all-tests.scm run-tests.scm $(XTESTS) \
+     start_sw_tpm.sh
 
 CLEANFILES = gpg.conf gpg-agent.conf S.gpg-agent \
      pubring.gpg pubring.gpg~ pubring.kbx pubring.kbx~ \
      secring.gpg pubring.pkr secring.skr \
      gnupg-test.stop random_seed gpg-agent.log tofu.db \
      passphrases sshcontrol S.gpg-agent.ssh report.xml \
-     msg.txt
+     msg.txt *.log
 
 clean-local:
  -rm -rf private-keys-v1.d openpgp-revocs.d
--
2.27.0


_______________________________________________
Gnupg-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH gnupg 2/2] build: Check for the IBM TSS tools to run the tpm2d tests.

GnuPG - Dev mailing list
In reply to this post by GnuPG - Dev mailing list
* configure.ac (TEST_LIBTSS): Make that conditional depend on the
detection of tssstartup.

--
While the tpm2d daemon can use either the Intel TSS or the IBM TSS,
the test code (specifically, the start_sw_tpm.sh script) requires
some tools from the IBM TSS (tssstartup and tsspowerup).

If a software TPM is detected at configure time but the IBM TSS
tools are absent (e.g. because only the Intel TSS is available on
the system), `make check` will attempt to run the tpm2d tests and
those will fail when the start_sw_tpm.sh script is launched.

This patch makes running the tpm2d tests dependent not only on
the detection of a software TPM, but also on the detection of
tssstartup (it is probably safe to assume that if tssstartup is
present, then tsspowerup is available as well).

Signed-off-by: Damien Goutte-Gattat <[hidden email]>
---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 82e3e670c..59374491f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1638,6 +1638,7 @@ if test "$build_tpm2d" = "yes"; then
     AC_PATH_PROG(TPMSERVER, tpm_server,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
     AC_PATH_PROG(SWTPM, swtpm,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
     AC_PATH_PROG(SWTPM_IOCTL, swtpm_ioctl,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
+    AC_PATH_PROG(TSSSTARTUP, tssstartup,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
   fi
 fi
 if test "$have_libtss" = no; then
@@ -1646,7 +1647,7 @@ fi
 AC_SUBST(LIBTSS_LIBS)
 AC_SUBST(LIBTSS_CFLAGS)
 AM_CONDITIONAL(HAVE_LIBTSS, test "$have_libtss" != no)
-AM_CONDITIONAL(TEST_LIBTSS, test -n "$TPMSERVER" -o -n "$SWTPM")
+AM_CONDITIONAL(TEST_LIBTSS, test -n "$TPMSERVER" || test -n "$SWTPM" && test -n "$TSSSTARTUP")
 AC_SUBST(HAVE_LIBTSS)
 
 #
--
2.27.0


_______________________________________________
Gnupg-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH gnupg 0/2] Small fixes for running the tpm2dtests.

GnuPG - Dev mailing list
In reply to this post by GnuPG - Dev mailing list
On Mon, 15 Mar 2021 21:20, Damien Goutte-Gattat said:

> The following two patches fix two small issues with the build system
> caused by the newly added TPM code and specifically the corresponding

Thanks.


Shalom-Salam,

   Werner

--
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

_______________________________________________
Gnupg-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-devel

signature.asc (233 bytes) Download Attachment