From 2c839ec5098bf1ad39ec574729891c622a485083 Mon Sep 17 00:00:00 2001 From: imarom Date: Thu, 30 Mar 2017 17:20:40 +0300 Subject: check for service mode ports should be from among the acquired ports only any non acquired ports should be ignored Signed-off-by: imarom --- .../stl/trex_stl_lib/trex_stl_client.py | 17 +++++++++++------ 1 file changed, 11 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 6f6e8bfd..b48732d6 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 @@ -1394,12 +1394,17 @@ class STLClient(object): for port_id, port_obj in self.ports.items() if port_obj.is_acquired() and port_obj.is_resolved()] - - def get_service_enabled_ports(self): - return [port_id - for port_id, port_obj in self.ports.items() - if port_obj.is_service_mode_on()] + def get_service_enabled_ports(self, owned = True): + if owned: + return [port_id + for port_id, port_obj in self.ports.items() + if port_obj.is_service_mode_on() and port_obj.is_acquired()] + else: + return [port_id + for port_id, port_obj in self.ports.items() + if port_obj.is_service_mode_on()] + # get paused ports def get_paused_ports (self, owned = True): @@ -4562,4 +4567,4 @@ class STLClient(object): return - \ No newline at end of file + -- cgit 1.2.3-korg