diff options
author | 2016-02-10 16:05:35 +0200 | |
---|---|---|
committer | 2016-02-10 16:05:35 +0200 | |
commit | 6c3a6dd6c1f2bf1c6a39dacad8e5db3551580521 (patch) | |
tree | 5f9b7561f81914ec7be32ef4657f32c51e8ae7b1 | |
parent | 267aeb3436afe9929e6dda1c1681a342bcb534da (diff) |
multi burst example
-rw-r--r-- | scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py | 9 | ||||
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py | 2 | ||||
-rw-r--r-- | scripts/exp/multi_burst_2st_1000pkt.pcap | bin | 0 -> 1696 bytes | |||
-rw-r--r-- | scripts/stl/multi_burst_2st_1000pkt.py | 46 |
4 files changed, 52 insertions, 5 deletions
diff --git a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py index d94ac646..40a02de5 100644 --- a/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py +++ b/scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py @@ -145,7 +145,7 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): self.golden_run("basic_tuple_gen", "imix_tuple_gen", "-m 50kpps --limit 500 --cores 8", silent = False) def test_all_profiles (self): - p=[ + p1=[ ["udp_1pkt_1mac_override.py","-m 1 -l 50",True], ["syn_attack.py","-m 1 -l 50",False], # can't compare random now ["udp_1pkt_1mac.py","-m 1 -l 50",True], @@ -157,13 +157,14 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): ["udp_1pkt_mpls_vm.py","-m 1 ",True], ["imix.py","-m 1 -l 100",True], ["udp_inc_len_9k.py","-m 1 -l 100",True], - ["udp_1pkt_range_clients.py","-m 1 -l 100",True] + ["udp_1pkt_range_clients.py","-m 1 -l 100",True], + ["multi_burst_2st_1000pkt.py","-m 1 -l 100",True] ]; - #p=[ ["burst_3st_600pkt.py","-m 1 -l 100",True] ] + p=[ ["multi_burst_2st_1000pkt.py","-m 1 -l 100",True] ] for obj in p: - self.run_py_profile_path (obj[0],obj[1],compare =obj[2], do_no_remove=False) + self.run_py_profile_path (obj[0],obj[1],compare =obj[2], do_no_remove=True) 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 91eef745..50b9f896 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 @@ -63,7 +63,7 @@ class STLTXMultiBurst(STLTXMode): def __init__ (self, pps = 1, pkts_per_burst = 1, - ibg = 0.0, + ibg = 0.0, # usec not SEC count = 1): if not isinstance(pps, (int, float)): diff --git a/scripts/exp/multi_burst_2st_1000pkt.pcap b/scripts/exp/multi_burst_2st_1000pkt.pcap Binary files differnew file mode 100644 index 00000000..2da71e0f --- /dev/null +++ b/scripts/exp/multi_burst_2st_1000pkt.pcap diff --git a/scripts/stl/multi_burst_2st_1000pkt.py b/scripts/stl/multi_burst_2st_1000pkt.py new file mode 100644 index 00000000..9922458e --- /dev/null +++ b/scripts/stl/multi_burst_2st_1000pkt.py @@ -0,0 +1,46 @@ +from trex_stl_lib.api import * + +# 1 clients MAC override the LSB of destination +class STLS1(object): + + def __init__ (self): + self.fsize =64; # the size of the packet + self.burst_size = 2 + + + def create_stream (self): + + # create a base packet and pad it to size + size = self.fsize - 4; # no FCS + base_pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025) + base_pkt1 = Ether()/IP(src="16.0.0.2",dst="48.0.0.1")/UDP(dport=12,sport=1025) + pad = max(0, size - len(base_pkt)) * 'x' + + + return STLProfile( [ STLStream( isg = 10.0, # star in delay + name ='S0', + packet = STLPktBuilder(pkt = base_pkt/pad), + mode = STLTXSingleBurst( pps = 10, total_pkts = self.burst_size), + next = 'S1'), # point to next stream + + STLStream( self_start = False, # stream is disabled enable trow S0 + name ='S1', + packet = STLPktBuilder(pkt = base_pkt1/pad), + mode = STLTXMultiBurst( pps = 1000,pkts_per_burst = 4,ibg = 1000000.0,count = 5) + ) + + ]).get_streams() + + + def get_streams (self, direction = 0): + # create 1 stream + return self.create_stream() + + +# dynamic load - used for trex console or simulator +def register(): + return STLS1() + + + + |