diff options
author | 2016-11-22 17:16:36 +0200 | |
---|---|---|
committer | 2016-11-22 17:16:36 +0200 | |
commit | 75585e213de850395b6bcd0aff0841cd9cced92c (patch) | |
tree | fc2733edff683748929317a610c83fc33cb7935f /scripts/automation/trex_control_plane/stl/trex_stl_lib/utils | |
parent | 6c18d6a2173ff2f3ecd031046077cd65d3ed8785 (diff) |
RX features - few tweaks
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py | 10 | ||||
-rwxr-xr-x | scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py index 02e13fd7..cbbacb27 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py @@ -98,3 +98,13 @@ def is_valid_ipv4 (addr): def is_valid_mac (mac): return bool(re.match("[0-9a-f]{2}([-:])[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$", mac.lower())) +def list_remove_dup (l): + tmp = list() + + for x in l: + if not x in tmp: + tmp.append(x) + + return tmp + + 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 f9c416d8..f20bdad6 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 @@ -1,6 +1,6 @@ import argparse from collections import namedtuple, OrderedDict -from .common import list_intersect, list_difference, is_valid_ipv4, is_valid_mac +from .common import list_intersect, list_difference, is_valid_ipv4, is_valid_mac, list_remove_dup from .text_opts import format_text from ..trex_stl_types import * from .constants import ON_OFF_DICT, UP_DOWN_DICT, FLOW_CTRL_DICT @@ -644,6 +644,8 @@ class CCmdArgParser(argparse.ArgumentParser): else: opts.ports = default_ports + opts.ports = list_remove_dup(opts.ports) + # so maybe we have ports configured invalid_ports = list_difference(opts.ports, self.stateless_client.get_all_ports()) if invalid_ports: |