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

virsh_event: fix disk discovery #5430

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions libvirt/tests/src/event/virsh_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from virttest.libvirt_xml.devices.interface import Interface
from virttest.libvirt_xml.devices.panic import Panic
from virttest.libvirt_xml.devices.watchdog import Watchdog
from virttest.utils_libvirt.libvirt_disk import get_non_root_disk_name

from xml.dom.minidom import parseString

Expand Down Expand Up @@ -378,8 +379,10 @@ def _check_disk(target):
logging.debug(process.run('qemu-img info %s -U' % new_disk))
virsh.domblkthreshold(vm_name, 'vdb', '100M')
session = dom.wait_for_login()
session.cmd("mkfs.ext4 /dev/vdb && mount /dev/vdb /mnt && ls /mnt && "
"dd if=/dev/urandom of=/mnt/bigfile bs=1M count=300 && sync", timeout=90)
disk_name, _ = get_non_root_disk_name(session)
session.cmd("mkfs.ext4 /dev/%s && mount /dev/%s /mnt && ls /mnt && "
"dd if=/dev/urandom of=/mnt/bigfile bs=1M count=300 && sync"
% (disk_name, disk_name), timeout=90)
time.sleep(5)
session.close()
expected_events_list.append("'block-threshold' for %s:"
Expand Down Expand Up @@ -558,8 +561,10 @@ def _check_disk(target):
add_disk(dom.name, new_disk, 'vdb', '--subdriver qcow2 --config', 'qcow2')
dom.start()
session = dom.wait_for_login()
session.cmd("mkfs.ext4 /dev/vdb && mount /dev/vdb /mnt && ls /mnt && "
"dd if=/dev/zero of=/mnt/test.img bs=1M count=50", ignore_all_errors=True)
disk_name, _ = get_non_root_disk_name(session)
session.cmd("mkfs.ext4 /dev/%s && mount /dev/%s /mnt && ls /mnt && "
"dd if=/dev/zero of=/mnt/test.img bs=1M count=50"
% (disk_name, disk_name), ignore_all_errors=True)
time.sleep(5)
session.close()
expected_events_list.append("'io-error' for %s: " + "%s" % new_disk + r" \(virtio-disk1\) pause")
Expand Down
Loading