tp-libvirt icon indicating copy to clipboard operation
tp-libvirt copied to clipboard

libvirt_hooks.py: Fix string matching

Open Slancaster1 opened this issue 7 months ago • 1 comments

The Issue

The hook log for the hook "release end" can sometimes provide a reason for the release.

/etc/libvirt/hooks/qemu guest_name release end <shutoff-reason>

The test currently looks for a logline that does not provide a reason for relase. This appears like this:

/etc/libvirt/hooks/qemu guest_name release end -

This results in the test failing if a reason is provided. E.G. the test will fail if this log line is given:

/etc/libvirt/hooks/qemu guest_name release end shutdown

The Fix

Alter test such that it only looks for "release end" with or without a reason. I feel this is the best approach, as either outputs are valid.

Evidence

Console output showing this test passing

[root@ampere-mtsnow-altramax-22 ~]# avocado run --vt-type libvirt --vt-machine-type arm64-mmio --test-runner=runner libvirt_hooks.vm.start_stop
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     : f6ae8f9c2a42078f41f74140dee2cee98d9911aa
JOB LOG    : /var/log/avocado/job-results/job-2024-07-15T11.20-f6ae8f9/job.log
 (1/1) type_specific.io-github-autotest-libvirt.libvirt_hooks.vm.start_stop: PASS (63.00 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/log/avocado/job-results/job-2024-07-15T11.20-f6ae8f9/results.html
JOB TIME   : 63.42 s

Slancaster1 avatar Jul 15 '24 15:07 Slancaster1