-
Notifications
You must be signed in to change notification settings - Fork 168
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
libvirt-guests: Improve test logging #5173
Conversation
b662f80
to
a6a7887
Compare
The test sometimes fails and there's no log for the guest service at all. Add checks for start and restart to succeed and if not, log the service logs with journalctl. Also, the Tail was called incorrectly leading to (per default unrecorded) TypeError "can only concatenate str (not "tuple") to str" The Tail already has a log file where it stores the output. Print its path so it can be inspected if needed. Signed-off-by: Sebastian Mitterle <[email protected]>
a6a7887
to
4bf6076
Compare
|
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.
LGTM
output_params=(tailed_log_file)) | ||
tailed_messages = aexpect.Tail(command='tail -f /var/log/messages') | ||
logging.debug("Tail of log messages are logged in %s", | ||
tailed_messages.output_filename) |
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.
Will this output_filename be cleaned after testing automatically?
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.
Not by default. The file is test specific and created under the tmp basedir https://github.com/avocado-framework/aexpect/blob/main/aexpect/client.py#L145
The way to clean those files would be to call tailed_messages
explicitly. We don't do this so we can inspect the file after the test run.
The test sometimes fails and there's no log for the guest service at all. Add checks for start and restart to succeed and if not, log the service logs with journalctl.
Also, the Tail was called incorrectly leading to (per default unrecorded) TypeError
"can only concatenate str (not "tuple") to str"
The Tail already has a log file where it stores the output. Print its path so it can be inspected if needed.