-
Notifications
You must be signed in to change notification settings - Fork 19
Backport: f/agent-registration-with-non-default-tpm-algorithms #909
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
base: rhel-9-main
Are you sure you want to change the base?
Conversation
…ithms Signed-off-by: Sergio Correia <scorreia@redhat.com>
Reviewer's GuideThis PR refines TPM emulator setup by removing unnecessary platform certificate creation flags and backports a comprehensive functional test suite to validate agent registration and TPM EK support when using non-default encryption and signing algorithms. Sequence diagram for TPM algorithm support detection and agent registrationsequenceDiagram
actor User
participant "Test Script"
participant "TPM Emulator"
participant "TPM2 Tools"
User->>"Test Script": Start test
"Test Script"->>"TPM Emulator": Start emulator
"Test Script"->>"TPM2 Tools": Query ECC curve support
"TPM2 Tools"-->>"Test Script": Return ECC curves
"Test Script"->>"TPM2 Tools": Query RSA key size support
"TPM2 Tools"-->>"Test Script": Return RSA key sizes
loop For each ECC curve
"Test Script"->>"TPM2 Tools": Try EK creation with curve
"TPM2 Tools"-->>"Test Script": Success/Failure
end
loop For each RSA key size
"Test Script"->>"TPM2 Tools": Try EK creation with key size
"TPM2 Tools"-->>"Test Script": Success/Failure
end
"Test Script"->>User: Log supported algorithms
User->>"Test Script": Register agent with supported algorithm
"Test Script"->>"TPM Emulator": Validate registration
"Test Script"->>"TPM Emulator": Stop emulator
"Test Script"->>User: Cleanup and finish
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
@@ -0,0 +1,81 @@ | |||
#!/bin/bash | |||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k | |||
. /usr/share/beakerlib/beakerlib.sh || exit 1 |
Check warning
Code scanning / shellcheck
SC1091 Warning test
@@ -0,0 +1,79 @@ | |||
#!/bin/bash | |||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k | |||
. /usr/share/beakerlib/beakerlib.sh || exit 1 |
Check warning
Code scanning / shellcheck
SC1091 Warning
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.
Hey there - I've reviewed your changes - here's some feedback:
- main.fmf is empty—please add the necessary FMF metadata (including test parameters for TPM_ENCRYPTION_ALG and TPM_SIGNING_ALG) so the suite can be discovered and executed.
- Since the scripts require TPM_ENCRYPTION_ALG and TPM_SIGNING_ALG to be set externally, consider defining defaults or a parameter matrix in main.fmf to ensure CI jobs supply valid values.
- The emulator startup/teardown logic is duplicated across the new scripts—factor this into a shared helper function to simplify maintenance.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- main.fmf is empty—please add the necessary FMF metadata (including test parameters for TPM_ENCRYPTION_ALG and TPM_SIGNING_ALG) so the suite can be discovered and executed.
- Since the scripts require TPM_ENCRYPTION_ALG and TPM_SIGNING_ALG to be set externally, consider defining defaults or a parameter matrix in main.fmf to ensure CI jobs supply valid values.
- The emulator startup/teardown logic is duplicated across the new scripts—factor this into a shared helper function to simplify maintenance.
## Individual Comments
### Comment 1
<location> `functional/agent-registration-with-non-default-tpm-algorithms/tpm_support_detection.sh:76` </location>
<code_context>
+ rlRun "limeCondStopAbrmd"
+ fi
+ limeSubmitCommonLogs
+ rlRun "rm -r ${TmpDir}" 0 "Removing tmp directory"
+ rlPhaseEnd
+
</code_context>
<issue_to_address>
**nitpick (bug_risk):** Use double quotes around variable expansions to prevent word splitting and globbing.
Quoting "${TmpDir}" ensures the command works correctly even if the directory path includes spaces or special characters.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
Backport functional tests for agent registration using custom TPM encryption and signing algorithms and align TPM emulator setup scripts with supported options
Enhancements:
Tests: