Martin Polednik has uploaded a new change for review.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
hostdev: add test for SR-IOV VF
Hostdev uses interface element for SR-IOV VFs, and therefore needs to be also covered with additional test.
Change-Id: I1bf2e07f492508757be2691417c706219ded54af Signed-off-by: Martin Polednik mpolednik@redhat.com --- M tests/hostdevTests.py 1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/43094/1
diff --git a/tests/hostdevTests.py b/tests/hostdevTests.py index 4e198a7..ba6cc96 100644 --- a/tests/hostdevTests.py +++ b/tests/hostdevTests.py @@ -116,6 +116,20 @@ </source> %s </hostdev> + ''', + _SRIOV_VF: + ''' + <interface managed="no" type="hostdev"> + <driver name="vfio"/> + <source> + <address bus="5" domain="0" function="7" slot="16" + type="pci"/> + </source> + <mac address="ff:ff:ff:ff:ff:ff"/> + <vlan> + <tag id="3"/> + </vlan> + </interface> '''}
DEVICES_PARSED = {u'pci_0000_00_1b_0': {'product': '6 Series/C200 Series ' @@ -392,3 +406,10 @@ _DEVICE_XML[device_name] % ('<address bus="0x01" domain="0x0000" function="0x0" slot="0x02" \ type="pci"/>')) + + def testCreateSRIOVVF(self): + dev_spec = {'type': 'hostdev', 'device': _SRIOV_VF, + 'specParams': + {'macAddr': 'ff:ff:ff:ff:ff:ff', 'vlanId': 3}} + device = hostdevice.HostDevice(self.conf, self.log, **dev_spec) + self.assertXMLEqual(device.getXML().toxml(), _DEVICE_XML[_SRIOV_VF])
automation@ovirt.org has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Francesco Romani has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 1: Code-Review+1
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.
Martin Polednik has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 1:
(1 comment)
https://gerrit.ovirt.org/#/c/43094/1/tests/hostdevTests.py File tests/hostdevTests.py:
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:
Thanks for the note, interesting! Now, numvfs itself is tested in hostdev module tests, so I'm not sure that it is somewhat required - but since I don't want to touch FS consider it done.
automation@ovirt.org has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Martin Polednik has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 2: Verified+1
Ido Barkan has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 2: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 2: Code-Review+2
raising
Dan Kenigsberg has submitted this change and it was merged.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
hostdev: add test for SR-IOV VF
Hostdev uses interface element for SR-IOV VFs, and therefore needs to be also covered with additional test.
Change-Id: I1bf2e07f492508757be2691417c706219ded54af Signed-off-by: Martin Polednik mpolednik@redhat.com Reviewed-on: https://gerrit.ovirt.org/43094 Continuous-Integration: Jenkins CI Reviewed-by: Ido Barkan ibarkan@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com --- M tests/hostdevTests.py 1 file changed, 23 insertions(+), 0 deletions(-)
Approvals: Ido Barkan: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved Martin Polednik: Verified
automation@ovirt.org has posted comments on this change.
Change subject: hostdev: add test for SR-IOV VF ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org