From 3931530bce5529e141f0fb10d6c72981aa0d97e6 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 18 Feb 2016 16:10:30 +0200 Subject: add python profile for new write_mask command --- .../regression/unit_tests/functional_tests/stl_basic_tests.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.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 a2249d5a..9419ab62 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 @@ -139,7 +139,7 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): def test_stl_profiles (self): - p = [ + p0 = [ ["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], @@ -175,12 +175,17 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): ["udp_1pkt_simple_mac_dst.py","-m 1 -l 1 ",True], ["udp_1pkt_simple_mac_src.py","-m 1 -l 1 ",True], ["udp_1pkt_simple_mac_dst_src.py","-m 1 -l 1 ",True], - ["burst_3st_loop_x_times.py","-m 1 -l 20 ",True] + ["burst_3st_loop_x_times.py","-m 1 -l 20 ",True], + ["udp_1pkt_mac_step.py","-m 1 -l 20 ",True], + ["udp_1pkt_mac_mask1.py","-m 1 -l 20 ",True] , + ["udp_1pkt_mac_mask2.py","-m 1 -l 20 ",True], + ["udp_1pkt_mac_mask3.py","-m 1 -l 20 ",True] + ]; - p1 = [ ["udp_1pkt_mac_step.py","-m 1 -l 20 ",True] ] + p = [ ["udp_1pkt_mac_mask3.py","-m 1 -l 20 ",True] ] for obj in p: -- cgit 1.2.3-korg From 38defe118db360190121c44a9b65c1477f54afa3 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 18 Feb 2016 16:49:09 +0200 Subject: fix mpls example to use write_mask instruction --- .../unit_tests/functional_tests/stl_basic_tests.py | 4 ++-- scripts/exp/udp_1pkt_mpls_vm.pcap | Bin 8624 -> 8624 bytes scripts/stl/udp_1pkt_mpls_vm.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.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 9419ab62..cd12bff7 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 @@ -139,7 +139,7 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): def test_stl_profiles (self): - p0 = [ + p = [ ["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], @@ -185,7 +185,7 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): ]; - p = [ ["udp_1pkt_mac_mask3.py","-m 1 -l 20 ",True] ] + p1 = [ ["udp_1pkt_mpls_vm.py","-m 1 ",True] ] for obj in p: diff --git a/scripts/exp/udp_1pkt_mpls_vm.pcap b/scripts/exp/udp_1pkt_mpls_vm.pcap index f205b334..23fdc7fe 100644 Binary files a/scripts/exp/udp_1pkt_mpls_vm.pcap and b/scripts/exp/udp_1pkt_mpls_vm.pcap differ diff --git a/scripts/stl/udp_1pkt_mpls_vm.py b/scripts/stl/udp_1pkt_mpls_vm.py index 262a662f..57cfb7ee 100644 --- a/scripts/stl/udp_1pkt_mpls_vm.py +++ b/scripts/stl/udp_1pkt_mpls_vm.py @@ -12,7 +12,7 @@ class STLS1(object): pkt = Ether()/MPLS(label=17,cos=1,s=0,ttl=255)/MPLS(label=0,cos=1,s=1,ttl=12)/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/('x'*20) vm = CTRexScRaw( [ STLVmFlowVar(name="mlabel", min_value=1, max_value=2000, size=2, op="inc"), # 2 bytes var - STLVmWrFlowVar(fv_name="mlabel", pkt_offset= "MPLS:1.label") # LABEL is 20 bits expected is val*8 as 3 LSB are off, 16,32,64 .. using new instruction it will be possible to write to any bits + STLVmWrMaskFlowVar(fv_name="mlabel", pkt_offset= "MPLS:1.label",pkt_cast_size=4, mask=0xFFFFF000,shift=12) # write to 20bit MSB ] ) -- cgit 1.2.3-korg