description: Simple template to deploy a single compute instance
parameters:
- availability_zone_9:
+ availability_zone_0:
type: string
label: Key Name
description: Name of key-pair to be used for compute instance
description: Simple template to deploy a single compute instance
parameters:
- vm1_nr1_ip_4:
+ vm1_nr1_ip_0:
type: string
label: Key Name
description: Name of key-pair to be used for compute instance
description: Simple template to deploy a single compute instance
parameters:
- vm1_name_16:
+ vm1_name_0:
type: string
label: Key Name
description: Name of key-pair to be used for compute instance
@validates("R-41492", "R-35735", "R-98748")
-def test_allowed_address_pairs_include_vm_type_network_role(heat_template):
+def test_allowed_address_pairs_include_vm_type_network_role(yaml_file):
"""
Check that all allowed_address_pairs include the {vm_type} of the
nova server it is associated to and also contains the
{network_role} of the network it is associated with
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-98450")
-def test_availability_zone_naming(heat_template):
+def test_availability_zone_naming(yaml_file):
"""
Make sure all availability zones are properly formatted
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-98450")
-def test_availability_zones_start_at_0(heat_template):
- params = Heat(heat_template).parameters
+def test_availability_zones_start_at_0(yaml_file):
+ params = Heat(yaml_file).parameters
invalid_params = check_indices(AZ_PATTERN, params, "Availability Zone Parameters")
assert not invalid_params, ". ".join(invalid_params)
@validates("R-04747")
-def test_cloud_config(heat_template):
+def test_cloud_config(yaml_file):
"""validate resource ids
"""
- h = Heat(filepath=heat_template)
+ h = Heat(filepath=yaml_file)
if not h.resources:
pytest.skip("No resources in this template")
@validates("R-02164")
-def test_contrail_fqdn(heat_template):
+def test_contrail_fqdn(yaml_file):
"""
When a VNF's Heat Orchestration Template's Contrail resource
has a property that
* **MUST** follow the format ``{network-role}_net_fqdn``
* **MUST** be declared as type ``string``
"""
- run_test(heat_template, validate_virtual_network_refs)
+ run_test(yaml_file, validate_virtual_network_refs)
@validates("R-53310", "R-46128")
-def test_contrail_instance_ip_resource_id_external(heat_template):
+def test_contrail_instance_ip_resource_id_external(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource OS::ContrailV2::InstanceIp
that is configuring an IPv4 Address on a port attached to an external
"""
run_test(
- heat_template,
+ yaml_file,
regex_names=("ip", "v6_ip"),
network_flavor=ContrailV2InstanceIpProcessor.network_flavor_external,
)
@validates("R-62187", "R-87563")
-def test_contrail_instance_ip_resource_id_internal(heat_template):
+def test_contrail_instance_ip_resource_id_internal(yaml_file):
"""
internal
{vm-type}_{vm-type_index}_int_{network-role}_vmi_{vmi_index}
_v6_IP_{index}
"""
run_test(
- heat_template,
+ yaml_file,
regex_names=("int_ip", "int_v6_ip"),
network_flavor=ContrailV2InstanceIpProcessor.network_flavor_internal,
)
@validates("R-20947", "R-88540")
-def test_contrail_instance_ip_resource_id_subint(heat_template):
+def test_contrail_instance_ip_resource_id_subint(yaml_file):
"""
subint
{vm-type}_{vm-type_index}_subint_{network-role}_vmi_{vmi_index}
_v6_IP_{index}
"""
run_test(
- heat_template,
+ yaml_file,
regex_names=("subint_ip", "subint_v6_ip"),
network_flavor=ContrailV2InstanceIpProcessor.network_flavor_subint,
)
@validates("R-28222")
-def test_contrail_irt_route_param_format(heat_template):
+def test_contrail_irt_route_param_format(yaml_file):
"""
If a VNF's Heat Orchestration Template
``OS::ContrailV2::InterfaceRouteTable`` resource
``interface_route_table_routes_route`` map property parameter name
**MUST** follow the format
"""
- run_test(heat_template, validate_irt_route_param_format)
+ run_test(yaml_file, validate_irt_route_param_format)
@validates("R-19756")
-def test_contrail_irt_route_param_type(heat_template):
+def test_contrail_irt_route_param_type(yaml_file):
"""
* ``{vm-type}_{network-role}_route_prefixes``
**MUST** be defined as type ``json``.
"""
- run_test(heat_template, validate_irt_route_param_type)
+ run_test(yaml_file, validate_irt_route_param_type)
@validates("R-81214")
-def test_contrail_interfaceroutetable_resource_id(heat_template):
+def test_contrail_interfaceroutetable_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
``OS::ContrailV2::InterfaceRouteTable``
contain the ``{network-role}``.
"""
run_test(
- heat_template,
+ yaml_file,
ContrailV2InterfaceRouteTableProcessor,
get_network_roles,
"network_role",
@validates("R-30753")
-def test_contrail_networkipam_resource_id(heat_template):
+def test_contrail_networkipam_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
``OS::ContrailV2::NetworkIpam``
contain the ``{network-role}``.
"""
run_test(
- heat_template, ContrailV2NetworkIpamProcessor, get_network_roles, "network_role"
+ yaml_file, ContrailV2NetworkIpamProcessor, get_network_roles, "network_role"
)
@validates("R-20065")
-def test_contrail_porttuple_resource_id(heat_template):
+def test_contrail_porttuple_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
``OS::ContrailV2::PortTuple``
**MUST**
contain the ``{vm-type}``.
"""
- run_test(heat_template, ContrailV2PortTupleProcessor, get_vm_types, "vm_type")
+ run_test(yaml_file, ContrailV2PortTupleProcessor, get_vm_types, "vm_type")
@validates("R-76014")
-def test_contrail_servicehealthcheck_resource_id(heat_template):
+def test_contrail_servicehealthcheck_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
``OS::ContrailV2::ServiceHealthCheck``
contain the ``{vm-type}``.
"""
run_test(
- heat_template, ContrailV2ServiceHealthCheckProcessor, get_vm_types, "vm_type"
+ yaml_file, ContrailV2ServiceHealthCheckProcessor, get_vm_types, "vm_type"
)
@validates("R-16437")
-def test_contrail_servicetemplate_resource_id(heat_template):
+def test_contrail_servicetemplate_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
``OS::ContrailV2::ServiceTemplate``
**MUST**
contain the ``{vm-type}``.
"""
- run_test(heat_template, ContrailV2ServiceTemplateProcessor, get_vm_types, "vm_type")
+ run_test(yaml_file, ContrailV2ServiceTemplateProcessor, get_vm_types, "vm_type")
@validates("R-96253")
-def test_contrail_instance_ip_resource_id_external(heat_template):
+def test_contrail_instance_ip_resource_id_external(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
OS::ContrailV2::VirtualMachineInterface that is attaching to an
{vm-type}_{vm-type_index}_{network-role}_vmi_{vmi_index}
"""
run_test(
- heat_template,
+ yaml_file,
regex_name="vmi_external",
network_flavor=ContrailV2VirtualMachineInterfaceProcessor.network_flavor_external,
)
@validates("R-50468")
-def test_contrail_instance_ip_resource_id_internal(heat_template):
+def test_contrail_instance_ip_resource_id_internal(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
OS::ContrailV2::VirtualMachineInterface that is attaching to an
{vm-type}_{vm-type_index}_int_{network-role}_vmi_{vmi_index}
"""
run_test(
- heat_template,
+ yaml_file,
regex_name="vmi_internal",
network_flavor=ContrailV2VirtualMachineInterfaceProcessor.network_flavor_internal,
)
@validates("R-54458")
-def test_contrail_instance_ip_resource_id_subint(heat_template):
+def test_contrail_instance_ip_resource_id_subint(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
OS::ContrailV2::VirtualMachineInterface that is attaching to an
{vm-type}_{vm-type_index}_subint_{network-role}_vmi_{vmi_index}
"""
run_test(
- heat_template,
+ yaml_file,
regex_name="vmi_subint",
network_flavor=ContrailV2VirtualMachineInterfaceProcessor.network_flavor_subint,
)
@validates("R-99110")
-def test_neutron_net_resource_id(heat_template):
+def test_neutron_net_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
OS::ContrailV2::VirtualNetwork Resource ID
or
2) int_{network-role}_RVN`` where RVN represents Resource Virtual
"""
- heat = Heat(filepath=heat_template)
+ heat = Heat(filepath=yaml_file)
heat_object_class = ContrailV2VirtualNetworkProcessor
resource_type = heat_object_class.resource_type
resources = heat.get_resource_by_type(resource_type)
"R-04697",
"R-34037",
)
-def test_fixed_ips_include_vm_type_network_role(heat_template):
+def test_fixed_ips_include_vm_type_network_role(yaml_file):
"""
Check that all fixed_ips ip addresses include the {vm_type} of the
nova server it is associated to and also contains the {network_role}
of the network it is associated with
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-05257")
-def test_neutron_floating_ip_resource_type(heat_template):
+def test_neutron_floating_ip_resource_type(yaml_file):
"""
A VNF's Heat Orchestration Template's **MUST NOT**
contain the Resource ``OS::Neutron::FloatingIP``.
"""
- run_test(heat_template, "OS::Neutron::FloatingIP")
+ run_test(yaml_file, "OS::Neutron::FloatingIP")
@validates("R-76449")
-def test_neutron_floating_ip_association_resource_type(heat_template):
+def test_neutron_floating_ip_association_resource_type(yaml_file):
"""
A VNF's Heat Orchestration Template's **MUST NOT**
contain the Resource ``OS::Neutron::FloatingIPAssociation``.
"""
- run_test(heat_template, "OS::Neutron::FloatingIPAssociation")
+ run_test(yaml_file, "OS::Neutron::FloatingIPAssociation")
@validates("R-23664")
-def test_heat_template_structure_contains_resources(heat_template):
+def test_heat_template_structure_contains_resources(yaml_file):
"""
Check that all heat templates have the required sections
"""
required_key_values = ["resources"]
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
assert all(
[k in yml for k in required_key_values]
), "{} doesn't contain the {} section, but it is required".format(
- heat_template, required_key_values[0]
+ yaml_file, required_key_values[0]
)
@validates("R-90152")
@pytest.mark.base
-def test_06_heat_template_resource_section_has_resources(heat_template):
+def test_06_heat_template_resource_section_has_resources(yaml_file):
found_resource = False
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
resources = yml.get("resources")
@validates("R-71577", "R-40971")
-def test_ips_start_at_0(heat_template):
- params = Heat(heat_template).parameters
+def test_ips_start_at_0(yaml_file):
+ params = Heat(yaml_file).parameters
invalid_params = check_indices(IP_PARAM_PATTERN, params, "IP Parameters")
assert not invalid_params, ". ".join(invalid_params)
@validates("R-30804")
-def test_multipart_mime(heat_template):
+def test_multipart_mime(yaml_file):
"""validate resource ids
"""
- h = Heat(filepath=heat_template)
+ h = Heat(filepath=yaml_file)
if not h.resources:
pytest.skip("No resources in this template")
@validates("R-10834")
-def test_nested_parameter_args(heat_template):
+def test_nested_parameter_args(yaml_file):
"""
If a VNF’s Heat Orchestration Template resource attribute
property metadata uses a nested get_param, then the "outer"
vf_module_id:
get_param: [ cdl, { get_param: num }]
"""
- heat = Heat(filepath=heat_template)
+ heat = Heat(filepath=yaml_file)
if not heat.resources:
pytest.skip("No resources found")
has_nested_parameters = False
@validates("R-11041")
-def test_nested_template_parameters(heat_template):
+def test_nested_template_parameters(yaml_file):
"""
All parameters defined in a VNFs Nested YAML file
**MUST** be passed in as properties of the resource calling
the nested yaml file.
"""
- dirname, basename = os.path.split(heat_template)
- heat = Heat(filepath=heat_template)
+ dirname, basename = os.path.split(yaml_file)
+ heat = Heat(filepath=yaml_file)
if not heat.resources:
pytest.skip("No resources found")
nested_type = nested_files.get_type_nested_files(heat.yml, dirname)
@validates("R-62983", "R-86182")
-def test_network_format(heat_template):
+def test_network_format(yaml_file):
"""
Make sure all network properties use the allowed naming
conventions
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-93177")
-def test_network_format_use_get_param_or_get_resource(heat_template):
+def test_network_format_use_get_param_or_get_resource(yaml_file):
"""
Make sure all network properties only use get_param
or get_resource of an internal network
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-25720")
-def test_neutron_net_resource_id(heat_template):
+def test_neutron_net_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource OS::Neutron::Net
Resource ID **MUST** use the naming convention
* int_{network-role}_network
"""
- heat = Heat(filepath=heat_template)
+ heat = Heat(filepath=yaml_file)
neutron_nets = heat.get_resource_by_type(NeutronNetProcessor.resource_type)
if not neutron_nets:
pytest.skip("No neutron nets found")
@validates("R-91810")
-def test_neutron_port_external_ipaddress(heat_template):
+def test_neutron_port_external_ipaddress(yaml_file):
"""
If a VNF requires ONAP to assign a Virtual IP (VIP) Address to
ports connected an external network, the port
**MUST NOT** have more than one IPv4 VIP address.
"""
- run_test(heat_template, validate_external_ipaddress)
+ run_test(yaml_file, validate_external_ipaddress)
@validates("R-41956")
-def test_neutron_port_external_ipaddress_v6(heat_template):
+def test_neutron_port_external_ipaddress_v6(yaml_file):
"""
If a VNF requires ONAP to assign a Virtual IP (VIP) Address to
ports connected an external network, the port
**MUST NOT** have more than one IPv6 VIP address.
"""
- run_test(heat_template, validate_external_ipaddress_v6)
+ run_test(yaml_file, validate_external_ipaddress_v6)
@validates("R-10754")
@validates("R-38236")
-def test_neutron_port_fixed_ips(heat_template):
+def test_neutron_port_fixed_ips(yaml_file):
"""
The VNF's Heat Orchestration Template's
resource ``OS::Neutron::Port`` property ``fixed_ips``
map property ``subnet``/``subnet_id`` parameter
**MUST** be declared type ``string``.
"""
- run_test(heat_template, validate_fixed_ip)
+ run_test(yaml_file, validate_fixed_ip)
@validates("R-62802", "R-15287")
-def test_neutron_port_external_fixed_ips(heat_template):
+def test_neutron_port_external_fixed_ips(yaml_file):
"""
When the VNF's Heat Orchestration Template's
resource ``OS::Neutron::Port`` is attaching
and the external network IPv6 subnet is to be specified
* ``{network-role}_v6_subnet_id``
"""
- run_test(heat_template, validate_external_fixed_ip)
+ run_test(yaml_file, validate_external_fixed_ip)
@validates("R-84123", "R-76160")
-def test_neutron_port_internal_fixed_ips(heat_template):
+def test_neutron_port_internal_fixed_ips(yaml_file):
"""
When
* ``int_{network-role}_v6_subnet_id``
"""
- run_test(heat_template, validate_internal_fixed_ip)
+ run_test(yaml_file, validate_internal_fixed_ip)
@validates("R-18008")
-def test_neutron_port_network_param_is_string(heat_template):
+def test_neutron_port_network_param_is_string(yaml_file):
"""
Make sure all network properties use the allowed naming
conventions
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-85734")
-def test_non_server_name(heat_template):
+def test_non_server_name(yaml_file):
"""
If a VNF's Heat Orchestration Template contains the property ``name``
for a non ``OS::Nova::Server`` resource, the intrinsic function
supplied metadata parameter ``vnf_name`` to generate a unique value.
"""
- h = Heat(filepath=heat_template)
+ h = Heat(filepath=yaml_file)
if not h.resources:
pytest.skip("No resources in this template")
@validates("R-54171")
-def test_nova_server_name_parameter_starts_at(heat_template):
- params = Heat(heat_template).parameters
+def test_nova_server_name_parameter_starts_at(yaml_file):
+ params = Heat(yaml_file).parameters
invalid_params = check_indices(
SERVER_NAME_PARAM, params, "OS::Nova::Server Name Parameters"
)
@validates("R-29751")
-def test_nova_server_resource_id(heat_template):
+def test_nova_server_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource
OS::Nova::Server Resource ID
* ``{vm-type}_server_{index}``
"""
- heat = Heat(filepath=heat_template)
+ heat = Heat(filepath=yaml_file)
resources = heat.nova_server_resources
if not resources:
pytest.skip("No Nova Server resources found")
@validates("R-20308")
-def test_environment_context(heat_template):
+def test_environment_context(yaml_file):
"""
A VNF's Heat Orchestration Template's OS::Nova::Server Resource
**MUST**
metadata map value parameter 'environment_context' **MUST**
be declared as type: 'string'.
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
if "parameters" not in yml:
continue
error = validate_metadata(metadata, yml["parameters"])
if error:
- assert False, '%s resource "%s" %s' % (heat_template, resource, error)
+ assert False, '%s resource "%s" %s' % (yaml_file, resource, error)
def validate_metadata(metadata, parameters):
@validates("R-57282")
-def test_vm_type_consistent_on_nova_servers(heat_template):
+def test_vm_type_consistent_on_nova_servers(yaml_file):
"""
Make sure all nova servers have properly formatted properties
for their name, image and flavor
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-901331", "R-481670", "R-663631")
-def test_vm_type_assignments_on_nova_servers_only_use_get_param(heat_template):
+def test_vm_type_assignments_on_nova_servers_only_use_get_param(yaml_file):
"""
Make sure all nova servers only use get_param for their properties
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-74978")
-def test_workload_context(heat_template):
+def test_workload_context(yaml_file):
"""
A VNF's Heat Orchestration Template's OS::Nova::Server Resource
**MUST**
metadata map value parameter 'workload_context' **MUST**
be declared as type: 'string'.
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
if "parameters" not in yml:
continue
error = validate_metadata(metadata, yml["parameters"])
if error:
- assert False, '%s resource "%s" %s' % (heat_template, resource, error)
+ assert False, '%s resource "%s" %s' % (yaml_file, resource, error)
def validate_metadata(metadata, parameters):
@validates("R-20453", "R-26351", "R-26506", "R-681859")
-def test_port_resource_ids(heat_template):
+def test_port_resource_ids(yaml_file):
"""
Check that all resource ids for ports follow the right
naming convention to include the {vm_type} of the
nova server it is associated to and also contains the
{network_role} of the network it is associated with
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined
@validates("R-23311")
-def test_availability_zone_parameter_type(heat_template):
- check_parameter_type(heat_template, "availability_zone_", "string")
+def test_availability_zone_parameter_type(yaml_file):
+ check_parameter_type(yaml_file, "availability_zone_", "string")
@validates("R-07507")
-def test_vnf_id_parameter_type_and_parameter_name(heat_template):
- check_parameter_type(heat_template, "vnf_id", "string")
- check_server_parameter_name(heat_template, "vnf_id", "vnf_id")
+def test_vnf_id_parameter_type_and_parameter_name(yaml_file):
+ check_parameter_type(yaml_file, "vnf_id", "string")
+ check_server_parameter_name(yaml_file, "vnf_id", "vnf_id")
@validates("R-82134")
-def test_vf_module_id_parameter_type_and_parameter_name(heat_template):
- check_parameter_type(heat_template, "vf_module_id", "string")
- check_server_parameter_name(heat_template, "vf_module_id", "vf_module_id")
+def test_vf_module_id_parameter_type_and_parameter_name(yaml_file):
+ check_parameter_type(yaml_file, "vf_module_id", "string")
+ check_server_parameter_name(yaml_file, "vf_module_id", "vf_module_id")
@validates("R-62428")
-def test_vnf_name_parameter_type_and_parameter_name(heat_template):
- check_parameter_type(heat_template, "vnf_name", "string")
- check_server_parameter_name(heat_template, "vnf_name", "vnf_name")
+def test_vnf_name_parameter_type_and_parameter_name(yaml_file):
+ check_parameter_type(yaml_file, "vnf_name", "string")
+ check_server_parameter_name(yaml_file, "vnf_name", "vnf_name")
@validates("R-39067")
-def test_vf_module_name_parameter_type_and_parameter_name(heat_template):
- check_parameter_type(heat_template, "vf_module_name", "string")
- check_server_parameter_name(heat_template, "vf_module_name", "vf_module_name")
+def test_vf_module_name_parameter_type_and_parameter_name(yaml_file):
+ check_parameter_type(yaml_file, "vf_module_name", "string")
+ check_server_parameter_name(yaml_file, "vf_module_name", "vf_module_name")
@validates("R-95430")
-def test_vm_role_parameter_type_and_parameter_name(heat_template):
- check_parameter_type(heat_template, "vm_role", "string")
- check_server_parameter_name(heat_template, "vm_role", "vm_role")
+def test_vm_role_parameter_type_and_parameter_name(yaml_file):
+ check_parameter_type(yaml_file, "vm_role", "string")
+ check_server_parameter_name(yaml_file, "vm_role", "vm_role")
@validates("R-54340")
-def test_vf_module_index_parameter_type_and_parameter_name(heat_template):
- check_parameter_type(heat_template, "vf_module_index", "number")
- check_server_parameter_name(heat_template, "vf_module_index", "vf_module_index")
+def test_vf_module_index_parameter_type_and_parameter_name(yaml_file):
+ check_parameter_type(yaml_file, "vf_module_index", "number")
+ check_server_parameter_name(yaml_file, "vf_module_index", "vf_module_index")
@validates("R-08975")
-def test_software_config_vm_type(heat_template):
+def test_software_config_vm_type(yaml_file):
"""
A VNF's Heat Orchestration Template's Resource OS::Heat::SoftwareConfig
Resource ID **MUST** contain the {vm-type}.
"""
- heat = Heat(filepath=heat_template)
+ heat = Heat(filepath=yaml_file)
software_configs = heat.get_resource_by_type("OS::Heat::SoftwareConfig")
if not software_configs:
pytest.skip("No SoftwareConfig resources found")
@validates("R-86476")
-def test_vm_role_from_env_file(heat_template):
+def test_vm_role_from_env_file(yaml_file):
"""
Validate vm_role when using parameters and env file
"""
- pair = get_environment_pair(heat_template)
+ pair = get_environment_pair(yaml_file)
if not pair:
pytest.skip("Unable to resolve environment pair")
template_params = pair["yyml"].get("parameters") or {}
@validates("R-32394")
-def test_vm_type_case(heat_template):
+def test_vm_type_case(yaml_file):
"""
A VNF's Heat Orchestration Template's use of ``{vm-type}`` in all Resource
property parameter names **MUST** be the same case.
"""
- heat = Heat(filepath=heat_template)
+ heat = Heat(filepath=yaml_file)
resources = heat.resources
if not resources:
pytest.skip("No resources found")
@validates("R-46839")
-def test_vm_type_resource_id(heat_template):
+def test_vm_type_resource_id(yaml_file):
"""
A VNF's Heat Orchestration Template's use of ``{vm-type}``
in all Resource IDs **MUST** be the same case.
"""
bad = {}
- h = Heat(filepath=heat_template)
+ h = Heat(filepath=yaml_file)
if not h.resources:
pytest.skip("No resources specified in the heat template")
vm_types = {
@validates("R-98407")
-def test_vm_type_syntax(heat_template):
+def test_vm_type_syntax(yaml_file):
"""
A VNF's Heat Orchestration Template's ``{vm-type}``
**MUST** contain only
contain any of the following strings:
``_int`` or ``int_`` or ``_int_``.
"""
- v = Heat(filepath=heat_template)
+ v = Heat(filepath=yaml_file)
if not v.resources:
pytest.skip("No resources")
t = set()
from .utils.vm_types import get_vm_type_for_nova_server
-def test_volume_resource_ids(heat_template):
+def test_volume_resource_ids(yaml_file):
"""
Check that all resource ids for cinder volumes follow the right
naming convention to include the {vm_type} of the
nova server it is associated to
"""
- with open(heat_template) as fh:
+ with open(yaml_file) as fh:
yml = yaml.load(fh)
# skip if resources are not defined