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

Clean up and fix guest_generate_testdata.py #90

Merged

Conversation

erichte-ibm
Copy link
Collaborator

As reported in #89 test data generated by guest_generate_testdata.py do not pass the guest test cases. The culprit was a simple directory name typo: goldenkeys vs goldenKeys. However, as this file was in serious need of clean up, took the time to fix it up as well -- mostly fixing style issues, indentation problems (which I'm rather confused on how this ran in the first place, knowing how picky python is), and other bits of redundant code.

There's still a few more things that can probably be cleaned up in this file, I may add a few more commits to this PR before merging.

There are several style problems in this file, most notably indentation
issues: mixed tabs and spaces, as well as incorrect level of indentation.
Correct them, as well as other subtle formatting issues.

Signed-off-by: Eric Richter <[email protected]>
…os.path.join

An array of paths is _very_ unclear when reading a section of code
without context. Use named globals instead so that the reader does not
need to move around the file to translate.

Also use os.path.join() everywhere instead of manually joining paths with
an add operation. This ensures path separators are included where needed,
and also helps with portability.

Signed-off-by: Eric Richter <[email protected]>
There is no need to separate the list of variables signed by PK or by KEK,
the third element of that list does that for us. Merging them, and using
list decompositon, we can simplify the generation functions to use one
loop and avoid list access by semi-arbitrary index numbers.

Signed-off-by: Eric Richter <[email protected]>
Apparently the directory for golden keys expected by the test cases
should be goldenKeys, not goldenkeys. This script would generate test
files that would not actually replace the old files, causing any test
cases that test update auth files to fail, as they were signed with
different keys.

Signed-off-by: Eric Richter <[email protected]>
@erichte-ibm erichte-ibm merged commit dd64431 into open-power:main Oct 7, 2024
8 checks passed
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.

1 participant