summaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/rally/rally.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest/opnfv_tests/openstack/rally/rally.py')
-rw-r--r--functest/opnfv_tests/openstack/rally/rally.py44
1 files changed, 35 insertions, 9 deletions
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py
index 24c9147c..d5acb1b2 100644
--- a/functest/opnfv_tests/openstack/rally/rally.py
+++ b/functest/opnfv_tests/openstack/rally/rally.py
@@ -188,21 +188,44 @@ class RallyBase(testcase.OSGCTestCase):
installer_type = CONST.__getattribute__('INSTALLER_TYPE')
deploy_scenario = CONST.__getattribute__('DEPLOY_SCENARIO')
- if (bool(installer_type) * bool(deploy_scenario)):
- if 'scenario' in black_list_yaml.keys():
- for item in black_list_yaml['scenario']:
- scenarios = item['scenarios']
- installers = item['installers']
- if (deploy_scenario in scenarios and
- installer_type in installers):
- tests = item['tests']
- black_tests.extend(tests)
+ if (bool(installer_type) and bool(deploy_scenario) and
+ 'scenario' in black_list_yaml.keys()):
+ for item in black_list_yaml['scenario']:
+ scenarios = item['scenarios']
+ installers = item['installers']
+ in_it = RallyBase.in_iterable_re
+ if (in_it(deploy_scenario, scenarios) and
+ in_it(installer_type, installers)):
+ tests = item['tests']
+ black_tests.extend(tests)
except Exception:
logger.debug("Scenario exclusion not applied.")
return black_tests
@staticmethod
+ def in_iterable_re(needle, haystack):
+ """
+ Check if given needle is in the iterable haystack, using regex.
+
+ :param needle: string to be matched
+ :param haystack: iterable of strings (optionally regex patterns)
+ :return: True if needle is eqial to any of the elements in haystack,
+ or if a nonempty regex pattern in haystack is found in needle.
+ """
+
+ # match without regex
+ if needle in haystack:
+ return True
+
+ for pattern in haystack:
+ # match if regex pattern is set and found in the needle
+ if pattern and re.search(pattern, needle) is not None:
+ return True
+ else:
+ return False
+
+ @staticmethod
def excl_func():
black_tests = []
func_list = []
@@ -235,6 +258,9 @@ class RallyBase(testcase.OSGCTestCase):
black_tests = list(set(RallyBase.excl_func() +
RallyBase.excl_scenario()))
+ if black_tests:
+ logger.debug("Blacklisted tests: " + str(black_tests))
+
include = True
for cases_line in cases_file:
if include:
or: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
nsd:nsd-catalog:
  nsd:
    - id: 4-vnf-correlated
      name: 4-vnf-correlated
      short-name: 4-vnf-correlated
      description: 4-vnf-correlated
      constituent-vnfd:
        - member-vnf-index: '0'
          vnfd-id-ref: tg__0
          VNF model: ../../vnf_descriptors/tg_rfc2544_tpl.yaml      #VNF type
        - member-vnf-index: '1'
          vnfd-id-ref: tg__1
          VNF model: ../../vnf_descriptors/udp_replay_vnf.yaml      #VNF type
        - member-vnf-index: '2'
          vnfd-id-ref: vnf__0
          VNF model: ../../vnf_descriptors/cgnapt_vnf.yaml      #VNF type
        - member-vnf-index: '3'
          vnfd-id-ref: vnf__1
          VNF model: ../../vnf_descriptors/cgnapt_vnf.yaml      #VNF type
        - member-vnf-index: '4'
          vnfd-id-ref: vnf__2
          VNF model: ../../vnf_descriptors/cgnapt_vnf.yaml      #VNF type
        - member-vnf-index: '5'
          vnfd-id-ref: vnf__3
          VNF model: ../../vnf_descriptors/cgnapt_vnf.yaml      #VNF type

      vld:
        - id: uplink_0
          name: "tg__0 to vnf__0 link 0"
          type: ELAN
          vnfd-connection-point-ref:
            - member-vnf-index-ref: '0'
              vnfd-connection-point-ref: xe0
              vnfd-id-ref: tg__0
            - member-vnf-index-ref: '2'
              vnfd-connection-point-ref: xe0
              vnfd-id-ref: vnf__0
        - id: downlink_0
          name: "vnf__0 to tg__1 link 0"
          type: ELAN
          vnfd-connection-point-ref:
            - member-vnf-index-ref: '2'
              vnfd-connection-point-ref: xe1
              vnfd-id-ref: vnf__0
            - member-vnf-index-ref: '1'
              vnfd-connection-point-ref: xe0
              vnfd-id-ref: tg__1
        - id: uplink_1
          name: "tg__0 to vnf__1 link 1"
          type: ELAN
          vnfd-connection-point-ref:
            - member-vnf-index-ref: '0'
              vnfd-connection-point-ref: xe1
              vnfd-id-ref: tg__0
            - member-vnf-index-ref: '3'
              vnfd-connection-point-ref: xe0
              vnfd-id-ref: vnf__1
        - id: downlink_1
          name: "vnf__1 to tg__1 link 1"
          type: ELAN
          vnfd-connection-point-ref:
            - member-vnf-index-ref: '3'
              vnfd-connection-point-ref: xe1
              vnfd-id-ref: vnf__1
            - member-vnf-index-ref: '1'
              vnfd-connection-point-ref: xe1
              vnfd-id-ref: tg__1
        - id: uplink_2
          name: "tg__0 to vnf__2 link 2"
          type: ELAN
          vnfd-connection-point-ref:
            - member-vnf-index-ref: '0'
              vnfd-connection-point-ref: xe2
              vnfd-id-ref: tg__0
            - member-vnf-index-ref: '4'
              vnfd-connection-point-ref: xe0
              vnfd-id-ref: vnf__2
        - id: downlink_2
          name: "vnf__2 to tg__1 link 2"
          type: ELAN
          vnfd-connection-point-ref:
            - member-vnf-index-ref: '4'
              vnfd-connection-point-ref: xe1
              vnfd-id-ref: vnf__2
            - member-vnf-index-ref: '1'
              vnfd-connection-point-ref: xe2
              vnfd-id-ref: tg__1
        - id: uplink_3
          name: "tg__0 to vnf__3 link 3"
          type: ELAN
          vnfd-connection-point-ref:
            - member-vnf-index-ref: '0'
              vnfd-connection-point-ref: xe3
              vnfd-id-ref: tg__0
            - member-vnf-index-ref: '5'
              vnfd-connection-point-ref: xe0
              vnfd-id-ref: vnf__3
        - id: downlink_3
          name: "vnf__3 to tg__1 link 3"
          type: ELAN
          vnfd-connection-point-ref:
            - member-vnf-index-ref: '5'
              vnfd-connection-point-ref: xe1
              vnfd-id-ref: vnf__3
            - member-vnf-index-ref: '1'
              vnfd-connection-point-ref: xe3
              vnfd-id-ref: tg__1