NSB: fix port topology
[yardstick.git] / tests / unit / network_services / vnf_generic / vnf / test_tg_ixload.py
index 5c81aa8..e6e4b88 100644 (file)
@@ -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")