diff options
author | Dan Klein <danklein10@gmail.com> | 2015-10-25 11:33:48 +0200 |
---|---|---|
committer | Dan Klein <danklein10@gmail.com> | 2015-10-25 11:33:48 +0200 |
commit | ebb0b48faca96bad7bfe8da0bf80df7c7c80350d (patch) | |
tree | 13930133d5dc55d0ad2fa35a8d37d2157227b237 /scripts/automation/trex_control_plane | |
parent | a2a634fc8b5bac450ea37f29dde521b7d9e740c8 (diff) |
HLTAPI progress...
Diffstat (limited to 'scripts/automation/trex_control_plane')
4 files changed, 37 insertions, 5 deletions
diff --git a/scripts/automation/trex_control_plane/client/trex_hltapi.py b/scripts/automation/trex_control_plane/client/trex_hltapi.py index b180eb5b..7453d8ec 100755 --- a/scripts/automation/trex_control_plane/client/trex_hltapi.py +++ b/scripts/automation/trex_control_plane/client/trex_hltapi.py @@ -11,14 +11,40 @@ class CTRexHltApi(object): def __init__(self): pass - def connect_status(self): + def connect(self, device, port_list, username, reset=False, break_locks=False): pass + def interface_config(self, port_handle, mode="config"): + pass + + def get_status(self): + pass + + def get_port_handler(self): + pass + + def traffic_config(self, mode, port_handle, + mac_src, mac_dst, + l3_protocol, ip_src_addr, ip_dst_addr, l3_length, + transmit_mode, rate_pps): + pass + def traffic_control(self, action, port_handle): + pass - def config_traffic(self): + def traffic_stats(self, port_handle, mode): pass + def get_aggregate_port_stats(self, port_handle): + return self.traffic_stats(port_handle, mode="aggregate") + + def get_stream_stats(self, port_handle): + return self.traffic_stats(port_handle, mode="stream") + + + + + if __name__ == "__main__": pass diff --git a/scripts/automation/trex_control_plane/client/trex_stateless_client.py b/scripts/automation/trex_control_plane/client/trex_stateless_client.py index 8956aaf5..7d287a5e 100755 --- a/scripts/automation/trex_control_plane/client/trex_stateless_client.py +++ b/scripts/automation/trex_control_plane/client/trex_stateless_client.py @@ -63,6 +63,9 @@ class CTRexStatelessClient(object): return self._system_info # ----- user-access methods ----- # + def connect(self): + self.tx_link.connect() + def ping(self): return self.transmit("ping") @@ -323,6 +326,8 @@ class CTRexStatelessClient(object): self.server = server self.port = port self.rpc_link = JsonRpcClient(self.server, self.port) + + def connect(self): if not self.virtual: self.rpc_link.connect() diff --git a/scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py b/scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py index ed14e6f8..1c5dbe7e 100755 --- a/scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py +++ b/scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py @@ -182,7 +182,7 @@ class JsonRpcClient(object): # if no error there should be a result if ("result" not in response_json): - return False, "Malfromed Response ({0})".format(str(response)) + return False, "Malformed Response ({0})".format(str(response)) return True, response_json["result"] @@ -200,7 +200,7 @@ class JsonRpcClient(object): else: return False, "Not connected to server" - def connect(self, server = None, port = None): + def connect(self, server=None, port=None): if self.connected: self.disconnect() diff --git a/scripts/automation/trex_control_plane/console/trex_console.py b/scripts/automation/trex_control_plane/console/trex_console.py index 0f5c30af..4f9743f4 100755 --- a/scripts/automation/trex_control_plane/console/trex_console.py +++ b/scripts/automation/trex_control_plane/console/trex_console.py @@ -17,7 +17,6 @@ See the License for the specific language governing permissions and limitations under the License. """ -__version__ = "1.0" import cmd import json @@ -36,6 +35,8 @@ from client_utils.jsonrpc_client import TrexStatelessClient import trex_status from collections import namedtuple +__version__ = "1.0" + LoadedStreamList = namedtuple('LoadedStreamList', ['loaded', 'compiled']) # |