From f11bbb2d9c4f0e8fb5bf2a7b8d9ade597fc1be05 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 11 Feb 2016 15:17:12 +0200 Subject: test add udp_1pkt_simple --- .../unit_tests/functional_tests/stl_basic_tests.py | 8 +++++--- scripts/exp/udp_1pkt_range_clients.pcap | Bin 7624 -> 7624 bytes scripts/exp/udp_1pkt_simple.pcap | Bin 0 -> 252 bytes scripts/stl/udp_1pkt_range_clients.py | 7 +++++-- scripts/stl/udp_1pkt_simple.py | 19 +++++++++++++++++++ 5 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 scripts/exp/udp_1pkt_simple.pcap create mode 100644 scripts/stl/udp_1pkt_simple.py 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 ea3c872c..cfdba3c3 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 @@ -171,18 +171,20 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): ["yaml/imix_1pkt_tuple_gen.yaml","-m 1 -l 100",True], ["yaml/imix_1pkt_vm.yaml","-m 1 -l 100",True], ["udp_1pkt_pcap.py","-m 1 -l 10",True], - ["udp_3pkt_pcap.py","-m 1 -l 10",True] + ["udp_3pkt_pcap.py","-m 1 -l 10",True], + ["udp_1pkt_simple.py","-m 1 -l 3",True] ]; - p1=[ ["yaml/imix_1pkt_vm.yaml","-m 1 -l 100",True] ] + + p0 =[ ["udp_1pkt_simple.py","-m 1 -l 3",True] ] for obj in p: self.run_py_profile_path (obj[0],obj[1],compare =obj[2], do_no_remove=True) - def test_hlt_profiles (self): + def hlt_profiles (self): p = ( ['hlt/hlt_udp_inc_len_9k.py', '-m 1 -l 50', False], ) diff --git a/scripts/exp/udp_1pkt_range_clients.pcap b/scripts/exp/udp_1pkt_range_clients.pcap index f6502847..d0e6d923 100644 Binary files a/scripts/exp/udp_1pkt_range_clients.pcap and b/scripts/exp/udp_1pkt_range_clients.pcap differ diff --git a/scripts/exp/udp_1pkt_simple.pcap b/scripts/exp/udp_1pkt_simple.pcap new file mode 100644 index 00000000..3d215bf1 Binary files /dev/null and b/scripts/exp/udp_1pkt_simple.pcap differ diff --git a/scripts/stl/udp_1pkt_range_clients.py b/scripts/stl/udp_1pkt_range_clients.py index 2078b748..6b898ed2 100644 --- a/scripts/stl/udp_1pkt_range_clients.py +++ b/scripts/stl/udp_1pkt_range_clients.py @@ -3,7 +3,7 @@ from trex_stl_lib.api import * # x clients override the LSB of destination #Base src ip : 55.55.1.1, dst ip: Fixed -#Increment host port portion starting at 55.55.1.1 for 'n' number of clients (55.55.1.1, 55.55.1.2) +#Increment src ipt portion starting at 55.55.1.1 for 'n' number of clients (55.55.1.1, 55.55.1.2) #Src MAC: start with 0000.dddd.0001, increment mac in steps of 1 #Dst MAC: Fixed (will be taken from trex_conf.yaml @@ -25,7 +25,10 @@ class STLS1(object): STLVmFlowVar(name="mac_src_wa", min_value=0x0000dddd, max_value=0x0000dddd, size=4, op="inc"), # workaround hardcoded the src MAC MSB, will be solved as an option in the stream STLVmWrFlowVar(fv_name="mac_src_wa", pkt_offset= 6), # write constrant 0000.ddddd - STLVmWrFlowVar(fv_name="mac_src", pkt_offset= 10) # write it to LSB of ethernet.src + STLVmWrFlowVar(fv_name="mac_src", pkt_offset= 10), # write it to LSB of ethernet.src + STLVmWrFlowVar(fv_name="mac_src" ,pkt_offset="IP.src",offset_fixup=2), # it is 2 byte so there is a need to fixup in 2 bytes + STLVmFixIpv4(offset = "IP") + ] ) diff --git a/scripts/stl/udp_1pkt_simple.py b/scripts/stl/udp_1pkt_simple.py new file mode 100644 index 00000000..31492291 --- /dev/null +++ b/scripts/stl/udp_1pkt_simple.py @@ -0,0 +1,19 @@ +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 = STLTXCont() ) + + 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() + + + -- cgit 1.2.3-korg