rust-keyutils icon indicating copy to clipboard operation
rust-keyutils copied to clipboard

test: add basic encrypted key management tests

Open dlrobertson opened this issue 5 years ago • 4 comments

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.

dlrobertson avatar Jan 09 '20 14:01 dlrobertson

:( 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.

mathstuf avatar Jan 09 '20 15:01 mathstuf

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.

mathstuf avatar Jan 09 '20 18:01 mathstuf

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.

mathstuf avatar Jan 10 '20 01:01 mathstuf

Awesome! Will update soon

dlrobertson avatar Jan 10 '20 16:01 dlrobertson