diff options
author | Martin Klozik <martinx.klozik@intel.com> | 2018-01-18 15:22:42 +0000 |
---|---|---|
committer | Martin Klozik <martinx.klozik@intel.com> | 2018-01-18 15:22:42 +0000 |
commit | 3e4a1be91d487d4a73fc80f1c3f23ebf78c15953 (patch) | |
tree | b432f1cb79684561e602740e5e87785b795b9688 /tools/pkt_gen | |
parent | ce8e18ddcfb84f887aa91f38133781da2f592309 (diff) |
ixia: Add support of LISTs in TRAFFIC
The control script for Ixia (i.e. Ixia and IxNet classes)
is written in TCL and thus VSPERF must translate TRAFFIC
dictionary into TCL notation. The method for data type
conversion was updated to correctly process new 'capture'
settings, which uses python lists for tx and rx capture
ports definition.
JIRA: VSPERF-556
Change-Id: I639942b11ea11ce1b443a2a2e99c3da6619ba569
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com>
Reviewed-by: Trevor Cooper <trevor.cooper@intel.com>
Reviewed-by: Richard Elias <richardx.elias@intel.com>
Diffstat (limited to 'tools/pkt_gen')
-rwxr-xr-x | tools/pkt_gen/ixia/ixia.py | 8 | ||||
-rwxr-xr-x | tools/pkt_gen/ixnet/ixnet.py | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tools/pkt_gen/ixia/ixia.py b/tools/pkt_gen/ixia/ixia.py index e768be06..d4ca56f2 100755 --- a/tools/pkt_gen/ixia/ixia.py +++ b/tools/pkt_gen/ixia/ixia.py @@ -111,6 +111,11 @@ def _build_set_cmds(values, prefix='dict set'): yield subkey continue + if isinstance(value, list): + value = '{{{}}}'.format(' '.join(str(x) for x in value)) + yield ' '.join([prefix, 'set', key, value]).strip() + continue + # tcl doesn't recognise the strings "True" or "False", only "1" # or "0". Special case to convert them if isinstance(value, bool): @@ -118,6 +123,9 @@ def _build_set_cmds(values, prefix='dict set'): else: value = str(value) + if isinstance(value, str) and not value: + value = '{}' + if prefix: yield ' '.join([prefix, key, value]).strip() else: diff --git a/tools/pkt_gen/ixnet/ixnet.py b/tools/pkt_gen/ixnet/ixnet.py index b8fb1879..d1ba9096 100755 --- a/tools/pkt_gen/ixnet/ixnet.py +++ b/tools/pkt_gen/ixnet/ixnet.py @@ -127,6 +127,11 @@ def _build_set_cmds(values, prefix='dict set'): yield subkey continue + if isinstance(value, list): + value = '{{{}}}'.format(' '.join(str(x) for x in value)) + yield ' '.join([prefix, 'set', key, value]).strip() + continue + # tcl doesn't recognise the strings "True" or "False", only "1" # or "0". Special case to convert them if isinstance(value, bool): @@ -134,6 +139,9 @@ def _build_set_cmds(values, prefix='dict set'): else: value = str(value) + if isinstance(value, str) and not value: + value = '{}' + if prefix: yield ' '.join([prefix, key, value]).strip() else: |