diff options
Diffstat (limited to 'scripts/stl')
-rw-r--r-- | scripts/stl/flow_stats.py | 6 | ||||
-rw-r--r-- | scripts/stl/udp_1pkt_pcap.py | 5 | ||||
-rw-r--r-- | scripts/stl/udp_1pkt_simple_burst.py | 24 | ||||
-rw-r--r-- | scripts/stl/udp_3pkt_pcap.py | 9 | ||||
-rw-r--r-- | scripts/stl/yaml/imix_1pkt_vm_minus.yaml | 3 |
5 files changed, 40 insertions, 7 deletions
diff --git a/scripts/stl/flow_stats.py b/scripts/stl/flow_stats.py index 69e1166c..cbb5ac21 100644 --- a/scripts/stl/flow_stats.py +++ b/scripts/stl/flow_stats.py @@ -1,15 +1,17 @@ from trex_stl_lib.api import * +import os # stream from pcap file. continues pps 10 in sec +CP = os.path.join(os.path.dirname(__file__)) class STLS1(object): def get_streams (self, direction = 0, **kwargs): - return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd + return [STLStream(packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_64B_no_crc.pcap")), # path relative to pwd mode = STLTXCont(pps=1000), flow_stats = STLFlowStats(pg_id = 7)), - STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_594B_no_crc.pcap"), # path relative to pwd + STLStream(packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_594B_no_crc.pcap")), # path relative to pwd mode = STLTXCont(pps=5000), flow_stats = STLFlowStats(pg_id = 12)) ] diff --git a/scripts/stl/udp_1pkt_pcap.py b/scripts/stl/udp_1pkt_pcap.py index 9fb0e269..2a364810 100644 --- a/scripts/stl/udp_1pkt_pcap.py +++ b/scripts/stl/udp_1pkt_pcap.py @@ -1,11 +1,14 @@ from trex_stl_lib.api import * +import os # stream from pcap file. continues pps 10 in sec +CP = os.path.join(os.path.dirname(__file__)) + class STLS1(object): def get_streams (self, direction = 0, **kwargs): - return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd + return [STLStream(packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_64B_no_crc.pcap")), mode = STLTXCont(pps=10)) ] #rate continues, could be STLTXSingleBurst,STLTXMultiBurst diff --git a/scripts/stl/udp_1pkt_simple_burst.py b/scripts/stl/udp_1pkt_simple_burst.py new file mode 100644 index 00000000..bf485ab0 --- /dev/null +++ b/scripts/stl/udp_1pkt_simple_burst.py @@ -0,0 +1,24 @@ +from trex_stl_lib.api import * + +class STLS1(object): + + def create_stream (self): + return STLStream( + packet = + STLPktBuilder( + pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/ + UDP(dport=12,sport=1025)/(10*'x') + ), + mode = STLTXSingleBurst(total_pkts = 1)) + + def get_streams (self, direction = 0, **kwargs): + # create 1 stream + return [ self.create_stream() ] + + +# dynamic load - used for trex console or simulator +def register(): + return STLS1() + + + diff --git a/scripts/stl/udp_3pkt_pcap.py b/scripts/stl/udp_3pkt_pcap.py index fd2c609e..19ff46bc 100644 --- a/scripts/stl/udp_3pkt_pcap.py +++ b/scripts/stl/udp_3pkt_pcap.py @@ -1,26 +1,29 @@ from trex_stl_lib.api import * +import os # stream from pcap file. continues pps 10 in sec +CP = os.path.join(os.path.dirname(__file__)) + class STLS1(object): def create_stream (self): return STLProfile( [ STLStream( isg = 10.0, # star in delay name ='S0', - packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), + packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_64B_no_crc.pcap")), mode = STLTXSingleBurst( pps = 10, total_pkts = 10), next = 'S1'), # point to next stream STLStream( self_start = False, # stream is disabled enable trow S0 name ='S1', - packet = STLPktBuilder(pkt ="stl/yaml/udp_594B_no_crc.pcap"), + packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_594B_no_crc.pcap")), mode = STLTXSingleBurst( pps = 10, total_pkts = 20), next = 'S2' ), STLStream( self_start = False, # stream is disabled enable trow S0 name ='S2', - packet = STLPktBuilder(pkt ="stl/yaml/udp_1518B_no_crc.pcap"), + packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_1518B_no_crc.pcap")), mode = STLTXSingleBurst( pps = 10, total_pkts = 30 ) ) ]).get_streams() diff --git a/scripts/stl/yaml/imix_1pkt_vm_minus.yaml b/scripts/stl/yaml/imix_1pkt_vm_minus.yaml index e83cfdd0..6d5345df 100644 --- a/scripts/stl/yaml/imix_1pkt_vm_minus.yaml +++ b/scripts/stl/yaml/imix_1pkt_vm_minus.yaml @@ -18,7 +18,8 @@ "min_value" : 1000, "name" : "l3_src", "op" : "inc", - "size" : 2, + "step": 1, + "size" : 4, "type" : "flow_var" }, { |