aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-21 15:00:30 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-22 14:00:22 -0700
commitfe3d086141f85d4fa6ed7cbaca70222e223c3323 (patch)
tree3401d5c962a00ff903fac62e8d08062d31e41540 /yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
parent4529399c79b1e61ea37cb79e790adc130c98cf45 (diff)
tg_rfc2544_ixia: log exceptions and fix list iter
Change-Id: Ia9722604b7c8ae23e784e780f113d012de544d4b Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py')
-rw-r--r--yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
index cd9553d12..12266d6ad 100644
--- a/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
+++ b/yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py
@@ -81,11 +81,13 @@ class IxiaResourceHelper(ClientResourceHelper):
latency = stats[0]
samples = {}
- for port_name in ports:
+ # this is not DPDK port num, but this is whatever number we gave
+ # when we selected ports and programmed the profile
+ for port_num in ports:
try:
- # this is not DPDK port num, but this is whatever number we gave
- # when we selected ports and programmed the profile
- port_num = self.vnfd_helper.port_num(port_name)
+ # reverse lookup port name from port_num so the stats dict is descriptive
+ intf = self.vnfd_helper.find_interface_by_port(port_num)
+ port_name = intf["name"]
samples[port_name] = {
"rx_throughput_kps": float(last_result["Rx_Rate_Kbps"][port_num]),
"tx_throughput_kps": float(last_result["Tx_Rate_Kbps"][port_num]),
@@ -140,9 +142,9 @@ class IxiaResourceHelper(ClientResourceHelper):
mac = {}
for vld_id, traffic in static_traffic.items():
intfs = self.vnfd_helper.port_pairs.networks.get(vld_id, [])
- interface = next(intfs, None)
+ interface = next(iter(intfs), None)
if interface:
- virt_intf = interface["virtual-interface"]
+ virt_intf = self.vnfd_helper.find_interface(name=interface)["virtual-interface"]
# we only know static traffic id by reading the json
# this is used by _get_ixia_traffic_profile
mac["src_mac_{}".format(traffic["id"])] = virt_intf.get("local_mac", default)
@@ -169,7 +171,7 @@ class IxiaResourceHelper(ClientResourceHelper):
self.client.ix_stop_traffic()
self._queue.put(samples)
except Exception:
- LOG.info("Run Traffic terminated")
+ LOG.exception("Run Traffic terminated")
if not self.rfc_helper.is_done():
self._terminated.value = 1