check for service mode ports should be from among the acquired ports
authorimarom <[email protected]>
Thu, 30 Mar 2017 14:20:40 +0000 (17:20 +0300)
committerimarom <[email protected]>
Thu, 30 Mar 2017 14:20:40 +0000 (17:20 +0300)
only
any non acquired ports should be ignored

Signed-off-by: imarom <[email protected]>
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py

index 6f6e8bf..b48732d 100755 (executable)
@@ -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
+