-
Notifications
You must be signed in to change notification settings - Fork 5
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
Extend test matrix to cover more possible build combinations of features #122
Conversation
b96c62d
to
af4d8b1
Compare
This is mostly ready for review. The only thing to figure out is the issue with the memorydb and why the jsondb fails in CI, but works locally. |
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.
Looks largely ok, only minor nits.
Thanks this is exactly where I wanted to see things headed!
The idea is to be comprehensive in the coverage, or just have at least some test coverage? because I has some experience with all-pairs testing and extension of it to triplets, quadruplets, etc.... |
Right now, we have around 25 features: https://github.com/latchset/kryoptic/blob/main/Cargo.toml#L49 They have some internal dependencies and then there is the "default" feature which we want or dont want to build. I was worried that doing all pairs (or triplets) would explode or would be even more work to exclude meaningless ones. |
all pairs (n-tuples) testing is especially effective if you have a lot of features, as then you avoid the combinatorial explosion and no, having meaningless combinations is not a problem, when you generate the combinations you can exclude combinations that are either impossible to support (like testing ECDH on build without ECC) or combinations we explicitly don't want to support (for whatever reason) |
In most cases each algorithm is fully independent from each other algorithm, so that testing them in pairs makes little sense. We have a core that is always involved and therefore is always tested. Then we have the algorithms which just operate on specific data, regardless of the core or anything else. The only major variability is the databases, because what they contain may influence the result of specific tests. So perhaps testing each "true leaf" algorithm on their own with each database may make some sense. Mostly to ensure there is no unexpected dependency between algorithms, but that is rather simple to verify so I would not want to spend a lot of CPU on that, and definitely not make CI much slower due to this. Perhaps we can have matrix testing done once a week on a scheduled CI run just for completeness. |
With recent changes the dbsuffix is not used anywhere. I kept it for now because it might be useful in the future, even though it works only for SQL and JSON. If you do not agree, I can remove it altogether. |
7c6b9c4
to
4cd093e
Compare
We can always resurrect from git, I am ok dropping anything that is not used anymore. |
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Previously, they were stored in token as CKO_DATA, but NSS DB does not support the CKO_DATA objects. Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
This does not work with the NSS DB. Use more common reference by ID and class. Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
The name dbpath is confusing as it is a path only for 2 dbs for now. For memory, there are optional arguments, as there is really no path and for NSS DB, the directory needs to be prefixed with `configDir=`, which makes it very nonintuitive. Signed-off-by: Jakub Jelen <[email protected]>
Signed-off-by: Jakub Jelen <[email protected]>
move what makes sense to RSA test. Signed-off-by: Jakub Jelen <[email protected]>
The test drivers are now written for persistent storage to properly excercise the whole process from library initialization, reading data from persistent storage, writing them and more. The memorydb is specific as it is not persistent. In the tests, we are able to initialize it successfully, but the content is thrown away and then a new empty token is created again, which does not have the expected content. Signed-off-by: Jakub Jelen <[email protected]>
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.
Only a couple of nits, but great job with this, thanks!!
Thanks for this work, really appreciated! |
With the amount of features the kryoptic supports, keeping track that they are self contained and all of the dependencies is quite tedious work.
This extends the test matrix and updates the tests to be able to run with different storages. For now,
jsondb
,sqlitedb
andnssdb
work, but thememorydb
does not. Additionally, I encountered the issue that the memory db is not possible to provision, unless encryption is turned on, because it tries to find PIN counters, which are not in non-encrypted storage.Fixes: #118