From 01b6e69563d6f8ea30d6cdcdc6da33624f583910 Mon Sep 17 00:00:00 2001 From: Boris Glimcher Date: Mon, 15 Jul 2024 21:22:23 +0300 Subject: [PATCH] ci: avoid apt install Signed-off-by: Boris Glimcher --- docker-compose.yml | 12 ++++++++++++ scripts/tests.sh | 4 +--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d9452a0..6fe2514 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -266,6 +266,18 @@ services: '--log', 'level=20', '--flags', 'not-need-init,startup-clear'] + swtpm-test: + image: docker.io/strongx509/tpm:5.9.13 + depends_on: + - swtpm + volumes: + - tpm-data:/swtpm + networks: + - opi + environment: + TPM2TOOLS_TCTI: swtpm:path=/swtpm/swtpm.sock + command: ['tpm2', 'clear'] + volumes: tpm-data: server-certs: diff --git a/scripts/tests.sh b/scripts/tests.sh index bbcb0eb..a1c6a9b 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -29,9 +29,7 @@ docker-compose exec -T client cat /var/lib/dhclient/dhclient.leases | grep sztp- 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 +docker run --rm -T -v sztp_tpm-data:/swtpm -e TPM2TOOLS_TCTI="swtpm:path=/swtpm/swtpm.sock" docker.io/strongx509/tpm:5.9.13 tpm2 clear # reusable variables CERTIFICATES=(--key /certs/third_private_key.pem --cert /certs/third_my_cert.pem --cacert /certs/opi.pem)