Add integration test for PKCS#11 module#385
Merged
simo5 merged 2 commits intolatchset:mainfrom Jan 19, 2026
Merged
Conversation
42f7eb9 to
1f8230e
Compare
b59fa9f to
749fcdd
Compare
Jakuje
approved these changes
Jan 19, 2026
Contributor
Jakuje
left a comment
There was a problem hiding this comment.
aside of the inline comment, lgtm
Add an integration test to the cdylib crate using the `rust-cryptoki` library to act as a client to the PKCS#11 shared library. This test verifies the core functionality by executing a standard workflow: initializing the library, initializing a token, setting SO and User PINs, logging in, and generating an RSA key pair. This ensures the C ABI for fundamental operations is working as expected. Signed-off-by: Simo Sorce <simo@redhat.com>
749fcdd to
f62ef77
Compare
Signed-off-by: Simo Sorce <simo@redhat.com>
Member
Author
|
I fixed the issue with the committed database but also made integration tests optional. To run them you have to explicitly run cargo build before you run cargo test in order to generate the .so, so on a clean project running just cargo test would fail. With the integration tests made optional, cargo test will run all other tests fine on a clean tree. I think this is a better experience. I tried to make the dependency on cryptoki optional too, but dev-dependencies can't be made optional so we'll have to keep it as it is. |
Jakuje
approved these changes
Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add an integration test to the cdylib crate using the
rust-cryptokilibrary to act as a client to the PKCS#11 shared library.This finally establishes end-to-end testing, of the actual pkcs#11 driver generated from the cdylib crate which is what is used by users.
The rust-cryptoki crate is used to drive the testing.
Checklist
Reviewer's checklist: