add_streams now returns the correct stream IDs which were allocated by the port
authorimarom <[email protected]>
Sun, 13 Mar 2016 13:23:51 +0000 (15:23 +0200)
committerimarom <[email protected]>
Sun, 13 Mar 2016 13:23:51 +0000 (15:23 +0200)
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py

index ec821f6..186771d 100644 (file)
@@ -1392,7 +1392,8 @@ class STLClient(object):
         if not rc:
             raise STLError(rc)
 
-        return [stream.get_id() for stream in streams]
+        # return the stream IDs
+        return rc.data()
 
 
     @__api_check(True)
index 4529efa..1ffeffe 100644 (file)
@@ -227,6 +227,7 @@ class Port(object):
 
         rc = self.transmit_batch(batch)
 
+        ret = RC()
         for i, single_rc in enumerate(rc):
             if single_rc:
                 stream_id = batch[i].params['stream_id']
@@ -236,10 +237,12 @@ class Port(object):
                                            'mode' : streams_list[i].get_mode(),
                                            'rate' : streams_list[i].get_rate()}
 
+                ret.add(RC_OK(data = stream_id))
+
 
         self.state = self.STATE_STREAMS if (len(self.streams) > 0) else self.STATE_IDLE
 
-        return self.ok() if rc else self.err(str(rc))
+        return ret if rc else self.err(str(rc))