summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/client/trex_stateless_client.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-01-24 11:35:41 -0500
committerimarom <imarom@cisco.com>2016-01-24 11:35:41 -0500
commitb87ac8e2af727598b3120510b221244c9c499e56 (patch)
tree425d9cb46b9fa49eb13a0e2773a3e68591182c6c /scripts/automation/trex_control_plane/client/trex_stateless_client.py
parent7294d7f162e19e0ccd3a37eafbafe22cf63df6a4 (diff)
added support for L1 B/W check
both start/update now enforce this and it can be bypassed by providing 'force'
Diffstat (limited to 'scripts/automation/trex_control_plane/client/trex_stateless_client.py')
-rwxr-xr-xscripts/automation/trex_control_plane/client/trex_stateless_client.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/scripts/automation/trex_control_plane/client/trex_stateless_client.py b/scripts/automation/trex_control_plane/client/trex_stateless_client.py
index c59da7b4..32618a05 100755
--- a/scripts/automation/trex_control_plane/client/trex_stateless_client.py
+++ b/scripts/automation/trex_control_plane/client/trex_stateless_client.py
@@ -605,14 +605,14 @@ class STLClient(object):
return self.ports[port_id].get_stream_id_list()
- def __start_traffic (self, multiplier, duration, port_id_list = None):
+ def __start_traffic (self, multiplier, duration, port_id_list = None, force = False):
port_id_list = self.__ports(port_id_list)
rc = RC()
for port_id in port_id_list:
- rc.add(self.ports[port_id].start(multiplier, duration))
+ rc.add(self.ports[port_id].start(multiplier, duration, force))
return rc
@@ -655,7 +655,7 @@ class STLClient(object):
rc = RC()
for port_id in port_id_list:
- rc.add(self.ports[port_id].update(mult))
+ rc.add(self.ports[port_id].update(mult, force))
return rc
@@ -786,7 +786,7 @@ class STLClient(object):
if not dry:
self.logger.pre_cmd("Starting traffic on port(s) {0}:".format(port_id_list))
- rc = self.__start_traffic(mult, duration, port_id_list)
+ rc = self.__start_traffic(mult, duration, port_id_list, force)
self.logger.post_cmd(rc)
return rc
@@ -815,10 +815,10 @@ class STLClient(object):
return RC_OK()
#update cmd
- def __update (self, port_id_list, mult):
+ def __update (self, port_id_list, mult, force):
self.logger.pre_cmd("Updating traffic on port(s) {0}:".format(port_id_list))
- rc = self.__update_traffic(mult, port_id_list)
+ rc = self.__update_traffic(mult, port_id_list, force)
self.logger.post_cmd(rc)
return rc
@@ -1365,7 +1365,7 @@ class STLClient(object):
# update traffic
@__api_check(True)
- def update (self, ports = None, mult = "1", total = False):
+ def update (self, ports = None, mult = "1", total = False, force = False):
# by default the user means all the active ports
if ports == None:
@@ -1389,7 +1389,7 @@ class STLClient(object):
# call low level functions
- rc = self.__update(ports, mult_obj)
+ rc = self.__update(ports, mult_obj, force)
if not rc:
raise STLError(rc)
@@ -1638,7 +1638,8 @@ class STLClient(object):
self.update_line.__doc__,
parsing_opts.PORT_LIST_WITH_ALL,
parsing_opts.MULTIPLIER,
- parsing_opts.TOTAL)
+ parsing_opts.TOTAL,
+ parsing_opts.FORCE)
opts = parser.parse_args(line.split())
if opts is None:
@@ -1651,7 +1652,7 @@ class STLClient(object):
self.logger.log(format_text("No ports in valid state to update\n", 'bold'))
return
- self.update(ports, opts.mult, opts.total)
+ self.update(ports, opts.mult, opts.total, opts.force)
# true means print time
return True