summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-05-17 11:20:57 +0300
committerimarom <imarom@cisco.com>2016-05-17 11:22:27 +0300
commit6dac5c0b4617c3d5f0a7fd2cb2b2b2dfdce6f4ba (patch)
tree0267e9e217d53c63b96634a9a1640ad418f1f702 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
parentfad99b60c53a5dcf042a6b8b0d041d6d7116b871 (diff)
timeout fix - two bugs in two lines of code :-( ... now it should be ok
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
index d209cd64..be46e95f 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
@@ -406,13 +406,15 @@ class Port(object):
"mul": mul,
"duration": duration,
"force": force}
-
- rc = self.transmit("start_traffic", params)
-
+
# must set this before to avoid race with the async response
+ last_state = self.state
self.state = self.STATE_TX
+
+ rc = self.transmit("start_traffic", params)
+
if rc.bad():
- self.state = self.STATE_IDLE
+ self.state = last_state
return self.err(rc.err())
return self.ok()