summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/console
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-11-25 07:39:39 -0500
committerimarom <imarom@cisco.com>2015-11-25 07:39:39 -0500
commitb6ec2066653319b60385de1d4117165eb88890a1 (patch)
tree582bda39a6d04641b3fd9481ca23d6ede53e5a17 /scripts/automation/trex_control_plane/console
parent92dea3787ab7b2c9877af9cd539d42a6957f7da6 (diff)
fixed a bug with default start command in the console
also added clear events and more types of events
Diffstat (limited to 'scripts/automation/trex_control_plane/console')
-rwxr-xr-xscripts/automation/trex_control_plane/console/parsing_opts.py2
-rwxr-xr-xscripts/automation/trex_control_plane/console/trex_console.py22
2 files changed, 23 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/console/parsing_opts.py b/scripts/automation/trex_control_plane/console/parsing_opts.py
index d2484a83..0bcdce84 100755
--- a/scripts/automation/trex_control_plane/console/parsing_opts.py
+++ b/scripts/automation/trex_control_plane/console/parsing_opts.py
@@ -121,7 +121,7 @@ def is_valid_file(filename):
OPTIONS_DB = {MULTIPLIER: ArgumentPack(['-m', '--multiplier'],
{'help': match_multiplier_help,
'dest': "mult",
- 'default': 1.0,
+ 'default': {'type':'raw', 'max':1},
'type': match_multiplier}),
diff --git a/scripts/automation/trex_control_plane/console/trex_console.py b/scripts/automation/trex_control_plane/console/trex_console.py
index b164af4e..fc2c845a 100755
--- a/scripts/automation/trex_control_plane/console/trex_console.py
+++ b/scripts/automation/trex_control_plane/console/trex_console.py
@@ -334,12 +334,34 @@ class TRexConsole(TRexGeneralCmd):
self.stateless_client.cmd_reset()
+ def help_events (self):
+ self.do_events("-h")
+
def do_events (self, line):
'''shows events recieved from server\n'''
+
+ x = parsing_opts.ArgumentPack(['-c','--clear'],
+ {'action' : "store_true",
+ 'default': False,
+ 'help': "clear the events log"})
+
+ parser = parsing_opts.gen_parser(self,
+ "events",
+ self.do_events.__doc__,
+ x)
+
+ opts = parser.parse_args(line.split())
+ if opts is None:
+ return
+
events = self.stateless_client.get_events()
for ev in events:
print ev
+ if opts.clear:
+ self.stateless_client.clear_events()
+ print format_text("\n\nEvent log was cleared\n\n")
+
# tui
def do_tui (self, line):
'''Shows a graphical console\n'''