summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2017-01-22 15:36:20 +0200
committerimarom <imarom@cisco.com>2017-01-22 15:36:20 +0200
commitf5f92b068561dcdf8414494e5daf6d285ea24135 (patch)
tree46925eb424943781e452f1fd9ebb5bd1f1774568 /scripts/automation/trex_control_plane/stl/trex_stl_lib
parent641fed03d8e407b6dca94f5280b9a1b4c768f601 (diff)
few tweaks
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py14
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py4
2 files changed, 12 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
index 5435619a..c82d77fb 100755
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
@@ -3058,13 +3058,19 @@ class STLClient(object):
self.logger.post_cmd(rc)
raise STLError(rc)
- pkts = rc.data()['pkts']
+ pkts = rc.data()['pkts']
+ pending = rc.data()['pending']
+ start_ts = rc.data()['start_ts']
+
for pkt in pkts:
- ts = pkt['ts']
+ ts = pkt['ts'] - start_ts
+ ts_sec = int(ts)
+ ts_usec = int( (ts - ts_sec) * 1e6 )
+
pkt_bin = base64.b64decode(pkt['binary'])
- writer._write_packet(pkt_bin, sec = 0, usec = 0)
+ writer._write_packet(pkt_bin, sec = ts_sec, usec = ts_usec)
- pending = rc.data()['pending']
+
self.logger.post_cmd(rc)
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py
index 72c9317a..ff07b59a 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py
@@ -184,7 +184,7 @@ class JsonRpcClient(object):
break
except zmq.Again:
tries += 1
- if tries > 5:
+ if tries > 0:
self.disconnect()
return RC_ERR("*** [RPC] - Failed to send message to server")
@@ -200,7 +200,7 @@ class JsonRpcClient(object):
break
except zmq.Again:
tries += 1
- if tries > 5:
+ if tries > 0:
self.disconnect()
return RC_ERR("*** [RPC] - Failed to get server response from {0}".format(self.transport))