summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-03-02 11:05:51 +0200
committerimarom <imarom@cisco.com>2016-03-02 13:35:09 +0200
commit59a3b58d240661a2bc06c6ede473d2eda4eb5e55 (patch)
tree37dd8d43c4bc6a0421d5964d7d1c57be3cca51a2 /scripts
parent70cfb9f88b00016f1413754e5625b5b05acc2063 (diff)
TX barrier
Diffstat (limited to 'scripts')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py9
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py28
2 files changed, 20 insertions, 17 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 50566853..04dd77ec 100644
--- 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
@@ -227,7 +227,7 @@ class AsyncEventHandler(object):
ev = "Port {0} job done".format(port_id)
# call the handler
- self.__async_event_port_stopped(port_id)
+ self.__async_event_port_job_done(port_id)
show_event = True
# port was stolen...
@@ -264,6 +264,9 @@ class AsyncEventHandler(object):
# private functions
+ def __async_event_port_job_done (self, port_id):
+ self.client.ports[port_id].async_event_port_job_done()
+
def __async_event_port_stopped (self, port_id):
self.client.ports[port_id].async_event_port_stopped()
@@ -1332,7 +1335,6 @@ class STLClient(object):
:parameters:
ports : list
ports to execute the command
-
:raises:
+ :exc:`STLError`
@@ -1354,7 +1356,6 @@ class STLClient(object):
if not rc:
raise STLError(rc)
-
"""
update traffic on port(s)
@@ -1433,8 +1434,6 @@ class STLClient(object):
if not rc:
raise STLError(rc)
-
-
"""
resume traffic on port(s)
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 6aa18847..4529efa9 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
@@ -334,7 +334,7 @@ class Port(object):
"mul": mul,
"duration": duration,
"force": force}
-
+
rc = self.transmit("start_traffic", params)
if rc.bad():
return self.err(rc.err())
@@ -363,7 +363,6 @@ class Port(object):
if rc.bad():
return self.err(rc.err())
- # only valid state after stop
self.state = self.STATE_STREAMS
return self.ok()
@@ -383,7 +382,6 @@ class Port(object):
if rc.bad():
return self.err(rc.err())
- # only valid state after stop
self.state = self.STATE_PAUSE
return self.ok()
@@ -400,11 +398,12 @@ class Port(object):
params = {"handler": self.handler,
"port_id": self.port_id}
+ # only valid state after stop
+
rc = self.transmit("resume_traffic", params)
if rc.bad():
return self.err(rc.err())
- # only valid state after stop
self.state = self.STATE_TX
return self.ok()
@@ -591,21 +590,26 @@ class Port(object):
- ################# events handler ######################
- def async_event_port_stopped (self):
+ ################# events handler ######################
+ def async_event_port_job_done (self):
self.state = self.STATE_STREAMS
-
- def async_event_port_started (self):
- self.state = self.STATE_TX
-
+ # rest of the events are used for TUI / read only sessions
+ def async_event_port_stopped (self):
+ if not self.is_acquired():
+ self.state = self.STATE_STREAMS
def async_event_port_paused (self):
- self.state = self.STATE_PAUSE
+ if not self.is_acquired():
+ self.state = self.STATE_PAUSE
+ def async_event_port_started (self):
+ if not self.is_acquired():
+ self.state = self.STATE_TX
def async_event_port_resumed (self):
- self.state = self.STATE_TX
+ if not self.is_acquired():
+ self.state = self.STATE_TX
def async_event_forced_acquired (self):
self.handler = None