summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/console
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-01-27 10:47:40 -0500
committerimarom <imarom@cisco.com>2016-01-27 11:01:44 -0500
commit7351ddb52a2162fc2ac303c687a2ed50cbb0843e (patch)
treedfba74936e5f671f7fa764e16efc6735d8defe43 /scripts/automation/trex_control_plane/console
parent73d9481b063d851ba16dc853f7309e3080970408 (diff)
API: example for bi-directional flows
Diffstat (limited to 'scripts/automation/trex_control_plane/console')
-rwxr-xr-xscripts/automation/trex_control_plane/console/trex_console.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/console/trex_console.py b/scripts/automation/trex_control_plane/console/trex_console.py
index 1defc6b2..6a4af350 100755
--- a/scripts/automation/trex_control_plane/console/trex_console.py
+++ b/scripts/automation/trex_control_plane/console/trex_console.py
@@ -221,7 +221,7 @@ class TRexConsole(TRexGeneralCmd):
def get_console_identifier(self):
- return "{context}_{server}".format(context=self.__class__.__name__,
+ return "{context}_{server}".format(context=get_current_user(),
server=self.stateless_client.get_connection_info()['server'])
def register_main_console_methods(self):
@@ -305,12 +305,12 @@ class TRexConsole(TRexGeneralCmd):
elif line == "on":
self.verbose = True
- self.stateless_client.set_verbose(self.stateless_client.logger.VERBOSE_HIGH)
+ self.stateless_client.set_verbose("high")
print format_text("\nverbose set to on\n", 'green', 'bold')
elif line == "off":
self.verbose = False
- self.stateless_client.set_verbose(self.stateless_client.logger.VERBOSE_REGULAR)
+ self.stateless_client.set_verbose("normal")
print format_text("\nverbose set to off\n", 'green', 'bold')
else:
@@ -515,7 +515,7 @@ class TRexConsole(TRexGeneralCmd):
info = self.stateless_client.get_connection_info()
- exe = './trex-console -t -q -s {0} -p {1} --async_port {2}'.format(info['server'], info['sync_port'], info['async_port'])
+ exe = './trex-console --top -t -q -s {0} -p {1} --async_port {2}'.format(info['server'], info['sync_port'], info['async_port'])
cmd = ['xterm', '-geometry', '111x42', '-sl', '0', '-title', 'trex_tui', '-e', exe]
self.terminal = subprocess.Popen(cmd)
@@ -686,6 +686,13 @@ def setParserOptions():
action="store_true", help="Starts with TUI mode",
default = False)
+ parser.add_argument("-x", "--xtui", dest="xtui",
+ action="store_true", help="Starts with XTERM TUI mode",
+ default = False)
+
+ parser.add_argument("--top", dest="top",
+ action="store_true", help="Set the window as always on top",
+ default = False)
parser.add_argument("-q", "--quiet", dest="quiet",
action="store_true", help="Starts with all outputs suppressed",
@@ -698,6 +705,14 @@ def main():
parser = setParserOptions()
options = parser.parse_args()
+ if options.xtui:
+ options.tui = True
+
+ # always on top
+ if options.top:
+ set_window_always_on_top('trex_tui')
+
+
# Stateless client connection
if options.quiet:
verbose_level = LoggerApi.VERBOSE_QUIET
@@ -742,9 +757,9 @@ def main():
console = TRexConsole(stateless_client, options.verbose)
logger.prompt_redraw = console.prompt_redraw
+ # TUI
if options.tui:
- set_window_always_on_top('trex_tui')
- console.do_tui("")
+ console.do_tui("-x" if options.xtui else "")
else:
console.start()