-
Notifications
You must be signed in to change notification settings - Fork 9
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
Port libkeyutils tests #34
Conversation
Seems that the CI containers do not have a new enough libkeyutils for |
Marking it as a weak symbol seems to be a perma-unstable solution: rust-lang/rust#29603. For now, I'll comment out the dh_compute tests and once we finish #24, they can be added back again with the appropriate ENOSYS detection logic. |
4a60aa3
to
3291db8
Compare
99b6361
to
318a35a
Compare
Seems that the |
421f739
to
82d2878
Compare
// Avoid a panic in the code below be ensuring that we actually have a keyring. Parsing | ||
// a key's payload as a keyring payload. | ||
let desc = self.description()?; | ||
if desc.type_ != keytypes::Keyring::name() { |
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.
See #35 for a better way of doing this.
There are some tests which end up with |
a4384cb
to
6fb0df5
Compare
6fb0df5
to
2bc9508
Compare
The documentation states that a keyring may be given or a special keyring used. The special IDs are looked up in the requesting process' namespace. An ID of `0` means that no link is requested.
The parser for the key payload is blindly trusting that the key ID is actually a keyring and not transformed or replaced in some way. Guard against this case be ensuring that we actually have a keyring ID.
The destination keyring does not need to be the same as the one that is searched. Fix the API and remove the now-broken tests.
The API did not match what is actually possible with the kernel API. Instead, just offer two simple methods which do what is needed. Also remove the old test which doesn't match what the API looks like anymore.
This is more ergonomic and allows for just passing a plain string around.
Some tests handle it manually to test behavior once the keyring is deallocated, so leave the old functionality there.
736ae3d
to
1a70ad2
Compare
Probably related to not having a user `1` available on the machine.
8b7e6d4
to
7728eda
Compare
Codecov Report
@@ Coverage Diff @@
## master #34 +/- ##
===========================================
+ Coverage 67.1% 89.71% +22.61%
===========================================
Files 19 33 +14
Lines 766 2032 +1266
===========================================
+ Hits 514 1823 +1309
+ Misses 252 209 -43
Continue to review full report at Codecov.
|
Well, this is far better. |
Continuted work towards #32.
TODO:
Cc: @josephlr