diff options
author | 2016-12-04 11:30:08 +0200 | |
---|---|---|
committer | 2016-12-04 11:30:34 +0200 | |
commit | c2e0fc656cb6b3e34939dbe2b9495282f6fd0f53 (patch) | |
tree | 6f66d8c3a91e5b445c685cd77055511cd2011875 /scripts/automation/trex_control_plane/stl/trex_stl_lib | |
parent | 4477491bf7d052d9d140508e645b673f7dc87a65 (diff) |
test breakage due to incorrect speed calculation
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | 9 | ||||
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py index 9b955465..ef74a85e 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py @@ -129,10 +129,10 @@ class Port(object): return RC_OK(data) def get_speed_bps (self): - return (self.__attr['speed'] * 1000 * 1000 * 1000) + return (self.get_speed_gbps() * 1000 * 1000 * 1000) - def get_formatted_speed (self): - return "%g Gb/s" % (self.__attr['speed'] / 1000) + def get_speed_gbps (self): + return self.__attr['speed'] def is_acquired(self): return (self.handler != None) @@ -826,7 +826,7 @@ class Port(object): info['is_virtual'] = 'N/A' # speed - info['speed'] = self.get_formatted_speed() + info['speed'] = self.get_speed_gbps() # RX filter mode info['rx_filter_mode'] = 'hardware match' if attr['rx_filter_mode'] == 'hw' else 'fetch all' @@ -865,7 +865,6 @@ class Port(object): queue = rx_info['queue'] info['rx_queue'] = '[{0} / {1}]'.format(queue['count'], queue['size']) if queue['is_active'] else 'off' - return info diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py index 2efb5a84..6a59126f 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py @@ -1130,7 +1130,7 @@ class CPortStats(CTRexStats): return {"owner": owner, "state": "{0}".format(port_state), 'link': link_state, - "speed": self._port_obj.get_formatted_speed() if self._port_obj else '', + "speed": "%g Gb/s" % self._port_obj.get_speed_gbps() if self._port_obj else '', "CPU util.": "{0} {1}%".format(self.get_trend_gui("m_cpu_util", use_raw = True), format_threshold(round_float(self.get("m_cpu_util")), [85, 100], [0, 85])) if self._port_obj else '' , "--": " ", |