Skip to content

Conversation

kkaarreell
Copy link
Collaborator

@kkaarreell kkaarreell commented Oct 10, 2025

…ithms

Summary by Sourcery

Enable attestation in the non-default TPM algorithms functional test by default and introduce a new TPM support detection script for enumerating supported ECC curves and RSA key sizes in an emulated TPM.

New Features:

  • Add tpm_support_detection.sh to survey and log supported TPM ECC curves and RSA key sizes for EK creation in the emulator.

Enhancements:

  • Re-enable the attestation phase in the non-default TPM algorithms test with a SKIP_ATTESTATION flag to optionally skip the process.

Tests:

  • Integrate conditional attestation logic into test.sh to allow actual attestation runs when supported.

…ithms

Signed-off-by: Sergio Correia <scorreia@redhat.com>
@kkaarreell kkaarreell self-assigned this Oct 10, 2025
Copy link

sourcery-ai bot commented Oct 10, 2025

Reviewer's Guide

This PR enables optional attestation in the non-default TPM algorithms registration test by introducing a skip flag, and adds a new support-detection script to dynamically survey and log TPM EK algorithm availability before running functional tests.

Flow diagram for TPM support detection script execution

flowchart TD
    A["Start TPM support detection script"] --> B["Setup: Import test helpers and start TPM emulator if present"]
    B --> C["Create temporary directory"]
    C --> D["Survey ECC curve support"]
    D --> E["Survey RSA key size support"]
    E --> F["Test ECC curves for EK creation"]
    F --> G["Test RSA key sizes for EK creation"]
    G --> H["Log supported algorithms"]
    H --> I["Submit logs"]
    I --> J["Cleanup: Stop TPM emulator, remove temp directory"]
    J --> K["End"]
Loading

File-Level Changes

Change Details Files
Add conditional attestation logic to test script
  • Introduce SKIP_ATTESTATION environment variable
  • Wrap attestation steps in if/else to skip or execute
  • Log which alg/sig combinations are skipped
functional/agent-registration-with-non-default-tpm-algorithms/test.sh
Add TPM support detection script
  • Create script to import test-helpers and set up TPM emulator
  • Query tpm2_getcap for ECC curves and RSA algorithms
  • Loop through ECC curves and RSA sizes to test EK creation and log results
  • Submit logs and clean up emulator and temp directory
functional/agent-registration-with-non-default-tpm-algorithms/tpm_support_detection.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@@ -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

Not following: /usr/share/beakerlib/beakerlib.sh: openBinaryFile: does not exist (No such file or directory)
Copy link

@sourcery-ai sourcery-ai bot left a 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 and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## 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 expansion to prevent word splitting.

Quoting "${TmpDir}" ensures correct removal even if the directory name includes spaces or special characters.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@kkaarreell
Copy link
Collaborator Author

@kkaarreell kkaarreell merged commit 5d5c3c3 into rhel-10-main Oct 13, 2025
3 of 5 checks passed
@kkaarreell kkaarreell deleted the backport/20251010_49538_rhel-10-main branch October 13, 2025 11:53
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.

2 participants