keylime-secure-mount: Accept expected logs from the library#1099
Merged
Conversation
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>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideTest 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
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) |
There was a problem hiding this comment.
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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Collaborator
Author
|
test failure is unrelated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: