aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierrick Louin <pierrick.louin@orange.com>2020-10-13 23:52:04 +0200
committerFran�ois-R�gis Menguy <francoisregis.menguy@orange.com>2020-11-05 08:13:18 +0000
commitc00d9292739dd7ae072c0d6befcd7e87dc7d0566 (patch)
treec6f8f27bae470103a35edcf5c1ec3a8efa53a1c5
parent05d97da9654890303c40de256ce23915d8faf6ac (diff)
NFVBENCH-188: Add an option for dumping the TRex log file
Change-Id: Icd48638a5d789ea780ef8c39bc3a2cb963b8bc8a Signed-off-by: Pierrick Louin <pierrick.louin@orange.com>
-rw-r--r--nfvbench/nfvbench.py14
1 files changed, 14 insertions, 0 deletions
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='<mask>',
@@ -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