aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-10-19 15:52:50 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-10-19 15:52:50 +0000
commit2ed8cb5009d69f8aa12853137c04544fa3956fbe (patch)
tree661a4bbf149a7341aa67bc7377537e6a8e58bd52
parentfaee281ab73e49629265fe66dcfdd456d79be2bc (diff)
parenta27278dacaa54ae60cd3bdfa6e6145643f76fa02 (diff)
Merge "BugFix: Negative dropped packets in Prox tests"
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py4
-rw-r--r--yardstick/network_services/vnf_generic/vnf/prox_vnf.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py
index a6d40877d..e29e8ddcd 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_prox_vnf.py
@@ -348,9 +348,9 @@ class TestProxApproxVnf(unittest.TestCase):
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()
diff --git a/yardstick/network_services/vnf_generic/vnf/prox_vnf.py b/yardstick/network_services/vnf_generic/vnf/prox_vnf.py
index 24712dd27..b7d295eee 100644
--- a/yardstick/network_services/vnf_generic/vnf/prox_vnf.py
+++ b/yardstick/network_services/vnf_generic/vnf/prox_vnf.py
@@ -89,9 +89,9 @@ class ProxApproxVnf(SampleVNF):
return {}
result = {
- "packets_in": tx_total,
- "packets_dropped": abs(rx_total - tx_total),
- "packets_fwd": rx_total,
+ "packets_in": rx_total,
+ "packets_dropped": max((tx_total - rx_total), 0),
+ "packets_fwd": tx_total,
# we share ProxResourceHelper with TG, but we want to collect
# collectd KPIs here and not TG KPIs, so use a different method name
"collect_stats": self.resource_helper.collect_collectd_kpi(),