diff options
author | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-24 20:00:27 +0200 |
---|---|---|
committer | Yaroslav Brustinov <ybrustin@cisco.com> | 2016-03-24 20:00:27 +0200 |
commit | 59f00264f39dfb95a62401776b4ed8c433682fa7 (patch) | |
tree | 96b5411f17faed9f62aa9e4722b29d767d502b1b /scripts/automation/trex_control_plane/client | |
parent | 4e8ce34a9ef6b8883cfed47f77c9b753e1cf4248 (diff) |
gather stateful client to stf folder, create trex_client package
Diffstat (limited to 'scripts/automation/trex_control_plane/client')
3 files changed, 0 insertions, 86 deletions
diff --git a/scripts/automation/trex_control_plane/client/__init__.py b/scripts/automation/trex_control_plane/client/__init__.py deleted file mode 100755 index e1d24710..00000000 --- a/scripts/automation/trex_control_plane/client/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__all__ = ["trex_client"]
diff --git a/scripts/automation/trex_control_plane/client/trex_adv_client.py b/scripts/automation/trex_control_plane/client/trex_adv_client.py deleted file mode 100755 index bf7ccf58..00000000 --- a/scripts/automation/trex_control_plane/client/trex_adv_client.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/router/bin/python - -import trex_client -from jsonrpclib import ProtocolError, AppError - -class CTRexAdvClient(trex_client.CTRexClient): - def __init__ (self, trex_host, max_history_size = 100, trex_daemon_port = 8090, trex_zmq_port = 4500, verbose = False): - super(CTRexAdvClient, self).__init__(trex_host, max_history_size, trex_daemon_port, trex_zmq_port, verbose) - pass - - # TRex KIWI advanced methods - def start_quick_trex(self, pcap_file, d, delay, dual, ipv6, times, interfaces): - try: - return self.server.start_quick_trex(pcap_file = pcap_file, duration = d, dual = dual, delay = delay, ipv6 = ipv6, times = times, interfaces = interfaces) - except AppError as err: - self.__handle_AppError_exception(err.args[0]) - except ProtocolError: - raise - finally: - self.prompt_verbose_data() - - def stop_quick_trex(self): - try: - return self.server.stop_quick_trex() - except AppError as err: - self.__handle_AppError_exception(err.args[0]) - except ProtocolError: - raise - finally: - self.prompt_verbose_data() - -# def is_running(self): -# pass - - def get_running_stats(self): - try: - return self.server.get_running_stats() - except AppError as err: - self.__handle_AppError_exception(err.args[0]) - except ProtocolError: - raise - finally: - self.prompt_verbose_data() - - def clear_counters(self): - try: - return self.server.clear_counters() - except AppError as err: - self.__handle_AppError_exception(err.args[0]) - except ProtocolError: - raise - finally: - self.prompt_verbose_data() - - -if __name__ == "__main__": - trex = CTRexAdvClient('trex-dan', trex_daemon_port = 8383, verbose = True) - print trex.start_quick_trex(delay = 10, - dual = True, - d = 20, - interfaces = ["gig0/0/1", "gig0/0/2"], - ipv6 = False, - pcap_file="avl/http_browsing.pcap", - times=3) - print trex.stop_quick_trex() - print trex.get_running_stats() - print trex.clear_counters() - pass - - diff --git a/scripts/automation/trex_control_plane/client/trex_root_path.py b/scripts/automation/trex_control_plane/client/trex_root_path.py deleted file mode 100644 index de4ec03b..00000000 --- a/scripts/automation/trex_control_plane/client/trex_root_path.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/router/bin/python - -import os -import sys - -def add_root_to_path (): - """adds trex_control_plane root dir to script path, up to `depth` parent dirs""" - root_dirname = 'trex_control_plane' - file_path = os.path.dirname(os.path.realpath(__file__)) - - components = file_path.split(os.sep) - sys.path.append( str.join(os.sep, components[:components.index(root_dirname)+1]) ) - return - -add_root_to_path() |