diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-07-26 00:58:29 -0700 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-07-26 00:59:56 -0700 |
commit | d9b9b8970312e13f798a367439cfc2c333c7fca4 (patch) | |
tree | d30731f7b23ec6ec11373e9f48e1dfcfcb2b6de8 /tests/unit/benchmark/contexts/test_sriov.py | |
parent | 12ce596d02be27abf4ab2e9aebb873002c6cd6a9 (diff) |
fix sriov/ovs-dpdk unittests on systems with fewer than 10 cores
we need to wrap vcpupin modulo number of cores.
also mock time.sleep
Change-Id: I6433418a99505b469c61c81a9a023d84434fa0ee
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'tests/unit/benchmark/contexts/test_sriov.py')
-rw-r--r-- | tests/unit/benchmark/contexts/test_sriov.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/unit/benchmark/contexts/test_sriov.py b/tests/unit/benchmark/contexts/test_sriov.py index e4d8f5e1a..a8641a2eb 100644 --- a/tests/unit/benchmark/contexts/test_sriov.py +++ b/tests/unit/benchmark/contexts/test_sriov.py @@ -185,8 +185,8 @@ class SriovTestCase(unittest.TestCase): nic_details['vf_pci'][i] = sriov_obj.get_vf_datas.return_value vf_pci = [[], []] vf_pci[i] = sriov_obj.get_vf_datas.return_value - self.assertIsNotNone( - sriov_obj.configure_nics_for_sriov(DRIVER, NIC_DETAILS)) + with mock.patch("yardstick.benchmark.contexts.sriov.time"): + self.assertIsNotNone(sriov_obj.configure_nics_for_sriov(DRIVER, NIC_DETAILS)) def test_setup_sriov_context(self): with mock.patch("yardstick.ssh.SSH") as ssh: @@ -224,8 +224,8 @@ class SriovTestCase(unittest.TestCase): mock.Mock(return_value=(0, {}, "")) ssh_mock.put = mock.Mock() sriov_obj.check_output = mock.Mock(return_value=(1, {})) - self.assertIsNone( - sriov_obj.setup_sriov_context(PCIS, nic_details, DRIVER)) + with mock.patch("yardstick.benchmark.contexts.sriov.time"): + self.assertIsNone(sriov_obj.setup_sriov_context(PCIS, nic_details, DRIVER)) def test_setup_sriov_context_vm_already_present(self): with mock.patch("yardstick.ssh.SSH") as ssh: @@ -263,10 +263,8 @@ class SriovTestCase(unittest.TestCase): mock.Mock(return_value=(0, {}, "")) ssh_mock.put = mock.Mock() sriov_obj.check_output = mock.Mock(return_value=(0, "vm1")) - self.assertIsNone(sriov_obj.setup_sriov_context( - PCIS, - nic_details, - DRIVER)) + with mock.patch("yardstick.benchmark.contexts.sriov.time"): + self.assertIsNone(sriov_obj.setup_sriov_context(PCIS, nic_details, DRIVER)) @mock.patch( 'yardstick.benchmark.contexts.sriov', |