Skip to content

Commit

Permalink
tests: add tpm test
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Jul 15, 2024
1 parent 08a36e4 commit 243d889
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 5 additions & 0 deletions scripts/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 243d889

Please sign in to comment.