Skip to content

Conversation

kkaarreell
Copy link
Collaborator

@kkaarreell kkaarreell commented Oct 20, 2025

Summary by Sourcery

Add support for push attestation (push_model_agent) in test framework and setup, including helper functions, systemd unit configs, enhancements to existing tests, and a new functional test suite

New Features:

  • Implement test-helpers functions for managing the push_model_agent service and integrate its logs
  • Add tenant option --push-model and parameterize measured-boot tests to support starting the push agent
  • Introduce systemd drop-in configurations for the keylime_push_model_agent service in installation and TPM emulator setup scripts
  • Add a new functional test suite for push attestation on localhost covering success and failure scenarios

Enhancements:

  • Parameterize agent startup commands in measured-boot-swtpm tests with AGENT_SERVICE variable
  • Apply quoting and whitespace improvements and correct documentation typos in test-helpers library

ansasaki and others added 8 commits October 20, 2025 14:38
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Setup the push-attestation agent service in the same way as
pull-attestation agent service.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Add a drop-in configuration file for the keylime_push_model_agent
service to set the TCTI environment variable.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
This adds an end-to-end test and a specific plan for push-attestation.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Change repositories to test

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
@kkaarreell kkaarreell self-assigned this Oct 20, 2025
Copy link

sourcery-ai bot commented Oct 20, 2025

Reviewer's Guide

This PR introduces support for the push-model attestation agent across the test framework and functional tests by extending the test-helpers library, updating existing test scripts to parameterize the agent service, adding systemd unit drop-in configurations for the new service, and introducing a dedicated functional test suite for push attestation.

File-Level Changes

Change Details Files
Add push-model agent wrappers and log integration in test-helpers
  • Special-case "push_model_agent" in log-name resolver
  • Implement limeStartPushAgent, limeStopPushAgent, limePushAgentLogfile
  • Include push agent logfile in common log submission
Library/test-helpers/lib.sh
Parameterize agent service in measured-boot-swtpm-sanity tests
  • Define TENANT_ARGS and choose AGENT_SERVICE at runtime
  • Replace static limeStartAgent/StopAgent calls with dynamic limeStart${AGENT_SERVICE}/Stop
  • Append ${TENANT_ARGS} to keylime_tenant invocations
functional/measured-boot-swtpm-sanity/test.sh
Add systemd drop-in unit files for keylime_push_model_agent
  • Create service.d dirs for push_model_agent under install and config tests
  • Add log-trace, measured-boot and coverage environment drop-ins
  • Loop over agent dirs when applying TPM emulator TCTI config
setup/install_upstream_rust_keylime/test.sh
setup/configure_tpm_emulator/test.sh
Introduce functional push attestation test suite
  • Add new push-attestation-on-localhost test script
  • Include corresponding FMF files
functional/push-attestation-on-localhost/test.sh
functional/push-attestation-on-localhost/main.fmf
plans/.../push-attestation-on-localhost/main.fmf
Minor cleanup and typo fixes
  • Quote environment variables and paths consistently
  • Fix tidy formatting and remove stray spaces
  • Correct header typo from limeAgentrLogfile to limeAgentLogfile
Library/test-helpers/lib.sh
functional/measured-boot-swtpm-sanity/test.sh
setup/...

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

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 - here's some feedback:

  • In limeStartPushAgent you’re appending to __INTERNAL_limeTPMDetails without quoting the variable—please use "${__INTERNAL_limeTPMDetails}" to avoid word‐splitting.
  • The TPM capability collection logic in limeStartPushAgent is duplicated; consider extracting it into a shared helper function for reuse across services.
  • When appending TENANT_ARGS in the functional tests, wrap "${TENANT_ARGS}" in quotes or conditionally include it so that empty values don’t introduce stray spaces or syntax errors.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In limeStartPushAgent you’re appending to __INTERNAL_limeTPMDetails without quoting the variable—please use "${__INTERNAL_limeTPMDetails}" to avoid word‐splitting.
- The TPM capability collection logic in limeStartPushAgent is duplicated; consider extracting it into a shared helper function for reuse across services.
- When appending TENANT_ARGS in the functional tests, wrap "${TENANT_ARGS}" in quotes or conditionally include it so that empty values don’t introduce stray spaces or syntax errors.

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.

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