summaryrefslogtreecommitdiffstats
path: root/scripts/stl
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-03-30 17:46:02 +0300
committerimarom <imarom@cisco.com>2016-03-31 15:51:18 +0300
commit32b6b28437504ce80182f48cc99dd40f5feb626f (patch)
tree7fa0875839f6536e84168e55b67ab76636c4cc24 /scripts/stl
parentfc4620422d79d218170aad12fc55fa4a98076c13 (diff)
STL tests (API)
Diffstat (limited to 'scripts/stl')
-rw-r--r--scripts/stl/flow_stats.py6
-rw-r--r--scripts/stl/udp_1pkt_pcap.py5
-rw-r--r--scripts/stl/udp_3pkt_pcap.py9
-rw-r--r--scripts/stl/yaml/imix_1pkt_vm_minus.yaml3
4 files changed, 16 insertions, 7 deletions
diff --git a/scripts/stl/flow_stats.py b/scripts/stl/flow_stats.py
index 69e1166c..cbb5ac21 100644
--- a/scripts/stl/flow_stats.py
+++ b/scripts/stl/flow_stats.py
@@ -1,15 +1,17 @@
from trex_stl_lib.api import *
+import os
# stream from pcap file. continues pps 10 in sec
+CP = os.path.join(os.path.dirname(__file__))
class STLS1(object):
def get_streams (self, direction = 0, **kwargs):
- return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd
+ return [STLStream(packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_64B_no_crc.pcap")), # path relative to pwd
mode = STLTXCont(pps=1000),
flow_stats = STLFlowStats(pg_id = 7)),
- STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_594B_no_crc.pcap"), # path relative to pwd
+ STLStream(packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_594B_no_crc.pcap")), # path relative to pwd
mode = STLTXCont(pps=5000),
flow_stats = STLFlowStats(pg_id = 12))
]
diff --git a/scripts/stl/udp_1pkt_pcap.py b/scripts/stl/udp_1pkt_pcap.py
index 9fb0e269..2a364810 100644
--- a/scripts/stl/udp_1pkt_pcap.py
+++ b/scripts/stl/udp_1pkt_pcap.py
@@ -1,11 +1,14 @@
from trex_stl_lib.api import *
+import os
# stream from pcap file. continues pps 10 in sec
+CP = os.path.join(os.path.dirname(__file__))
+
class STLS1(object):
def get_streams (self, direction = 0, **kwargs):
- return [STLStream(packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"), # path relative to pwd
+ return [STLStream(packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_64B_no_crc.pcap")),
mode = STLTXCont(pps=10)) ] #rate continues, could be STLTXSingleBurst,STLTXMultiBurst
diff --git a/scripts/stl/udp_3pkt_pcap.py b/scripts/stl/udp_3pkt_pcap.py
index fd2c609e..19ff46bc 100644
--- a/scripts/stl/udp_3pkt_pcap.py
+++ b/scripts/stl/udp_3pkt_pcap.py
@@ -1,26 +1,29 @@
from trex_stl_lib.api import *
+import os
# stream from pcap file. continues pps 10 in sec
+CP = os.path.join(os.path.dirname(__file__))
+
class STLS1(object):
def create_stream (self):
return STLProfile( [ STLStream( isg = 10.0, # star in delay
name ='S0',
- packet = STLPktBuilder(pkt ="stl/yaml/udp_64B_no_crc.pcap"),
+ packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_64B_no_crc.pcap")),
mode = STLTXSingleBurst( pps = 10, total_pkts = 10),
next = 'S1'), # point to next stream
STLStream( self_start = False, # stream is disabled enable trow S0
name ='S1',
- packet = STLPktBuilder(pkt ="stl/yaml/udp_594B_no_crc.pcap"),
+ packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_594B_no_crc.pcap")),
mode = STLTXSingleBurst( pps = 10, total_pkts = 20),
next = 'S2' ),
STLStream( self_start = False, # stream is disabled enable trow S0
name ='S2',
- packet = STLPktBuilder(pkt ="stl/yaml/udp_1518B_no_crc.pcap"),
+ packet = STLPktBuilder(pkt = os.path.join(CP, "yaml/udp_1518B_no_crc.pcap")),
mode = STLTXSingleBurst( pps = 10, total_pkts = 30 )
)
]).get_streams()
diff --git a/scripts/stl/yaml/imix_1pkt_vm_minus.yaml b/scripts/stl/yaml/imix_1pkt_vm_minus.yaml
index e83cfdd0..6d5345df 100644
--- a/scripts/stl/yaml/imix_1pkt_vm_minus.yaml
+++ b/scripts/stl/yaml/imix_1pkt_vm_minus.yaml
@@ -18,7 +18,8 @@
"min_value" : 1000,
"name" : "l3_src",
"op" : "inc",
- "size" : 2,
+ "step": 1,
+ "size" : 4,
"type" : "flow_var"
},
{