Skip to content

Commit

Permalink
passt: fix test cases on s390x
Browse files Browse the repository at this point in the history
Default interfaces on s390x are named 'enc'.
ACPI is not available on s390x.

Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
  • Loading branch information
smitterl committed Aug 9, 2023
1 parent 7d608a6 commit d7adeea
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@
conn_check_args_1 = ('TCP6', 'localhost', 31339, 41339, True, None)
conn_check_args_2 = ('UDP4', 'localhost', 2025, 2025, True, None)
conn_check_args_3 = ('UDP6', 'localhost', 2025, 2025, True, None)
s390-virtio:
vm_iface = enc1
iface_attrs = {'model': 'virtio', 'ips': ${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, 'alias': ${alias}, 'type_name': 'user', 'portForwards': ${portForwards}}
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@
conn_check_args_1 = ('TCP6', server_default_gw_v6, vm_c_iface, 41335, 41335)
conn_check_args_2 = ('UDP4', server_default_gw, None, 21335, 21335)
conn_check_args_3 = ('UDP6', server_default_gw_v6, vm_c_iface, 21335, 21335)
s390-virtio:
vm_c_iface = enc1
iface_attrs = {'model': 'virtio', **${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, 'type_name': 'user', **${portForwards}}
6 changes: 6 additions & 0 deletions libvirt/tests/cfg/virtual_network/passt/passt_function.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions libvirt/tests/cfg/virtual_network/passt/passt_reconnect.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@
conn_check_args_1 = ('TCP6', 'localhost', 31339, 41339, True, None)
conn_check_args_2 = ('UDP4', 'localhost', 2025, 2025, True, None)
conn_check_args_3 = ('UDP6', 'localhost', 2025, 2025, True, None)
s390-virtio:
vm_iface = enc1
iface_attrs = {'model': 'virtio', **${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, **${alias}, 'type_name': 'user', **${portForwards}}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
iface_attrs = {'model': 'virtio', 'acpi': {'index': '1'}, **${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, **${alias}, 'type_name': 'user', **${portForwards}}
ipv6_prefix = 128
vm_iface = eno1
s390-virtio:
vm_iface = enc1
iface_attrs = {'model': 'virtio', **${ips}, 'backend': ${backend}, 'source': {'dev': '${host_iface}'}, **${alias}, 'type_name': 'user', **${portForwards}}
variants file_size:
- 10M:
bs = 1M
Expand Down
2 changes: 1 addition & 1 deletion libvirt/tests/src/virtual_network/passt/passt_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libvirt/tests/src/virtual_network/passt/passt_reconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,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)
Expand Down
6 changes: 4 additions & 2 deletions provider/virtual_network/passt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d7adeea

Please sign in to comment.