Skip to content
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

Test import_mok_state() when MokListRT would be bigger than available size #417

Merged
merged 4 commits into from
Jan 17, 2025

Conversation

vathpela
Copy link
Contributor

@vathpela vathpela commented Sep 20, 2021

This patch set adds test_mok_mirror_1(), which is basically like test_mok_mirror_0() except with a variable size limit smaller than MokListRT would be, and with the .must_be_absent flag set to true in the test data, so the test will fail if the variable is successfully created or if the data is not in the mokvars config variable.

@julian-klode
Copy link
Collaborator

Should the tests maybe have more descriptive names than 0 and 1? And/Or comments would be nice, so you won't need to dig through commits later to find out what the test tests.

@vathpela
Copy link
Contributor Author

Should the tests maybe have more descriptive names than 0 and 1? And/Or comments would be nice, so you won't need to dig through commits later to find out what the test tests.

Yeah, that's a big part of why this is still a draft.

@vathpela vathpela force-pushed the test-mok-mirror-enospc branch from 3dc8189 to a439ec2 Compare October 12, 2021 15:10
@vathpela vathpela marked this pull request as ready for review October 12, 2021 15:10
@vathpela vathpela changed the base branch from main to shim-15.5 October 12, 2021 15:10
@vathpela vathpela added this to the shim 15.5 milestone Oct 13, 2021
@frozencemetery frozencemetery removed this from the shim 15.5 milestone Mar 8, 2022
Copy link
Member

@frozencemetery frozencemetery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs rebased on main - I'm not sure where github is getting "no conflicts" from.

@vathpela vathpela force-pushed the test-mok-mirror-enospc branch 2 times, most recently from 37de20a to af376e5 Compare January 17, 2025 20:42
When SetVariable() is called, currently the test for being out of space
is correct, but the accounting is backwards - success adds more space
available.

This fixes the accounting and (with SHIM_DEBUG) logs the variable size.

Signed-off-by: Peter Jones <[email protected]>
This splits up the API for setting default usage limits, adding a test
API function to set alternate usage limits.

Signed-off-by: Peter Jones <[email protected]>
This makes a generic test_mok_mirror() which can validate the result of
(hopefully) any run of any result of import_mok_state(), and changes
test_mok_mirror_0() to use it, and also documents what's being tested
and the results it expects to see.

Signed-off-by: Peter Jones <[email protected]>
This adds another test case for mirroring mok variables - in this case
there is arbitrarily not enough space in the SetVariable() storage
backend for some or all of the variables, and so some variables are
mirrored to both variables and the config space storage, and some only
to the config space storage.

Currently the test only ensures that the out-of-resources condition on
the variable storage is handled correctly; we don't (yet) test the
config space.  That's an avenue for future work.

Signed-off-by: Peter Jones <[email protected]>
@vathpela vathpela changed the base branch from shim-15.5 to main January 17, 2025 20:45
@vathpela vathpela force-pushed the test-mok-mirror-enospc branch from af376e5 to 4eb84a0 Compare January 17, 2025 20:45
@vathpela vathpela dismissed frozencemetery’s stale review January 17, 2025 20:46

This issue is fixed.

@vathpela vathpela merged commit 70366a2 into rhboot:main Jan 17, 2025
20 checks passed
@vathpela vathpela deleted the test-mok-mirror-enospc branch January 17, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants