From 265810b68ff8635e6bb781d28b30aa369401587f Mon Sep 17 00:00:00 2001 From: chunfuwen Date: Thu, 2 Dec 2021 00:12:14 -0500 Subject: [PATCH] Fix fail to get SG_IO device issue Allow time to enable multipathd alive after restart Signed-off-by: chunfuwen --- .../src/virtual_disks/virtual_disks_multipath.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libvirt/tests/src/virtual_disks/virtual_disks_multipath.py b/libvirt/tests/src/virtual_disks/virtual_disks_multipath.py index 6521704122..0b64708b2c 100644 --- a/libvirt/tests/src/virtual_disks/virtual_disks_multipath.py +++ b/libvirt/tests/src/virtual_disks/virtual_disks_multipath.py @@ -159,6 +159,17 @@ def has_new_mpath_devs(): disk_params['driver_name'] = params.get("virt_disk_drive_name", "qemu") disk_params['driver_type'] = params.get("virt_disk_device_format", "raw") disk_xml = libvirt.create_disk_xml(disk_params) + + def _verify_multipathd_alive(): + """ + Verify whether multipathd statue is active, return bool value + """ + host_session = aexpect.ShellSession("sh") + return utils_misc.get_guest_service_status( + host_session, 'multipathd') == 'active' + # Allow time to enable multipathd alive after restart + utils_misc.wait_for(_verify_multipathd_alive, 40) + # Test disk operation with newly added disk xml attach_option = "" if not hotplug_disk: