added tests for PCAP profiles
authorimarom <[email protected]>
Thu, 18 Feb 2016 11:53:43 +0000 (06:53 -0500)
committerimarom <[email protected]>
Thu, 18 Feb 2016 11:53:43 +0000 (06:53 -0500)
scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py
scripts/exp/pcap.pcap [new file with mode: 0644]
scripts/exp/pcap_with_vm.pcap [new file with mode: 0644]
scripts/stl/pcap_with_vm.py
scripts/stl/sample.pcap

index a2249d5..b9754a8 100644 (file)
@@ -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 (file)
index 0000000..e246584
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 (file)
index 0000000..87d1b56
Binary files /dev/null and b/scripts/exp/pcap_with_vm.pcap differ
index 7962d2b..c3f34cf 100644 (file)
@@ -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'}):
 
index 2cb9d89..c4598a3 100644 (file)
Binary files a/scripts/stl/sample.pcap and b/scripts/stl/sample.pcap differ