-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make TCTI configurable and force the tests to use the simulator #18
Conversation
Signed-off-by: Jonas Witschel <diabonas@gmx.de>
The tcti context can be set using this option or via the environment variable TPM2TOTP_TCTI. The syntax follows the one from tpm2-tools and tpm2-tss-engine. The code is implemented in a separate file so that it can be reused in the integration tests. Signed-off-by: Jonas Witschel <diabonas@gmx.de>
Codecov Report
@@ Coverage Diff @@
## master #18 +/- ##
==========================================
- Coverage 84.34% 80.53% -3.81%
==========================================
Files 3 4 +1
Lines 658 745 +87
==========================================
+ Hits 555 600 +45
- Misses 103 145 +42
Continue to review full report at Codecov.
|
Currently the integration tests use the first TPM they find on the system. This commit starts a TPM simulator for every integration test and configures the TCTI environment variable to use it, allowing parallel execution of the tests. The test harness is adapted from the one in tpm2-tss-engine. Signed-off-by: Jonas Witschel <diabonas@gmx.de>
This is possible after the preceeding changes to the integration test harness. Signed-off-by: Jonas Witschel <diabonas@gmx.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the effort.
I'll merge it for now, but before the next release, I want to get rid of the static tcti variable.
However, I'd wait for https://github.com/tpm2-software/tpm2-tss/wiki/TCTI-loader-library to be done and then it should be easy to switch over, given all the existing work already done.
Awesome, |
This PR makes allows configuring the TCTI to be used with
TSS2_TCTI_CONTEXT
argument (can beNULL
) for the library functions and-T
/--tcti
option or the environment variableTPM2TOTP_TCTI
for the tpm2-totp command.The syntax and the implementation for the command option/environment variable follow the implementations in tpm2-tools (tpm2-software/tpm2-tools#765,
tpm2_options.c
andtpm2_tcti_ldr.c
) and tpm2-tss-engine (tpm2-software/tpm2-tss-engine#62,tpm2-tss-engine-tcti.c
).Using these configuration options, we can force the tests to use the TPM simulator, enabling the possibility to run the tests (in parallel) on systems with existing hardware TPMs. The implementation is adapted from tpm2-tss-engine (tpm2-software/tpm2-tss-engine#107,
sh_log_compiler.sh
).Closes #7.