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

Virt_admin_logging: create local disk and clear messages log #5942

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

Conversation

rh-jugraham
Copy link
Contributor

@rh-jugraham rh-jugraham commented Oct 16, 2024

Issue:
TestFail: Check message log:journal failed in log file:/var/log/messages

More specifically:

ERROR| VM fails to start with:command: "/usr/bin/virsh -c 'qemu:///system' start avocado-vt-vm1 "exit_status: 1duration: 0.02745846800007712interrupted: Falsepid: 155132encoding: 'UTF-8'stdout: '\n'stderr: "error: Failed to start domain 'avocado-vt-vm1'\nerror: Cannot access storage file '/var/lib/libvirt/images/no_existed_journal.qcow2' (as uid:107, gid:107): No such file or directory\n"

Fix:
Run create_local_disk() to ensure that no_existed_journal.qcow2 exists.

Additionally, since in some cases, this test case checks the entirety of /var/log/messages (which contains logs from all test runs) for the key word "journal" to determine whether the test passes/fails, this failure causes subsequent tests to pass because "journal" is present in the error message. To fix this, /var/log/messages is cleared at the beginning of the test run to make sure that the only messages checks are ones that were logged during that specific test run.

Tests passing:

[root@hpe-apollo-cn99xx-21 /]# /usr/local/bin/avocado run --vt-type libvirt --test-runner=runner conf_file.libvirtd_conf.virt_admin_logging.positive_test.journal_virt_admin_log_output --vt
-connect-uri qemu:///system
No python imaging library installed. Screendump and Windows guest BSOD detection are disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
No python imaging library installed. PPM image conversion to JPEG disabled. In order to enable it, please install python-imaging or the equivalent for your distro.
JOB ID     : 3863ed038b0c7a6fb76a053ad249d337ab259263
JOB LOG    : /var/log/avocado/job-results/job-2024-10-17T10.41-3863ed0/job.log
 (1/7) type_specific.io-github-autotest-libvirt.conf_file.libvirtd_conf.virt_admin_logging.positive_test.journal_virt_admin_log_output: PASS (10.80 s)
 (2/7) type_specific.io-github-autotest-libvirt.conf_file.libvirtd_conf.virt_admin_logging.positive_test.journal_virt_admin_log_output: PASS (21.49 s)
 (3/7) type_specific.io-github-autotest-libvirt.conf_file.libvirtd_conf.virt_admin_logging.positive_test.journal_virt_admin_log_output: PASS (21.14 s)
 (4/7) type_specific.io-github-autotest-libvirt.conf_file.libvirtd_conf.virt_admin_logging.positive_test.journal_virt_admin_log_output: PASS (9.06 s)
 (5/7) type_specific.io-github-autotest-libvirt.conf_file.libvirtd_conf.virt_admin_logging.positive_test.journal_virt_admin_log_output: PASS (8.97 s)
 (6/7) type_specific.io-github-autotest-libvirt.conf_file.libvirtd_conf.virt_admin_logging.positive_test.journal_virt_admin_log_output: PASS (9.02 s)
 (7/7) type_specific.io-github-autotest-libvirt.conf_file.libvirtd_conf.virt_admin_logging.positive_test.journal_virt_admin_log_output: PASS (8.84 s)
RESULTS    : PASS 7 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/log/avocado/job-results/job-2024-10-17T10.41-3863ed0/results.html
JOB TIME   : 90.53 s

@rh-jugraham rh-jugraham changed the title journal_virt_admin_log_output bug fix Virt_admin_logging: create local disk and clear messages log Oct 17, 2024
@rh-jugraham rh-jugraham marked this pull request as ready for review October 17, 2024 14:58
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.

1 participant