summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/automation/trex_control_plane/client/trex_async_client.py5
-rwxr-xr-xscripts/automation/trex_control_plane/client/trex_stateless_client.py2
-rwxr-xr-xscripts/automation/trex_control_plane/console/trex_console.py18
3 files changed, 22 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/client/trex_async_client.py b/scripts/automation/trex_control_plane/client/trex_async_client.py
index d13513bf..31bec93f 100644
--- a/scripts/automation/trex_control_plane/client/trex_async_client.py
+++ b/scripts/automation/trex_control_plane/client/trex_async_client.py
@@ -151,16 +151,17 @@ class TrexAsyncStatsManager():
class CTRexAsyncClient():
- def __init__ (self, port):
+ def __init__ (self, server, port):
self.port = port
+ self.server = server
self.raw_snapshot = {}
self.stats = TrexAsyncStatsManager()
- self.tr = "tcp://localhost:{0}".format(self.port)
+ self.tr = "tcp://{0}:{1}".format(self.server, self.port)
print "\nConnecting To ZMQ Publisher At {0}".format(self.tr)
self.active = True
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 4478ed3f..21f62ece 100755
--- a/scripts/automation/trex_control_plane/client/trex_stateless_client.py
+++ b/scripts/automation/trex_control_plane/client/trex_stateless_client.py
@@ -338,7 +338,7 @@ class CTRexStatelessClient(object):
self._server_version = None
self.__err_log = None
- self._async_client = CTRexAsyncClient(async_port)
+ self._async_client = CTRexAsyncClient(server, async_port)
self.streams_db = CStreamsDB()
diff --git a/scripts/automation/trex_control_plane/console/trex_console.py b/scripts/automation/trex_control_plane/console/trex_console.py
index 7cb65fa6..8e8b25ec 100755
--- a/scripts/automation/trex_control_plane/console/trex_console.py
+++ b/scripts/automation/trex_control_plane/console/trex_console.py
@@ -39,6 +39,24 @@ import parsing_opts
__version__ = "1.0"
+class TRexGeneralCmd(cmd.Cmd):
+ def __init__(self):
+ cmd.Cmd.__init__(self)
+
+ def emptyline(self):
+ """Called when an empty line is entered in response to the prompt.
+
+ This overriding is such that when empty line is passed, **nothing happens**.
+ """
+ return
+
+ def completenames(self, text, *ignored):
+ """
+ This overriding is such that a space is added to name completion.
+ """
+ dotext = 'do_'+text
+ return [a[3:]+' ' for a in self.get_names() if a.startswith(dotext)]
+
#
# main console object
class TRexConsole(cmd.Cmd):