Skip to content

Commit

Permalink
unsupported_live_update:Remove interface backend settings before setting
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chloerh committed Dec 6, 2024
1 parent 973f549 commit d49f868
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 .*
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}')

Expand All @@ -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}')

Expand Down

0 comments on commit d49f868

Please sign in to comment.