From c8d1f318e2d322626e401c9599ba75006d2e8e6c Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Mon, 13 Mar 2017 10:07:01 +0200 Subject: stl console: add "readonly" flag to connect Change-Id: Iee3fc72efaa55cdbc457340b855982146167a859 Signed-off-by: Yaroslav Brustinov --- .../trex_control_plane/stl/trex_stl_lib/trex_stl_client.py | 6 ++++-- .../trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py index 412fcbe3..6f6e8bfd 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py @@ -3647,14 +3647,16 @@ class STLClient(object): parser = parsing_opts.gen_parser(self, "connect", self.connect_line.__doc__, - parsing_opts.FORCE) + parsing_opts.FORCE, + parsing_opts.READONLY) opts = parser.parse_args(line.split()) if not opts: return opts self.connect() - self.acquire(force = opts.force) + if not opts.readonly: + self.acquire(force = opts.force) return RC_OK() diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py index dabc7320..36893972 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py @@ -30,6 +30,7 @@ STREAM_FROM_PATH_OR_FILE DURATION TIMEOUT FORCE +READONLY DRY_RUN XTERM TOTAL @@ -565,6 +566,11 @@ OPTIONS_DB = {MULTIPLIER: ArgumentPack(['-m', '--multiplier'], 'default': False, 'help': "Set if you want to stop active ports before appyling command."}), + READONLY: ArgumentPack(['-r'], + {'action': 'store_true', + 'dest': 'readonly', + 'help': 'Do not acquire ports, connect as read-only.'}), + REMOTE_FILE: ArgumentPack(['-r', '--remote'], {"action": "store_true", 'default': False, -- cgit 1.2.3-korg