summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-11-14 10:58:56 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-11-14 10:58:56 +0200
commitdeb1ce15e6dd0e64c981dbedbf764e5c426e6ec4 (patch)
treeba1969fa075803afba9c581dd5b339557b7d51cd /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
parentf6641c898b4ef5a6bd7f0d504404ac3576f9a397 (diff)
fix STL push pcap: start from zero (or explicit delay)
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
index e63f9125..63e61b1d 100755
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_streams.py
@@ -1073,6 +1073,8 @@ class STLProfile(object):
def __pkts_to_streams (pkts, ipg_usec, speedup, loop_count, vm, packet_hook, start_delay_usec = 0):
streams = []
+ if speedup == 0:
+ raise STLError('Speedup should not be 0')
# 10 ms delay before starting the PCAP
last_ts_usec = -(start_delay_usec)
@@ -1084,7 +1086,10 @@ class STLProfile(object):
for i, (cap, meta) in enumerate(pkts, start = 1):
# IPG - if not provided, take from cap
if ipg_usec == None:
- ts_usec = (meta[0] * 1e6 + meta[1]) / float(speedup)
+ packet_time = meta[0] * 1e6 + meta[1]
+ if i == 1:
+ base_time = packet_time
+ ts_usec = (packet_time - base_time) / float(speedup)
else:
ts_usec = (ipg_usec * i) / float(speedup)