diff options
author | 2016-01-24 04:01:30 -0500 | |
---|---|---|
committer | 2016-01-24 06:02:46 -0500 | |
commit | 6f4a51c126b7a78ee8e37d396ed2b61b05fa506c (patch) | |
tree | e8b1c20e0d02cb40fa1539f2896f07345625b6f3 /scripts/automation/trex_control_plane/client | |
parent | db5b9d6085b3e5cf71e1abf42c7a745cb723e00e (diff) |
added example
Diffstat (limited to 'scripts/automation/trex_control_plane/client')
-rwxr-xr-x | scripts/automation/trex_control_plane/client/trex_hltapi.py | 4 | ||||
-rwxr-xr-x | scripts/automation/trex_control_plane/client/trex_stateless_client.py | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/client/trex_hltapi.py b/scripts/automation/trex_control_plane/client/trex_hltapi.py index 848d5a9e..c25c73cb 100755 --- a/scripts/automation/trex_control_plane/client/trex_hltapi.py +++ b/scripts/automation/trex_control_plane/client/trex_hltapi.py @@ -2,7 +2,7 @@ import trex_root_path from client_utils.packet_builder import CTRexPktBuilder -from trex_stateless_client import CTRexStatelessClient +from trex_stateless_client import STLClient from common.trex_streams import * from client_utils.general_utils import id_count_gen import dpkt @@ -20,7 +20,7 @@ class CTRexHltApi(object): # sync = RPC, async = ZMQ def connect(self, device, port_list, username, sync_port = 4501, async_port = 4500, reset=False, break_locks=False): ret_dict = {"status": 0} - self.trex_client = CTRexStatelessClient(username, device, sync_port, async_port) + self.trex_client = STLClient(username, device, sync_port, async_port) rc = self.trex_client.connect() if rc.bad(): 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 c5d7e053..c1a4d1d1 100755 --- a/scripts/automation/trex_control_plane/client/trex_stateless_client.py +++ b/scripts/automation/trex_control_plane/client/trex_stateless_client.py @@ -419,8 +419,8 @@ class CCommLink(object): ############################ ############################# ############################ ############################# -class CTRexStatelessClient(object): - """docstring for CTRexStatelessClient""" +class STLClient(object): + """docstring for STLClient""" def __init__(self, username = general_utils.get_current_user(), @@ -968,6 +968,7 @@ class CTRexStatelessClient(object): stats_obj = {} for stats_type in stats_opts: stats_obj.update(self.stats_generator.generate_single_statistic(port_id_list, stats_type)) + return stats_obj def _get_streams(self, port_id_list, streams_mask=set()): @@ -1244,9 +1245,11 @@ class CTRexStatelessClient(object): # pings the server on the RPC channel @__api_check(True) def ping(self): - rc = self.__ping() self.logger.pre_cmd( "Pinging the server on '{0}' port '{1}': ".format(self.connection_info['server'], - self.connection_info['sync_port'])) + self.connection_info['sync_port'])) + rc = self.__ping() + + self.logger.post_cmd(rc) if not rc: raise STLError(rc) |