diff options
author | Ido Barnea <ibarnea@cisco.com> | 2017-02-15 17:17:18 +0200 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2017-02-16 15:38:30 +0200 |
commit | af52e17f717ee272577bcaa3524b272531752423 (patch) | |
tree | d6e05ad8e24629776549da98910d43801295e9f3 /scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py | |
parent | 76338aa3565f381df1f415b10d3d22bb5b8d71b6 (diff) |
VLAN keyword in platform config file will now make all traffic be sent over vlan
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py')
-rwxr-xr-x | scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py | 25 |
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. |