From: imarom Date: Thu, 18 Feb 2016 11:53:43 +0000 (-0500) Subject: added tests for PCAP profiles X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=d650f106869eef15b7c347f8e49896dc9a572c3c;p=trex.git added tests for PCAP profiles --- 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..b9754a82 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 @@ -153,6 +153,8 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test): ["udp_inc_len_9k.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], + ["pcap.py", "-m 1", True], + ["pcap_with_vm.py", "-m 1", True], # YAML test ["yaml/burst_1000_pkt.yaml","-m 1 -l 100",True], diff --git a/scripts/exp/pcap.pcap b/scripts/exp/pcap.pcap new file mode 100644 index 00000000..e2465848 Binary files /dev/null and b/scripts/exp/pcap.pcap differ diff --git a/scripts/exp/pcap_with_vm.pcap b/scripts/exp/pcap_with_vm.pcap new file mode 100644 index 00000000..87d1b567 Binary files /dev/null and b/scripts/exp/pcap_with_vm.pcap differ diff --git a/scripts/stl/pcap_with_vm.py b/scripts/stl/pcap_with_vm.py index 7962d2b2..c3f34cfb 100644 --- a/scripts/stl/pcap_with_vm.py +++ b/scripts/stl/pcap_with_vm.py @@ -11,24 +11,33 @@ class STLPcap(object): if not ip_src_range and not ip_dst_range: return None - vm = [STLVmFixIpv4(offset = "IP")] + # until the feature of offsets will be fixed for PCAP use hard coded offsets + + vm = [] if ip_src_range: vm += [STLVmFlowVar(name="src", min_value = ip_src_range['start'], max_value = ip_src_range['end'], size = 4, op = "inc"), - STLVmWrFlowVar(fv_name="src",pkt_offset= "IP.src") + #STLVmWrFlowVar(fv_name="src",pkt_offset= "IP.src") + STLVmWrFlowVar(fv_name="src",pkt_offset = 26) ] if ip_dst_range: vm += [STLVmFlowVar(name="dst", min_value = ip_dst_range['start'], max_value = ip_dst_range['end'], size = 4, op = "inc"), - STLVmWrFlowVar(fv_name="dst",pkt_offset= "IP.dst") + + #STLVmWrFlowVar(fv_name="dst",pkt_offset= "IP.dst") + STLVmWrFlowVar(fv_name="dst",pkt_offset = 30) ] + vm += [#STLVmFixIpv4(offset = "IP") + STLVmFixIpv4(offset = 14) + ] + return vm def get_streams (self, ipg_usec = 10.0, - loop_count = 1, + loop_count = 5, ip_src_range = None, ip_dst_range = {'start' : '10.0.0.1', 'end': '10.0.0.254'}): diff --git a/scripts/stl/sample.pcap b/scripts/stl/sample.pcap index 2cb9d893..c4598a33 100644 Binary files a/scripts/stl/sample.pcap and b/scripts/stl/sample.pcap differ