diff --git a/libvirt/tests/cfg/virtual_network/passt/passt_function.cfg b/libvirt/tests/cfg/virtual_network/passt/passt_function.cfg index f8951abd3f9..946ec72132b 100644 --- a/libvirt/tests/cfg/virtual_network/passt/passt_function.cfg +++ b/libvirt/tests/cfg/virtual_network/passt/passt_function.cfg @@ -22,6 +22,9 @@ iface_attrs = {'model': 'virtio', 'acpi': {'index': '1'}, 'type_name': 'user', 'backend': {'type': 'passt'}, 'source': {'dev': '${host_iface}'}} vm_iface = eno1 vm_ping_outside = pass + s390-virtio: + iface_attrs = {'model': 'virtio', 'type_name': 'user', 'backend': {'type': 'passt'}, 'source': {'dev': '${host_iface}'}} + vm_iface = enc1 - ip_portfw: alias = {'name': 'ua-c87b89ff-b769-4abc-921f-30d42d7aec5b'} backend = {'type': 'passt'} @@ -49,3 +52,6 @@ conn_check_args_7 = ('UDP4', 'localhost', 2025, 2025, True, None) conn_check_args_8 = ('UDP6', host_ip_v6, 4431, 4432, True, None) conn_check_args_9 = ('UDP6', '::1', 4431, 4432, False, None) + s390-virtio: + iface_attrs = {'model': 'virtio', 'ips': ${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, 'alias': ${alias}, 'type_name': 'user', 'portForwards': ${portForwards}} + vm_iface = enc1 diff --git a/libvirt/tests/src/virtual_network/passt/passt_function.py b/libvirt/tests/src/virtual_network/passt/passt_function.py index 97c1425f413..4a7975bed91 100644 --- a/libvirt/tests/src/virtual_network/passt/passt_function.py +++ b/libvirt/tests/src/virtual_network/passt/passt_function.py @@ -98,7 +98,7 @@ def run(test, params, env): test.fail(f'Logfile of passt "{log_file}" not created') session = vm.wait_for_serial_login(timeout=60) - passt.check_vm_ip(iface_attrs, session, host_iface) + passt.check_vm_ip(iface_attrs, session, host_iface, vm_iface) passt.check_vm_mtu(session, vm_iface, mtu) passt.check_default_gw(session) passt.check_nameserver(session) diff --git a/provider/virtual_network/passt.py b/provider/virtual_network/passt.py index ae14893eb2c..2bd67a44207 100644 --- a/provider/virtual_network/passt.py +++ b/provider/virtual_network/passt.py @@ -169,15 +169,17 @@ def check_proc(target): raise exceptions.TestFail(';'.join(failed_check)) -def check_vm_ip(iface_attrs, session, host_iface): +def check_vm_ip(iface_attrs, session, host_iface, vm_iface=None): """ Check if vm ip and prefix meet expectation :param iface_attrs: attributes of interface :param session: shell session instance of vm :param host_iface: host interface + :param vm_iface: vm interface, will be constructed for x86_64 if None """ - vm_iface = 'eno' + iface_attrs.get('acpi', {'index': '1'})['index'] + if not vm_iface: + vm_iface = 'eno' + iface_attrs.get('acpi', {'index': '1'})['index'] vm_ip, prefix = get_iface_ip_and_prefix(vm_iface, session=session) LOG.debug(f'VM ip and prefix: {vm_ip}, {prefix}') if 'ips' in iface_attrs: