Skip to content

Conversation

@kkaarreell
Copy link
Collaborator

@kkaarreell kkaarreell commented Oct 21, 2025

Summary by Sourcery

Enable and test the push-model attestation agent across the test infrastructure by adding helper functions, updating service configurations, parameterizing existing tests, and introducing a dedicated push-model functional test suite

New Features:

  • Add test helper functions for starting, stopping, and logging the push-model attestation agent
  • Introduce a new push-attestation-on-localhost functional test for push-model attestation

Enhancements:

  • Extend measured-boot-swtpm-sanity and basic-attestation tests to parameterize between standard and push-model agents with dynamic commands and --push-model flag
  • Update systemd drop-in configurations to include keylime_push_model_agent in Rust installation and TPM emulator setup
  • Include push-model agent logs in the common log submission routine
  • Fix quoting of internal log variables and correct minor typos in test helper scripts

Tests:

  • Adapt existing container and measured-boot test suites to support the push-model agent variant

@kkaarreell kkaarreell self-assigned this Oct 21, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 21, 2025

Reviewer's Guide

Adds comprehensive support for push-model attestation by extending test helpers, parameterizing existing tests and container scripts, updating service drop-in configurations, and introducing a new push-attestation-on-localhost test suite.

File-Level Changes

Change Details Files
Support push_model_agent in test-helpers with logging and lifecycle integration
  • Added alias handling in __limeGetLogName for push_model_agent
  • Introduced limeStartPushAgent, limeStopPushAgent, and limePushAgentLogfile functions
  • Extended limeSubmitCommonLogs to include push agent logs
  • Fixed typo in documentation heading and adjusted variable quoting in log initialization
Library/test-helpers/lib.sh
Parameterize existing functional and container tests for optional push-model mode
  • Defined TENANT_ARGS and AGENT_CMD based on AGENT_SERVICE
  • Added conditional verifier mode and challenge_lifetime settings
  • Replaced fixed limeStartAgent/limeStopAgent calls with limeStart${AGENT_SERVICE}/limeStop${AGENT_SERVICE}
  • Appended ${TENANT_ARGS} to keylime_tenant invocations
functional/measured-boot-swtpm-sanity/test.sh
container/functional/keylime_agent_container-basic-attestation/test.sh
Extend systemd drop-in configurations for keylime_push_model_agent
  • Created service.d directories and drop-in unit files for push_model_agent with log trace, measured-boot, and coverage settings
  • Updated TPM emulator setup to apply TCTI configs to both agent services
setup/install_upstream_rust_keylime/test.sh
setup/configure_tpm_emulator/test.sh
Introduce new functional push-attestation-on-localhost test suite
  • Added standalone test script to set up push-mode environment and validate attestation cycles
  • Included FMF metadata for the new push-attestation test
functional/push-attestation-on-localhost/test.sh
functional/push-attestation-on-localhost/main.fmf

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:

  • The mapping in __limeGetLogName for push_model_agent to “agent” risks mixing push-agent logs with the standard agent logs—consider giving push_model_agent its own suffix to avoid collisions.
  • There’s duplicated logic for TENANT_ARGS and AGENT_CMD across several test scripts; extracting that into a shared helper or small wrapper would reduce maintenance overhead.
  • When truncating log files in lib.sh, using the built-in no-op ':' (e.g. ‘: > file’) is more idiomatic and slightly more portable than ‘true > file’.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The mapping in __limeGetLogName for push_model_agent to “agent” risks mixing push-agent logs with the standard agent logs—consider giving push_model_agent its own suffix to avoid collisions.
- There’s duplicated logic for TENANT_ARGS and AGENT_CMD across several test scripts; extracting that into a shared helper or small wrapper would reduce maintenance overhead.
- When truncating log files in lib.sh, using the built-in no-op ':' (e.g. ‘: > file’) is more idiomatic and slightly more portable than ‘true > file’.

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

/packit test

@kkaarreell
Copy link
Collaborator Author

/packit test

@kkaarreell
Copy link
Collaborator Author

/packit test

@kkaarreell kkaarreell force-pushed the ks_push_cont branch 2 times, most recently from c94deff to 3aa47e6 Compare December 4, 2025 06:28
else
_MAJOR=$( rpm -q --qf '%{VERSION}' centos-stream-release | cut -d '.' -f 1 )
_ARCH=$( arch )
dnf -y copr enable packit/keylime-rust-keylime-master-centos centos-stream-${_MAJOR}-${_ARCH}

Check warning

Code scanning / shellcheck

SC2086 Warning test

Double quote to prevent globbing and word splitting.
else
_MAJOR=$( rpm -q --qf '%{VERSION}' centos-stream-release | cut -d '.' -f 1 )
_ARCH=$( arch )
dnf -y copr enable packit/keylime-rust-keylime-master-centos centos-stream-${_MAJOR}-${_ARCH}

Check warning

Code scanning / shellcheck

SC2086 Warning test

Double quote to prevent globbing and word splitting.
sleep 5
rlRun "limeWaitForAgentStatus $AGENT_ID_FIRST 'Get Quote'"
rlRun "limeWaitForAgentStatus $AGENT_ID_SECOND 'Get Quote'"
sleep $limeTimeout

Check warning

Code scanning / shellcheck

SC2154 Warning test

limeTimeout is referenced but not assigned.
sleep 5
rlRun "limeWaitForAgentStatus $AGENT_ID_FIRST 'Get Quote'"
rlRun "limeWaitForAgentStatus $AGENT_ID_SECOND 'Get Quote'"
sleep $limeTimeout

Check warning

Code scanning / shellcheck

SC2086 Warning test

Double quote to prevent globbing and word splitting.
@kkaarreell kkaarreell force-pushed the ks_push_cont branch 2 times, most recently from 15651b9 to 8426174 Compare December 4, 2025 16:14
@kkaarreell
Copy link
Collaborator Author

test failures are unrelated, probably due to wrong change in keylime/rust-keylime#1158

@kkaarreell kkaarreell merged commit 5a847d3 into main Dec 4, 2025
3 of 10 checks passed
@kkaarreell kkaarreell deleted the ks_push_cont branch December 4, 2025 22:58
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