[utils/dmesg.py]: Add helper for journalctl logs and kernel cmdline parameters#6268
Conversation
Summary of ChangesHello @Sumitupadhyay1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces two new helper utilities within avocado-utils to improve kernel-related diagnostics and testing capabilities. One utility allows for programmatic verification of kernel command-line parameters, ensuring specific boot configurations are active. The other provides a method to collect and filter kernel logs from journalctl, enabling easier validation of kernel events and behaviors. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds two useful helper functions for interacting with kernel logs and command line parameters. The implementation is straightforward, but I have a couple of suggestions to improve correctness and consistency.
In check_kernel_cmdline_param, the current substring check could lead to false positives. I've suggested a more robust way to check for the exact parameter.
For collect_journalctl_logs, I've suggested using modern type hints for consistency with the other new function and refactoring the implementation to be more concise using a list comprehension.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6268 +/- ##
==========================================
- Coverage 73.69% 73.67% -0.02%
==========================================
Files 206 206
Lines 22620 22634 +14
==========================================
+ Hits 16670 16676 +6
- Misses 5950 5958 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@Sumitupadhyay1 Can you please have a look on above checks failing on your patch? |
023eb9e to
1df982a
Compare
|
@richtja Could you please review this Pull Request. |
1df982a to
f5fc3c5
Compare
|
The failing docs checks are upstream issues, not caused by this PR. They match the problem already fixed in PR: #6273 and applying those changes locally makes the build pass. |
|
This pull request depends on the execution of avocado-misc-tests. |
|
@richtja, Could you please review the pull request? Merging it would help with testing the avocado-misc-tests. |
1 similar comment
|
@richtja, Could you please review the pull request? Merging it would help with testing the avocado-misc-tests. |
richtja
left a comment
There was a problem hiding this comment.
Hi @Sumitupadhyay1, there are many format changes which are not related to this PR. Can you please remove them? Thanks
f5fc3c5 to
47f5820
Compare
Add collect_journalctl_logs() to list pattern matches in kernel logs. Add check_kernel_cmdline_param() to verify parameters in /proc/cmdline. Signed-off-by: Sumit Kumar <sumitkum@amd.com>
47f5820 to
ba17c54
Compare
|
Hi @richtja , thank you for the review. I’ve addressed all the requested changes. Could you please take another look at the pull request? Thanks! |
|
@richtja, Could you please review the pull request? Merging it would help with testing the avocado-misc-tests. |
richtja
left a comment
There was a problem hiding this comment.
Hi @Sumitupadhyay1, thank you for the update. It LGTM now.
Add utilities to:
Collect kernel log pattern matches
Run journalctl -k -b to fetch current boot kernel logs, filter for a given pattern, and return matching lines for validation in tests.
Verify kernel cmdline parameters
Read /proc/cmdline and check for a specified boot parameter, returning True if present, otherwise False, to confirm features were enabled at boot.