diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-21 15:00:30 -0700 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-09-25 08:30:21 -0700 |
commit | a8225b336df8fbb626a22bb38d8f8ca96af977f9 (patch) | |
tree | a1b7c8c7ad72bf0d77e704591c023542599d0603 /yardstick/network_services | |
parent | 86c0326342b33f6e0b090b973fb58831ed1d38d2 (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')
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/tg_rfc2544_ixia.py | 16 |
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 |