Skip to content
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

Making logs smaller by getting it only for the time of test execution #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

katlapinka
Copy link
Contributor

Gathering dmesg and /var/log/messages only for the time when given test is running

Kamoppl
Kamoppl previously approved these changes Jan 8, 2025
Comment on lines +206 to +211
test_identifier = re.escape(TestRun.LOGGER.unique_test_identifier)

TestRun.executor.run(
f"dmesg | awk '/{test_identifier}/,0' > {log_files['dmesg.log']}")
TestRun.executor.run(
f"awk '/{test_identifier}/,0' {messages_log} > {log_files['messages.log']}")
Copy link
Contributor

@Deixx Deixx Jan 30, 2025

Choose a reason for hiding this comment

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

If the identifier is set to the template and no one calls print_test_identifier_to_logs() then there is no identifier in logs and awk returns empty string.
I'd suggest default empty value - then if identifier is not set awk will gather everything and collect from the identifier otherwise

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