From d49f868b7eacf9612c85402948340890ff7299e3 Mon Sep 17 00:00:00 2001 From: Haijiao Zhao Date: Thu, 5 Dec 2024 22:23:43 -0500 Subject: [PATCH] unsupported_live_update:Remove interface backend settings before setting new value Since the original dict value won't be deleted automatically, but we want to remove one attribute. And don't remove interfaces on vmxml before test setting. And remove 2 test cases that are no need to test (bug won't do) Signed-off-by: Haijiao Zhao --- .../update_device/unsupported_live_update_alter.cfg | 1 + .../update_device/unsupported_live_update_delete.cfg | 8 -------- .../update_device/unsupported_live_update.py | 4 +++- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libvirt/tests/cfg/virtual_network/update_device/unsupported_live_update_alter.cfg b/libvirt/tests/cfg/virtual_network/update_device/unsupported_live_update_alter.cfg index e8956d8f4f..b46a0c3b44 100644 --- a/libvirt/tests/cfg/virtual_network/update_device/unsupported_live_update_alter.cfg +++ b/libvirt/tests/cfg/virtual_network/update_device/unsupported_live_update_alter.cfg @@ -36,6 +36,7 @@ err_msg = cannot modify network device model from .* to .* - backend: extra_attrs = {'backend': {'tap': '/dev/net/tun', 'vhost': '/dev/vhost-net'}} + tmp_attrs = {'backend': None} update_attrs = {'backend': {'tap': '/dev/net/tun'}} err_msg = cannot modify network device backend settings - driver: diff --git a/libvirt/tests/cfg/virtual_network/update_device/unsupported_live_update_delete.cfg b/libvirt/tests/cfg/virtual_network/update_device/unsupported_live_update_delete.cfg index 07bd0d2903..faa80241ca 100644 --- a/libvirt/tests/cfg/virtual_network/update_device/unsupported_live_update_delete.cfg +++ b/libvirt/tests/cfg/virtual_network/update_device/unsupported_live_update_delete.cfg @@ -27,10 +27,6 @@ extra_attrs = {'rom': {'enabled': 'no'}} del_attr = rom err_msg = cannot modify network device rom enabled setting - - target_dev: - extra_attrs = {'target': {'dev': 'test'}} - del_attr = target - err_msg = cannot modify network device tap name - model_type: del_attr = model err_msg = cannot modify network device model from .* to .* @@ -41,10 +37,6 @@ - driver: del_attr = driver err_msg = cannot modify virtio network device driver attributes - - alias_name: - extra_attrs = {'alias': {'name': 'ua-47034d36-5483-411c-86f8-7989d08d762b'}} - del_attr = alias - err_msg = device not found: no device found at address .* matching MAC address .* and alias .* - mac: del_attr = mac_address err_msg = "cannot change network interface mac address|device not found" diff --git a/libvirt/tests/src/virtual_network/update_device/unsupported_live_update.py b/libvirt/tests/src/virtual_network/update_device/unsupported_live_update.py index e981f635ae..1211a3fb75 100644 --- a/libvirt/tests/src/virtual_network/update_device/unsupported_live_update.py +++ b/libvirt/tests/src/virtual_network/update_device/unsupported_live_update.py @@ -29,6 +29,7 @@ def run(test, params, env): iface_attrs = {**base_iface_attrs, **extra_attrs} update_attrs = eval(params.get('update_attrs', '{}')) + tmp_attrs = eval(params.get('tmp_attrs', '{}')) del_attr = params.get('del_attr') vmxml = vm_xml.VMXML.new_from_inactive_dumpxml(vm_name) @@ -41,7 +42,6 @@ def run(test, params, env): vmxml.os = osxml libvirt_vmxml.modify_vm_device(vmxml, 'disk', {'boot': '1'}) - vmxml.del_device('interface', by_tag=True) libvirt_vmxml.modify_vm_device(vmxml, 'interface', iface_attrs) LOG.debug(f'VMXML of {vm_name}:\n{virsh.dumpxml(vm_name).stdout_text}') @@ -56,6 +56,8 @@ def run(test, params, env): else: eval(f'iface.del_{del_attr}')() else: + if tmp_attrs: + iface.setup_attrs(**tmp_attrs) iface.setup_attrs(**update_attrs) LOG.debug(f'Interface xml to update with:\n{iface}')