rust-keyutils
rust-keyutils copied to clipboard
test: add basic encrypted key management tests
I added some basic tests for the Encrypted KeyType. Note that this change now requires CONFIG_ENCRYPTED_KEYS to be enabled for unit tests to pass.
:( It appears the runners do not support encrypted keys... man_shrugging maybe place the tests or all of encrypted keys behind a feature?
Yes, testing this stuff has been…painful on public CI infrastructure. They have this fetish with running as root inside containers which really messes with the permission checking done here. Quotas are also wacky and cause…interesting failures. See #34 for some fun.
Note that this change now requires CONFIG_ENCRYPTED_KEYS to be enabled for unit tests to pass.
#34 also has code to make tests into no-ops if a feature is not supported. I wish there were a way to say "this test is skipped" in Rust, but that is tied up in rust-lang/rust#50297.
I've just merged #34 (with #39 as a TODO item) and some holes for tests when run as root. Please move the tests to the encrypted.rs file and use some of the patterns there for capability checking.
Awesome! Will update soon