automate VIRT-303225 - [vIOMMU] virsh reset when booting guest for 10+ times#6249
Conversation
| @@ -0,0 +1,94 @@ | |||
| import os | |||
There was a problem hiding this comment.
I used libvirt.check_logfile() to check is some strings exist in the log file. If you want to create a class for it, I think it can be used for some other tests, so it should be added in avocado-vt.
There was a problem hiding this comment.
Done ... see:
avocado-framework/avocado-vt#4095
There was a problem hiding this comment.
7f3aaf1 to
f09ec7e
Compare
|
|
||
| from provider.viommu import viommu_base | ||
|
|
||
| #from provider.vm_log_file import vm_log_file |
There was a problem hiding this comment.
Please delete the commented line here, thx!
| test.log.debug(vm_xml.VMXML.new_from_dumpxml(vm.name)) | ||
|
|
||
| test.log.debug("TEST_STEP: verify user is able to login also after restarts") | ||
| vm.wait_for_login() |
2a58ad4 to
d9b7144
Compare
|
retested ... test properly failing for smmuv3 as the log contains the message |
| dev_dict = test_obj.update_disk_addr(dev_dict) | ||
| if dev_dict["target"].get("bus") != "virtio": | ||
| libvirt_vmxml.modify_vm_device( | ||
| vm_xml.VMXML.new_from_dumpxml(vm.name), 'disk', {'driver': None}) |
There was a problem hiding this comment.
I do not understand what we need to set driver to None when bus is not virtio?
And then call the function again on Line 33.
There was a problem hiding this comment.
The default guest's xml may contain viommu enabled virtio disk. If we modify it to non-virtio disk in the test, it may report an error because of the extra driver attrs. In order to cover test env with/without viommu virtio disk, we'd better to cleanup the driver setting before the test.
| dev_dict = eval(params.get('disk_dict', '{}')) | ||
| test.log.debug(f"disk_dict: {dev_dict}") | ||
| if dev_dict: | ||
| dev_dict = test_obj.update_disk_addr(dev_dict) |
There was a problem hiding this comment.
We do not need to update the disk address, instead, we just remove the disk address, then set disk bus to scsi. That will be easier.
There was a problem hiding this comment.
This is the only thing I don't know how to do ... Why is the disk address update worse?
There was a problem hiding this comment.
test_obj.update_disk_addr is a wrapper function to update the disk attrs according to the test cfg and the prepared controller. In this case, it's the easiest way.
| libvirt_vmxml.modify_vm_device( | ||
| vm_xml.VMXML.new_from_dumpxml(vm.name), 'disk', dev_dict) | ||
|
|
||
| if cleanup_ifaces: |
There was a problem hiding this comment.
I do not see any interface setting in the manual case. What is the reason we modify interface setting here?
There was a problem hiding this comment.
This setting was in previous test. I expected that there can be case, that it is needed, so I let there this settings
There was a problem hiding this comment.
I have removed this, there just has to be the
test_obj.setup_iommu_test(iommu_dict=iommu_dict, cleanup_ifaces=False), (or True, doesn't matter)
if the value is not passed will fail with No DHCP ipv.
Yingshun
left a comment
There was a problem hiding this comment.
Commit a looks like a rebase? can you squash the commits? Others LGTM.
6f71d05 to
4045092
Compare
!!! the test is using new functions added to the avocado-vt framework in
avocado-framework/avocado-vt#4095
the test is about running starting VM according matrix setting,
the test can be parametrized:
Note:
The test is based (copied - yes I know this sucks) from VIRT-294579 (with some parts removed due smaller matrix) and to be honest I don't know if the rows 26-40 are written the best way as I am not the author of it.