+RE_EXTERNAL_PARAM_AAP = re.compile( # match pattern
+ r"(?P<vm_type>.+)_(?P<network_role>.+)_floating(_v6)?_ip$"
+)
+
+RE_INTERNAL_PARAM_AAP = re.compile( # match pattern
+ r"(?P<vm_type>.+)_int_(?P<network_role>.+)_floating(_v6)?_ip$"
+)
+
+RE_INTERNAL_PARAM_AAPS = re.compile( # match pattern
+ r"(?P<vm_type>.+)_int_(?P<network_role>.+)_floating(_v6)?_ips$"
+)
+
+aap_regx_dict = {
+ "external": {
+ "string": {
+ "readable": "{vm-type}_{network-role}_floating_ip or {vm-type}_{network-role}_floating_v6_ip",
+ "machine": RE_EXTERNAL_PARAM_AAP,
+ }
+ },
+ "internal": {
+ "string": {
+ "readable": "{vm-type}_int_{network-role}_floating_ip or {vm-type}_int_{network-role}_floating_v6_ip",
+ "machine": RE_INTERNAL_PARAM_AAP,
+ },
+ "comma_delimited_list": {
+ "readable": "{vm-type}_int_{network-role}_floating_ips or {vm-type}_int_{network-role}_floating_v6_ips",
+ "machine": RE_INTERNAL_PARAM_AAPS,
+ },
+ },
+ "parameter_to_resource_comparisons": ["vm_type", "network_role"],
+}
+
+
+@validates("R-41492", "R-35735", "R-159016", "R-91810", "R-41956", "R-41493")
+def test_external_aap_format(yaml_file):
+ check_parameter_format(
+ yaml_file,
+ aap_regx_dict,
+ "external",
+ NeutronPortProcessor,
+ "allowed_address_pairs",
+ "ip_address",
+ exemptions_allowed=True,
+ )