-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a plugin for DMesg log analysis post TC Execution #3637
Conversation
umfranci
commented
Feb 7, 2025
- The purpose of this Draft PR is to create a code for checking the DMesg logs for any exceptions once the test case execution is completed.
- The execution will be done based on a switch - the default value of which would be false - hence avoiding any unnecessary failures/noise.
- This can be later on extended to also check panic patterns or increase the scope of the checks executed after the test case is completed.
@@ -501,6 +502,11 @@ def get_information(self) -> Dict[str, str]: | |||
|
|||
return final_information | |||
|
|||
def exec_check_dmesg_oops(self) -> bool: | |||
return plugin_manager.hook.check_dmesg_oops( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Group errors from different plugins, if it returns non-empty.
- Raise failure exception and let the upper layer to deal with it.
@@ -1186,6 +1192,9 @@ class NodeHookSpec: | |||
def get_node_information(self, node: Node) -> Dict[str, str]: | |||
... | |||
|
|||
@hookspec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's only hooked in LISA upstream code, it doesn't need to use the hookspec. Just implement as a normal method.
@@ -752,6 +752,16 @@ def start( | |||
log=case_log, | |||
) | |||
|
|||
nodes = environment.nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move into __run_case
after test passed, and let the handle_exception
proceed the raised exception.
@@ -1444,6 +1444,8 @@ class Platform(TypedSchema, ExtendableSchemaMixin): | |||
capture_azure_information: bool = False | |||
# capture boot time info or not | |||
capture_boot_time: bool = False | |||
# to check if dmesg logs need to be analyzed after each test case | |||
check_dmesg_after_case: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_kernel_error