add simple pcap file example
authorHanoh Haim <[email protected]>
Thu, 11 Feb 2016 09:52:15 +0000 (11:52 +0200)
committerHanoh Haim <[email protected]>
Thu, 11 Feb 2016 09:52:15 +0000 (11:52 +0200)
scripts/automation/regression/unit_tests/functional_tests/stl_basic_tests.py
scripts/exp/udp_1pkt_pcap.pcap [new file with mode: 0644]
scripts/stl/udp_1pkt_pcap.py [new file with mode: 0644]

index bf02c07..ad5013b 100644 (file)
@@ -166,15 +166,16 @@ class CStlBasic_Test(functional_general_test.CGeneralFunctional_Test):
             ["yaml/imix_1pkt.yaml","-m 1 -l 100",True],
             ["yaml/imix_1pkt_2.yaml","-m 1 -l 100",True],
             ["yaml/imix_1pkt_tuple_gen.yaml","-m 1 -l 100",True],
-            ["yaml/imix_1pkt_vm.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]
 
           ];
 
-        p1=[ ["yaml/imix_1pkt_2.yaml","-m 1 -l 100",True] ]
+        p1=[ ["udp_1pkt_pcap.py","-m 1 -l 10",True] ]
         
 
         for obj in p:
-            self.run_py_profile_path (obj[0],obj[1],compare =obj[2], do_no_remove=True)
+            self.run_py_profile_path (obj[0],obj[1],compare =obj[2], do_no_remove=False)
 
 
 
diff --git a/scripts/exp/udp_1pkt_pcap.pcap b/scripts/exp/udp_1pkt_pcap.pcap
new file mode 100644 (file)
index 0000000..f150434
Binary files /dev/null and b/scripts/exp/udp_1pkt_pcap.pcap differ
diff --git a/scripts/stl/udp_1pkt_pcap.py b/scripts/stl/udp_1pkt_pcap.py
new file mode 100644 (file)
index 0000000..a0d2ee4
--- /dev/null
@@ -0,0 +1,17 @@
+from trex_stl_lib.api import *
+
+# stream from pcap file. continues pps 10 in sec 
+
+class STLS1(object):
+
+    def get_streams (self, direction = 0):
+        return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd 
+                         mode = STLTXCont(pps=10)) ] #rate continues, could be STLTXSingleBurst,STLTXMultiBurst
+
+
+# dynamic load - used for trex console or simulator
+def register():
+    return STLS1()
+
+
+