diff options
-rw-r--r-- | ice_validator/tests/fixtures/test_port_resource_ids/pass/valid_template.yaml | 22 | ||||
-rw-r--r-- | ice_validator/tests/test_port_resource_ids.py | 11 |
2 files changed, 17 insertions, 16 deletions
diff --git a/ice_validator/tests/fixtures/test_port_resource_ids/pass/valid_template.yaml b/ice_validator/tests/fixtures/test_port_resource_ids/pass/valid_template.yaml index a16badc..20bc79e 100644 --- a/ice_validator/tests/fixtures/test_port_resource_ids/pass/valid_template.yaml +++ b/ice_validator/tests/fixtures/test_port_resource_ids/pass/valid_template.yaml @@ -108,8 +108,8 @@ resources: name: { get_param: [admin_names, 0] } flavor: { get_param: admin_flavor_name} networks: - - port: { get_resource: admin_0_exnet_0_port } - - port: { get_resource: admin_0_int_vpnnet_0_port } + - port: { get_resource: admin_0_exnet_port_0 } + - port: { get_resource: admin_0_int_vpnnet_port_0 } metadata: vnf_name: { get_param: vnf_name } vnf_id: { get_param: vnf_id } @@ -122,8 +122,8 @@ resources: name: { get_param: [admin_names, 1] } flavor: { get_param: admin_flavor_name} networks: - - port: { get_resource: ADMIN_1_EXTNET_0_PORT } - - port: { get_resource: admin_1_extnet_1_port } + - port: { get_resource: ADMIN_1_EXTNET_PORT_0 } + - port: { get_resource: admin_1_extnet_port_1 } metadata: vnf_name: { get_param: vnf_name } vnf_id: { get_param: vnf_id } @@ -136,7 +136,7 @@ resources: name: { get_param: [admin_names, 2] } flavor: { get_param: admin_flavor_name} networks: - - port: { get_resource: admin_2_int_vpnnet_0_port } + - port: { get_resource: admin_2_int_vpnnet_port_0 } metadata: vnf_name: { get_param: vnf_name } vnf_id: { get_param: vnf_id } @@ -152,30 +152,32 @@ resources: vnf_id: { get_param: vnf_id } vf_module_id: { get_param: vf_module_id } - admin_0_exnet_0_port: + admin_0_exnet_port_0: type: OS::Neutron::Port properties: network: { get_param: exnet_net_name } - admin_0_int_vpnnet_0_port: + admin_0_int_vpnnet_port_0: type: OS::Neutron::Port properties: network: { get_param: int_vpnnet_net_id } - ADMIN_1_EXTNET_0_PORT: + ADMIN_1_EXTNET_PORT_0: type: OS::Neutron::Port properties: network: { get_param: extnet_net_name } - admin_1_extnet_1_port: + admin_1_extnet_port_1: type: OS::Neutron::Port properties: network: { get_param: extnet_net_id } + int_oam_net: type: OS::Neutron::Net properties: name: { get_param: int_oam_net_name } - admin_2_int_vpnnet_0_port: + + admin_2_int_vpnnet_port_0: type: OS::Neutron::Port properties: network: { get_resource: int_oam_net } 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 |