Skip to content

Commit

Permalink
provider//passt: add changes for multiarch
Browse files Browse the repository at this point in the history
'passt.avx2' is a specialization only for x86_64.
On other architectures the process might just be "passt".

Change the regular expression to match any process containing
"passt".

`check_vm_ip` calculated the guest interface name for x86_64
for other architectures allow for configuration of this value.

Signed-off-by: Sebastian Mitterle <[email protected]>
  • Loading branch information
smitterl committed Dec 21, 2023
1 parent 2de0330 commit ae4067e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 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, can be omitted on x86_64
"""
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 Expand Up @@ -379,7 +381,7 @@ def check_port_listen(ports, protocol, host_ip=None):
"""
if protocol.lower() not in ('tcp', 'udp'):
raise exceptions.TestError(f'Unsupported protocol: {protocol}')
cmd_listen = process.run(f"ss -{protocol[0].lower()}lpn|egrep 'passt.avx2'",
cmd_listen = process.run(f"ss -{protocol[0].lower()}lpn|egrep 'passt'",
shell=True).stdout_text
for item in ports:
if item in cmd_listen:
Expand Down

0 comments on commit ae4067e

Please sign in to comment.