summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/common
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-01-24 04:01:30 -0500
committerimarom <imarom@cisco.com>2016-01-24 06:02:46 -0500
commit6f4a51c126b7a78ee8e37d396ed2b61b05fa506c (patch)
treee8b1c20e0d02cb40fa1539f2896f07345625b6f3 /scripts/automation/trex_control_plane/common
parentdb5b9d6085b3e5cf71e1abf42c7a745cb723e00e (diff)
added example
Diffstat (limited to 'scripts/automation/trex_control_plane/common')
-rwxr-xr-xscripts/automation/trex_control_plane/common/trex_stats.py5
-rwxr-xr-xscripts/automation/trex_control_plane/common/trex_streams.py1
2 files changed, 4 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/common/trex_stats.py b/scripts/automation/trex_control_plane/common/trex_stats.py
index 9c2cd7f1..3f64310f 100755
--- a/scripts/automation/trex_control_plane/common/trex_stats.py
+++ b/scripts/automation/trex_control_plane/common/trex_stats.py
@@ -59,7 +59,7 @@ def calculate_diff_raw (samples):
class CTRexInfoGenerator(object):
"""
This object is responsible of generating stats and information from objects maintained at
- CTRexStatelessClient and the ports.
+ STLClient and the ports.
"""
def __init__(self, global_stats_ref, ports_dict_ref):
@@ -477,6 +477,9 @@ class CPortStats(CTRexStats):
raise TypeError("cannot add non stats object to stats")
# main stats
+ if not self.latest_stats:
+ self.latest_stats = {}
+
self.__merge_dicts(self.latest_stats, x.latest_stats)
# reference stats
diff --git a/scripts/automation/trex_control_plane/common/trex_streams.py b/scripts/automation/trex_control_plane/common/trex_streams.py
index 800b6d49..ea3d71d1 100755
--- a/scripts/automation/trex_control_plane/common/trex_streams.py
+++ b/scripts/automation/trex_control_plane/common/trex_streams.py
@@ -210,7 +210,6 @@ class CStream(object):
setattr(self, k, kwargs[k])
# TODO: load to _pkt_bld_obj also when passed as byte array!
elif isinstance(binary, str) and binary.endswith(".pcap"):
- # self.load_packet_from_pcap(binary, kwargs[k]["meta"])
self._pkt_bld_obj.load_packet_from_pcap(binary)
self._pkt_bld_obj.metadata = kwargs[k]["meta"]
self.packet = self._pkt_bld_obj.dump_pkt()