PROX: catch ports stats parse error 87/41087/2
authorRoss Brattain <ross.b.brattain@intel.com>
Sat, 2 Sep 2017 01:21:11 +0000 (18:21 -0700)
committerRoss Brattain <ross.b.brattain@intel.com>
Tue, 5 Sep 2017 17:58:29 +0000 (10:58 -0700)
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 <ross.b.brattain@intel.com>
yardstick/network_services/vnf_generic/vnf/prox_vnf.py

index 214c9f3..cb09b43 100644 (file)
@@ -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),