NFVBENCH-107 NFVbench 2.0 ValueError at end of fixed rate run 97/64697/1 stable/gambia 2.0.4
authorahothan <ahothan@cisco.com>
Wed, 7 Nov 2018 18:16:08 +0000 (10:16 -0800)
committerahothan <ahothan@cisco.com>
Wed, 7 Nov 2018 18:16:08 +0000 (10:16 -0800)
Change-Id: I16181a530d040f0ff9348a7b4c1764fec5f73d69
Signed-off-by: ahothan <ahothan@cisco.com>
nfvbench/chaining.py
nfvbench/traffic_gen/trex.py

index fa9b799..5e2d730 100644 (file)
@@ -1073,7 +1073,7 @@ class ChainManager(object):
                 return self.chains[0].get_host_ips()
             # in the case of EXT, the compute node must be retrieved from the port
             # associated to any of the dest MACs
-            dst_macs = self.chain_runner.traffic_client.gen.get_dest_macs()
+            dst_macs = self.generator_config.get_dest_macs()
             # dest MAC on port 0, chain 0
             dst_mac = dst_macs[0][0]
             host_ip = self.get_host_ip_from_mac(dst_mac)
index 4d7e175..6aec57d 100644 (file)
@@ -197,6 +197,12 @@ class TRex(AbstractTrafficGenerator):
 
         If there are latency streams, those same counters need to be added in the same way
         """
+        def get_latency(lval):
+            try:
+                return int(round(lval))
+            except ValueError:
+                return 0
+
         for ifs in if_stats:
             ifs.tx = ifs.rx = 0
         for port in range(2):
@@ -211,9 +217,9 @@ class TRex(AbstractTrafficGenerator):
             try:
                 lat = trex_stats['latency'][lat_pg_id]['latency']
                 # dropped_pkts += lat['err_cntrs']['dropped']
-                latencies[port].max_usec = int(round(lat['total_max']))
-                latencies[port].min_usec = int(round(lat['total_min']))
-                latencies[port].avg_usec = int(round(lat['average']))
+                latencies[port].max_usec = get_latency(lat['total_max'])
+                latencies[port].min_usec = get_latency(lat['total_min'])
+                latencies[port].avg_usec = get_latency(lat['average'])
             except KeyError:
                 pass