diff options
author | stark, steven <ss820f@att.com> | 2018-06-21 10:16:00 -0700 |
---|---|---|
committer | stark, steven <ss820f@att.com> | 2018-06-21 10:16:00 -0700 |
commit | fb9c5e35e22f7fe4465ea33b4e2ac85ccfd33bee (patch) | |
tree | 9a24ed487c70a4c83b10d80d04fd7390543cdddc /ice_validator/tests/test_port_resource_ids.py | |
parent | d8ac84bd10c9695e071cd2ef30d9dfb7a311010e (diff) |
[VVP] test port resource ids
test port resource ids regex and logic doesn't properly validate ports
Change-Id: Iae9a83c65eb04a232fb229a97c944f0ac4d62497
Issue-ID: VVP-85
Signed-off-by: stark, steven <ss820f@att.com>
Diffstat (limited to 'ice_validator/tests/test_port_resource_ids.py')
-rw-r--r-- | ice_validator/tests/test_port_resource_ids.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ice_validator/tests/test_port_resource_ids.py b/ice_validator/tests/test_port_resource_ids.py index f7bf1e8..f8f55ed 100644 --- a/ice_validator/tests/test_port_resource_ids.py +++ b/ice_validator/tests/test_port_resource_ids.py @@ -62,8 +62,8 @@ def test_port_resource_ids(heat_template): pytest.skip("No resources specified in the heat template") port_patterns = { - 'internal': re.compile(r'(.+?)_\d+_int_(.+?)_\d+_port'), - 'external': re.compile(r'(.+?)_\d+_(.+?)_\d+_port'), + 'internal': re.compile(r'(.+?)_\d+_int_(.+?)_port_\d+'), + 'external': re.compile(r'(.+?)_\d+_(.+?)_port_\d+'), } resources = yml['resources'] @@ -110,6 +110,7 @@ def test_port_resource_ids(heat_template): continue has_vm_type = vm_type+"_" in port_id + has_network_role = False if port_resource: if property_uses_get_resource(v, "network"): @@ -123,10 +124,8 @@ def test_port_resource_ids(heat_template): if not network_type: continue - prepend = "" - if network_type == 'internal': - prepend = "int_" - has_network_role = prepend+network_role+"_" in port_id + if port_patterns[network_type].match(port_id): + has_network_role = True else: # match the assumed naming convention for ports # if the specified port is provided via get_param |