From 15d9333cf16c533cd438ca4195f50e91b479feec Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Fri, 1 Sep 2017 18:21:11 -0700 Subject: PROX: catch ports stats parse error for some reason port status returned fewer fields, catch this for debug and return empty result dict so test continues and hopefully we get a valid stat read on next call. Change-Id: I54f1a86707d2a00efcb82a7e0239d12f90a6542c Signed-off-by: Ross Brattain --- yardstick/network_services/vnf_generic/vnf/prox_vnf.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/yardstick/network_services/vnf_generic/vnf/prox_vnf.py b/yardstick/network_services/vnf_generic/vnf/prox_vnf.py index 214c9f3a0..cb09b43f6 100644 --- a/yardstick/network_services/vnf_generic/vnf/prox_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/prox_vnf.py @@ -71,8 +71,14 @@ class ProxApproxVnf(SampleVNF): "1, 2 or 4 ports only supported at this time") port_stats = self.vnf_execute('port_stats', range(len(self.vnfd_helper.interfaces))) - rx_total = port_stats[6] - tx_total = port_stats[7] + try: + rx_total = port_stats[6] + tx_total = port_stats[7] + except IndexError: + LOG.error("port_stats parse fail %s", port_stats) + # return empty dict so we don't mess up existing KPIs + return {} + result = { "packets_in": tx_total, "packets_dropped": (tx_total - rx_total), -- cgit 1.2.3-korg