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

Update the passt test as behavior changes #6176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
error_msg = Invalid interface name .*: No such device
- inactive_host_iface:
error_msg = External interface not usable
passt_version = 0^20250121.g4f2c8e7
- non_exist_bind_ip:
portForwards = {'portForwards': [{'ranges': [{'start': '9000'}], 'attrs': {'proto': 'tcp', 'address': 'IP_EXAMPLE'}}]}
error_msg = Failed to bind port
Expand Down
20 changes: 16 additions & 4 deletions libvirt/tests/src/virtual_network/passt/passt_negative_setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,22 @@ def _get_test_ip():
virsh.start(vm_name, uri=virsh_uri, **VIRSH_ARGS)
result = virsh.attach_device(vm_name, iface_device.xml,
uri=virsh_uri, debug=True)

libvirt.check_exit_status(result, status_error)
if error_msg:
libvirt.check_result(result, error_msg)
if scenario == 'inactive_host_iface':
passt_ver_cmp = params.get("passt_version")
passt_ver = process.run("rpm -q passt", shell=True,
ignore_status=True).stdout_text.strip().split('-')[1]
# With newer passt version, vm can start successfully
# with inactive interface
if passt_ver < passt_ver_cmp:
libvirt.check_exit_status(result, status_error)
libvirt.check_result(result, error_msg)
else:
status_error = False
libvirt.check_exit_status(result, status_error)
else:
libvirt.check_exit_status(result, status_error)
if error_msg:
libvirt.check_result(result, error_msg)

finally:
if scenario == 'rm_passt_pgk':
Expand Down