Skip to content

keylime-secure-mount: Accept expected logs from the library#1099

Merged
kkaarreell merged 1 commit into
rhel-9-mainfrom
backport/20260722114609_rhel-9-main
Jul 22, 2026
Merged

keylime-secure-mount: Accept expected logs from the library#1099
kkaarreell merged 1 commit into
rhel-9-mainfrom
backport/20260722114609_rhel-9-main

Conversation

@kkaarreell

@kkaarreell kkaarreell commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

After moving some code to the library, it is possible that some of the logs are generated there and not in the keylime_agent.

Therefore, drop the origin of the log from the expected log message.

Summary by Sourcery

Tests:

  • Update keylime secure mount sanity tests to match log messages without asserting the keylime_agent module prefix.

After moving some code to the library, it is possible that some of the
logs are generated there and not in the keylime_agent.

Therefore, drop the origin of the log from the expected log message.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
@kkaarreell kkaarreell self-assigned this Jul 22, 2026
@sourcery-ai

sourcery-ai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Test expectations for keylime secure mount logs are relaxed to no longer depend on the log origin/module prefix, so they still pass when messages come from the shared library instead of keylime_agent.

File-Level Changes

Change Details Files
Relax log message assertions in secure_mount sanity test to ignore the log origin prefix.
  • Updated the success-case grep assertion to look only for the directory-created message text without the leading log level and module path.
  • Updated the error-case grep assertion to look only for the secure mount error message text without the leading log level and module path.
sanity/keylime-secure_mount/test.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

rlRun "limeStartAgent"
sleep 3
rlAssertGrep "INFO keylime_agent::secure_mount > Directory \"$SECURE_DIR\" created" $(limeAgentLogfile)
rlAssertGrep "Directory \"$SECURE_DIR\" created" $(limeAgentLogfile)
rlRun "mount -t ramfs -o size=1m,mode=0700 ramfs $SECURE_DIR"
rlRun "limeStartAgent"
rlAssertGrep "ERROR keylime_agent::secure_mount > Secure mount error: Secure storage location $SECURE_DIR already mounted on wrong file system type:" $(limeAgentLogfile)
rlAssertGrep "Secure mount error: Secure storage location $SECURE_DIR already mounted on wrong file system type:" $(limeAgentLogfile)

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider making the log match a bit more specific (e.g., using regex anchors or additional context) to avoid the relaxed grep accidentally matching unrelated messages that contain similar text.
  • If other tests in this suite rely on module-qualified log prefixes, it may be worth reviewing them for consistency with this new library-based logging approach to keep expectations uniform.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider making the log match a bit more specific (e.g., using regex anchors or additional context) to avoid the relaxed grep accidentally matching unrelated messages that contain similar text.
- If other tests in this suite rely on module-qualified log prefixes, it may be worth reviewing them for consistency with this new library-based logging approach to keep expectations uniform.

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
Copy Markdown
Collaborator Author

test failure is unrelated

@kkaarreell
kkaarreell merged commit a1ab821 into rhel-9-main Jul 22, 2026
3 of 5 checks passed
@kkaarreell
kkaarreell deleted the backport/20260722114609_rhel-9-main branch July 22, 2026 12:06
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.

3 participants