From 17e720ee8611d950c56e3a873f0ac9cd2b235279 Mon Sep 17 00:00:00 2001 From: imarom Date: Sun, 13 Mar 2016 15:23:51 +0200 Subject: add_streams now returns the correct stream IDs which were allocated by the port --- .../trex_control_plane/stl/trex_stl_lib/trex_stl_client.py | 3 ++- .../automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib') 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 ec821f68..186771d8 100644 --- 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 @@ -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) diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py index 4529efa9..1ffeffe0 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py @@ -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)) -- cgit