diff options
author | imarom <imarom@cisco.com> | 2015-11-25 04:46:56 -0500 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2015-11-25 04:46:56 -0500 |
commit | 4a41c26a5cf23635a5b1332af6e806c915cf7e6c (patch) | |
tree | 35e77fb81f60e5b6537d865760ea1d8f6f485c99 /scripts/automation/trex_control_plane/console | |
parent | b0446de90c05d0a129fc38e6aef981dff243ccb7 (diff) |
support for "total" flag for start
also fixed a bug in mpps (trex console)
Diffstat (limited to 'scripts/automation/trex_control_plane/console')
-rwxr-xr-x | scripts/automation/trex_control_plane/console/parsing_opts.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/console/parsing_opts.py b/scripts/automation/trex_control_plane/console/parsing_opts.py index 14e8c563..d2484a83 100755 --- a/scripts/automation/trex_control_plane/console/parsing_opts.py +++ b/scripts/automation/trex_control_plane/console/parsing_opts.py @@ -19,6 +19,7 @@ SERVER_IP = 7 STREAM_FROM_PATH_OR_FILE = 8 DURATION = 9 FORCE = 10 +TOTAL = 11 # list of ArgumentGroup types MUTEX = 1 @@ -56,7 +57,7 @@ match_multiplier_help = """Multiplier should be passed in the following format: def match_multiplier(val): '''match some val against multiplier shortcut inputs ''' - match = re.match("^(\d+(\.\d+)?)(bps|kbps|mbps|gbps|pps|kpps|mbps|%?)$", val) + match = re.match("^(\d+(\.\d+)?)(bps|kbps|mbps|gbps|pps|kpps|mpps|%?)$", val) result = {} @@ -68,7 +69,7 @@ def match_multiplier(val): # raw type (factor) if not unit: result['type'] = 'raw' - result['factor'] = value + result['max'] = value elif unit == 'bps': result['type'] = 'max_bps' @@ -123,6 +124,13 @@ OPTIONS_DB = {MULTIPLIER: ArgumentPack(['-m', '--multiplier'], 'default': 1.0, 'type': match_multiplier}), + + TOTAL: ArgumentPack(['-t', '--total'], + {'help': "traffic will be divided between all ports specified", + 'dest': "total", + 'default': False, + 'action': "store_true"}), + PORT_LIST: ArgumentPack(['--port'], {"nargs": '+', 'dest':'ports', |