Ido Barkan has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 1: Code-Review-1
(2 comments)
https://gerrit.ovirt.org/#/c/43094/1/tests/hostdevTests.py File tests/hostdevTests.py:
Line 409: Line 410: def testCreateSRIOVVF(self): Line 411: dev_spec = {'type': 'hostdev', 'device': _SRIOV_VF, Line 412: 'specParams': Line 413: {'macAddr': 'ff:ff:ff:ff:ff:ff', 'vlanId': 3}} can you please add 'bootOrder': '9' to dev_spec and test that _DEVICE_XML[_SRIOV_VF] has a <boot order="9"/> child for the <interface ..> node? Line 414: device = hostdevice.HostDevice(self.conf, self.log, **dev_spec)
Line 410: def testCreateSRIOVVF(self): Line 411: dev_spec = {'type': 'hostdev', 'device': _SRIOV_VF, Line 412: 'specParams': Line 413: {'macAddr': 'ff:ff:ff:ff:ff:ff', 'vlanId': 3}} Line 414: device = hostdevice.HostDevice(self.conf, self.log, **dev_spec) nit: --this does not explicitly realated to this patch, but for unittesting hostdev in general.
during get_device_params -> get_device_ref_and_params -> parse_device_params _sriov_totalvfs is called, and fails with an IOError. This is luckily swallwen, but it will be nice to monkeypathch in this test. Currently this leads to HostDevice._deviceParams['total_vfs'] to be missing.