From 243d889d0bdf257935d830fe0c991de6397e5831 Mon Sep 17 00:00:00 2001 From: Boris Glimcher Date: Mon, 15 Jul 2024 19:47:11 +0300 Subject: [PATCH] tests: add tpm test Signed-off-by: Boris Glimcher --- docker-compose.yml | 2 +- scripts/tests.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 93111e10..d9452a04 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -260,7 +260,7 @@ services: - opi command: ['socket', '--tpm2', '--server', 'type=unixio,path=/swtpm/swtpm.sock', - '--ctrl', 'type=tcp,port=2322', + '--ctrl', 'type=unixio,path=/swtpm/swtpm.sock.ctrl', '--tpmstate', 'dir=/swtpm', '--log', 'file=swtpm.log', '--log', 'level=20', diff --git a/scripts/tests.sh b/scripts/tests.sh index d95f54ed..bbcb0eba 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -28,6 +28,11 @@ docker-compose exec -T client cat /var/lib/dhclient/dhclient.leases docker-compose exec -T client cat /var/lib/dhclient/dhclient.leases | grep sztp-redirect-urls REDIRECT=$(docker-compose exec -T client cat /var/lib/dhclient/dhclient.leases | grep sztp-redirect-urls | head -n 1 | awk '{print $3}' | tr -d '";') +# tests TPM +docker-compose exec --rm -T swtpm apt update +docker-compose exec --rm -T swtpm apt install -y tpm2-tools +docker-compose exec --rm -T -e TPM2TOOLS_TCTI="swtpm:path=/swtpm/swtpm.sock" swtpm tpm2 clear + # reusable variables CERTIFICATES=(--key /certs/third_private_key.pem --cert /certs/third_my_cert.pem --cacert /certs/opi.pem) SERIAL_NUMBER=third-serial-number