On Tue, Sep 16, 2025 at 04:39:37PM -0600, Shuah Khan wrote:
On 9/16/25 07:48, Jarkko Sakkinen wrote:
Hi,
The pre-existing kselftest for TPM2 is derived works of my earlier Python based rudimentary TPM2 stack called 'tpm2-scripts'.
In order to get more coverage and more mainintainable and extensible test suite I'd like to eventually rewrite the tests with bash and tpm2sh, which is a TPM2 cli written with Rust and based on my new TPM2 stack [1] [2].
Given linux-rust work, would it be acceptable to require cargo to install a runner for kselftest? I'm finishing off now 0.11 version of the tool, which will take some time (versions before that are honestly quite bad, don't try them) but after that this would be something I'd like to put together.
Probably fine - how does this impact kselftest default run?
OK so this was early query: I might introduce such test as part of series that hasa waited for long time for an update [1]. I can use tpm2sh more easily to reproduce equivalent crypto as kernel does and make a test that can compare the results in a meaningful manner. I also plan to relocate tpm2sh as part of git.kernel.org custody from Github, as its main dependency tpm2-protocol crate already is [2].
I went over the top in the original mail: most definitely it makes sense to retain the pre-existing test, and such "Rust-enhanced" test should be conditional, and can instead of depending on cargo simply do "command -v" in order to check the existence of tpm2sh and output installation instructions if it is missing.
With those precautions it should be somewhat harmless unless you actually want to run that test.
Thanks for quick response!
[1] https://lore.kernel.org/linux-integrity/20240528210823.28798-1-jarkko@kernel... [2] https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/tpm2-protocol.git
BR, Jarkko