summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-10-25 16:46:47 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-10-28 14:38:35 +0200
commit1016c3d481dc9e2eb9ab03332aff441c03239614 (patch)
treec0a0946a8418aaea8521ed6fe8c72ada455f1b43 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
parent528f62bb50ca111f387b56b280f3a4b271f8ace3 (diff)
console: rearrange lines at "stats --ps"
in case of start traffic with link down, return error with link state Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py5
1 files changed, 5 insertions, 0 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 a2821cc2..80a4c4dc 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
@@ -2050,6 +2050,11 @@ class STLClient(object):
validate_type('total', total, bool)
validate_type('core_mask', core_mask, (int, list))
+ # verify link status
+ ports_link_down = [port_id for port_id in ports if self.ports[port_id].attr.get('link',{}).get('up') == False]
+ if not force and ports_link_down:
+ raise STLError("Port(s) %s - link DOWN - check the connection or specify 'force'" % ports_link_down)
+
#########################
# decode core mask argument
decoded_mask = self.__decode_core_mask(ports, core_mask)