From 3159743120d9e1033c5ed809c1031b814204fd8f Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Wed, 3 Aug 2016 16:18:50 +0300 Subject: set default stateful duration 1 hour, forbid duration in stateless add "add_profile"stateless Python API command fix trex_perf.py --- .../stl/trex_stl_lib/trex_stl_client.py | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (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 4e3d3092..4799b2fc 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 @@ -1536,7 +1536,6 @@ class STLClient(object): @__api_check(False) def connect (self): """ - def connect(self): Connects to the TRex server @@ -1829,6 +1828,33 @@ class STLClient(object): # return the stream IDs return rc.data() + @__api_check(True) + def add_profile(self, filename, ports = None, **kwargs): + """ | Add streams from profile by its type. Supported types are: + | .py + | .yaml + | .pcap file that converted to profile automatically + + :parameters: + filename : string + filename (with path) of the profile + ports : list + list of ports to add the profile (default: all acquired) + kwargs : dict + forward those key-value pairs to the profile (tunables) + + :returns: + List of stream IDs in order of the stream list + + :raises: + + :exc:`STLError` + + """ + + validate_type('filename', filename, basestring) + profile = STLProfile.load(filename, **kwargs) + return self.add_streams(profile.get_streams(), ports) + @__api_check(True) def remove_streams (self, stream_id_list, ports = None): -- cgit