X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Funit%2Fnetwork_services%2Fvnf_generic%2Fvnf%2Ftest_tg_rfc2544_ixia.py;h=f62a0fb3b423823c5d966b009a6df604c5044819;hb=dd57115618caa299f6dd1eb350b55ecf062ca92e;hp=0e303dc3b9b081ddac67454d706b77857a5032e9;hpb=3016786696b9e5a26b364cb5bd4cb5676420fe58;p=yardstick.git diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py index 0e303dc3b..f62a0fb3b 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py @@ -252,6 +252,7 @@ class TestIXIATrafficGen(unittest.TestCase): mock_traffic_profile = mock.Mock(autospec=TrafficProfile) mock_traffic_profile.get_traffic_definition.return_value = "64" mock_traffic_profile.params = self.TRAFFIC_PROFILE + # traffic_profile.ports is standardized on port_num mock_traffic_profile.ports = [0, 1] mock_ssh_instance = mock.Mock(autospec=mock_ssh.SSH) @@ -346,8 +347,12 @@ class TestIXIATrafficGen(unittest.TestCase): 'task_path': '/path/to/task' } - with mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', - create=True) as mock_open: - mock_open.return_value = mock.MagicMock() + @mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True) + @mock.patch('yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.open', + mock.mock_open(), create=True) + @mock.patch('yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.LOG.exception') + def _traffic_runner(*args): result = sut._traffic_runner(mock_traffic_profile) self.assertIsNone(result) + + _traffic_runner()