summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2017-03-05 15:09:57 +0200
committerHanoh Haim <hhaim@cisco.com>2017-03-05 15:10:14 +0200
commit7c362a7c7355d4487d4d6eefc188c16a56418373 (patch)
tree37e8e7571b5f6f7ff980ec29dbd09a6632c35879 /scripts
parentbfb5a276daac7e12aaa5d3e4ce7c32a6d65b03da (diff)
fix STLVmFlowVarRepetableRandom typo instruction
Signed-off-by: Hanoh Haim <hhaim@cisco.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/automation/trex_control_plane/doc_stl/api/field_engine.rst6
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py23
-rw-r--r--scripts/exp/rtsp_short3-0.erfbin0 -> 20032 bytes
-rw-r--r--scripts/stl/udp_1pkt_repeat_random.py2
4 files changed, 23 insertions, 8 deletions
diff --git a/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst b/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst
index cac2f5ab..47222aa2 100755
--- a/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst
+++ b/scripts/automation/trex_control_plane/doc_stl/api/field_engine.rst
@@ -163,10 +163,10 @@ STLVmTupleGen
:members:
:member-order: bysource
-STLVmFlowVarRepetableRandom
+STLVmFlowVarRepeatableRandom
----------------------------
-.. autoclass:: trex_stl_lib.trex_stl_packet_builder_scapy.STLVmFlowVarRepetableRandom
+.. autoclass:: trex_stl_lib.trex_stl_packet_builder_scapy.STLVmFlowVarRepeatableRandom
:members:
:member-order: bysource
@@ -236,7 +236,7 @@ Field Engine snippet
vm = STLScVmRaw( [ STLVmFlowVar ( "ip_src", min_value="10.0.0.1",
max_value="10.0.0.255", size=4, step=1,op="inc"),
- STLVmFlowVarRepetableRandom ( "ip_dst",
+ STLVmFlowVarRepeatableRandom ( "ip_dst",
min_value="48.0.0.1",
max_value="48.0.0.255",
size=4,
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
index edd3d91e..d50f4050 100755
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_packet_builder_scapy.py
@@ -743,13 +743,16 @@ class STLVmFlowVar(CTRexVmDescBase):
def get_var_name(self):
return [self.name]
-class STLVmFlowVarRepetableRandom(CTRexVmDescBase):
+class STLVmFlowVarRepeatableRandom(CTRexVmDescBase):
def __init__(self, name, size=4, limit=100, seed=None, min_value=0, max_value=None):
"""
Flow variable instruction for repeatable random with limit number of generating numbers. Allocates memory on a stream context.
The size argument determines the variable size. Could be 1,2,4 or 8
+ 1. The maximum number of distinct values will 'limit'. There could be a case of repetition
+ 2. The values will be repeated after 'limit' number of values.
+
:parameters:
name : string
Name of the stream variable
@@ -775,15 +778,15 @@ class STLVmFlowVarRepetableRandom(CTRexVmDescBase):
# Example1
# input , 1 byte or random with limit of 5
- STLVmFlowVarRepetableRandom("var1",size=1,limit=5)
+ STLVmFlowVarRepeatableRandom("var1",size=1,limit=5)
# output 255,1,7,129,8, ==> repeat 255,1,7,129,8
- STLVmFlowVarRepetableRandom("var1",size=4,limit=100,min_value=0x12345678, max_value=0x32345678)
+ STLVmFlowVarRepeatableRandom("var1",size=4,limit=100,min_value=0x12345678, max_value=0x32345678)
"""
- super(STLVmFlowVarRepetableRandom, self).__init__()
+ super(STLVmFlowVarRepeatableRandom, self).__init__()
self.name = name;
validate_type('name', name, str)
self.size =size
@@ -811,6 +814,18 @@ class STLVmFlowVarRepetableRandom(CTRexVmDescBase):
def get_var_name(self):
return [self.name]
+class STLVmFlowVarRepetableRandom(STLVmFlowVarRepeatableRandom):
+
+ def __init__(self, name, size=4, limit=100, seed=None, min_value=0, max_value=None):
+ super(STLVmFlowVarRepetableRandom, self).__init__(name, size, limit, seed, min_value, max_value)
+
+ def get_obj (self):
+ return CTRexVmInsFlowVarRandLimit(self.name, self.size, self.limit, self.seed, self.min_value, self.max_value);
+
+ def get_var_name(self):
+ return [self.name]
+
+
class STLVmFixChecksumHw(CTRexVmDescBase):
def __init__(self, l3_offset,l4_offset,l4_type):
"""
diff --git a/scripts/exp/rtsp_short3-0.erf b/scripts/exp/rtsp_short3-0.erf
index e69de29b..1b178df9 100644
--- a/scripts/exp/rtsp_short3-0.erf
+++ b/scripts/exp/rtsp_short3-0.erf
Binary files differ
diff --git a/scripts/stl/udp_1pkt_repeat_random.py b/scripts/stl/udp_1pkt_repeat_random.py
index 860970ed..49fbd752 100644
--- a/scripts/stl/udp_1pkt_repeat_random.py
+++ b/scripts/stl/udp_1pkt_repeat_random.py
@@ -22,7 +22,7 @@ class STLS1(object):
vm = STLScVmRaw( [ STLVmFlowVar ( "ip_src", min_value="10.0.0.1",
max_value="10.0.0.255", size=4, step=1,op="inc"),
- STLVmFlowVarRepetableRandom ( "ip_dst",
+ STLVmFlowVarRepeatableRandom ( "ip_dst",
min_value="48.0.0.1",
max_value="48.0.0.255",
size=4,