summaryrefslogtreecommitdiffstats
path: root/scripts/stl/hlt/hlt_udp_rand_len_9k.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-04-27 23:27:34 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-04-27 23:27:34 +0300
commitc04b8b0dfa97c0eae40e4dc35b7cc223c2fb85e6 (patch)
tree2b7856af3af6768efde8f0ed508001d3e012fdf9 /scripts/stl/hlt/hlt_udp_rand_len_9k.py
parent429072c5997c76bd9338ad896127b5241d740b28 (diff)
regression: stateless CPU benchmark for profiles
Diffstat (limited to 'scripts/stl/hlt/hlt_udp_rand_len_9k.py')
-rwxr-xr-xscripts/stl/hlt/hlt_udp_rand_len_9k.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/stl/hlt/hlt_udp_rand_len_9k.py b/scripts/stl/hlt/hlt_udp_rand_len_9k.py
new file mode 100755
index 00000000..1966823c
--- /dev/null
+++ b/scripts/stl/hlt/hlt_udp_rand_len_9k.py
@@ -0,0 +1,31 @@
+from trex_stl_lib.trex_stl_hltapi import STLHltStream
+
+
+class STLS1(object):
+ '''
+ Create Eth/IP/UDP steam with random packet size (L3 size from 50 to 9*1024)
+ '''
+
+ def get_streams (self, direction = 0, **kwargs):
+ min_size = 50
+ max_size = 9*1024
+ return [STLHltStream(length_mode = 'random',
+ l3_length_min = min_size,
+ l3_length_max = max_size,
+ l3_protocol = 'ipv4',
+ ip_src_addr = '16.0.0.1',
+ ip_dst_addr = '48.0.0.1',
+ l4_protocol = 'udp',
+ udp_src_port = 1025,
+ udp_dst_port = 12,
+ rate_pps = 1000,
+ ignore_macs = True,
+ )
+ ]
+
+# dynamic load - used for trex console or simulator
+def register():
+ return STLS1()
+
+
+