summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-02-08 11:25:07 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-02-24 14:21:29 +0200
commitf0ab9eba97221e491cf7b3dd846eb8c23d920ec2 (patch)
treecaf0b2f4f9cc0874a53bb3af813d5bae8d644914 /scripts
parent252b8ab3f41a18af8561cece71cf07bc9872f39f (diff)
Rx stat per flow. Low level working for xl710, and partly for i350.
added full clone (with CP VM) to stream
Diffstat (limited to 'scripts')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py19
-rw-r--r--scripts/stl/rx_stats.py19
2 files changed, 35 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
index 90dd9657..adbb88a6 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
@@ -121,7 +121,21 @@ STLStreamDstMAC_CFG_FILE=0
STLStreamDstMAC_PKT =1
STLStreamDstMAC_ARP =2
+# RX stats class
+class STLRxStats(object):
+ def __init__ (self, user_id):
+ self.fields = {}
+ self.fields['stream_id'] = user_id
+ self.fields['enabled'] = True
+ self.fields['seq_enabled'] = False
+ self.fields['latency_enabled'] = False
+ def to_json (self):
+ return dict(self.fields)
+
+ @staticmethod
+ def defaults ():
+ return {'enabled' : False}
class STLStream(object):
@@ -216,10 +230,9 @@ class STLStream(object):
self.packet_desc = None
if not rx_stats:
- self.fields['rx_stats'] = {}
- self.fields['rx_stats']['enabled'] = False
+ self.fields['rx_stats'] = STLRxStats.defaults()
else:
- self.fields['rx_stats'] = rx_stats
+ self.fields['rx_stats'] = rx_stats.to_json()
def __str__ (self):
diff --git a/scripts/stl/rx_stats.py b/scripts/stl/rx_stats.py
new file mode 100644
index 00000000..892fe1a0
--- /dev/null
+++ b/scripts/stl/rx_stats.py
@@ -0,0 +1,19 @@
+from trex_stl_lib.api import *
+
+# stream from pcap file. continues pps 10 in sec
+
+class STLS1(object):
+
+ def get_streams (self, direction = 0):
+ return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd
+ mode = STLTXCont(pps=10),
+ rx_stats = STLRxStats(user_id = 7))
+ ]
+
+
+# dynamic load - used for trex console or simulator
+def register():
+ return STLS1()
+
+
+