BugFix: Negative dropped packets in Prox tests
[yardstick.git] / tests / unit / network_services / vnf_generic / vnf / test_prox_vnf.py
index f8b592d..e29e8dd 100644 (file)
@@ -85,7 +85,7 @@ class TestProxApproxVnf(unittest.TestCase):
                             'vpci': '0000:05:00.0',
                             'local_ip': '152.16.100.19',
                             'type': 'PCI-PASSTHROUGH',
-                            'vld_id': '',
+                            'vld_id': 'downlink_0',
                             'ifname': 'xe1',
                             'netmask': '255.255.255.0',
                             'dpdk_port_num': 0,
@@ -104,8 +104,8 @@ class TestProxApproxVnf(unittest.TestCase):
                             'vpci': '0000:05:00.1',
                             'local_ip': '152.16.40.19',
                             'type': 'PCI-PASSTHROUGH',
-                            'vld_id': '',
-                            'ifname': 'xe3',
+                            'vld_id': 'uplink_0',
+                            'ifname': 'xe1',
                             'driver': "i40e",
                             'netmask': '255.255.255.0',
                             'dpdk_port_num': 1,
@@ -342,15 +342,15 @@ class TestProxApproxVnf(unittest.TestCase):
 
         resource_helper = mock.MagicMock()
         resource_helper.execute.return_value = list(range(12))
-        resource_helper.collect_kpi.return_value = {'core': {'result': 234}}
+        resource_helper.collect_collectd_kpi.return_value = {'core': {'result': 234}}
 
         prox_approx_vnf = ProxApproxVnf(NAME, self.VNFD0)
         prox_approx_vnf.resource_helper = resource_helper
 
         expected = {
-            'packets_in': 7,
+            'packets_in': 6,
             'packets_dropped': 1,
-            'packets_fwd': 6,
+            'packets_fwd': 7,
             'collect_stats': {'core': {'result': 234}},
         }
         result = prox_approx_vnf.collect_kpi()
@@ -365,6 +365,7 @@ class TestProxApproxVnf(unittest.TestCase):
         prox_approx_vnf = ProxApproxVnf(NAME, deepcopy(self.VNFD0))
         prox_approx_vnf.resource_helper = resource_helper
         prox_approx_vnf.vnfd_helper['vdu'][0]['external-interface'] = []
+        prox_approx_vnf.vnfd_helper.port_pairs.interfaces = []
 
         with self.assertRaises(RuntimeError):
             prox_approx_vnf.collect_kpi()
@@ -375,7 +376,7 @@ class TestProxApproxVnf(unittest.TestCase):
         return file_path
 
     @mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True)
-    @mock.patch('yardstick.network_services.vnf_generic.vnf.iniparser.open', create=True)
+    @mock.patch('yardstick.network_services.helpers.iniparser.open', create=True)
     @mock.patch(SSH_HELPER)
     def test_run_prox(self, ssh, *_):
         mock_ssh(ssh)