diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-02-10 15:19:51 +0200 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-02-10 15:19:51 +0200 |
commit | f2a86412d7b160619a92d0942e27f608608bf3a6 (patch) | |
tree | b3b143263ec5d8d175812eae80ee3cad6b679c52 | |
parent | 0c2b005a017a8574a3580e45118069079e9ea7ff (diff) |
burst example
-rw-r--r-- | scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py | 2 | ||||
-rw-r--r-- | scripts/exp/burst_3st_600pkt.pcap | bin | 0 -> 4584 bytes | |||
-rw-r--r-- | scripts/stl/burst_3st_600pkt.py | 51 | ||||
-rw-r--r-- | scripts/stl/udp_1pkt_1mac.pyc | bin | 1531 -> 0 bytes | |||
-rw-r--r-- | scripts/stl/udp_1pkt_1mac_override.pyc | bin | 1776 -> 0 bytes | |||
-rw-r--r-- | scripts/stl/udp_1pkt_mac.pyc | bin | 1525 -> 0 bytes |
6 files changed, 52 insertions, 1 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 3ffa1780..d94ac646 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 @@ -160,7 +160,7 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): ["udp_1pkt_range_clients.py","-m 1 -l 100",True] ]; - #p=[ ["udp_1pkt_range_clients.py","-m 1 -l 100",True] ] + #p=[ ["burst_3st_600pkt.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) diff --git a/scripts/exp/burst_3st_600pkt.pcap b/scripts/exp/burst_3st_600pkt.pcap Binary files differnew file mode 100644 index 00000000..f0a71ecf --- /dev/null +++ b/scripts/exp/burst_3st_600pkt.pcap diff --git a/scripts/stl/burst_3st_600pkt.py b/scripts/stl/burst_3st_600pkt.py new file mode 100644 index 00000000..817b6777 --- /dev/null +++ b/scripts/stl/burst_3st_600pkt.py @@ -0,0 +1,51 @@ +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 + + + 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) + base_pkt2 = Ether()/IP(src="16.0.0.3",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 = 10), + 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 = STLTXSingleBurst( pps = 10, total_pkts = 20), + next = 'S2' ), + + STLStream( self_start = False, # stream is disabled enable trow S0 + name ='S2', + packet = STLPktBuilder(pkt = base_pkt2/pad), + mode = STLTXSingleBurst( pps = 10, total_pkts = 30 ) + ) + ]).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() + + + + diff --git a/scripts/stl/udp_1pkt_1mac.pyc b/scripts/stl/udp_1pkt_1mac.pyc Binary files differdeleted file mode 100644 index 9fd5442f..00000000 --- a/scripts/stl/udp_1pkt_1mac.pyc +++ /dev/null diff --git a/scripts/stl/udp_1pkt_1mac_override.pyc b/scripts/stl/udp_1pkt_1mac_override.pyc Binary files differdeleted file mode 100644 index 6656968d..00000000 --- a/scripts/stl/udp_1pkt_1mac_override.pyc +++ /dev/null diff --git a/scripts/stl/udp_1pkt_mac.pyc b/scripts/stl/udp_1pkt_mac.pyc Binary files differdeleted file mode 100644 index 61ae6914..00000000 --- a/scripts/stl/udp_1pkt_mac.pyc +++ /dev/null |