summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-03-16 20:04:28 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-03-16 20:04:28 +0200
commit027850daba11821c3c4eeb1d3711d5905c1ed95d (patch)
tree85681ec64d435f4c9bc03deb2e7e16cd3d0f105c /scripts/automation/trex_control_plane/stl/trex_stl_lib/utils
parentdaf8476c5602d026364df9816ade07a3d4831a0a (diff)
parentaa334e0ef9258ffc70f0741627861b832d79a69b (diff)
Merge branch 'master' of csi-sceasr-b32:/auto/proj-pcube-b/apps/PL-b/tools/repo//trex-core
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py22
1 files changed, 22 insertions, 0 deletions
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 0390ac9c..c4f2b358 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 @@ COUNT = 18
PROMISCUOUS = 19
NO_PROMISCUOUS = 20
PROMISCUOUS_SWITCH = 21
+TUNABLES = 22
GLOBAL_STATS = 50
PORT_STATS = 51
@@ -190,6 +191,19 @@ def is_valid_file(filename):
return filename
+def decode_tunables_to_dict (**kwargs):
+ return kwargs
+
+def decode_tunables (tunable_str):
+ try:
+ tunables = [eval('decode_tunables_to_dict({0})'.format(t)) for t in tunable_str.split('#')]
+
+ except (SyntaxError, NameError):
+ raise argparse.ArgumentTypeError("bad syntax for tunables: {0}".format(tunable_str))
+
+ return tunables
+
+
OPTIONS_DB = {MULTIPLIER: ArgumentPack(['-m', '--multiplier'],
{'help': match_multiplier_help,
'dest': "mult",
@@ -233,6 +247,14 @@ OPTIONS_DB = {MULTIPLIER: ArgumentPack(['-m', '--multiplier'],
'default': None,
'action': "store_true"}),
+
+ TUNABLES: ArgumentPack(['-t'],
+ {'help': "sets tunable for a profile",
+ 'dest': "tunables",
+ 'default': None,
+ 'type': decode_tunables}),
+
+
NO_PROMISCUOUS: ArgumentPack(['--no_prom'],
{'help': "sets port promiscuous off",
'dest': "prom",