+@validates("R-16968")
+def test_network_resource_id_format(yaml_file):
+ heat = Heat(yaml_file)
+ network_ids = chain.from_iterable(
+ heat.get_resource_by_type(t) for t in NETWORK_RESOURCE_TYPES
+ )
+ invalid_networks = {
+ r_id for r_id in network_ids if not RE_INTERNAL_NETWORK_RID.match(r_id)
+ }
+ assert not invalid_networks, (
+ "Heat templates must only create internal networks "
+ "and their resource IDs must follow the format "
+ "int_{{network-role}}_network. The following network's resource IDs "
+ "have invalid resource ID formats: "
+ "{}".format(", ".join(invalid_networks))
+ )