File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,3 +159,29 @@ make check-code-coverage
159159This will run the test suite (` make check ` ) and build a code coverage report
160160detailing the code which was touched.
161161
162+ ## Build and run all tests in a container
163+
164+ To make the test setup as reproducible as possible and to reduce the risk
165+ of damaging the real TPM, a container environment is also available.
166+
167+ Build and run a container with podman (Docker should work as well):
168+
169+ ``` sh
170+ TEST_CONTAINER=ubuntu-2204
171+ # TEST_CONTAINER=fedora-38
172+ podman build -f " test/Containerfiles/Containerfile.$TEST_CONTAINER " --tag " tpm2-openssl-build-$TEST_CONTAINER "
173+ podman run -it --name tpm2-openssl-1 -v " $( pwd) :/build:Z" --rm --userns=keep-id \
174+ " localhost/tpm2-openssl-build-$TEST_CONTAINER " /bin/bash
175+ ```
176+
177+ Run all tests with the swtpm simulator in the container:
178+
179+ ``` sh
180+ /build/test/run-with-simulator
181+ ```
182+
183+ Run all tests with the IBM simulator in the container:
184+
185+ ``` sh
186+ /build/test/run-with-simulator ibm
187+ ```
You can’t perform that action at this time.
0 commit comments