X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Funit%2Fnetwork_services%2Fvnf_generic%2Fvnf%2Ftest_tg_ixload.py;h=e6e4b882eea98679b12a92ed23f2e2314bce0a3a;hb=1b059e41e553247bda0168d6b40eb67b56e7b56e;hp=5c81aa8865039fe36deaf00bfbef296a004672fc;hpb=b583d4bfe6bc49e0f3bf4beec6612390a1d4bd24;p=yardstick.git diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py index 5c81aa886..e6e4b882e 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py @@ -70,7 +70,7 @@ class TestIxLoadTrafficGen(unittest.TestCase): 'local_ip': '152.16.100.19', 'type': 'PCI-PASSTHROUGH', 'netmask': '255.255.255.0', - 'dpdk_port_num': '0', + 'dpdk_port_num': 0, 'bandwidth': '10 Gbps', 'driver': "i40e", 'dst_ip': '152.16.100.20', @@ -85,7 +85,7 @@ class TestIxLoadTrafficGen(unittest.TestCase): 'type': 'PCI-PASSTHROUGH', 'driver': "i40e", 'netmask': '255.255.255.0', - 'dpdk_port_num': '1', + 'dpdk_port_num': 1, 'bandwidth': '10 Gbps', 'dst_ip': '152.16.40.20', 'local_iface_name': 'xe1', @@ -123,7 +123,7 @@ class TestIxLoadTrafficGen(unittest.TestCase): ssh.from_node.return_value = ssh_mock vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] ixload_traffic_gen = IxLoadTrafficGen(NAME, vnfd) - self.assertIsNone(ixload_traffic_gen.data) + self.assertIsNone(ixload_traffic_gen.resource_helper.data) def test_collect_kpi(self): with mock.patch("yardstick.ssh.SSH") as ssh: @@ -161,7 +161,8 @@ class TestIxLoadTrafficGen(unittest.TestCase): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] ixload_traffic_gen = IxLoadTrafficGen(NAME, vnfd) scenario_cfg = {'tc': "nsb_test_case", - 'ixia_profile': "ixload.cfg"} + 'ixia_profile': "ixload.cfg", + 'task_path': "/path/to/task"} ixload_traffic_gen.RESULTS_MOUNT = "/tmp/result" shutil.copy = mock.Mock() scenario_cfg.update({'options': {'packetsize': 64, 'traffic_type': 4, @@ -173,8 +174,9 @@ class TestIxLoadTrafficGen(unittest.TestCase): '1C/1T', 'worker_threads': 1}} }}) - self.assertRaises(IOError, - ixload_traffic_gen.instantiate(scenario_cfg, {})) + with mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True) as mock_open: + mock_open.return_value = mock.MagicMock() + ixload_traffic_gen.instantiate(scenario_cfg, {}) @mock.patch("yardstick.network_services.vnf_generic.vnf.tg_ixload.call") @mock.patch("yardstick.network_services.vnf_generic.vnf.tg_ixload.shutil")