summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py b/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py
index 490e3b7a..43504c96 100755
--- a/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py
+++ b/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py
@@ -889,6 +889,31 @@ class CTRexClient(object):
finally:
self.prompt_verbose_data()
+ def get_trex_config(self):
+ """
+ Get Trex config file (/etc/trex_cfg.yaml).
+
+ :return:
+ String representation of TRex config file
+
+ :raises:
+ + :exc:`trex_exceptions.TRexRequestDenied`, in case file could not be read.
+ + ProtocolError, in case of error in JSON-RPC protocol.
+
+ """
+ try:
+ res = binascii.a2b_base64(self.server.get_trex_config())
+ if type(res) is bytes:
+ return res.decode()
+ return res
+ except AppError as err:
+ self._handle_AppError_exception(err.args[0])
+ except ProtocolError:
+ raise
+ finally:
+ self.prompt_verbose_data()
+
+
def push_files (self, filepaths):
"""
Pushes a file (or a list of files) to store locally on server.