]> git.proxmox.com Git - mirror_qemu.git/commit - tests/tpm-util.c
test: Add test cases that use the external swtpm with CRB interface
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 7 Mar 2018 19:45:06 +0000 (14:45 -0500)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Sat, 26 May 2018 02:47:27 +0000 (22:47 -0400)
commitb21373d0713d060e42dcec8262197a91b71dfd4b
tree725d7caff4f4aa8e302abe1a4dea04b455545164
parent9d1f0985a77429c6d527077a44b28d43f5906112
test: Add test cases that use the external swtpm with CRB interface

Add a test program for testing the CRB with the external swtpm.

The 1st test case extends a PCR and reads back the value and compares
it against an expected return packet.

The 2nd test case repeats the 1st test case and then migrates the
external swtpm's state along with the VM state to a destination
QEMU and swtpm and checks that the PCR has the expected value now.

The test cases require 'swtpm' to be installed on the system and
in the PATH and 'swtpm' must support the --tpm2 option. If this is
not the case, the test will be skipped.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
tests/Makefile.include
tests/tpm-crb-swtpm-test.c [new file with mode: 0644]
tests/tpm-util.c [new file with mode: 0644]
tests/tpm-util.h [new file with mode: 0644]