diff options
author | 2016-09-21 18:12:46 +0300 | |
---|---|---|
committer | 2016-09-25 15:08:06 +0300 | |
commit | 2cf444195c3d8a0215216e5f1899fded15bd7627 (patch) | |
tree | 10f17d20f2bcc98a1635f767a7acca97a6e0eadb /scripts/automation/trex_control_plane/stl | |
parent | 0b520a31268bea0492795a56c4a65d93cdb21676 (diff) |
Splitter - padding for non circular VMs
Diffstat (limited to 'scripts/automation/trex_control_plane/stl')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py | 4 | ||||
-rwxr-xr-x | scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py | 18 |
2 files changed, 13 insertions, 9 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py index 0394cf43..63a1232b 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_sim.py @@ -111,8 +111,6 @@ class STLSim(object): # handle YAMLs if tunables == None: tunables = {} - else: - tunables = tunables[0] for input_file in input_files: try: @@ -556,7 +554,7 @@ def test_multi_core (r, options): duration = options.duration, mode = 'none', silent = True, - tunables = [{'seed': 5}]) + tunables = options.tunables) print("") 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 e1de6b55..65333e0f 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 @@ -213,19 +213,25 @@ 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('#')] + tunables = {} - except (SyntaxError, NameError): - raise argparse.ArgumentTypeError("bad syntax for tunables: {0}".format(tunable_str)) + # split by diaz to tokens + tokens = tunable_str.split('#') + + # each token is of form X=Y + for token in tokens: + print(token) + m = re.search('(.*)=(.*)', token) + if not m: + raise argparse.ArgumentTypeError("bad syntax for tunables: {0}".format(token)) + tunables[m.group(1)] = m.group(2) return tunables + OPTIONS_DB = {MULTIPLIER: ArgumentPack(['-m', '--multiplier'], {'help': match_multiplier_help, 'dest': "mult", |