From c00d9292739dd7ae072c0d6befcd7e87dc7d0566 Mon Sep 17 00:00:00 2001 From: Pierrick Louin Date: Tue, 13 Oct 2020 23:52:04 +0200 Subject: NFVBENCH-188: Add an option for dumping the TRex log file Change-Id: Icd48638a5d789ea780ef8c39bc3a2cb963b8bc8a Signed-off-by: Pierrick Louin --- nfvbench/nfvbench.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nfvbench/nfvbench.py b/nfvbench/nfvbench.py index da069bf..19c402f 100644 --- a/nfvbench/nfvbench.py +++ b/nfvbench/nfvbench.py @@ -576,6 +576,12 @@ def _parse_opts_from_cli(): default=None, help='Change json/log files ownership with this group (int)') + parser.add_argument('--show-trex-log', dest='show_trex_log', + default=None, + action='store_true', + help='Show the current TRex local server log file contents' + + ' => diagnostic/help in case of configuration problems') + parser.add_argument('--debug-mask', dest='debug_mask', type=int_arg, metavar='', @@ -687,6 +693,14 @@ def main(): print((default_cfg.decode("utf-8"))) sys.exit(0) + # dump the contents of the trex log file + if opts.show_trex_log: + try: + print(open('/tmp/trex.log').read(), end="") + except FileNotFoundError: + print("No TRex log file found!") + sys.exit(0) + config.name = '' if opts.config: # do not check extra_specs in flavor as it can contain any key/value pairs -- cgit 1.2.3-korg