From cc21b8b08b6dbcec577bfb26ff397ac899da8002 Mon Sep 17 00:00:00 2001 From: "Michael F. Lamb" Date: Tue, 5 Sep 2017 11:21:28 -0700 Subject: Commit seed code for validation-scripts This imports the initial seed code for validation scripts. These files were imported from a tarball with the SHA1SUM ce2ae49c82546b987c8ad2f68ac43d94b4934818. From the contents of the tarball, some errant .pyc files were removed, and a .gitignore file was added. The result matches exactly the contents of the origin private repository at hash 88c656e. Change-Id: I97d19b11495e116890ca6577e83037b0934519cc Issue-Id: VVP-11 Signed-off-by: Michael F. Lamb --- .../fail/mismatch_get_resource.yaml | 192 +++++++++++++++ .../fail/mismatch_get_resource_volume.yaml | 73 ++++++ .../fail/mismatch_resource_id.yaml | 192 +++++++++++++++ .../fail/mismatch_resource_id_volume.yaml | 73 ++++++ .../pass/valid_template.yaml | 192 +++++++++++++++ .../pass/valid_template_volume.yaml | 73 ++++++ .../invalid_naming_for_allowed_address_pairs.yaml | 125 ++++++++++ .../fail/single_ip_format_used_in_array.yaml | 125 ++++++++++ .../fail/wrong_network_role.yaml | 125 ++++++++++ .../pass/valid_heat_template.yaml | 125 ++++++++++ ...al_network_network_role_wrong_in_parameter.yaml | 259 +++++++++++++++++++++ ...xternal_network_vm_type_wrong_in_parameter.yaml | 259 +++++++++++++++++++++ ...al_network_network_role_wrong_in_parameter.yaml | 259 +++++++++++++++++++++ ...nternal_network_vm_type_wrong_in_parameter.yaml | 259 +++++++++++++++++++++ .../fail/mismatch_vm_type_exernal_nova_server.yaml | 259 +++++++++++++++++++++ .../mismatch_vm_type_internal_nova_server.yaml | 259 +++++++++++++++++++++ .../pass/valid_template.yaml | 259 +++++++++++++++++++++ .../fail/missing_increment.yaml | 53 +++++ .../fail/not_starting_with_availability_zone.yaml | 65 ++++++ .../fail/using_a_non_digit_increment.yaml | 34 +++ .../fail/using_list_instead_of_get_param.yaml | 53 +++++ .../pass/valid_heat_template.yaml | 53 +++++ .../fail/not_using_get_param.yaml | 53 +++++ .../fail/only_specifying_param.yaml | 53 +++++ .../pass/valid_heat_template.yaml | 53 +++++ .../fail/failing_directory/check_cant_fail.yaml | 57 +++++ .../pass/base_well_named_1/base_well_named.yaml | 57 +++++ .../pass/base_well_named_2/well_base_named.yaml | 57 +++++ .../pass/base_well_named_3/well_named_base.yaml | 57 +++++ .../fail/base_template.yaml | 100 ++++++++ ...dule_1_template_missing_output_consumption.yaml | 88 +++++++ .../fail/module_2_child_1_template.yaml | 88 +++++++ ...dule_2_template_missing_output_consumption.yaml | 91 ++++++++ .../pass/base_template.yaml | 100 ++++++++ .../pass/module_1_template.yaml | 88 +++++++ .../pass/module_2_child_1_template.yaml | 88 +++++++ .../pass/module_2_template.yaml | 95 ++++++++ .../match_environment_filename_slightly_lon.yaml | 44 ++++ .../match_environment_filename_slightly_long.env | 44 ++++ .../match_environment_filename_slightly_shor.env | 44 ++++ .../match_environment_filename_slightly_short.yaml | 44 ++++ .../no_match/no_match_environment_filename.env | 44 ++++ .../pass/good_matches/good_yaml_eg.env | 44 ++++ .../pass/good_matches/good_yaml_eg.yaml | 44 ++++ .../fail/base_template.yaml | 114 +++++++++ .../fail/base_template_env.yaml | 60 +++++ .../test_env_files_provided/pass/base_template.env | 60 +++++ .../pass/base_template.yaml | 114 +++++++++ .../fail/non_environment_invalid_key.env | 63 +++++ .../fail/non_environment_no_keys.env | 44 ++++ .../pass/environment.env | 60 +++++ .../fail/invalid_naming_for_fixed_ips.yaml | 94 ++++++++ .../pass/valid_heat_template.yaml | 94 ++++++++ .../fail/get_param_not_used_for_fixed_ips.yaml | 94 ++++++++ .../fail/get_resource_used_for_fixed_ips.yaml | 94 ++++++++ .../pass/valid_heat_template.yaml | 94 ++++++++ .../external_mismatch_vm_type_nova_server.yaml | 213 +++++++++++++++++ .../fail/external_wrong_network_role_param.yaml | 213 +++++++++++++++++ .../fail/external_wrong_vm_type_param.yaml | 213 +++++++++++++++++ .../internal_mismatch_vm_type_nova_server.yaml | 213 +++++++++++++++++ .../fail/internal_wrong_network_role_param.yaml | 213 +++++++++++++++++ .../fail/internal_wrong_vm_type_param.yaml | 213 +++++++++++++++++ .../pass/valid_template.yaml | 213 +++++++++++++++++ .../fail/personality_contains_http.yaml | 94 ++++++++ .../fail/user_data_contains_ftp.yaml | 94 ++++++++ .../fail/user_data_contains_http.yaml | 94 ++++++++ .../pass/valid_template.yaml | 94 ++++++++ ...arameter_numeric_value_missing_constraints.yaml | 46 ++++ .../pass/valid_heat_template.yaml | 77 ++++++ .../fail/env_missing_yaml.env | 44 ++++ .../fail/misnamed_pair.yaml | 64 +++++ .../fail/misnamed_pairr.env | 44 ++++ .../fail/yaml_missing_env.yaml | 64 +++++ .../test_heat_pairs_provided/pass/good_yaml_eg.env | 44 ++++ .../pass/good_yaml_eg.yaml | 64 +++++ .../pass/good_yaml_eg_volume.env | 44 ++++ .../pass/good_yaml_eg_volume.yaml | 66 ++++++ .../fail/parameter_default_value_specified.yaml | 53 +++++ .../fail/parameter_invalid_keys.yaml | 54 +++++ .../pass/valid_heat_template.yaml | 77 ++++++ .../fail/environment.yaml | 60 +++++ .../fail/valid_heat_template.env | 114 +++++++++ .../pass/environment.env | 60 +++++ .../pass/valid_heat_template.yaml | 114 +++++++++ .../pass/valid_heat_template.yml | 114 +++++++++ .../fail/template_missing_description.yaml | 76 ++++++ .../fail/template_missing_type.yaml | 76 ++++++ .../pass/valid_template.yaml | 77 ++++++ .../fail/non_heat_template_invalid_keys.yaml | 63 +++++ .../fail/non_heat_template_invalid_keys.yml | 63 +++++ .../fail/non_heat_template_no_valid_keys.yaml | 43 ++++ .../pass/valid_heat_template.yaml | 114 +++++++++ .../pass/valid_heat_template.yml | 114 +++++++++ .../pass/valid_heat_template_minimal_sections.yaml | 65 ++++++ .../fail/base_template.env | 114 +++++++++ .../fail/base_template.template | 114 +++++++++ .../pass/base_template.env | 60 +++++ .../pass/base_template.yaml | 114 +++++++++ .../fail/heat_template_missing_nested_files.yaml | 62 +++++ .../pass/nested_template_1.yaml | 59 +++++ .../pass/nested_template_2.yaml | 59 +++++ .../pass/valid_nested_heat_template.yaml | 50 ++++ .../fail/heat_template_invalid_nesting.yaml | 70 ++++++ .../pass/nested_template_1.yaml | 59 +++++ .../pass/nested_template_2.yaml | 59 +++++ .../pass/valid_nested_heat_template.yaml | 62 +++++ .../pass/valid_non_nested_template.yaml | 69 ++++++ ..._naming_used_for_internal_network_resource.yaml | 65 ++++++ .../fail/invalid_naming_used_for_network.yaml | 60 +++++ .../pass/valid_heat_template.yaml | 65 ++++++ .../fail/get_param_not_used_for_network.yaml | 76 ++++++ .../get_resource_used_for_external_network.yaml | 65 ++++++ .../pass/valid_heat_template.yaml | 76 ++++++ .../fail/unused_param.env | 46 ++++ .../fail/unused_param.yaml | 67 ++++++ .../pass/no_unused_param.env | 45 ++++ .../pass/no_unused_param.yaml | 65 ++++++ .../fail/not_supported_policies.yml | 76 ++++++ .../pass/with_supported_policies.yml | 76 ++++++ .../fail/wrong_type_for_parameters.yaml | 116 +++++++++ .../pass/valid_heat_template.yaml | 102 ++++++++ .../fail/mismatch_vm_type_key_properties.yaml | 68 ++++++ .../mismatch_vm_type_key_properties_uppercase.yaml | 68 ++++++ .../fail/mismatch_vm_type_resource_id.yaml | 68 ++++++ .../mismatch_vm_type_resource_id_uppercase.yaml | 68 ++++++ .../pass/valid_heat_template.yaml | 68 ++++++ .../fail/inconsistent_vm_type.yaml | 70 ++++++ .../pass/valid_heat_template.yaml | 68 ++++++ .../fail/missing_get_param.yaml | 70 ++++++ .../using_str_replace_instead_of_get_param.yaml | 69 ++++++ .../pass/valid_heat_template.yaml | 102 ++++++++ .../fail/bad_yaml_less_indent_on_value.yaml | 53 +++++ .../test_parse_yaml/fail/bad_yaml_multierror.yaml | 54 +++++ .../test_parse_yaml/fail/bad_yaml_tab.yaml | 53 +++++ .../fail/bad_yaml_value_and_keys.yaml | 53 +++++ .../test_parse_yaml/pass/good_yaml_eg.yaml | 52 +++++ .../mismatch_vm_type_port_id_get_resource.yaml | 158 +++++++++++++ ..._port_attached_to_nova_server_get_resource.yaml | 158 +++++++++++++ ...ched_to_nova_server_get_resource_uppercase.yaml | 158 +++++++++++++ .../pass/valid_template.yaml | 158 +++++++++++++ .../fail/missing_param_definition_1.yaml | 139 +++++++++++ .../fail/missing_param_definition_2.yaml | 132 +++++++++++ .../fail/missing_param_reference.yaml | 134 +++++++++++ ...ms_referenced_are_defined_and_vice_versa_1.yaml | 139 +++++++++++ ...ms_referenced_are_defined_and_vice_versa_2.yaml | 143 ++++++++++++ ...plate_required_parameters_with_constraints.yaml | 81 +++++++ .../pass/valid_heat_template.yaml | 53 +++++ .../missing_required_parameters_in_env_file.env | 44 ++++ .../missing_required_parameters_in_env_file.yaml | 74 ++++++ .../pass/required_parameters_specified.env | 45 ++++ .../pass/required_parameters_specified.yaml | 74 ++++++ .../required_parameters_specified_not_needed.env | 42 ++++ .../required_parameters_specified_not_needed.yaml | 49 ++++ .../missing_required_parameters_in_template.yaml | 73 ++++++ .../pass/required_parameters_specified.yaml | 74 ++++++ .../required_parameters_specified_not_needed.yaml | 49 ++++ .../invalid_characters_in_resource_id_template.yml | 67 ++++++ .../valid_characters_in_resource_id_template.yml | 58 +++++ ...template_missing_specified_vf_module_index.yaml | 104 +++++++++ .../template_missing_specified_vf_module_name.yaml | 109 +++++++++ ...te_missing_specified_vf_module_name_in_rsg.yaml | 100 ++++++++ .../pass/valid_heat_template_1.yaml | 113 +++++++++ .../pass/valid_heat_template_2.yaml | 108 +++++++++ .../pass/valid_heat_template_3.yaml | 104 +++++++++ .../pass/valid_heat_template_4.yaml | 104 +++++++++ .../fail/missing_vf_module_id.yaml | 48 ++++ .../fail/missing_vnf_id.yaml | 48 ++++ .../fail/missing_vnf_name.yaml | 48 ++++ .../pass/has_required_metadata.yaml | 49 ++++ .../fail/missing_metadata_section.yaml | 45 ++++ .../fail/missing_properties_section.yaml | 43 ++++ .../fail/not_using_get_param.yaml | 52 +++++ .../pass/has_required_metadata.yaml | 49 ++++ .../invalid_naming_used_for_get_param_subnet.yaml | 86 +++++++ ...nvalid_naming_used_for_get_resource_subnet.yaml | 86 +++++++ .../pass/valid_heat_template.yaml | 86 +++++++ .../fail/get_param_not_used_for_subnet.yaml | 86 +++++++ .../get_resource_used_for_external_network.yaml | 86 +++++++ .../pass/valid_heat_template.yaml | 86 +++++++ .../fail/heat_template_1.yaml | 108 +++++++++ ...at_template_2_identical_to_heat_template_2.yaml | 108 +++++++++ .../pass/unique_resource_template_1.yml | 108 +++++++++ .../pass/unique_resource_template_2.yml | 108 +++++++++ ...ource_stack_name_without_vnf_name_or_module.yml | 89 +++++++ .../pass/unique_resource_template.yml | 91 ++++++++ ...ource_stack_name_without_vnf_name_or_module.yml | 71 ++++++ .../pass/unique_resource_template.yml | 91 ++++++++ .../fail/duplicate_resource_template.yml | 58 +++++ .../fail/unique_resource_template.yml | 58 +++++ .../pass/unique_resource_template_1.yml | 58 +++++ .../pass/unique_resource_template_2.yml | 58 +++++ .../fail/duplicate_resource_template.yml | 58 +++++ .../pass/unique_resource_template.yml | 58 +++++ .../fail/no_value_volume.yaml | 69 ++++++ .../fail/use_get_param_volume.yml | 61 +++++ .../pass/valid_template_volume.yml | 70 ++++++ .../fail/more_outputs_than_parameters.yaml | 111 +++++++++ .../fail/more_outputs_than_parameters_volume.yaml | 99 ++++++++ .../pass/valid_template.yaml | 103 ++++++++ .../pass/valid_template_volume.yaml | 81 +++++++ ...ch_vm_type_instance_uuid_volume_attachment.yaml | 150 ++++++++++++ .../mismatch_vm_type_volume_id_nova_server_id.yaml | 150 ++++++++++++ .../fail/mismatch_vm_type_volume_id_param.yaml | 150 ++++++++++++ .../fail/mismatch_vm_type_volume_id_resource.yaml | 150 ++++++++++++ ...smatch_vm_type_volume_id_volume_attachment.yaml | 150 ++++++++++++ ...type_volume_id_volume_attachment_uppercase.yaml | 150 ++++++++++++ .../pass/valid_template.yaml | 150 ++++++++++++ .../fail/badly_named_volume_1.yaml | 59 +++++ .../fail/missing_keyword.yaml | 59 +++++ .../fail/only_nova_severs_in_volume.yaml | 51 ++++ .../pass/well_named_volume.yaml | 59 +++++ .../fail/missing_outputs_volume.yaml | 50 ++++ .../pass/well_named_volume.yaml | 58 +++++ ...smatch_resource_keys_outputs_keys_1_volume.yaml | 71 ++++++ ...smatch_resource_keys_outputs_keys_2_volume.yaml | 71 ++++++ ...smatch_resource_keys_outputs_keys_3_volume.yaml | 71 ++++++ .../fail/more_outputs_than_resources_volume.yaml | 72 ++++++ .../fail/more_resources_than_outputs_volume.yaml | 66 ++++++ .../pass/valid_template_volume.yaml | 71 ++++++ 219 files changed, 19746 insertions(+) create mode 100644 ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_get_resource.yaml create mode 100644 ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_get_resource_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_resource_id.yaml create mode 100644 ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_resource_id_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_all_referenced_resources_exists/pass/valid_template.yaml create mode 100644 ice_validator/tests/fixtures/test_all_referenced_resources_exists/pass/valid_template_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/invalid_naming_for_allowed_address_pairs.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/single_ip_format_used_in_array.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/wrong_network_role.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pair_format/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/external_network_network_role_wrong_in_parameter.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/external_network_vm_type_wrong_in_parameter.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/internal_network_network_role_wrong_in_parameter.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/internal_network_vm_type_wrong_in_parameter.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/mismatch_vm_type_exernal_nova_server.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/mismatch_vm_type_internal_nova_server.yaml create mode 100644 ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/pass/valid_template.yaml create mode 100644 ice_validator/tests/fixtures/test_availability_zone/fail/missing_increment.yaml create mode 100644 ice_validator/tests/fixtures/test_availability_zone/fail/not_starting_with_availability_zone.yaml create mode 100644 ice_validator/tests/fixtures/test_availability_zone/fail/using_a_non_digit_increment.yaml create mode 100644 ice_validator/tests/fixtures/test_availability_zone/fail/using_list_instead_of_get_param.yaml create mode 100644 ice_validator/tests/fixtures/test_availability_zone/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_availability_zone_get_param/fail/not_using_get_param.yaml create mode 100644 ice_validator/tests/fixtures/test_availability_zone_get_param/fail/only_specifying_param.yaml create mode 100644 ice_validator/tests/fixtures/test_availability_zone_get_param/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_names/fail/failing_directory/check_cant_fail.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_1/base_well_named.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_2/well_base_named.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_3/well_named_base.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/base_template.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_1_template_missing_output_consumption.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_2_child_1_template.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_2_template_missing_output_consumption.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/base_template.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_1_template.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_2_child_1_template.yaml create mode 100644 ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_2_template.yaml create mode 100644 ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_lon.yaml create mode 100644 ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_long.env create mode 100644 ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_shor.env create mode 100644 ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_short.yaml create mode 100644 ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/no_match_environment_filename.env create mode 100644 ice_validator/tests/fixtures/test_env_and_yaml_same_name/pass/good_matches/good_yaml_eg.env create mode 100644 ice_validator/tests/fixtures/test_env_and_yaml_same_name/pass/good_matches/good_yaml_eg.yaml create mode 100644 ice_validator/tests/fixtures/test_env_files_provided/fail/base_template.yaml create mode 100644 ice_validator/tests/fixtures/test_env_files_provided/fail/base_template_env.yaml create mode 100644 ice_validator/tests/fixtures/test_env_files_provided/pass/base_template.env create mode 100644 ice_validator/tests/fixtures/test_env_files_provided/pass/base_template.yaml create mode 100644 ice_validator/tests/fixtures/test_environment_file_structure/fail/non_environment_invalid_key.env create mode 100644 ice_validator/tests/fixtures/test_environment_file_structure/fail/non_environment_no_keys.env create mode 100644 ice_validator/tests/fixtures/test_environment_file_structure/pass/environment.env create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_format/fail/invalid_naming_for_fixed_ips.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_format/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/fail/get_param_not_used_for_fixed_ips.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/fail/get_resource_used_for_fixed_ips.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_mismatch_vm_type_nova_server.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_wrong_network_role_param.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_wrong_vm_type_param.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_mismatch_vm_type_nova_server.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_wrong_network_role_param.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_wrong_vm_type_param.yaml create mode 100644 ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/pass/valid_template.yaml create mode 100644 ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/personality_contains_http.yaml create mode 100644 ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/user_data_contains_ftp.yaml create mode 100644 ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/user_data_contains_http.yaml create mode 100644 ice_validator/tests/fixtures/test_get_file_only_reference_local_files/pass/valid_template.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_numeric_parameters/fail/parameter_numeric_value_missing_constraints.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_numeric_parameters/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_pairs_provided/fail/env_missing_yaml.env create mode 100644 ice_validator/tests/fixtures/test_heat_pairs_provided/fail/misnamed_pair.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_pairs_provided/fail/misnamed_pairr.env create mode 100644 ice_validator/tests/fixtures/test_heat_pairs_provided/fail/yaml_missing_env.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg.env create mode 100644 ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg_volume.env create mode 100644 ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_parameter_section/fail/parameter_default_value_specified.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_parameter_section/fail/parameter_invalid_keys.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_parameter_section/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/fail/environment.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/fail/valid_heat_template.env create mode 100644 ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/environment.env create mode 100644 ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/valid_heat_template.yml create mode 100644 ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/fail/template_missing_description.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/fail/template_missing_type.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/pass/valid_template.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_invalid_keys.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_invalid_keys.yml create mode 100644 ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_no_valid_keys.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template.yml create mode 100644 ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template_minimal_sections.yaml create mode 100644 ice_validator/tests/fixtures/test_heat_templates_provided/fail/base_template.env create mode 100644 ice_validator/tests/fixtures/test_heat_templates_provided/fail/base_template.template create mode 100644 ice_validator/tests/fixtures/test_heat_templates_provided/pass/base_template.env create mode 100644 ice_validator/tests/fixtures/test_heat_templates_provided/pass/base_template.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates/fail/heat_template_missing_nested_files.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates/pass/nested_template_1.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates/pass/nested_template_2.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates/pass/valid_nested_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/fail/heat_template_invalid_nesting.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/nested_template_1.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/nested_template_2.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/valid_nested_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/valid_non_nested_template.yaml create mode 100644 ice_validator/tests/fixtures/test_network_format/fail/invalid_naming_used_for_internal_network_resource.yaml create mode 100644 ice_validator/tests/fixtures/test_network_format/fail/invalid_naming_used_for_network.yaml create mode 100644 ice_validator/tests/fixtures/test_network_format/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/fail/get_param_not_used_for_network.yaml create mode 100644 ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/fail/get_resource_used_for_external_network.yaml create mode 100644 ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/fail/unused_param.env create mode 100644 ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/fail/unused_param.yaml create mode 100644 ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/pass/no_unused_param.env create mode 100644 ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/pass/no_unused_param.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servergroup_policies/fail/not_supported_policies.yml create mode 100644 ice_validator/tests/fixtures/test_nova_servergroup_policies/pass/with_supported_policies.yml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_correct_parameter_types/fail/wrong_type_for_parameters.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_correct_parameter_types/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_key_properties.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_key_properties_uppercase.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_resource_id.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_resource_id_uppercase.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_resource_ids/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_vm_types/fail/inconsistent_vm_type.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_vm_types/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/fail/missing_get_param.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/fail/using_str_replace_instead_of_get_param.yaml create mode 100644 ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_less_indent_on_value.yaml create mode 100644 ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_multierror.yaml create mode 100644 ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_tab.yaml create mode 100644 ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_value_and_keys.yaml create mode 100644 ice_validator/tests/fixtures/test_parse_yaml/pass/good_yaml_eg.yaml create mode 100644 ice_validator/tests/fixtures/test_port_resource_ids/fail/mismatch_vm_type_port_id_get_resource.yaml create mode 100644 ice_validator/tests/fixtures/test_port_resource_ids/fail/wrong_port_attached_to_nova_server_get_resource.yaml create mode 100644 ice_validator/tests/fixtures/test_port_resource_ids/fail/wrong_port_attached_to_nova_server_get_resource_uppercase.yaml create mode 100644 ice_validator/tests/fixtures/test_port_resource_ids/pass/valid_template.yaml create mode 100644 ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_definition_1.yaml create mode 100644 ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_definition_2.yaml create mode 100644 ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_reference.yaml create mode 100644 ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/pass/params_referenced_are_defined_and_vice_versa_1.yaml create mode 100644 ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/pass/params_referenced_are_defined_and_vice_versa_2.yaml create mode 100644 ice_validator/tests/fixtures/test_required_parameters_no_constraints/fail/heat_template_required_parameters_with_constraints.yaml create mode 100644 ice_validator/tests/fixtures/test_required_parameters_no_constraints/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/fail/missing_required_parameters_in_env_file.env create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/fail/missing_required_parameters_in_env_file.yaml create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified.env create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified.yaml create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified_not_needed.env create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified_not_needed.yaml create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/fail/missing_required_parameters_in_template.yaml create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/pass/required_parameters_specified.yaml create mode 100644 ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/pass/required_parameters_specified_not_needed.yaml create mode 100644 ice_validator/tests/fixtures/test_resource_ids_alphanumeric_only/fail/invalid_characters_in_resource_id_template.yml create mode 100644 ice_validator/tests/fixtures/test_resource_ids_alphanumeric_only/pass/valid_characters_in_resource_id_template.yml create mode 100644 ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_index.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_name.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_name_in_rsg.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_1.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_2.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_3.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_4.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vf_module_id.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vnf_id.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vnf_name.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_have_required_metadata/pass/has_required_metadata.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/missing_metadata_section.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/missing_properties_section.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/not_using_get_param.yaml create mode 100644 ice_validator/tests/fixtures/test_servers_metadata_use_get_param/pass/has_required_metadata.yaml create mode 100644 ice_validator/tests/fixtures/test_subnet_format/fail/invalid_naming_used_for_get_param_subnet.yaml create mode 100644 ice_validator/tests/fixtures/test_subnet_format/fail/invalid_naming_used_for_get_resource_subnet.yaml create mode 100644 ice_validator/tests/fixtures/test_subnet_format/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/fail/get_param_not_used_for_subnet.yaml create mode 100644 ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/fail/get_resource_used_for_external_network.yaml create mode 100644 ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/pass/valid_heat_template.yaml create mode 100644 ice_validator/tests/fixtures/test_unique_name_resources/fail/heat_template_1.yaml create mode 100644 ice_validator/tests/fixtures/test_unique_name_resources/fail/heat_template_2_identical_to_heat_template_2.yaml create mode 100644 ice_validator/tests/fixtures/test_unique_name_resources/pass/unique_resource_template_1.yml create mode 100644 ice_validator/tests/fixtures/test_unique_name_resources/pass/unique_resource_template_2.yml create mode 100644 ice_validator/tests/fixtures/test_unique_name_str_replace_use_params_in_tmpl/fail/unique_resource_stack_name_without_vnf_name_or_module.yml create mode 100644 ice_validator/tests/fixtures/test_unique_name_str_replace_use_params_in_tmpl/pass/unique_resource_template.yml create mode 100644 ice_validator/tests/fixtures/test_unique_name_str_replace_use_req_params/fail/unique_resource_stack_name_without_vnf_name_or_module.yml create mode 100644 ice_validator/tests/fixtures/test_unique_name_str_replace_use_req_params/pass/unique_resource_template.yml create mode 100644 ice_validator/tests/fixtures/test_unique_resources_across_all_templates/fail/duplicate_resource_template.yml create mode 100644 ice_validator/tests/fixtures/test_unique_resources_across_all_templates/fail/unique_resource_template.yml create mode 100644 ice_validator/tests/fixtures/test_unique_resources_across_all_templates/pass/unique_resource_template_1.yml create mode 100644 ice_validator/tests/fixtures/test_unique_resources_across_all_templates/pass/unique_resource_template_2.yml create mode 100644 ice_validator/tests/fixtures/test_unique_resources_across_template/fail/duplicate_resource_template.yml create mode 100644 ice_validator/tests/fixtures/test_unique_resources_across_template/pass/unique_resource_template.yml create mode 100644 ice_validator/tests/fixtures/test_volume_format_outputs/fail/no_value_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_format_outputs/fail/use_get_param_volume.yml create mode 100644 ice_validator/tests/fixtures/test_volume_format_outputs/pass/valid_template_volume.yml create mode 100644 ice_validator/tests/fixtures/test_volume_outputs_consumed/fail/more_outputs_than_parameters.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_outputs_consumed/fail/more_outputs_than_parameters_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_outputs_consumed/pass/valid_template.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_outputs_consumed/pass/valid_template_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_instance_uuid_volume_attachment.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_nova_server_id.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_param.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_resource.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_volume_attachment.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_volume_attachment_uppercase.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_resource_ids/pass/valid_template.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates/fail/badly_named_volume_1.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates/fail/missing_keyword.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates/fail/only_nova_severs_in_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates/pass/well_named_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates_outputs/fail/missing_outputs_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates_outputs/pass/well_named_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_1_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_2_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_3_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/more_outputs_than_resources_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/more_resources_than_outputs_volume.yaml create mode 100644 ice_validator/tests/fixtures/test_volume_templates_outputs_resources/pass/valid_template_volume.yaml (limited to 'ice_validator/tests/fixtures') diff --git a/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_get_resource.yaml b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_get_resource.yaml new file mode 100644 index 0000000..b11db06 --- /dev/null +++ b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_get_resource.yaml @@ -0,0 +1,192 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_0_extnet_0_port: + type: string + description: id of the admin_1_extnet_1_port + + db_1_int_intranet_0_port: + type: string + description: id of the admin_1_extnet_1_port + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_vpnnet_net_id: + type: string + description: network id for the internal network vpnnet + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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_10_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 0] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_param: db_0_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_param: db_1_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_0_exnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: exnet_net_name } + + admin_0_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + admin_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + admin_1_extnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_get_resource_volume.yaml b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_get_resource_volume.yaml new file mode 100644 index 0000000..4304a70 --- /dev/null +++ b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_get_resource_volume.yaml @@ -0,0 +1,73 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: > + An example volume template + +parameters: + + vm_type_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + vm_type_volume_id_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_id_10 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_id_1 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_resource_id.yaml b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_resource_id.yaml new file mode 100644 index 0000000..bb6f22e --- /dev/null +++ b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_resource_id.yaml @@ -0,0 +1,192 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_0_extnet_0_port: + type: string + description: id of the admin_1_extnet_1_port + + db_1_int_intranet_0_port: + type: string + description: id of the admin_1_extnet_1_port + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_vpnnet_net_id: + type: string + description: network id for the internal network vpnnet + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 0] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_param: db_0_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_param: db_1_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_0_exnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: exnet_net_name } + + admin_0_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + admin_1_extnet_10_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + admin_1_extnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_resource_id_volume.yaml b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_resource_id_volume.yaml new file mode 100644 index 0000000..2078b2d --- /dev/null +++ b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/fail/mismatch_resource_id_volume.yaml @@ -0,0 +1,73 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: > + An example volume template + +parameters: + + vm_type_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + vm_type_volume_id1_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_id_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_id_1 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_all_referenced_resources_exists/pass/valid_template.yaml b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/pass/valid_template.yaml new file mode 100644 index 0000000..783553f --- /dev/null +++ b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/pass/valid_template.yaml @@ -0,0 +1,192 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_0_extnet_0_port: + type: string + description: id of the admin_1_extnet_1_port + + db_1_int_intranet_0_port: + type: string + description: id of the admin_1_extnet_1_port + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_vpnnet_net_id: + type: string + description: network id for the internal network vpnnet + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 0] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_param: db_0_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_param: db_1_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_0_exnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: exnet_net_name } + + admin_0_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + admin_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + admin_1_extnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_all_referenced_resources_exists/pass/valid_template_volume.yaml b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/pass/valid_template_volume.yaml new file mode 100644 index 0000000..0d54d61 --- /dev/null +++ b/ice_validator/tests/fixtures/test_all_referenced_resources_exists/pass/valid_template_volume.yaml @@ -0,0 +1,73 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: > + An example volume template + +parameters: + + vm_type_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + vm_type_volume_id_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_id_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_id_1 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/invalid_naming_for_allowed_address_pairs.yaml b/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/invalid_naming_for_allowed_address_pairs.yaml new file mode 100644 index 0000000..db42cf6 --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/invalid_naming_for_allowed_address_pairs.yaml @@ -0,0 +1,125 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_int_intranet_floating_ip } + + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_int_intranet_floating_v6_ip } + + vm_type_1_extnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_floating_ip } + + vm_type_1_extnet_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_extnet_floating_v6_ip } + + vm_type_1_int_intranet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_int_intranet_ip_0 } + + vm_type_1_int_intranet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_int_intranet_v6_ip_0 } + + vm_type_1_extnet_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_ip } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_extnet_v6_ip_0 } + + vm_type_1_int_intranet_8_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_1_int_intranet_ip, 0] } + + vm_type_1_int_intranet_9_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_2_int_intranet_v6_ips, 0] } + + vm_type_1_extnet_10_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_ips } + + vm_type_1_extnet_11_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_2_extnet_v6_ips, 0] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/single_ip_format_used_in_array.yaml b/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/single_ip_format_used_in_array.yaml new file mode 100644 index 0000000..84774a1 --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/single_ip_format_used_in_array.yaml @@ -0,0 +1,125 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_int_intranet_floating_ip } + + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_int_intranet_floating_v6_ip } + + vm_type_1_extnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_floating_ip } + + vm_type_1_extnet_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_extnet_floating_v6_ip } + + vm_type_1_int_intranet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_int_intranet_ip_0 } + + vm_type_1_int_intranet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_int_intranet_v6_ip_0 } + + vm_type_1_extnet_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_ip_0 } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_extnet_v6_ip_0 } + + vm_type_1_int_intranet_8_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_1_int_intranet_ip, 0] } + + vm_type_1_int_intranet_9_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_2_int_intranet_v6_ips, 0] } + + vm_type_1_extnet_10_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_1_extnet_ip, 0] } + + vm_type_1_extnet_11_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_2_extnet_v6_ips, 0] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/wrong_network_role.yaml b/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/wrong_network_role.yaml new file mode 100644 index 0000000..a3e7806 --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pair_format/fail/wrong_network_role.yaml @@ -0,0 +1,125 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_int_intranet_floating_ip } + + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet2_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_int_intranet_floating_v6_ip } + + vm_type_1_extnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_floating_ip } + + vm_type_1_extnet_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_extnet_floating_v6_ip } + + vm_type_1_int_intranet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_int_intranet_ip_0 } + + vm_type_1_int_intranet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_int_intranet3_v6_ip_0 } + + vm_type_1_extnet_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_ip_0 } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_extnet_v6_ip_0 } + + vm_type_1_int_intranet_8_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_1_int_intranet_ips, 0] } + + vm_type_1_int_intranet_9_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_2_int_intranet_v6_ips, 0] } + + vm_type_1_extnet_10_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_1_extnet_ips, 0] } + + vm_type_1_extnet_11_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_2_extnet_v6_ips, 0] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_allowed_address_pair_format/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_allowed_address_pair_format/pass/valid_heat_template.yaml new file mode 100644 index 0000000..9a66ae5 --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pair_format/pass/valid_heat_template.yaml @@ -0,0 +1,125 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_int_intranet_floating_ip } + + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_int_intranet_floating_v6_ip } + + vm_type_1_extnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_floating_ip } + + vm_type_1_extnet_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_extnet_floating_v6_ip } + + vm_type_1_int_intranet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_int_intranet_ip_0 } + + vm_type_1_int_intranet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_int_intranet_v6_ip_0 } + + vm_type_1_extnet_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_1_extnet_ip_0 } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_2_extnet_v6_ip_0 } + + vm_type_1_int_intranet_8_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_1_int_intranet_ips, 0] } + + vm_type_1_int_intranet_9_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_2_int_intranet_v6_ips, 0] } + + vm_type_1_extnet_10_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_1_extnet_ips, 0] } + + vm_type_1_extnet_11_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_2_extnet_v6_ips, 0] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/external_network_network_role_wrong_in_parameter.yaml b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/external_network_network_role_wrong_in_parameter.yaml new file mode 100644 index 0000000..655c60a --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/external_network_network_role_wrong_in_parameter.yaml @@ -0,0 +1,259 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + db_int_intranet_floating_ip: + type: string + description: db_int_intranet_floating_ip + + db_int_intranet_floating_v6_ip: + type: string + description: db_int_intranet_floating_v6_ip + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + + lb_extnet_floating_ip: + type: string + description: lb_extnet_floating_ip + + lb_extnet_floating_v6_ip: + type: string + description: lb_extnet_floating_v6_ip + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + - port: { get_resource: lb_4_extnet_0_port } + - port: { get_resource: lb_5_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + - port: { get_resource: db_3_int_intranet_0_port } + - port: { get_resource: db_4_int_intranet_0_port } + - port: { get_resource: db_5_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + + db_3_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_4_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_ip } + + db_5_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_v6_ip } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_ips, 0] } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet1_v6_ips, 0] } + + lb_4_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_ip } + + lb_5_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_v6_ip } diff --git a/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/external_network_vm_type_wrong_in_parameter.yaml b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/external_network_vm_type_wrong_in_parameter.yaml new file mode 100644 index 0000000..b5abb2b --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/external_network_vm_type_wrong_in_parameter.yaml @@ -0,0 +1,259 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + db_int_intranet_floating_ip: + type: string + description: db_int_intranet_floating_ip + + db_int_intranet_floating_v6_ip: + type: string + description: db_int_intranet_floating_v6_ip + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + + lb_extnet_floating_ip: + type: string + description: lb_extnet_floating_ip + + lb_extnet_floating_v6_ip: + type: string + description: lb_extnet_floating_v6_ip + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + - port: { get_resource: lb_4_extnet_0_port } + - port: { get_resource: lb_5_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + - port: { get_resource: db_3_int_intranet_0_port } + - port: { get_resource: db_4_int_intranet_0_port } + - port: { get_resource: db_5_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + + db_3_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_4_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_ip } + + db_5_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_v6_ip } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb1_extnet_v6_ip_0 } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_ips, 0] } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_4_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_ip } + + lb_5_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_v6_ip } diff --git a/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/internal_network_network_role_wrong_in_parameter.yaml b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/internal_network_network_role_wrong_in_parameter.yaml new file mode 100644 index 0000000..71752dc --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/internal_network_network_role_wrong_in_parameter.yaml @@ -0,0 +1,259 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + db_int_intranet_floating_ip: + type: string + description: db_int_intranet_floating_ip + + db_int_intranet_floating_v6_ip: + type: string + description: db_int_intranet_floating_v6_ip + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + + lb_extnet_floating_ip: + type: string + description: lb_extnet_floating_ip + + lb_extnet_floating_v6_ip: + type: string + description: lb_extnet_floating_v6_ip + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + - port: { get_resource: lb_4_extnet_0_port } + - port: { get_resource: lb_5_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + - port: { get_resource: db_3_int_intranet_0_port } + - port: { get_resource: db_4_int_intranet_0_port } + - port: { get_resource: db_5_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + + db_3_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_4_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_ip } + + db_5_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet1_floating_v6_ip } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_ips, 0] } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_4_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_ip } + + lb_5_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_v6_ip } diff --git a/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/internal_network_vm_type_wrong_in_parameter.yaml b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/internal_network_vm_type_wrong_in_parameter.yaml new file mode 100644 index 0000000..607a5cc --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/internal_network_vm_type_wrong_in_parameter.yaml @@ -0,0 +1,259 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + db_int_intranet_floating_ip: + type: string + description: db_int_intranet_floating_ip + + db_int_intranet_floating_v6_ip: + type: string + description: db_int_intranet_floating_v6_ip + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + + lb_extnet_floating_ip: + type: string + description: lb_extnet_floating_ip + + lb_extnet_floating_v6_ip: + type: string + description: lb_extnet_floating_v6_ip + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + - port: { get_resource: lb_4_extnet_0_port } + - port: { get_resource: lb_5_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + - port: { get_resource: db_3_int_intranet_0_port } + - port: { get_resource: db_4_int_intranet_0_port } + - port: { get_resource: db_5_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + + db_3_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_4_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db1_int_intranet_floating_ip } + + db_5_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_v6_ip } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_ips, 0] } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_4_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_ip } + + lb_5_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_v6_ip } diff --git a/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/mismatch_vm_type_exernal_nova_server.yaml b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/mismatch_vm_type_exernal_nova_server.yaml new file mode 100644 index 0000000..8a38509 --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/mismatch_vm_type_exernal_nova_server.yaml @@ -0,0 +1,259 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb1_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb1_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + db_int_intranet_floating_ip: + type: string + description: db_int_intranet_floating_ip + + db_int_intranet_floating_v6_ip: + type: string + description: db_int_intranet_floating_v6_ip + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + + lb_extnet_floating_ip: + type: string + description: lb_extnet_floating_ip + + lb_extnet_floating_v6_ip: + type: string + description: lb_extnet_floating_v6_ip + +resources: + + lb1_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb1_names, 0] } + flavor: { get_param: lb1_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + - port: { get_resource: lb_4_extnet_0_port } + - port: { get_resource: lb_5_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + - port: { get_resource: db_3_int_intranet_0_port } + - port: { get_resource: db_4_int_intranet_0_port } + - port: { get_resource: db_5_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + + db_3_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_4_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_ip } + + db_5_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_v6_ip } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_ips, 0] } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_4_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_ip } + + lb_5_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_v6_ip } diff --git a/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/mismatch_vm_type_internal_nova_server.yaml b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/mismatch_vm_type_internal_nova_server.yaml new file mode 100644 index 0000000..03744d2 --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/fail/mismatch_vm_type_internal_nova_server.yaml @@ -0,0 +1,259 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db1_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db1_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + db_int_intranet_floating_ip: + type: string + description: db_int_intranet_floating_ip + + db_int_intranet_floating_v6_ip: + type: string + description: db_int_intranet_floating_v6_ip + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + + lb_extnet_floating_ip: + type: string + description: lb_extnet_floating_ip + + lb_extnet_floating_v6_ip: + type: string + description: lb_extnet_floating_v6_ip + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + - port: { get_resource: lb_4_extnet_0_port } + - port: { get_resource: lb_5_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db1_names, 1] } + flavor: { get_param: db1_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + - port: { get_resource: db_3_int_intranet_0_port } + - port: { get_resource: db_4_int_intranet_0_port } + - port: { get_resource: db_5_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + + db_3_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_4_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_ip } + + db_5_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_v6_ip } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_ips, 0] } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_4_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_ip } + + lb_5_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_v6_ip } diff --git a/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/pass/valid_template.yaml b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/pass/valid_template.yaml new file mode 100644 index 0000000..3aa1d2e --- /dev/null +++ b/ice_validator/tests/fixtures/test_allowed_address_pairs_include_vm_type_network_role/pass/valid_template.yaml @@ -0,0 +1,259 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + db_int_intranet_floating_ip: + type: string + description: db_int_intranet_floating_ip + + db_int_intranet_floating_v6_ip: + type: string + description: db_int_intranet_floating_v6_ip + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + + lb_extnet_floating_ip: + type: string + description: lb_extnet_floating_ip + + lb_extnet_floating_v6_ip: + type: string + description: lb_extnet_floating_v6_ip + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + - port: { get_resource: lb_4_extnet_0_port } + - port: { get_resource: lb_5_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + - port: { get_resource: db_3_int_intranet_0_port } + - port: { get_resource: db_4_int_intranet_0_port } + - port: { get_resource: db_5_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + + db_3_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_4_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_ip } + + db_5_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + allowed_address_pairs: + - ip_address: { get_param: db_int_intranet_floating_v6_ip } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_ips, 0] } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_4_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_ip } + + lb_5_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + allowed_address_pairs: + - ip_address: { get_param: lb_extnet_floating_v6_ip } diff --git a/ice_validator/tests/fixtures/test_availability_zone/fail/missing_increment.yaml b/ice_validator/tests/fixtures/test_availability_zone/fail/missing_increment.yaml new file mode 100644 index 0000000..98d779a --- /dev/null +++ b/ice_validator/tests/fixtures/test_availability_zone/fail/missing_increment.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_b_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_ } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } diff --git a/ice_validator/tests/fixtures/test_availability_zone/fail/not_starting_with_availability_zone.yaml b/ice_validator/tests/fixtures/test_availability_zone/fail/not_starting_with_availability_zone.yaml new file mode 100644 index 0000000..b07e8a1 --- /dev/null +++ b/ice_validator/tests/fixtures/test_availability_zone/fail/not_starting_with_availability_zone.yaml @@ -0,0 +1,65 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_b_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: wrong_availability_zone_0 } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } + vm_type_b_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_1 } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } diff --git a/ice_validator/tests/fixtures/test_availability_zone/fail/using_a_non_digit_increment.yaml b/ice_validator/tests/fixtures/test_availability_zone/fail/using_a_non_digit_increment.yaml new file mode 100644 index 0000000..1a2be4a --- /dev/null +++ b/ice_validator/tests/fixtures/test_availability_zone/fail/using_a_non_digit_increment.yaml @@ -0,0 +1,34 @@ +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# ================================================================================ +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP and OpenECOMP are trademarks +# and service marks of AT&T Intellectual Property. +--- +resources: + vm_type_b_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_a } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } diff --git a/ice_validator/tests/fixtures/test_availability_zone/fail/using_list_instead_of_get_param.yaml b/ice_validator/tests/fixtures/test_availability_zone/fail/using_list_instead_of_get_param.yaml new file mode 100644 index 0000000..9bdf372 --- /dev/null +++ b/ice_validator/tests/fixtures/test_availability_zone/fail/using_list_instead_of_get_param.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_b_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: [availability_zones, 0] } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } diff --git a/ice_validator/tests/fixtures/test_availability_zone/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_availability_zone/pass/valid_heat_template.yaml new file mode 100644 index 0000000..9480b5a --- /dev/null +++ b/ice_validator/tests/fixtures/test_availability_zone/pass/valid_heat_template.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_b_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } diff --git a/ice_validator/tests/fixtures/test_availability_zone_get_param/fail/not_using_get_param.yaml b/ice_validator/tests/fixtures/test_availability_zone_get_param/fail/not_using_get_param.yaml new file mode 100644 index 0000000..bd11a89 --- /dev/null +++ b/ice_validator/tests/fixtures/test_availability_zone_get_param/fail/not_using_get_param.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_b_server_0: + type: OS::Nova::Server + properties: + availability_zone: { str_replace: availability_zone_0 } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } diff --git a/ice_validator/tests/fixtures/test_availability_zone_get_param/fail/only_specifying_param.yaml b/ice_validator/tests/fixtures/test_availability_zone_get_param/fail/only_specifying_param.yaml new file mode 100644 index 0000000..e0cdba9 --- /dev/null +++ b/ice_validator/tests/fixtures/test_availability_zone_get_param/fail/only_specifying_param.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_b_server_0: + type: OS::Nova::Server + properties: + availability_zone: { availability_zone_0 } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } diff --git a/ice_validator/tests/fixtures/test_availability_zone_get_param/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_availability_zone_get_param/pass/valid_heat_template.yaml new file mode 100644 index 0000000..9480b5a --- /dev/null +++ b/ice_validator/tests/fixtures/test_availability_zone_get_param/pass/valid_heat_template.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_b_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + key_name: { get_param: vm_type_b_key_name } diff --git a/ice_validator/tests/fixtures/test_base_template_names/fail/failing_directory/check_cant_fail.yaml b/ice_validator/tests/fixtures/test_base_template_names/fail/failing_directory/check_cant_fail.yaml new file mode 100644 index 0000000..5f16fcc --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_names/fail/failing_directory/check_cant_fail.yaml @@ -0,0 +1,57 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +description: + base +parameters: + vm_type_volume_name_0: + type: string + vm_type_volume_size_0: + type: number + +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + +outputs: + vm_type_volume_id_0: + value: {get_resource: vm_type_volume_0} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_1/base_well_named.yaml b/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_1/base_well_named.yaml new file mode 100644 index 0000000..5f16fcc --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_1/base_well_named.yaml @@ -0,0 +1,57 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +description: + base +parameters: + vm_type_volume_name_0: + type: string + vm_type_volume_size_0: + type: number + +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + +outputs: + vm_type_volume_id_0: + value: {get_resource: vm_type_volume_0} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_2/well_base_named.yaml b/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_2/well_base_named.yaml new file mode 100644 index 0000000..5f16fcc --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_2/well_base_named.yaml @@ -0,0 +1,57 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +description: + base +parameters: + vm_type_volume_name_0: + type: string + vm_type_volume_size_0: + type: number + +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + +outputs: + vm_type_volume_id_0: + value: {get_resource: vm_type_volume_0} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_3/well_named_base.yaml b/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_3/well_named_base.yaml new file mode 100644 index 0000000..5f16fcc --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_names/pass/base_well_named_3/well_named_base.yaml @@ -0,0 +1,57 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +description: + base +parameters: + vm_type_volume_name_0: + type: string + vm_type_volume_size_0: + type: number + +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + +outputs: + vm_type_volume_id_0: + value: {get_resource: vm_type_volume_0} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/base_template.yaml b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/base_template.yaml new file mode 100644 index 0000000..103b380 --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/base_template.yaml @@ -0,0 +1,100 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_image_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + oam_net_id: + type: string + description: OAM net id + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [admin_names, 0] } + image: { get_param: admin_image_name } + flavor: { get_param: admin_flavor_name } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + networks: + - network: { get_param: oam_net_id } + +outputs: + + admin_server_id_0: + description: Admin server id 0 + value: { get_resource: admin_server_0 } + + oam_management_v4_address: + value: {get_attr: [admin_server, networks, { get_param: oam_net_id }, 0] } + + oam_management_v6_address: + value: {get_attr: [admin_server, networks, { get_param: oam_net_id }, 0] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_1_template_missing_output_consumption.yaml b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_1_template_missing_output_consumption.yaml new file mode 100644 index 0000000..8fb2de2 --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_1_template_missing_output_consumption.yaml @@ -0,0 +1,88 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_image_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + oam_net_id: + type: string + description: OAM net id + +resources: + + admin_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [admin_names, 1] } + image: { get_param: admin_image_name } + flavor: { get_param: admin_flavor_name } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + networks: + - network: { get_param: oam_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_2_child_1_template.yaml b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_2_child_1_template.yaml new file mode 100644 index 0000000..31fc359 --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_2_child_1_template.yaml @@ -0,0 +1,88 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_image_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + oam_net_id: + type: string + description: OAM net id + +resources: + + child_admin_server_3: + type: OS::Nova::Server + properties: + name: { get_param: [admin_names, 3] } + image: { get_param: admin_image_name } + flavor: { get_param: admin_flavor_name } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + networks: + - network: { get_param: oam_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_2_template_missing_output_consumption.yaml b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_2_template_missing_output_consumption.yaml new file mode 100644 index 0000000..8768c46 --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/fail/module_2_template_missing_output_consumption.yaml @@ -0,0 +1,91 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_image_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + oam_net_id: + type: string + description: OAM net id + +resources: + + admin_server_2: + type: OS::Nova::Server + properties: + name: { get_param: [ admin_names, 2 ] } + image: { get_param: admin_image_name } + flavor: { get_param: admin_flavor_name } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + networks: + - network: { get_param: oam_net_id } + + admin_server_3: + type: module_2_child_1_template.yaml \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/base_template.yaml b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/base_template.yaml new file mode 100644 index 0000000..103b380 --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/base_template.yaml @@ -0,0 +1,100 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_image_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + oam_net_id: + type: string + description: OAM net id + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [admin_names, 0] } + image: { get_param: admin_image_name } + flavor: { get_param: admin_flavor_name } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + networks: + - network: { get_param: oam_net_id } + +outputs: + + admin_server_id_0: + description: Admin server id 0 + value: { get_resource: admin_server_0 } + + oam_management_v4_address: + value: {get_attr: [admin_server, networks, { get_param: oam_net_id }, 0] } + + oam_management_v6_address: + value: {get_attr: [admin_server, networks, { get_param: oam_net_id }, 0] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_1_template.yaml b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_1_template.yaml new file mode 100644 index 0000000..8fb2de2 --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_1_template.yaml @@ -0,0 +1,88 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_image_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + oam_net_id: + type: string + description: OAM net id + +resources: + + admin_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [admin_names, 1] } + image: { get_param: admin_image_name } + flavor: { get_param: admin_flavor_name } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + networks: + - network: { get_param: oam_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_2_child_1_template.yaml b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_2_child_1_template.yaml new file mode 100644 index 0000000..31fc359 --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_2_child_1_template.yaml @@ -0,0 +1,88 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_image_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + oam_net_id: + type: string + description: OAM net id + +resources: + + child_admin_server_3: + type: OS::Nova::Server + properties: + name: { get_param: [admin_names, 3] } + image: { get_param: admin_image_name } + flavor: { get_param: admin_flavor_name } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + networks: + - network: { get_param: oam_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_2_template.yaml b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_2_template.yaml new file mode 100644 index 0000000..16ec503 --- /dev/null +++ b/ice_validator/tests/fixtures/test_base_template_outputs_consumed/pass/module_2_template.yaml @@ -0,0 +1,95 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_image_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + oam_net_id: + type: string + description: OAM net id + + admin_server_id_0: + type: string + description: output parameter from base + +resources: + + admin_server_2: + type: OS::Nova::Server + properties: + name: { get_param: [ admin_names, 2 ] } + image: { get_param: admin_image_name } + flavor: { get_param: admin_flavor_name } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + networks: + - network: { get_param: oam_net_id } + + admin_server_3: + type: module_2_child_1_template.yaml \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_lon.yaml b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_lon.yaml new file mode 100644 index 0000000..b9c4ff7 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_lon.yaml @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_long.env b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_long.env new file mode 100644 index 0000000..04fb338 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_long.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + parameters: + b: 2 + c: 3 + d: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_shor.env b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_shor.env new file mode 100644 index 0000000..04fb338 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_shor.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + parameters: + b: 2 + c: 3 + d: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_short.yaml b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_short.yaml new file mode 100644 index 0000000..b9c4ff7 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/match_environment_filename_slightly_short.yaml @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/no_match_environment_filename.env b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/no_match_environment_filename.env new file mode 100644 index 0000000..04fb338 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/fail/no_match/no_match_environment_filename.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + parameters: + b: 2 + c: 3 + d: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_and_yaml_same_name/pass/good_matches/good_yaml_eg.env b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/pass/good_matches/good_yaml_eg.env new file mode 100644 index 0000000..7cd88e3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/pass/good_matches/good_yaml_eg.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + b: 2 + c: 3 + d: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_and_yaml_same_name/pass/good_matches/good_yaml_eg.yaml b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/pass/good_matches/good_yaml_eg.yaml new file mode 100644 index 0000000..b9c4ff7 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_and_yaml_same_name/pass/good_matches/good_yaml_eg.yaml @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_files_provided/fail/base_template.yaml b/ice_validator/tests/fixtures/test_env_files_provided/fail/base_template.yaml new file mode 100644 index 0000000..fceb0ff --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_files_provided/fail/base_template.yaml @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2a \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_files_provided/fail/base_template_env.yaml b/ice_validator/tests/fixtures/test_env_files_provided/fail/base_template_env.yaml new file mode 100644 index 0000000..e7e2ac3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_files_provided/fail/base_template_env.yaml @@ -0,0 +1,60 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + KeyName: heat_key + InstanceType: m1.micro + ImageId: F18-x86_64-cfntools + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_files_provided/pass/base_template.env b/ice_validator/tests/fixtures/test_env_files_provided/pass/base_template.env new file mode 100644 index 0000000..e7e2ac3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_files_provided/pass/base_template.env @@ -0,0 +1,60 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + KeyName: heat_key + InstanceType: m1.micro + ImageId: F18-x86_64-cfntools + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_env_files_provided/pass/base_template.yaml b/ice_validator/tests/fixtures/test_env_files_provided/pass/base_template.yaml new file mode 100644 index 0000000..fceb0ff --- /dev/null +++ b/ice_validator/tests/fixtures/test_env_files_provided/pass/base_template.yaml @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2a \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_environment_file_structure/fail/non_environment_invalid_key.env b/ice_validator/tests/fixtures/test_environment_file_structure/fail/non_environment_invalid_key.env new file mode 100644 index 0000000..2ef2317 --- /dev/null +++ b/ice_validator/tests/fixtures/test_environment_file_structure/fail/non_environment_invalid_key.env @@ -0,0 +1,63 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + b: 1 + c: "example" + d: 100 + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge + +dummy_section: + dummy_key: "" \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_environment_file_structure/fail/non_environment_no_keys.env b/ice_validator/tests/fixtures/test_environment_file_structure/fail/non_environment_no_keys.env new file mode 100644 index 0000000..b9c4ff7 --- /dev/null +++ b/ice_validator/tests/fixtures/test_environment_file_structure/fail/non_environment_no_keys.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_environment_file_structure/pass/environment.env b/ice_validator/tests/fixtures/test_environment_file_structure/pass/environment.env new file mode 100644 index 0000000..e7e2ac3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_environment_file_structure/pass/environment.env @@ -0,0 +1,60 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + KeyName: heat_key + InstanceType: m1.micro + ImageId: F18-x86_64-cfntools + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_fixed_ips_format/fail/invalid_naming_for_fixed_ips.yaml b/ice_validator/tests/fixtures/test_fixed_ips_format/fail/invalid_naming_for_fixed_ips.yaml new file mode 100644 index 0000000..445bebf --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_format/fail/invalid_naming_for_fixed_ips.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - ip_address: { get_param: lb_0_int_intranet_ip_0 } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ip, 0] } + - ip_address: { get_param: db_1_int_vpnnet_ips } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - ip_address: { get_param: lb_1_extnet_ip_1 } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: lb_2_extnet_ip } + + vm_type_1_int_vpnnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_fixed_ips_format/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_fixed_ips_format/pass/valid_heat_template.yaml new file mode 100644 index 0000000..f1b4f4d --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_format/pass/valid_heat_template.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - ip_address: { get_param: lb_0_int_intranet_ip_0 } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - ip_address: { get_param: [db_1_int_vpnnet_ips, 1] } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - ip_address: { get_param: lb_1_extnet_ip_1 } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: lb_2_extnet_ip_0 } + + vm_type_1_int_vpnnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/fail/get_param_not_used_for_fixed_ips.yaml b/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/fail/get_param_not_used_for_fixed_ips.yaml new file mode 100644 index 0000000..6444de3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/fail/get_param_not_used_for_fixed_ips.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - ip_address: { get_param: lb_0_int_intranet_ip_0 } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - ip_address: { get_param: [db_1_int_vpnnet_ips, 1] } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - ip_address: { get_param: lb_1_extnet_ip_1 } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: lb_2_extnet_ip_0 } + + vm_type_1_int_vpnnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/fail/get_resource_used_for_fixed_ips.yaml b/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/fail/get_resource_used_for_fixed_ips.yaml new file mode 100644 index 0000000..2b1a9da --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/fail/get_resource_used_for_fixed_ips.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - ip_address: { get_param: lb_0_int_intranet_ip_0 } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - ip_address: { get_param: [db_1_int_vpnnet_ips, 1] } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_resource: lb_1_extnet_ip_0 } + - ip_address: { get_param: lb_1_extnet_ip_1 } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: lb_2_extnet_ip_0 } + + vm_type_1_int_vpnnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/pass/valid_heat_template.yaml new file mode 100644 index 0000000..f1b4f4d --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_format_use_get_param/pass/valid_heat_template.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - ip_address: { get_param: lb_0_int_intranet_ip_0 } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - ip_address: { get_param: [db_1_int_vpnnet_ips, 1] } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - ip_address: { get_param: lb_1_extnet_ip_1 } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: lb_2_extnet_ip_0 } + + vm_type_1_int_vpnnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_6_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_7_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_mismatch_vm_type_nova_server.yaml b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_mismatch_vm_type_nova_server.yaml new file mode 100644 index 0000000..ec40ab7 --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_mismatch_vm_type_nova_server.yaml @@ -0,0 +1,213 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb1_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb1_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_ip_1: + type: string + description: lb_extnet_ip_1 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb1_names, 0] } + flavor: { get_param: lb1_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: db_int_intranet_ip_0 } + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 1] } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_0 } + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: [lb_extnet_ips, 0] } + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_1 } + - subnet_id: { get_param: extnet_subnet_id } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } diff --git a/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_wrong_network_role_param.yaml b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_wrong_network_role_param.yaml new file mode 100644 index 0000000..863a557 --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_wrong_network_role_param.yaml @@ -0,0 +1,213 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_ip_1: + type: string + description: lb_extnet_ip_1 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: db_int_intranet_ip_0 } + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 1] } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet1_ip_0 } + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: [lb_extnet_ips, 0] } + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_1 } + - subnet_id: { get_param: extnet_subnet_id } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } diff --git a/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_wrong_vm_type_param.yaml b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_wrong_vm_type_param.yaml new file mode 100644 index 0000000..bafddc3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/external_wrong_vm_type_param.yaml @@ -0,0 +1,213 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_ip_1: + type: string + description: lb_extnet_ip_1 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: db_int_intranet_ip_0 } + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 1] } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_0 } + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: [lb_extnet_ips, 0] } + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb1_extnet_ip_1 } + - subnet_id: { get_param: extnet_subnet_id } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } diff --git a/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_mismatch_vm_type_nova_server.yaml b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_mismatch_vm_type_nova_server.yaml new file mode 100644 index 0000000..e202460 --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_mismatch_vm_type_nova_server.yaml @@ -0,0 +1,213 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db1_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db1_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_ip_1: + type: string + description: lb_extnet_ip_1 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db1_names, 1] } + flavor: { get_param: db1_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: db_int_intranet_ip_0 } + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 1] } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_0 } + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: [lb_extnet_ips, 0] } + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_1 } + - subnet_id: { get_param: extnet_subnet_id } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } diff --git a/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_wrong_network_role_param.yaml b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_wrong_network_role_param.yaml new file mode 100644 index 0000000..d9a0d1c --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_wrong_network_role_param.yaml @@ -0,0 +1,213 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_ip_1: + type: string + description: lb_extnet_ip_1 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: db_int_intranet1_ip_0 } + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 1] } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_0 } + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: [lb_extnet_ips, 0] } + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_1 } + - subnet_id: { get_param: extnet_subnet_id } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } diff --git a/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_wrong_vm_type_param.yaml b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_wrong_vm_type_param.yaml new file mode 100644 index 0000000..b7650c1 --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/fail/internal_wrong_vm_type_param.yaml @@ -0,0 +1,213 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_ip_1: + type: string + description: lb_extnet_ip_1 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: db_int_intranet_ip_0 } + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db1_int_intranet_ips, 0] } + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 1] } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_0 } + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: [lb_extnet_ips, 0] } + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_1 } + - subnet_id: { get_param: extnet_subnet_id } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } diff --git a/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/pass/valid_template.yaml b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/pass/valid_template.yaml new file mode 100644 index 0000000..f67b794 --- /dev/null +++ b/ice_validator/tests/fixtures/test_fixed_ips_include_vm_type_network_role/pass/valid_template.yaml @@ -0,0 +1,213 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + availability_zone_0: + type: string + description: availability zone to be used + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_intranet_net_id: + type: string + description: network id for the internal network intranet + + db_int_intranet_ip_0: + type: string + description: db_int_intranet_ip_0 + + db_int_intranet_v6_ip_0: + type: string + description: db_int_intranet_v6_ip_0 + + db_int_intranet_ips: + type: string + description: db_int_intranet_ips + + db_int_intranet_v6_ips: + type: string + description: db_int_intranet_v6_ips + + lb_extnet_ip_0: + type: string + description: lb_extnet_ip_0 + + lb_extnet_ip_1: + type: string + description: lb_extnet_ip_1 + + lb_extnet_v6_ip_0: + type: string + description: lb_extnet_v6_ip_0 + + lb_extnet_ips: + type: string + description: lb_extnet_ips + + lb_extnet_v6_ips: + type: string + description: lb_extnet_v6_ips + +resources: + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: lb_0_extnet_0_port } + - port: { get_resource: lb_1_extnet_0_port } + - port: { get_resource: lb_2_extnet_0_port } + - port: { get_resource: lb_3_extnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [db_names, 1] } + flavor: { get_param: db_flavor_name} + networks: + - port: { get_resource: db_0_int_intranet_0_port } + - port: { get_resource: db_1_int_intranet_0_port } + - port: { get_resource: db_2_int_intranet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + db_0_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: db_int_intranet_ip_0 } + - ip_address: { get_param: db_int_intranet_v6_ip_0 } + + db_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 0] } + - ip_address: { get_param: [db_int_intranet_v6_ips, 0] } + + db_2_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_id } + fixed_ips: + - ip_address: { get_param: [db_int_intranet_ips, 1] } + + lb_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_0 } + - ip_address: { get_param: lb_extnet_v6_ip_0 } + + lb_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - ip_address: { get_param: [lb_extnet_ips, 0] } + - ip_address: { get_param: [lb_extnet_v6_ips, 0] } + + lb_2_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_extnet_ip_1 } + - subnet_id: { get_param: extnet_subnet_id } + + lb_3_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } diff --git a/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/personality_contains_http.yaml b/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/personality_contains_http.yaml new file mode 100644 index 0000000..b0aac43 --- /dev/null +++ b/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/personality_contains_http.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + user_data: + get_file: user_data.sh + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + personality: {"/opt/new.txt": { get_file: "http://my.server.us/personality/new.txt" } } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/user_data_contains_ftp.yaml b/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/user_data_contains_ftp.yaml new file mode 100644 index 0000000..d7d6c2a --- /dev/null +++ b/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/user_data_contains_ftp.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + user_data: + get_file: user_data.sh + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + personality: {"/opt/new.txt": { get_file: "ftp://external.server.com" } } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/user_data_contains_http.yaml b/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/user_data_contains_http.yaml new file mode 100644 index 0000000..fa5b5a4 --- /dev/null +++ b/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/fail/user_data_contains_http.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + user_data: + get_file: http://server.example.com/files/user_data.sh + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + personality: {"/opt/new.txt": { get_file: "new.txt" } } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/pass/valid_template.yaml b/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/pass/valid_template.yaml new file mode 100644 index 0000000..c950f52 --- /dev/null +++ b/ice_validator/tests/fixtures/test_get_file_only_reference_local_files/pass/valid_template.yaml @@ -0,0 +1,94 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + user_data: + get_file: user_data.sh + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + personality: {"/opt/new.txt": { get_file: "new.txt"} } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_numeric_parameters/fail/parameter_numeric_value_missing_constraints.yaml b/ice_validator/tests/fixtures/test_heat_numeric_parameters/fail/parameter_numeric_value_missing_constraints.yaml new file mode 100644 index 0000000..d71b7af --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_numeric_parameters/fail/parameter_numeric_value_missing_constraints.yaml @@ -0,0 +1,46 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + b: + type: number + label: human-readable name of the parameter + description: description of the parameter + default: "default" \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_numeric_parameters/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_heat_numeric_parameters/pass/valid_heat_template.yaml new file mode 100644 index 0000000..7f29136 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_numeric_parameters/pass/valid_heat_template.yaml @@ -0,0 +1,77 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + a: + type: string + label: human-readable name of the parameter + description: description of the parameter + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + immutable: true + b: + type: number + label: human-readable name of the parameter + description: description of the parameter + hidden: false + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 + immutable: false + c: + type: json + label: human-readable name of the parameter + description: description of the parameter + d: + type: comma_delimited_list + label: human-readable name of the parameter + description: description of the parameter + e: + type: boolean + label: human-readable name of the parameter + description: description of the parameter \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/env_missing_yaml.env b/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/env_missing_yaml.env new file mode 100644 index 0000000..d28ad59 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/env_missing_yaml.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: value + vnf_id: value + vf_module_id: value \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/misnamed_pair.yaml b/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/misnamed_pair.yaml new file mode 100644 index 0000000..c83fa04 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/misnamed_pair.yaml @@ -0,0 +1,64 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + vf_module_id: + type: string + description: Unique ID for this VNF Module instance + +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } diff --git a/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/misnamed_pairr.env b/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/misnamed_pairr.env new file mode 100644 index 0000000..d28ad59 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/misnamed_pairr.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: value + vnf_id: value + vf_module_id: value \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/yaml_missing_env.yaml b/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/yaml_missing_env.yaml new file mode 100644 index 0000000..c83fa04 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_pairs_provided/fail/yaml_missing_env.yaml @@ -0,0 +1,64 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + vf_module_id: + type: string + description: Unique ID for this VNF Module instance + +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } diff --git a/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg.env b/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg.env new file mode 100644 index 0000000..d28ad59 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: value + vnf_id: value + vf_module_id: value \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg.yaml b/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg.yaml new file mode 100644 index 0000000..c83fa04 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg.yaml @@ -0,0 +1,64 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + vf_module_id: + type: string + description: Unique ID for this VNF Module instance + +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } diff --git a/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg_volume.env b/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg_volume.env new file mode 100644 index 0000000..43ac5b9 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg_volume.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vmtype_0_volume_name_0: name + vmtype_0_volume_type_0: SSD + vmtype_0_volume_name_0: 3 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg_volume.yaml b/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg_volume.yaml new file mode 100644 index 0000000..47f7424 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_pairs_provided/pass/good_yaml_eg_volume.yaml @@ -0,0 +1,66 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single independent volume instance + +parameters: + vmtype_0_volume_name_0: + type: string + description: Unique name for this volume instance + vmtype_0_volume_type_0: + type: string + description: Type for this volume instance + vmtype_0_cinder_volume_size_0: + type: string + description: Size in GB for this volume instance + +resources: + vmtype_0_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vmtype_0_cinder_volume_size_0 } + volume_type: { get_param: vmtype_0_volume_type_0 } + name: { get_param: vmtype_0_volume_name_0 } + +outputs: + vmtype_0_volume_id_0: + value: { get_resource: vmtype_0_volume_0} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_parameter_section/fail/parameter_default_value_specified.yaml b/ice_validator/tests/fixtures/test_heat_parameter_section/fail/parameter_default_value_specified.yaml new file mode 100644 index 0000000..d9b1c8b --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_parameter_section/fail/parameter_default_value_specified.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + a: + type: string + label: human-readable name of the parameter + description: description of the parameter + default: default value for parameter + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + immutable: true \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_parameter_section/fail/parameter_invalid_keys.yaml b/ice_validator/tests/fixtures/test_heat_parameter_section/fail/parameter_invalid_keys.yaml new file mode 100644 index 0000000..99d8531 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_parameter_section/fail/parameter_invalid_keys.yaml @@ -0,0 +1,54 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + a: + type: string + label: human-readable name of the parameter + description: description of the parameter + default: default value for parameter + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + immutable: true + dummy_key: "dummy_key" \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_parameter_section/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_heat_parameter_section/pass/valid_heat_template.yaml new file mode 100644 index 0000000..7f29136 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_parameter_section/pass/valid_heat_template.yaml @@ -0,0 +1,77 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + a: + type: string + label: human-readable name of the parameter + description: description of the parameter + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + immutable: true + b: + type: number + label: human-readable name of the parameter + description: description of the parameter + hidden: false + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 + immutable: false + c: + type: json + label: human-readable name of the parameter + description: description of the parameter + d: + type: comma_delimited_list + label: human-readable name of the parameter + description: description of the parameter + e: + type: boolean + label: human-readable name of the parameter + description: description of the parameter \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/fail/environment.yaml b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/fail/environment.yaml new file mode 100644 index 0000000..e7e2ac3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/fail/environment.yaml @@ -0,0 +1,60 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + KeyName: heat_key + InstanceType: m1.micro + ImageId: F18-x86_64-cfntools + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/fail/valid_heat_template.env b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/fail/valid_heat_template.env new file mode 100644 index 0000000..fceb0ff --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/fail/valid_heat_template.env @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2a \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/environment.env b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/environment.env new file mode 100644 index 0000000..e7e2ac3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/environment.env @@ -0,0 +1,60 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + KeyName: heat_key + InstanceType: m1.micro + ImageId: F18-x86_64-cfntools + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/valid_heat_template.yaml new file mode 100644 index 0000000..fceb0ff --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/valid_heat_template.yaml @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2a \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/valid_heat_template.yml b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/valid_heat_template.yml new file mode 100644 index 0000000..5d3cd17 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_and_env_file_extension/pass/valid_heat_template.yml @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/fail/template_missing_description.yaml b/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/fail/template_missing_description.yaml new file mode 100644 index 0000000..e8de8e3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/fail/template_missing_description.yaml @@ -0,0 +1,76 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + a: + type: string + label: human-readable name of the parameter + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + immutable: true + b: + type: number + label: human-readable name of the parameter + description: description of the parameter + hidden: false + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 + immutable: false + c: + type: json + label: human-readable name of the parameter + description: description of the parameter + d: + type: comma_delimited_list + label: human-readable name of the parameter + description: description of the parameter + e: + type: boolean + label: human-readable name of the parameter + description: description of the parameter \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/fail/template_missing_type.yaml b/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/fail/template_missing_type.yaml new file mode 100644 index 0000000..c547a59 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/fail/template_missing_type.yaml @@ -0,0 +1,76 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + a: + type: string + label: human-readable name of the parameter + description: description of the parameter + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + immutable: true + b: + type: number + label: human-readable name of the parameter + description: description of the parameter + hidden: false + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 + immutable: false + c: + label: human-readable name of the parameter + description: description of the parameter + d: + type: comma_delimited_list + label: human-readable name of the parameter + description: description of the parameter + e: + type: boolean + label: human-readable name of the parameter + description: description of the parameter \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/pass/valid_template.yaml b/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/pass/valid_template.yaml new file mode 100644 index 0000000..7f29136 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_parameters_contain_required_fields/pass/valid_template.yaml @@ -0,0 +1,77 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + a: + type: string + label: human-readable name of the parameter + description: description of the parameter + hidden: true + constraints: + - length: { min: 6, max: 8 } + description: User name must be between 6 and 8 characters + - allowed_pattern: "[A-Z]+[a-zA-Z0-9]*" + description: User name must start with an uppercase character + immutable: true + b: + type: number + label: human-readable name of the parameter + description: description of the parameter + hidden: false + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 + immutable: false + c: + type: json + label: human-readable name of the parameter + description: description of the parameter + d: + type: comma_delimited_list + label: human-readable name of the parameter + description: description of the parameter + e: + type: boolean + label: human-readable name of the parameter + description: description of the parameter \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_invalid_keys.yaml b/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_invalid_keys.yaml new file mode 100644 index 0000000..bf64f9a --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_invalid_keys.yaml @@ -0,0 +1,63 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + b: 1 + c: "example" + d: 100 + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge + +dummy_section: + dummy_section: "dummy_value" \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_invalid_keys.yml b/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_invalid_keys.yml new file mode 100644 index 0000000..bf64f9a --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_invalid_keys.yml @@ -0,0 +1,63 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + b: 1 + c: "example" + d: 100 + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge + +dummy_section: + dummy_section: "dummy_value" \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_no_valid_keys.yaml b/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_no_valid_keys.yaml new file mode 100644 index 0000000..74bf184 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_structure/fail/non_heat_template_no_valid_keys.yaml @@ -0,0 +1,43 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +b: 1 + c: "example" +d: 100 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template.yaml new file mode 100644 index 0000000..fceb0ff --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template.yaml @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2a \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template.yml b/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template.yml new file mode 100644 index 0000000..5d3cd17 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template.yml @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template_minimal_sections.yaml b/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template_minimal_sections.yaml new file mode 100644 index 0000000..260d284 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_template_structure/pass/valid_heat_template_minimal_sections.yaml @@ -0,0 +1,65 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_templates_provided/fail/base_template.env b/ice_validator/tests/fixtures/test_heat_templates_provided/fail/base_template.env new file mode 100644 index 0000000..fceb0ff --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_templates_provided/fail/base_template.env @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2a \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_templates_provided/fail/base_template.template b/ice_validator/tests/fixtures/test_heat_templates_provided/fail/base_template.template new file mode 100644 index 0000000..4c1fdcc --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_templates_provided/fail/base_template.template @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2a diff --git a/ice_validator/tests/fixtures/test_heat_templates_provided/pass/base_template.env b/ice_validator/tests/fixtures/test_heat_templates_provided/pass/base_template.env new file mode 100644 index 0000000..e7e2ac3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_templates_provided/pass/base_template.env @@ -0,0 +1,60 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + KeyName: heat_key + InstanceType: m1.micro + ImageId: F18-x86_64-cfntools + +parameter_defaults: + default_key: heat_key + +encrypted_parameters: + g: "" + +event_sinks: + - type: zaqar-queue + target: myqueue + ttl: 1200 + +parameter_merge_strategies: + default: merge + param1: overwrite + param2: deep_merge \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_heat_templates_provided/pass/base_template.yaml b/ice_validator/tests/fixtures/test_heat_templates_provided/pass/base_template.yaml new file mode 100644 index 0000000..fceb0ff --- /dev/null +++ b/ice_validator/tests/fixtures/test_heat_templates_provided/pass/base_template.yaml @@ -0,0 +1,114 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template to deploy a single compute instance + +parameter_groups: + - label: human-readable label of parameter group + description: description of the parameter group + parameters: + - pga + - pgb + +parameters: + b: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + c: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + d: + type: string + label: Key Name + description: Name of key-pair to be used for compute instance + +resources: + my_instance: + type: OS::Nova::Server + properties: + key_name: my_key + image: F18-x86_64-cfntools + flavor: m1.small + +outputs: + instance_ip: + description: The IP address of the deployed instance + value: { get_attr: [my_instance, first_address] } + +conditions: + cd1: True + cd2: + get_param: param1 + cd3: + equals: + - get_param: param2 + - yes + cd4: + not: + equals: + - get_param: param3 + - yes + cd5: + and: + - equals: + - get_param: env_type + - prod + - not: + equals: + - get_param: zone + - beijing + cd6: + or: + - equals: + - get_param: zone + - shanghai + - equals: + - get_param: zone + - beijing + cd7: + not: cd4 + cd8: + and: + - cd1 + - cd2a \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates/fail/heat_template_missing_nested_files.yaml b/ice_validator/tests/fixtures/test_nested_templates/fail/heat_template_missing_nested_files.yaml new file mode 100644 index 0000000..b65d6ac --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates/fail/heat_template_missing_nested_files.yaml @@ -0,0 +1,62 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +nested_template_description: base + +parameters: + vm_type_volume_name_0: + type: string + vm_type_volume_size_0: + type: number + +resources: + server_0: + type: nested_template_1.yaml + properties: + name: {get_param: server_name_0} + my_resource_group_1: + type: OS::Nova::Server + properties: + count: 5 + resource_def: { type: nested_template_2.yaml } + +outputs: + vm_type_volume_id_0: + value: {get_resource: vm_type_volume_0} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates/pass/nested_template_1.yaml b/ice_validator/tests/fixtures/test_nested_templates/pass/nested_template_1.yaml new file mode 100644 index 0000000..ef5a06e --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates/pass/nested_template_1.yaml @@ -0,0 +1,59 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +resources: + volume: + type: OS::Cinder::Volume + properties: + size: 1 + + volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_resource: volume } + instance_uuid: { get_resource: instance } + + instance: + type: OS::Nova::Server + properties: + image: myimage + flavor: m1.small \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates/pass/nested_template_2.yaml b/ice_validator/tests/fixtures/test_nested_templates/pass/nested_template_2.yaml new file mode 100644 index 0000000..ef5a06e --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates/pass/nested_template_2.yaml @@ -0,0 +1,59 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +resources: + volume: + type: OS::Cinder::Volume + properties: + size: 1 + + volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_resource: volume } + instance_uuid: { get_resource: instance } + + instance: + type: OS::Nova::Server + properties: + image: myimage + flavor: m1.small \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates/pass/valid_nested_heat_template.yaml b/ice_validator/tests/fixtures/test_nested_templates/pass/valid_nested_heat_template.yaml new file mode 100644 index 0000000..676437f --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates/pass/valid_nested_heat_template.yaml @@ -0,0 +1,50 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: nested_template_1.yaml + properties: + name: { get_param: server_name_0 } + my_resource_group_1: + type: OS::Heat::ResourceGroup + properties: + count: 5 + resource_def: { type: nested_template_2.yaml } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/fail/heat_template_invalid_nesting.yaml b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/fail/heat_template_invalid_nesting.yaml new file mode 100644 index 0000000..f1e47e0 --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/fail/heat_template_invalid_nesting.yaml @@ -0,0 +1,70 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +nested_template_description: base + +parameters: + vm_type_volume_name_0: + type: string + vm_type_volume_size_0: + type: number + +resources: + my_resource_group_1: + type: OS::Heat::ResourceGroup + properties: + count: 5 + resource_def: { nested_template_2.yaml } + + my_resource_group_2: + type: OS::Heat::ResourceGroup + properties: + count: 5 + resource_def: nested_template_2.yaml + + my_resource_group_3: + type: OS::Heat::ResourceGroup + properties: + count: 5 + resource_def: { type: nested_template_2 } + +outputs: + vm_type_volume_id_0: + value: {get_resource: vm_type_volume_0} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/nested_template_1.yaml b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/nested_template_1.yaml new file mode 100644 index 0000000..ef5a06e --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/nested_template_1.yaml @@ -0,0 +1,59 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +resources: + volume: + type: OS::Cinder::Volume + properties: + size: 1 + + volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_resource: volume } + instance_uuid: { get_resource: instance } + + instance: + type: OS::Nova::Server + properties: + image: myimage + flavor: m1.small \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/nested_template_2.yaml b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/nested_template_2.yaml new file mode 100644 index 0000000..ef5a06e --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/nested_template_2.yaml @@ -0,0 +1,59 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +resources: + volume: + type: OS::Cinder::Volume + properties: + size: 1 + + volume_attachment: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_resource: volume } + instance_uuid: { get_resource: instance } + + instance: + type: OS::Nova::Server + properties: + image: myimage + flavor: m1.small \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/valid_nested_heat_template.yaml b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/valid_nested_heat_template.yaml new file mode 100644 index 0000000..7782b56 --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/valid_nested_heat_template.yaml @@ -0,0 +1,62 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +description: base + +parameters: + vm_type_volume_name_0: + type: string + vm_type_volume_size_0: + type: number + +resources: + server_0: + type: nested_template_1.yaml + properties: + name: { get_param: server_name_0 } + my_resource_group_1: + type: OS::Heat::ResourceGroup + properties: + count: 5 + resource_def: { type: nested_template_2.yaml } + +outputs: + vm_type_volume_id_0: + value: {get_resource: vm_type_volume_0} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/valid_non_nested_template.yaml b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/valid_non_nested_template.yaml new file mode 100644 index 0000000..bc2e53d --- /dev/null +++ b/ice_validator/tests/fixtures/test_nested_templates_invalid_nesting/pass/valid_non_nested_template.yaml @@ -0,0 +1,69 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + max_count: + type: number + description: Max number of server groups + constraints: + - range: { min: 0, max: 20 } + description: max count must be between 0 and 20 + +resources: + multiple_server_groups: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: max_count } + resource_def: + type: OS::Nova::ServerGroup + properties: + name: + str_replace: + template: $VNF_NAME_resource_group + params: + $VNF_NAME: { get_param: vnf_name } + policies: ['anti-affinity'] diff --git a/ice_validator/tests/fixtures/test_network_format/fail/invalid_naming_used_for_internal_network_resource.yaml b/ice_validator/tests/fixtures/test_network_format/fail/invalid_naming_used_for_internal_network_resource.yaml new file mode 100644 index 0000000..26d0709 --- /dev/null +++ b/ice_validator/tests/fixtures/test_network_format/fail/invalid_naming_used_for_internal_network_resource.yaml @@ -0,0 +1,65 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + + vm_type_1_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + vm_type_1_extnet_net_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + vm_type_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + + vm_type_1_int_oam_1_port: + type: OS::Neutron::Port + properties: + network: { get_resource: int_oam_net } diff --git a/ice_validator/tests/fixtures/test_network_format/fail/invalid_naming_used_for_network.yaml b/ice_validator/tests/fixtures/test_network_format/fail/invalid_naming_used_for_network.yaml new file mode 100644 index 0000000..85bc86c --- /dev/null +++ b/ice_validator/tests/fixtures/test_network_format/fail/invalid_naming_used_for_network.yaml @@ -0,0 +1,60 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + + vm_type_1_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net } + + vm_type_1_extnet_net_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net } + + vm_type_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } diff --git a/ice_validator/tests/fixtures/test_network_format/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_network_format/pass/valid_heat_template.yaml new file mode 100644 index 0000000..422a979 --- /dev/null +++ b/ice_validator/tests/fixtures/test_network_format/pass/valid_heat_template.yaml @@ -0,0 +1,65 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + + vm_type_1_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + vm_type_1_extnet_net_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + vm_type_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + + vm_type_1_int_oam_1_port: + type: OS::Neutron::Port + properties: + network: { get_resource: int_oam_net_id } diff --git a/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/fail/get_param_not_used_for_network.yaml b/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/fail/get_param_not_used_for_network.yaml new file mode 100644 index 0000000..3673598 --- /dev/null +++ b/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/fail/get_param_not_used_for_network.yaml @@ -0,0 +1,76 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { int_intranet_net_name } + + vm_type_1_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + vm_type_1_external_net_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_name } + + vm_type_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + + int_network: + type: OS::Neutron::Net + properties: + name: + str_replace: + template: $PREFIX_int_network + params: + $PREFIX: { get_param: vnf_name } + admin_state_up: True + shared: False + + vm_type_0_int_network_0_port: + type: OS::Neutron::Port + properties: + network: { get_resource: int_network } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/fail/get_resource_used_for_external_network.yaml b/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/fail/get_resource_used_for_external_network.yaml new file mode 100644 index 0000000..cf34fce --- /dev/null +++ b/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/fail/get_resource_used_for_external_network.yaml @@ -0,0 +1,65 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + + vm_type_1_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + vm_type_1_external_net_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_name } + + vm_type_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + + vm_type_0_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_resource: extnet_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/pass/valid_heat_template.yaml new file mode 100644 index 0000000..bed976e --- /dev/null +++ b/ice_validator/tests/fixtures/test_network_format_use_get_param_or_get_resource/pass/valid_heat_template.yaml @@ -0,0 +1,76 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + + vm_type_1_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + vm_type_1_external_net_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_name } + + vm_type_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + + int_network: + type: OS::Neutron::Net + properties: + name: + str_replace: + template: $PREFIX_int_network + params: + $PREFIX: { get_param: vnf_name } + admin_state_up: True + shared: False + + vm_type_0_int_network_0_port: + type: OS::Neutron::Port + properties: + network: { get_resource: int_network } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/fail/unused_param.env b/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/fail/unused_param.env new file mode 100644 index 0000000..3a136c9 --- /dev/null +++ b/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/fail/unused_param.env @@ -0,0 +1,46 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + out: 2 + res: 3 + indexed: 4 + unused_env: 4 + indx: 1 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/fail/unused_param.yaml b/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/fail/unused_param.yaml new file mode 100644 index 0000000..421a699 --- /dev/null +++ b/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/fail/unused_param.yaml @@ -0,0 +1,67 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + out: + type: string + description: test for output + res: + type: string + description: test for resources + indexed: + type: comma_delimited_list + description: test for indexed param + indx: + type: number + description: Index of the current instance + unused_yaml: + type: number + description: unused param in yaml file +resources: + test: + type: abc + properties: + test_res: {get_param: res} + test_ind_param: { get_param: [ indexed, { get_param: indx } ] } + +outputs: + test_out: + description: test getting output param + value: {get_param: out} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/pass/no_unused_param.env b/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/pass/no_unused_param.env new file mode 100644 index 0000000..06a9821 --- /dev/null +++ b/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/pass/no_unused_param.env @@ -0,0 +1,45 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + out: 2 + res: 3 + indexed: 4 + indx: 1 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/pass/no_unused_param.yaml b/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/pass/no_unused_param.yaml new file mode 100644 index 0000000..953191b --- /dev/null +++ b/ice_validator/tests/fixtures/test_no_unused_parameters_between_env_and_templates/pass/no_unused_param.yaml @@ -0,0 +1,65 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + out: + type: string + description: test for output + res: + type: string + description: test for resources + indexed: + type: comma_delimited_list + description: test for indexed param + indx: + type: number + description: Index of the current instance + +resources: + test: + type: abc + properties: + test_res: {get_param: res} + test_ind_param: { get_param: [ indexed, { get_param: indx } ] } + +outputs: + test_out: + description: test getting output param + value: {get_param: out} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nova_servergroup_policies/fail/not_supported_policies.yml b/ice_validator/tests/fixtures/test_nova_servergroup_policies/fail/not_supported_policies.yml new file mode 100644 index 0000000..047673d --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servergroup_policies/fail/not_supported_policies.yml @@ -0,0 +1,76 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + db_server_group: + type: OS::Nova::ServerGroup + properties: + name: + str_replace: + params: + $vnf_name: {get_param: vnf_name} + template: $vnf_name-server_group1 + policies: + - OS Profile + lb_server_group: + type: OS::Nova::ServerGroup + properties: + name: + str_replace: + params: + $vnf_name: {get_param: vnf_name} + template: $vnf_name-server_group2 + policies: + - affinity + db_0: + type: OS::Nova::Server + properties: + scheduler_hints: + group: {get_param: db_server_group} + db_1: + type: OS::Nova::Server + properties: + scheduler_hints: + group: {get_param: db_server_group} + lb_0: + type: OS::Nova::Server + properties: + scheduler_hints: + group: {get_param: lb_server_group} diff --git a/ice_validator/tests/fixtures/test_nova_servergroup_policies/pass/with_supported_policies.yml b/ice_validator/tests/fixtures/test_nova_servergroup_policies/pass/with_supported_policies.yml new file mode 100644 index 0000000..5e50a1b --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servergroup_policies/pass/with_supported_policies.yml @@ -0,0 +1,76 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + db_server_group: + type: OS::Nova::ServerGroup + properties: + name: + str_replace: + params: + $vnf_name: {get_param: vnf_name} + template: $vnf_name-server_group1 + policies: + - anti-affinity + lb_server_group: + type: OS::Nova::ServerGroup + properties: + name: + str_replace: + params: + $vnf_name: {get_param: vnf_name} + template: $vnf_name-server_group2 + policies: + - affinity + db_0: + type: OS::Nova::Server + properties: + scheduler_hints: + group: {get_param: db_server_group} + db_1: + type: OS::Nova::Server + properties: + scheduler_hints: + group: {get_param: db_server_group} + lb_0: + type: OS::Nova::Server + properties: + scheduler_hints: + group: {get_param: lb_server_group} \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nova_servers_correct_parameter_types/fail/wrong_type_for_parameters.yaml b/ice_validator/tests/fixtures/test_nova_servers_correct_parameter_types/fail/wrong_type_for_parameters.yaml new file mode 100644 index 0000000..6bddeee --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_correct_parameter_types/fail/wrong_type_for_parameters.yaml @@ -0,0 +1,116 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template + +parameters: + + vnf_name: + type: string + description: Unique name for this VNF instance + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vm_type_a_names: + type: string + description: Names attribute for the VMs that are the my VNF + + vm_type_a_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + vm_type_a_image_name: + type: string + description: image to be used to create this vm must be one of the following flavors + + vm_type_b_name_0: + type: comma_delimited_list + description: Names attribute for the VMs that are the my VNF + + vm_type_b_name_1: + type: string + description: Names attribute for the VMs that are the my VNF + + vm_type_b_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + vm_type_b_image_name: + type: string + description: image to be used to create this vm must be one of the following flavors + +resources: + + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nova_servers_correct_parameter_types/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_nova_servers_correct_parameter_types/pass/valid_heat_template.yaml new file mode 100644 index 0000000..d51217c --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_correct_parameter_types/pass/valid_heat_template.yaml @@ -0,0 +1,102 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template + +parameters: + + vm_type_a_names: + type: comma_delimited_list + description: Names attribute for the VMs that are the my VNF + + vm_type_a_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + vm_type_a_image_name: + type: string + description: image to be used to create this vm must be one of the following flavors + + vm_type_b_name_0: + type: string + description: Names attribute for the VMs that are the my VNF + + vm_type_b_name_1: + type: string + description: Names attribute for the VMs that are the my VNF + + vm_type_b_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + vm_type_b_image_name: + type: string + description: image to be used to create this vm must be one of the following flavors + +resources: + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} diff --git a/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_key_properties.yaml b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_key_properties.yaml new file mode 100644 index 0000000..b8dfc76 --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_key_properties.yaml @@ -0,0 +1,68 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 2] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} diff --git a/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_key_properties_uppercase.yaml b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_key_properties_uppercase.yaml new file mode 100644 index 0000000..ecd9838 --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_key_properties_uppercase.yaml @@ -0,0 +1,68 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + VM_TYPE_B_SERVER_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 2] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} diff --git a/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_resource_id.yaml b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_resource_id.yaml new file mode 100644 index 0000000..c1c55be --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_resource_id.yaml @@ -0,0 +1,68 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_b_names, 1] } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} diff --git a/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_resource_id_uppercase.yaml b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_resource_id_uppercase.yaml new file mode 100644 index 0000000..d5f0cdc --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/fail/mismatch_vm_type_resource_id_uppercase.yaml @@ -0,0 +1,68 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + VM_TYPE_A_SERVER_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_b_names, 1] } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} diff --git a/ice_validator/tests/fixtures/test_nova_servers_resource_ids/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/pass/valid_heat_template.yaml new file mode 100644 index 0000000..0c1f8c0 --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_resource_ids/pass/valid_heat_template.yaml @@ -0,0 +1,68 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + VM_TYPE_B_SERVER_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} diff --git a/ice_validator/tests/fixtures/test_nova_servers_vm_types/fail/inconsistent_vm_type.yaml b/ice_validator/tests/fixtures/test_nova_servers_vm_types/fail/inconsistent_vm_type.yaml new file mode 100644 index 0000000..c8b6403 --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_vm_types/fail/inconsistent_vm_type.yaml @@ -0,0 +1,70 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a1_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a2_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nova_servers_vm_types/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_nova_servers_vm_types/pass/valid_heat_template.yaml new file mode 100644 index 0000000..8d3a0df --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_vm_types/pass/valid_heat_template.yaml @@ -0,0 +1,68 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} diff --git a/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/fail/missing_get_param.yaml b/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/fail/missing_get_param.yaml new file mode 100644 index 0000000..f3ec510 --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/fail/missing_get_param.yaml @@ -0,0 +1,70 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/fail/using_str_replace_instead_of_get_param.yaml b/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/fail/using_str_replace_instead_of_get_param.yaml new file mode 100644 index 0000000..773b28d --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/fail/using_str_replace_instead_of_get_param.yaml @@ -0,0 +1,69 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { str_replace: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} diff --git a/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/pass/valid_heat_template.yaml new file mode 100644 index 0000000..bb37559 --- /dev/null +++ b/ice_validator/tests/fixtures/test_nova_servers_vm_types_use_get_param/pass/valid_heat_template.yaml @@ -0,0 +1,102 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Simple template + +parameters: + + vm_type_a_names: + type: comma_delimited_list + description: Names attribute for the VMs that are the my VNF + + vm_type_a_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + vm_type_a_image_name: + type: string + description: image to be used to create this vm must be one of the following flavors + + vm_type_b_name_0: + type: string + description: Names attribute for the VMs that are the my VNF + + vm_type_b_name_1: + type: string + description: Names attribute for the VMs that are the my VNF + + vm_type_b_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + vm_type_b_image_name: + type: string + description: image to be used to create this vm must be one of the following flavors + +resources: + vm_type_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_a_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + + vm_type_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_0 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} + + vm_type_b_server_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_b_name_1 } + flavor: { get_param: vm_type_b_flavor_name} + image: { get_param: vm_type_b_image_name} diff --git a/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_less_indent_on_value.yaml b/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_less_indent_on_value.yaml new file mode 100644 index 0000000..59a58b4 --- /dev/null +++ b/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_less_indent_on_value.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 + e: + f: 3 + g: 4 + h: 3 + i: 4 + j: 3 + d: + c: 3 + lkf: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_multierror.yaml b/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_multierror.yaml new file mode 100644 index 0000000..4e0636e --- /dev/null +++ b/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_multierror.yaml @@ -0,0 +1,54 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 + e: + f: 3 + g: 4 + h: 3 + i: 4 + j: 3 + ddfg + c: 3 + lkf: + fhe: 5 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_tab.yaml b/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_tab.yaml new file mode 100644 index 0000000..b16ec7a --- /dev/null +++ b/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_tab.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 + e: + f: 3 + g: 4 + h: 3 + i: 4 + j: 3 + d: + c: 3 + lkf: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_value_and_keys.yaml b/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_value_and_keys.yaml new file mode 100644 index 0000000..85e350b --- /dev/null +++ b/ice_validator/tests/fixtures/test_parse_yaml/fail/bad_yaml_value_and_keys.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 + e: + f: 3 + g: 4 + h: 3 + i: 4 + j: 3 + d: + c: 3 + lkf: 4 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_parse_yaml/pass/good_yaml_eg.yaml b/ice_validator/tests/fixtures/test_parse_yaml/pass/good_yaml_eg.yaml new file mode 100644 index 0000000..8b5b820 --- /dev/null +++ b/ice_validator/tests/fixtures/test_parse_yaml/pass/good_yaml_eg.yaml @@ -0,0 +1,52 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- + a: 1 + b: + c: 3 + d: 4 + e: + f: 4 + g: + h: + test: test + k: g + + test: out \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_port_resource_ids/fail/mismatch_vm_type_port_id_get_resource.yaml b/ice_validator/tests/fixtures/test_port_resource_ids/fail/mismatch_vm_type_port_id_get_resource.yaml new file mode 100644 index 0000000..ac1b60c --- /dev/null +++ b/ice_validator/tests/fixtures/test_port_resource_ids/fail/mismatch_vm_type_port_id_get_resource.yaml @@ -0,0 +1,158 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_vpnnet_net_id: + type: string + description: network id for the internal network vpnnet + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + flavor: { get_param: admin_flavor_name} + networks: + - port: { get_resource: admin1_0_exnet_0_port } + - port: { get_resource: admin_0_int_vpnnet_0_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin1_0_exnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: exnet_net_name } + + admin_0_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + admin_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + admin_1_extnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_port_resource_ids/fail/wrong_port_attached_to_nova_server_get_resource.yaml b/ice_validator/tests/fixtures/test_port_resource_ids/fail/wrong_port_attached_to_nova_server_get_resource.yaml new file mode 100644 index 0000000..e944a35 --- /dev/null +++ b/ice_validator/tests/fixtures/test_port_resource_ids/fail/wrong_port_attached_to_nova_server_get_resource.yaml @@ -0,0 +1,158 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_vpnnet_net_id: + type: string + description: network id for the internal network vpnnet + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: admin_1_extnet_0_port } + - port: { get_resource: admin_1_extnet_1_port } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_0_exnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: exnet_net_name } + + admin_0_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + admin_1_extnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + admin_1_extnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_port_resource_ids/fail/wrong_port_attached_to_nova_server_get_resource_uppercase.yaml b/ice_validator/tests/fixtures/test_port_resource_ids/fail/wrong_port_attached_to_nova_server_get_resource_uppercase.yaml new file mode 100644 index 0000000..62a264e --- /dev/null +++ b/ice_validator/tests/fixtures/test_port_resource_ids/fail/wrong_port_attached_to_nova_server_get_resource_uppercase.yaml @@ -0,0 +1,158 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_vpnnet_net_id: + type: string + description: network id for the internal network vpnnet + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + networks: + - port: { get_resource: ADMIN_1_EXTNET_0_PORT } + - port: { get_resource: ADMIN_1_EXTNET_1_PORT } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_0_exnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: exnet_net_name } + + admin_0_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + ADMIN_1_EXTNET_0_PORT: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + ADMIN_1_EXTNET_1_PORT: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } \ No newline at end of file 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 new file mode 100644 index 0000000..dd5d768 --- /dev/null +++ b/ice_validator/tests/fixtures/test_port_resource_ids/pass/valid_template.yaml @@ -0,0 +1,158 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + db_names: + type: comma_delimited_list + description: Names attribute for the VMs + + lb_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + db_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + lb_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + exnet_net_name: + type: string + description: network name for the external network extnet + + exnet_net_id: + type: string + description: network id for the external network extnet + + int_vpnnet_net_id: + type: string + description: network id for the internal network vpnnet + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + 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 } + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [lb_names, 0] } + flavor: { get_param: lb_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_0_exnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: exnet_net_name } + + admin_0_int_vpnnet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + + ADMIN_1_EXTNET_0_PORT: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + + admin_1_extnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_definition_1.yaml b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_definition_1.yaml new file mode 100644 index 0000000..d5914ec --- /dev/null +++ b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_definition_1.yaml @@ -0,0 +1,139 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_id: + description: Unique ID for this VNF + type: string + vf_module_id: + description: Unique ID for this VF module + type: string + vnf_name: + type: string + description: Unique name for this VNF instance + ex_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + ex_vm_name: + type: string + description: Name of the VM + ex1_vm_names: + type: comma_delimited_list + description: Name of the VM + ex1_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex1_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex1_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + ex1_server_index: + type: number + label: server index + description: Index of server + constraint: + - range: { min: 1, max: 100 } + +resources: + ex_software_config_0: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + params: + $stack_name: { get_param: 'OS::stack_name' } + + ex_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: ex_vm_name } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex_image_name } + flavor: { get_param: ex_flavor_name } + key_name: { get_param: ex_key } + networks: + - network: { get_param: int_network_net_id } + user_data: + get_resource: ex_software_config_0 + + ex1_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, 0 ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } + + ex1_nova_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, { get_param: ex1_server_index } ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_definition_2.yaml b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_definition_2.yaml new file mode 100644 index 0000000..23d0bd5 --- /dev/null +++ b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_definition_2.yaml @@ -0,0 +1,132 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_id: + description: Unique ID for this VNF + type: string + vf_module_id: + description: Unique ID for this VF module + type: string + vnf_name: + type: string + description: Unique name for this VNF instance + ex_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + ex_vm_name: + type: string + description: Name of the VM + ex1_vm_names: + type: comma_delimited_list + description: Name of the VM + ex1_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex1_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex1_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + +resources: + ex_software_config_0: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + params: + $stack_name: { get_param: 'OS::stack_name' } + + ex_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: ex_vm_name } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex_image_name } + flavor: { get_param: ex_flavor_name } + key_name: { get_param: ex_key } + user_data: + get_resource: ex_software_config_0 + + ex1_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, 0 ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + metering.stack: { get_param: "OS::stack_id" } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } + + ex1_nova_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, { get_param: ex1_server_index } ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_reference.yaml b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_reference.yaml new file mode 100644 index 0000000..78632b8 --- /dev/null +++ b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/fail/missing_param_reference.yaml @@ -0,0 +1,134 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_id: + description: Unique ID for this VNF + type: string + vf_module_id: + description: Unique ID for this VF module + type: string + vnf_name: + type: string + description: Unique name for this VNF instance + ex_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + ex_vm_name: + type: string + description: Name of the VM + ex1_vm_names: + type: comma_delimited_list + description: Name of the VM + ex1_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex1_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex1_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + ex1_server_index: + type: number + label: server index + description: Index of server + constraint: + - range: { min: 1, max: 100 } + +resources: + ex_software_config_0: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + params: + $stack_name: { get_param: 'OS::stack_name' } + + ex_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: ex_vm_name } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex_image_name } + flavor: { get_param: ex_flavor_name } + key_name: { get_param: ex_key } + user_data: + get_resource: ex_software_config_0 + + ex1_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, 0 ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + project_id: { get_param: "OS::project_id" } + image: { get_param: ex1_image_name } + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } + + ex1_nova_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, { get_param: ex1_server_index } ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/pass/params_referenced_are_defined_and_vice_versa_1.yaml b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/pass/params_referenced_are_defined_and_vice_versa_1.yaml new file mode 100644 index 0000000..3080018 --- /dev/null +++ b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/pass/params_referenced_are_defined_and_vice_versa_1.yaml @@ -0,0 +1,139 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_id: + description: Unique ID for this VNF + type: string + vf_module_id: + description: Unique ID for this VF module + type: string + vnf_name: + type: string + description: Unique name for this VNF instance + ex_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + ex_vm_name: + type: string + description: Name of the VM + ex1_vm_names: + type: comma_delimited_list + description: Name of the VM + ex1_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex1_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex1_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + ex1_server_index: + type: number + label: server index + description: Index of server + constraint: + - range: { min: 1, max: 100 } + +resources: + ex_software_config_0: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + params: + $stack_name: { get_param: 'OS::stack_name' } + + ex_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: ex_vm_name } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + metering.stack: { get_param: "OS::stack_id" } + project_id: { get_param: "OS::project_id" } + image: { get_param: ex_image_name } + flavor: { get_param: ex_flavor_name } + key_name: { get_param: ex_key } + user_data: + get_resource: ex_software_config_0 + + ex1_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, 0 ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } + + ex1_nova_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, { get_param: ex1_server_index } ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/pass/params_referenced_are_defined_and_vice_versa_2.yaml b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/pass/params_referenced_are_defined_and_vice_versa_2.yaml new file mode 100644 index 0000000..46ea4cd --- /dev/null +++ b/ice_validator/tests/fixtures/test_referenced_and_defined_parameters_match/pass/params_referenced_are_defined_and_vice_versa_2.yaml @@ -0,0 +1,143 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance + +parameters: + vnf_id: + description: Unique ID for this VNF + type: string + vf_module_id: + description: Unique ID for this VF module + type: string + vnf_name: + type: string + description: Unique name for this VNF instance + ex_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + ex_vm_name: + type: string + description: Name of the VM + ex1_vm_names: + type: comma_delimited_list + description: Name of the VM + ex1_image_name: + type: string + label: Image name or ID + description: Image to be used for compute instance + ex1_flavor_name: + type: string + label: Flavor + description: Type of instance (flavor) to be used + ex1_key: + type: string + label: key pair + description: Name of the key apir the nova server will use + int_network_net_id: + type: string + label: Network name + description: Name of the network the nova server will connect to + ex1_server_index: + type: number + label: server index + description: Index of server + constraint: + - range: { min: 1, max: 100 } + +resources: + ex_software_config_0: + type: OS::Heat::SoftwareConfig + properties: + group: ungrouped + config: + params: + $stack_name: { get_param: 'OS::stack_name' } + + ex_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: ex_vm_name } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex_image_name } + flavor: { get_param: ex_flavor_name } + key_name: { get_param: ex_key } + networks: + - network: { get_param: int_network_net_id } + user_data: + get_resource: ex_software_config_0 + + ex1_nova_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, 0 ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } + + ex1_nova_server_1: + type: OS::Nova::Server + properties: + name: { get_param: [ ex1_vm_names, { get_param: ex1_server_index } ] } + metadata: + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } + image: { get_param: ex1_image_name} + flavor: { get_param: ex1_flavor_name } + key_name: { get_param: ex1_key } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_no_constraints/fail/heat_template_required_parameters_with_constraints.yaml b/ice_validator/tests/fixtures/test_required_parameters_no_constraints/fail/heat_template_required_parameters_with_constraints.yaml new file mode 100644 index 0000000..030dfdf --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_no_constraints/fail/heat_template_required_parameters_with_constraints.yaml @@ -0,0 +1,81 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 + vnf_id: + type: string + description: Unique ID for this VNF instance + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 + vf_module_name: + type: string + description: Unique name for this VNF Module instance + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 + vf_module_id: + type: string + description: Unique ID for this VNF Module instance + constraints: + - range: { min: 0, max: 10 } + description: allowed range of values + - allowed_values: + - 0 + - 5 + - 10 \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_no_constraints/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_required_parameters_no_constraints/pass/valid_heat_template.yaml new file mode 100644 index 0000000..c939a89 --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_no_constraints/pass/valid_heat_template.yaml @@ -0,0 +1,53 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + vf_module_name: + type: string + description: Unique name for this VNF Module instance + vf_module_id: + type: string + description: Unique ID for this VNF Module instance \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/fail/missing_required_parameters_in_env_file.env b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/fail/missing_required_parameters_in_env_file.env new file mode 100644 index 0000000..ab54063 --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/fail/missing_required_parameters_in_env_file.env @@ -0,0 +1,44 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: dummyvalue + vf_module_id: dummyvalue4 + external_net_id: dummyvalue \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/fail/missing_required_parameters_in_env_file.yaml b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/fail/missing_required_parameters_in_env_file.yaml new file mode 100644 index 0000000..275b820 --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/fail/missing_required_parameters_in_env_file.yaml @@ -0,0 +1,74 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + vf_module_id: + type: string + description: Unique ID for this VNF Module instance + external_net_id: + type: string + description: Unique name for this VNF instance +resources: + server_0: + type: OS::Nova::Server + properties: + name: { get_param: server_name_0 } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + server_1: + type: OS::Nova::Server + properties: + name: { get_param: server_name_1 } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + server_0_external_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified.env b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified.env new file mode 100644 index 0000000..116a359 --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified.env @@ -0,0 +1,45 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: dummyvalue + vnf_id: dummyvalue2 + vf_module_id: dummyvalue4 + external_net_id: dummyvalue \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified.yaml b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified.yaml new file mode 100644 index 0000000..275b820 --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified.yaml @@ -0,0 +1,74 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + vf_module_id: + type: string + description: Unique ID for this VNF Module instance + external_net_id: + type: string + description: Unique name for this VNF instance +resources: + server_0: + type: OS::Nova::Server + properties: + name: { get_param: server_name_0 } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + server_1: + type: OS::Nova::Server + properties: + name: { get_param: server_name_1 } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + server_0_external_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified_not_needed.env b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified_not_needed.env new file mode 100644 index 0000000..cbf5f64 --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified_not_needed.env @@ -0,0 +1,42 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + external_net_id: dummyvalue \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified_not_needed.yaml b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified_not_needed.yaml new file mode 100644 index 0000000..5ac62ae --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_env_files/pass/required_parameters_specified_not_needed.yaml @@ -0,0 +1,49 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + external_net_id: + type: string + description: Unique name for this VNF instance +resources: + server_0_external_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/fail/missing_required_parameters_in_template.yaml b/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/fail/missing_required_parameters_in_template.yaml new file mode 100644 index 0000000..1baef47 --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/fail/missing_required_parameters_in_template.yaml @@ -0,0 +1,73 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + vf_module_name: + type: string + description: Unique name for this VNF Module instance + external_net_id: + type: string + description: Unique name for this VNF instance +resources: + server_0: + type: OS::Nova::Server + properties: + name: { get_param: server_name_0 } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + server_1: + type: OS::Nova::Server + properties: + name: { get_param: server_name_1 } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + server_0_external_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/pass/required_parameters_specified.yaml b/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/pass/required_parameters_specified.yaml new file mode 100644 index 0000000..275b820 --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/pass/required_parameters_specified.yaml @@ -0,0 +1,74 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: Unique ID for this VNF instance + vf_module_id: + type: string + description: Unique ID for this VNF Module instance + external_net_id: + type: string + description: Unique name for this VNF instance +resources: + server_0: + type: OS::Nova::Server + properties: + name: { get_param: server_name_0 } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + server_1: + type: OS::Nova::Server + properties: + name: { get_param: server_name_1 } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + server_0_external_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/pass/required_parameters_specified_not_needed.yaml b/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/pass/required_parameters_specified_not_needed.yaml new file mode 100644 index 0000000..5ac62ae --- /dev/null +++ b/ice_validator/tests/fixtures/test_required_parameters_specified_in_heat_templates/pass/required_parameters_specified_not_needed.yaml @@ -0,0 +1,49 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +parameters: + external_net_id: + type: string + description: Unique name for this VNF instance +resources: + server_0_external_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: external_net_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_resource_ids_alphanumeric_only/fail/invalid_characters_in_resource_id_template.yml b/ice_validator/tests/fixtures/test_resource_ids_alphanumeric_only/fail/invalid_characters_in_resource_id_template.yml new file mode 100644 index 0000000..fc32cdf --- /dev/null +++ b/ice_validator/tests/fixtures/test_resource_ids_alphanumeric_only/fail/invalid_characters_in_resource_id_template.yml @@ -0,0 +1,67 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_volume_id_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_0 + params: + VNF_NAME: {get_param: vf_module_id } + "lb_volume_id::1": + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_1 + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + lb_volume_id-2: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_2 + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } diff --git a/ice_validator/tests/fixtures/test_resource_ids_alphanumeric_only/pass/valid_characters_in_resource_id_template.yml b/ice_validator/tests/fixtures/test_resource_ids_alphanumeric_only/pass/valid_characters_in_resource_id_template.yml new file mode 100644 index 0000000..d63a6a9 --- /dev/null +++ b/ice_validator/tests/fixtures/test_resource_ids_alphanumeric_only/pass/valid_characters_in_resource_id_template.yml @@ -0,0 +1,58 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_volume_id_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume+0 + params: + VNF_NAME: {get_param: vf_module_id } + lb_volume_id_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_1 + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } diff --git a/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_index.yaml b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_index.yaml new file mode 100644 index 0000000..fd3db32 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_index.yaml @@ -0,0 +1,104 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance - only one optional field and 2 servers + +parameters: + vf_module_id: + type: string + label: vf_module_id + description: Module ID for servers + vnf_id: + type: string + label: vnf_id + description: VNF ID for servers + vnf_name: + type: string + label: vnf_name + description: VNF name for servers + vm_role: + type: string + label: vf_role + description: Role of the server + example_server_name_0: + type: string + label: image + description: name for for server_0 + example_server_name_1: + type: string + label: image + description: name for for server_1 + example_server_image: + type: string + label: image + description: Glance image for server_0 + example_server_flavor: + type: string + label: flavor + description: Flavor for server_0 + +resources: + + example_server_0: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_0 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + + example_server_1: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_1 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + vf_module_index: { get_param: vf_module_index } diff --git a/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_name.yaml b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_name.yaml new file mode 100644 index 0000000..f4049e6 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_name.yaml @@ -0,0 +1,109 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance - only one optional field and 2 servers + +parameters: + vf_module_id: + type: string + label: vf_module_id + description: Module ID for servers + vnf_id: + type: string + label: vnf_id + description: VNF ID for servers + vnf_name: + type: string + label: vnf_name + description: VNF name for servers + vm_role: + type: string + label: vf_role + description: Role of the server + vf_module_index: + type: string + label: vf_role + description: Module index for the server + example_server_name_0: + type: string + label: image + description: name for for server_0 + example_server_name_1: + type: string + label: image + description: name for for server_1 + example_server_image: + type: string + label: image + description: Glance image for server_0 + example_server_flavor: + type: string + label: flavor + description: Flavor for server_0 + +resources: + + example_server_0: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_0 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + vf_module_name: { get_param: vf_module_name } + + example_server_1: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_1 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + vf_module_index: { get_param: vf_module_index } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_name_in_rsg.yaml b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_name_in_rsg.yaml new file mode 100644 index 0000000..6ecccc9 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/fail/template_missing_specified_vf_module_name_in_rsg.yaml @@ -0,0 +1,100 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance - only one optional field and 2 servers + +parameters: + vf_module_id: + type: string + label: vf_module_id + description: Module ID for servers + vnf_id: + type: string + label: vnf_id + description: VNF ID for servers + vnf_name: + type: string + label: vnf_name + description: VNF name for servers + vm_role: + type: string + label: vf_role + description: Role of the server + vf_module_index: + type: string + label: vf_role + description: Module index for the server + example_server_name_0: + type: string + label: image + description: name for for server_0 + example_server_name_1: + type: string + label: image + description: name for for server_1 + example_server_image: + type: string + label: image + description: Glance image for server_0 + example_server_flavor: + type: string + label: flavor + description: Flavor for server_0 + example_rsg__count_0: + type: number + constraints: + - range: { min: 0, max: 10 } + +resources: + + example_rsg_0: + type: OS::Heat::ResourceGroup + count: { get_param: example_rsg__count_0 } + resource_def: + type: OS::Nova::Server + properties: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + vf_module_name: { get_param: vf_module_name } + vf_module_index: { get_param: vf_module_index } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_1.yaml b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_1.yaml new file mode 100644 index 0000000..5a91f45 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_1.yaml @@ -0,0 +1,113 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance - only one optional field and 2 servers + +parameters: + vf_module_id: + type: string + label: vf_module_id + description: Module ID for servers + vnf_id: + type: string + label: vnf_id + description: VNF ID for servers + vnf_name: + type: string + label: vnf_name + description: VNF name for servers + vm_role: + type: string + label: vf_role + description: Role of the server + vf_module_name: + type: string + label: vf_role + description: Module name for the server + vf_module_index: + type: string + label: vf_role + description: Module index for the server + example_server_name_0: + type: string + label: image + description: name for for server_0 + example_server_name_1: + type: string + label: image + description: name for for server_1 + example_server_image: + type: string + label: image + description: Glance image for server_0 + example_server_flavor: + type: string + label: flavor + description: Flavor for server_0 + +resources: + + example_server_0: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_0 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + vf_module_name: { get_param: vf_module_name } + vf_module_index: { get_param: vf_module_index } + + example_server_1: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_1 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_2.yaml b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_2.yaml new file mode 100644 index 0000000..09005ed --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_2.yaml @@ -0,0 +1,108 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance - only one optional field and 2 servers + +parameters: + vf_module_id: + type: string + label: vf_module_id + description: Module ID for servers + vnf_id: + type: string + label: vnf_id + description: VNF ID for servers + vnf_name: + type: string + label: vnf_name + description: VNF name for servers + vm_role: + type: string + label: vf_role + description: Role of the server + vf_module_name: + type: string + label: vf_role + description: Module name for the server + example_server_name_0: + type: string + label: image + description: name for for server_0 + example_server_name_1: + type: string + label: image + description: name for for server_1 + example_server_image: + type: string + label: image + description: Glance image for server_0 + example_server_flavor: + type: string + label: flavor + description: Flavor for server_0 + +resources: + + example_server_0: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_0 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + vf_module_name: { get_param: vf_module_name } + + example_server_1: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_1 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_3.yaml b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_3.yaml new file mode 100644 index 0000000..41bfc06 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_3.yaml @@ -0,0 +1,104 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance - only one optional field and 2 servers + +parameters: + vf_module_id: + type: string + label: vf_module_id + description: Module ID for servers + vnf_id: + type: string + label: vnf_id + description: VNF ID for servers + vnf_name: + type: string + label: vnf_name + description: VNF name for servers + vf_module_name: + type: string + label: vf_role + description: Module name for the server + example_server_name_0: + type: string + label: image + description: name for for server_0 + example_server_name_1: + type: string + label: image + description: name for for server_1 + example_server_image: + type: string + label: image + description: Glance image for server_0 + example_server_flavor: + type: string + label: flavor + description: Flavor for server_0 + +resources: + + example_server_0: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_0 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + vf_module_name: { get_param: vf_module_name } + + example_server_1: + type: OS::Nova::Server + properties: + name: { get_param: example_server_name_1 } + image: { get_param: example_server_image } + flavor: { get_param: example_server_flavor } + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { 'example server' } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_4.yaml b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_4.yaml new file mode 100644 index 0000000..dd45592 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_optional_metadata/pass/valid_heat_template_4.yaml @@ -0,0 +1,104 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: Simple template to deploy a single compute instance - only one optional field and 2 servers + +parameters: + vf_module_id: + type: string + label: vf_module_id + description: Module ID for servers + vnf_id: + type: string + label: vnf_id + description: VNF ID for servers + vnf_name: + type: string + label: vnf_name + description: VNF name for servers + vm_role: + type: string + label: vf_role + description: Role of the server + vf_module_name: + type: string + label: vf_role + description: Module name for the server + vf_module_index: + type: string + label: vf_role + description: Module index for the server + example_server_name_0: + type: string + label: image + description: name for for server_0 + example_server_name_1: + type: string + label: image + description: name for for server_1 + example_server_image: + type: string + label: image + description: Glance image for server_0 + example_server_flavor: + type: string + label: flavor + description: Flavor for server_0 + example_rsg__count_0: + type: number + constraints: + - range: { min: 0, max: 10 } + +resources: + + example_rsg_0: + type: OS::Heat::ResourceGroup + count: { get_param: example_rsg__count_0 } + resource_def: + type: OS::Nova::Server + properties: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } + vm_role: { get_param: vm_role } + vf_module_name: { get_param: vf_module_name } + vf_module_index: { get_param: vf_module_index } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vf_module_id.yaml b/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vf_module_id.yaml new file mode 100644 index 0000000..f8433c9 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vf_module_id.yaml @@ -0,0 +1,48 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vnf_id.yaml b/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vnf_id.yaml new file mode 100644 index 0000000..012bf20 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vnf_id.yaml @@ -0,0 +1,48 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_name: { get_param: vnf_name } diff --git a/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vnf_name.yaml b/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vnf_name.yaml new file mode 100644 index 0000000..6a98246 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_required_metadata/fail/missing_vnf_name.yaml @@ -0,0 +1,48 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } diff --git a/ice_validator/tests/fixtures/test_servers_have_required_metadata/pass/has_required_metadata.yaml b/ice_validator/tests/fixtures/test_servers_have_required_metadata/pass/has_required_metadata.yaml new file mode 100644 index 0000000..4351101 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_have_required_metadata/pass/has_required_metadata.yaml @@ -0,0 +1,49 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } diff --git a/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/missing_metadata_section.yaml b/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/missing_metadata_section.yaml new file mode 100644 index 0000000..8f44729 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/missing_metadata_section.yaml @@ -0,0 +1,45 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} diff --git a/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/missing_properties_section.yaml b/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/missing_properties_section.yaml new file mode 100644 index 0000000..d43b745 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/missing_properties_section.yaml @@ -0,0 +1,43 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: OS::Nova::Server diff --git a/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/not_using_get_param.yaml b/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/not_using_get_param.yaml new file mode 100644 index 0000000..8301db6 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/fail/not_using_get_param.yaml @@ -0,0 +1,52 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vf_module_id: + - vf_module_id + vnf_id: + - vnf_id + vnf_name: + - vnf_name diff --git a/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/pass/has_required_metadata.yaml b/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/pass/has_required_metadata.yaml new file mode 100644 index 0000000..4351101 --- /dev/null +++ b/ice_validator/tests/fixtures/test_servers_metadata_use_get_param/pass/has_required_metadata.yaml @@ -0,0 +1,49 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + server_0: + type: OS::Nova::Server + properties: + name: {get_param: server_name_0} + metadata: + vf_module_id: { get_param: vf_module_id } + vnf_id: { get_param: vnf_id } + vnf_name: { get_param: vnf_name } diff --git a/ice_validator/tests/fixtures/test_subnet_format/fail/invalid_naming_used_for_get_param_subnet.yaml b/ice_validator/tests/fixtures/test_subnet_format/fail/invalid_naming_used_for_get_param_subnet.yaml new file mode 100644 index 0000000..4254287 --- /dev/null +++ b/ice_validator/tests/fixtures/test_subnet_format/fail/invalid_naming_used_for_get_param_subnet.yaml @@ -0,0 +1,86 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - subnet_id: { get_param: int_intranet_subnet_id } + - subnet_id: { get_param: int_intranet_v6_subnet_id } + + vm_type_1_int_vpnnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_param: int_vpnnet_subnet_id } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet1_subnet_id } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } + + vm_type_1_extnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + diff --git a/ice_validator/tests/fixtures/test_subnet_format/fail/invalid_naming_used_for_get_resource_subnet.yaml b/ice_validator/tests/fixtures/test_subnet_format/fail/invalid_naming_used_for_get_resource_subnet.yaml new file mode 100644 index 0000000..1af8d52 --- /dev/null +++ b/ice_validator/tests/fixtures/test_subnet_format/fail/invalid_naming_used_for_get_resource_subnet.yaml @@ -0,0 +1,86 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - subnet_id: { get_param: int_intranet_subnet_id } + - subnet_id: { get_param: int_intranet_v6_subnet_id } + + vm_type_1_int_vpnnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_param: int_vpnnet_subnet_id } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet1_subnet_id } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet1_subnet_id } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } + + vm_type_1_extnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + diff --git a/ice_validator/tests/fixtures/test_subnet_format/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_subnet_format/pass/valid_heat_template.yaml new file mode 100644 index 0000000..76f92e6 --- /dev/null +++ b/ice_validator/tests/fixtures/test_subnet_format/pass/valid_heat_template.yaml @@ -0,0 +1,86 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - subnet_id: { get_param: int_intranet_subnet_id } + - subnet_id: { get_param: int_intranet_v6_subnet_id } + + vm_type_1_int_vpnnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_param: int_vpnnet_subnet_id } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } + + vm_type_1_extnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + diff --git a/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/fail/get_param_not_used_for_subnet.yaml b/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/fail/get_param_not_used_for_subnet.yaml new file mode 100644 index 0000000..353fbe9 --- /dev/null +++ b/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/fail/get_param_not_used_for_subnet.yaml @@ -0,0 +1,86 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - subnet_id: { get_param: int_intranet_subnet_id } + - subnet_id: { get_param: int_intranet_v6_subnet_id } + + vm_type_1_int_vpnnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_param1: int_vpnnet_subnet_id } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { int_vpnnet_subnet_id } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } + + vm_type_1_extnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + diff --git a/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/fail/get_resource_used_for_external_network.yaml b/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/fail/get_resource_used_for_external_network.yaml new file mode 100644 index 0000000..4338edc --- /dev/null +++ b/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/fail/get_resource_used_for_external_network.yaml @@ -0,0 +1,86 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - subnet_id: { get_param: int_intranet_subnet_id } + - subnet_id: { get_param: int_intranet_v6_subnet_id } + + vm_type_1_int_vpnnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_param: int_vpnnet_subnet_id } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_resource: extnet_v6_subnet_id } + + vm_type_1_extnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + diff --git a/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/pass/valid_heat_template.yaml b/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/pass/valid_heat_template.yaml new file mode 100644 index 0000000..76f92e6 --- /dev/null +++ b/ice_validator/tests/fixtures/test_subnet_format_use_get_param_or_get_resource/pass/valid_heat_template.yaml @@ -0,0 +1,86 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_1_int_intranet_0_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_intranet_net_name } + fixed_ips: + - subnet_id: { get_param: int_intranet_subnet_id } + - subnet_id: { get_param: int_intranet_v6_subnet_id } + + vm_type_1_int_vpnnet_1_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_param: int_vpnnet_subnet_id } + + vm_type_1_int_vpnnet_2_port: + type: OS::Neutron::Port + properties: + network: { get_param: int_vpnnet_net_id } + fixed_ips: + - ip_address: { get_param: [db_1_int_vpnnet_ips, 0] } + - subnet_id: { get_resource: int_vpnnet_subnet_id } + + vm_type_1_extnet_net_3_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_name } + fixed_ips: + - ip_address: { get_param: lb_1_extnet_ip_0 } + - subnet_id: { get_param: extnet_subnet_id } + + vm_type_1_extnet_4_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + fixed_ips: + - subnet_id: { get_param: extnet_subnet_id } + - subnet_id: { get_param: extnet_v6_subnet_id } + + vm_type_1_extnet_5_port: + type: OS::Neutron::Port + properties: + network: { get_param: extnet_net_id } + diff --git a/ice_validator/tests/fixtures/test_unique_name_resources/fail/heat_template_1.yaml b/ice_validator/tests/fixtures/test_unique_name_resources/fail/heat_template_1.yaml new file mode 100644 index 0000000..a65c45b --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_name_resources/fail/heat_template_1.yaml @@ -0,0 +1,108 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, { get_param: lb_server_index }] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: MODULE_ID_STACK_NAME_oam_volume + params: + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_MODULE_ID_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + + my_keypair: + type: OS::Nova::Keypair + properties: + name: + str_replace: + template: VNF_NAME_key_pair + params: + VNF_NAME: { get_param: vnf_name } + public_key: {get_param: ssh_public_key} + save_private_key: false diff --git a/ice_validator/tests/fixtures/test_unique_name_resources/fail/heat_template_2_identical_to_heat_template_2.yaml b/ice_validator/tests/fixtures/test_unique_name_resources/fail/heat_template_2_identical_to_heat_template_2.yaml new file mode 100644 index 0000000..a65c45b --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_name_resources/fail/heat_template_2_identical_to_heat_template_2.yaml @@ -0,0 +1,108 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, { get_param: lb_server_index }] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: MODULE_ID_STACK_NAME_oam_volume + params: + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_MODULE_ID_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + + my_keypair: + type: OS::Nova::Keypair + properties: + name: + str_replace: + template: VNF_NAME_key_pair + params: + VNF_NAME: { get_param: vnf_name } + public_key: {get_param: ssh_public_key} + save_private_key: false diff --git a/ice_validator/tests/fixtures/test_unique_name_resources/pass/unique_resource_template_1.yml b/ice_validator/tests/fixtures/test_unique_name_resources/pass/unique_resource_template_1.yml new file mode 100644 index 0000000..a65c45b --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_name_resources/pass/unique_resource_template_1.yml @@ -0,0 +1,108 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, { get_param: lb_server_index }] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: MODULE_ID_STACK_NAME_oam_volume + params: + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_MODULE_ID_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + + my_keypair: + type: OS::Nova::Keypair + properties: + name: + str_replace: + template: VNF_NAME_key_pair + params: + VNF_NAME: { get_param: vnf_name } + public_key: {get_param: ssh_public_key} + save_private_key: false diff --git a/ice_validator/tests/fixtures/test_unique_name_resources/pass/unique_resource_template_2.yml b/ice_validator/tests/fixtures/test_unique_name_resources/pass/unique_resource_template_2.yml new file mode 100644 index 0000000..253d861 --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_name_resources/pass/unique_resource_template_2.yml @@ -0,0 +1,108 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, 1] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_server_4: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, { get_param: lb_server_index }] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + lb_volume_2: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + + lb_volume_3: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: MODULE_ID_STACK_NAME_oam_volume + params: + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + + lb_volume_2: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_MODULE_ID_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + + my_keypair: + type: OS::Nova::Keypair + properties: + name: + str_replace: + template: VNF_NAME_key_pair + params: + VNF_NAME: { get_param: vnf_name } + public_key: {get_param: ssh_public_key} + save_private_key: false diff --git a/ice_validator/tests/fixtures/test_unique_name_str_replace_use_params_in_tmpl/fail/unique_resource_stack_name_without_vnf_name_or_module.yml b/ice_validator/tests/fixtures/test_unique_name_str_replace_use_params_in_tmpl/fail/unique_resource_stack_name_without_vnf_name_or_module.yml new file mode 100644 index 0000000..fb38c95 --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_name_str_replace_use_params_in_tmpl/fail/unique_resource_stack_name_without_vnf_name_or_module.yml @@ -0,0 +1,89 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: MODULE_ID_STACK_NAME_oam_volume + params: + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_MODULE_ID_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + MODULE_ID: { get_param: vnf_module_id } + my_keypair: + type: OS::Nova::Keypair + properties: + name: + str_replace: + template: VNF_NAME_key_pair + params: + MODULE_ID: { get_param: vnf_module_id } + public_key: {get_param: ssh_public_key} + save_private_key: false \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_unique_name_str_replace_use_params_in_tmpl/pass/unique_resource_template.yml b/ice_validator/tests/fixtures/test_unique_name_str_replace_use_params_in_tmpl/pass/unique_resource_template.yml new file mode 100644 index 0000000..936e85d --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_name_str_replace_use_params_in_tmpl/pass/unique_resource_template.yml @@ -0,0 +1,91 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: MODULE_ID_STACK_NAME_oam_volume + params: + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_MODULE_ID_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vnf_module_id } + my_keypair: + type: OS::Nova::Keypair + properties: + name: + str_replace: + template: VNF_NAME_key_pair + params: + VNF_NAME: { get_param: vnf_name } + public_key: {get_param: ssh_public_key} + save_private_key: false diff --git a/ice_validator/tests/fixtures/test_unique_name_str_replace_use_req_params/fail/unique_resource_stack_name_without_vnf_name_or_module.yml b/ice_validator/tests/fixtures/test_unique_name_str_replace_use_req_params/fail/unique_resource_stack_name_without_vnf_name_or_module.yml new file mode 100644 index 0000000..a3af653 --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_name_str_replace_use_req_params/fail/unique_resource_stack_name_without_vnf_name_or_module.yml @@ -0,0 +1,71 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + STACK_NAME: { get_param: 'OS::stack_name' } + my_keypair: + type: OS::Nova::Keypair + properties: + name: + str_replace: + template: VNF_NAME_key_pair + params: + VNF_NAME: { get_param: vnf_name } + public_key: {get_param: ssh_public_key} + save_private_key: false diff --git a/ice_validator/tests/fixtures/test_unique_name_str_replace_use_req_params/pass/unique_resource_template.yml b/ice_validator/tests/fixtures/test_unique_name_str_replace_use_req_params/pass/unique_resource_template.yml new file mode 100644 index 0000000..0a70283 --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_name_str_replace_use_req_params/pass/unique_resource_template.yml @@ -0,0 +1,91 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [vm_type_a_names, 0] } + flavor: { get_param: vm_type_a_flavor_name} + image: { get_param: vm_type_a_image_name} + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : vm_type_a_cinder_volume_id_0 }, delete_on_termination : "false" }] + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + lb_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vf_module_id } + lb_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: { get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } + MODULE_ID: { get_param: vf_module_id } + my_keypair: + type: OS::Nova::Keypair + properties: + name: + str_replace: + template: VNF_NAME_key_pair + params: + VNF_NAME: { get_param: vnf_name } + public_key: {get_param: ssh_public_key} + save_private_key: false diff --git a/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/fail/duplicate_resource_template.yml b/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/fail/duplicate_resource_template.yml new file mode 100644 index 0000000..5ac2dc2 --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/fail/duplicate_resource_template.yml @@ -0,0 +1,58 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_volume_id_2: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_2 + params: + VNF_NAME: {get_param: vf_module_id } + lb_volume_id_4: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_4 + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } diff --git a/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/fail/unique_resource_template.yml b/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/fail/unique_resource_template.yml new file mode 100644 index 0000000..3ef1600 --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/fail/unique_resource_template.yml @@ -0,0 +1,58 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_volume_id_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_1 + params: + VNF_NAME: {get_param: vf_module_id } + lb_volume_id_2: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_2 + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } diff --git a/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/pass/unique_resource_template_1.yml b/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/pass/unique_resource_template_1.yml new file mode 100644 index 0000000..3ef1600 --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/pass/unique_resource_template_1.yml @@ -0,0 +1,58 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_volume_id_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_1 + params: + VNF_NAME: {get_param: vf_module_id } + lb_volume_id_2: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_2 + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } diff --git a/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/pass/unique_resource_template_2.yml b/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/pass/unique_resource_template_2.yml new file mode 100644 index 0000000..fc68cba --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_resources_across_all_templates/pass/unique_resource_template_2.yml @@ -0,0 +1,58 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + lb_volume_id_3: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_3 + params: + VNF_NAME: {get_param: vf_module_id } + lb_volume_id_4: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume_4 + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } diff --git a/ice_validator/tests/fixtures/test_unique_resources_across_template/fail/duplicate_resource_template.yml b/ice_validator/tests/fixtures/test_unique_resources_across_template/fail/duplicate_resource_template.yml new file mode 100644 index 0000000..16997d5 --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_resources_across_template/fail/duplicate_resource_template.yml @@ -0,0 +1,58 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: {get_param: vnf_module_id } + volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } diff --git a/ice_validator/tests/fixtures/test_unique_resources_across_template/pass/unique_resource_template.yml b/ice_validator/tests/fixtures/test_unique_resources_across_template/pass/unique_resource_template.yml new file mode 100644 index 0000000..4279b1c --- /dev/null +++ b/ice_validator/tests/fixtures/test_unique_resources_across_template/pass/unique_resource_template.yml @@ -0,0 +1,58 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: {get_param: vnf_module_id } + volume_2: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VF_NAME_STACK_NAME_oam_volume + params: + VNF_NAME: {get_param: vnf_name } + STACK_NAME: { get_param: 'OS::stack_name' } diff --git a/ice_validator/tests/fixtures/test_volume_format_outputs/fail/no_value_volume.yaml b/ice_validator/tests/fixtures/test_volume_format_outputs/fail/no_value_volume.yaml new file mode 100644 index 0000000..b630778 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_format_outputs/fail/no_value_volume.yaml @@ -0,0 +1,69 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_volume_id_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_id_0 } + + vm_type_volume_id_1: + resource: { get_resource: vm_type_volume_id_1 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RSG, refs] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_format_outputs/fail/use_get_param_volume.yml b/ice_validator/tests/fixtures/test_volume_format_outputs/fail/use_get_param_volume.yml new file mode 100644 index 0000000..2766dda --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_format_outputs/fail/use_get_param_volume.yml @@ -0,0 +1,61 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_volume_id_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_param: vm_type_volume_id_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_id_1 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RSG, refs] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_format_outputs/pass/valid_template_volume.yml b/ice_validator/tests/fixtures/test_volume_format_outputs/pass/valid_template_volume.yml new file mode 100644 index 0000000..97c6ab6 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_format_outputs/pass/valid_template_volume.yml @@ -0,0 +1,70 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_1 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RSG, refs] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_outputs_consumed/fail/more_outputs_than_parameters.yaml b/ice_validator/tests/fixtures/test_volume_outputs_consumed/fail/more_outputs_than_parameters.yaml new file mode 100644 index 0000000..1057cb3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_outputs_consumed/fail/more_outputs_than_parameters.yaml @@ -0,0 +1,111 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_boot_volume_id_0: + type: string + description: reference to externally created cinder vol + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin_boot_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_boot_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_boot_volume_id_2 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_outputs_consumed/fail/more_outputs_than_parameters_volume.yaml b/ice_validator/tests/fixtures/test_volume_outputs_consumed/fail/more_outputs_than_parameters_volume.yaml new file mode 100644 index 0000000..3ff6c48 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_outputs_consumed/fail/more_outputs_than_parameters_volume.yaml @@ -0,0 +1,99 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Volume template description + +parameters: + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_image_name: + type: string + description: Image used to initialize the admin instance's bootable cinder_volume + + admin_boot_volume_size_0: + type: number + description: Size 0 of Cinder Volume to be built + constraints: + - range: { min: 0, max: 5000} + + admin_boot_volume_size_1: + type: number + description: Size 1 of Cinder Volume to be built + constraints: + - range: { min: 0, max: 10000} + +resources: + + admin_boot_data_volume_0: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_admin_boot_volume_0 + params: + "VNF_NAME": { get_param: vnf_name } + size: { get_param: admin_boot_volume_size_0 } + image: { get_param: admin_image_name } + + admin_boot_data_volume_1: + type: OS::Cinder::Volume + properties: + name: + str_replace: + template: VNF_NAME_admin_boot_volume_1 + params: + "VNF_NAME": { get_param: vnf_name } + size: { get_param: admin_boot_volume_size_1 } + image: { get_param: admin_image_name } + +outputs: + + admin_boot_volume_id_0: + description: Cinder volume 0 + value: { get_resource: admin_boot_data_volume_0 } + + admin_boot_volume_id_1: + description: Cinder volume 1 + value: { get_resource: admin_boot_data_volume_1 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_outputs_consumed/pass/valid_template.yaml b/ice_validator/tests/fixtures/test_volume_outputs_consumed/pass/valid_template.yaml new file mode 100644 index 0000000..efdb26a --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_outputs_consumed/pass/valid_template.yaml @@ -0,0 +1,103 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_boot_volume_id_0: + type: string + description: reference to externally created cinder vol + + admin_boot_volume_id_1: + type: string + description: reference to externally created cinder vol + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin_boot_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_boot_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_outputs_consumed/pass/valid_template_volume.yaml b/ice_validator/tests/fixtures/test_volume_outputs_consumed/pass/valid_template_volume.yaml new file mode 100644 index 0000000..7a4e40d --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_outputs_consumed/pass/valid_template_volume.yaml @@ -0,0 +1,81 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2013-05-23 + +description: > + A template showing how to create a Nova instance, a Cinder volume and attach + the volume to the instance. The template uses only Heat OpenStack native + resource types. + +parameters: + + availability_zone: + type: string + description: The Availability Zone to launch the instance. + + admin_boot_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + admin_boot_volume_id_0: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_boot_volume_size_0} + availability_zone: { get_param: availability_zone } + + admin_boot_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_boot_volume_size_0} + availability_zone: { get_param: availability_zone } + +outputs: + + admin_boot_volume_id_0: + value: { get_resource: admin_boot_volume_id_0 } + + admin_boot_volume_id_1: + value: { get_resource: admin_boot_volume_id_1 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_instance_uuid_volume_attachment.yaml b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_instance_uuid_volume_attachment.yaml new file mode 100644 index 0000000..2b78e58 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_instance_uuid_volume_attachment.yaml @@ -0,0 +1,150 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_volume_id_0: + type: string + description: reference to externally created cinder vol + + admin_volume_id_1: + type: string + description: reference to externally created cinder vol + + admin_volume_id_2: + type: string + description: reference to externally created cinder vol + + admin_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 3] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_resource : admin_volume_id_3 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_volume_id_3: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_volume_size_0} + availability_zone: { get_param: availability_zone_0 } + + admin_volume_attachment_0: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: admin_volume_id_2 } + mountpoint: /dev/vdb + instance_uuid: { get_resource: admin2_server_2 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_nova_server_id.yaml b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_nova_server_id.yaml new file mode 100644 index 0000000..76aa95e --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_nova_server_id.yaml @@ -0,0 +1,150 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_volume_id_0: + type: string + description: reference to externally created cinder vol + + admin_volume_id_1: + type: string + description: reference to externally created cinder vol + + admin_volume_id_2: + type: string + description: reference to externally created cinder vol + + admin_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin2_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin2_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 3] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_resource : admin_volume_id_3 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_volume_id_3: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_volume_size_0} + availability_zone: { get_param: availability_zone_0 } + + admin_volume_attachment_0: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: admin_volume_id_2 } + mountpoint: /dev/vdb + instance_uuid: { get_resource: admin_server_2 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_param.yaml b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_param.yaml new file mode 100644 index 0000000..b0ff140 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_param.yaml @@ -0,0 +1,150 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_volume_id_0: + type: string + description: reference to externally created cinder vol + + admin_volume_id_1: + type: string + description: reference to externally created cinder vol + + admin_volume_id_2: + type: string + description: reference to externally created cinder vol + + admin_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin2_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 3] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_resource : admin_volume_id_3 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_volume_id_3: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_volume_size_0} + availability_zone: { get_param: availability_zone_0 } + + admin_volume_attachment_0: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: admin_volume_id_2 } + mountpoint: /dev/vdb + instance_uuid: { get_resource: admin_server_2 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_resource.yaml b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_resource.yaml new file mode 100644 index 0000000..88fc6e2 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_resource.yaml @@ -0,0 +1,150 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_volume_id_0: + type: string + description: reference to externally created cinder vol + + admin_volume_id_1: + type: string + description: reference to externally created cinder vol + + admin_volume_id_2: + type: string + description: reference to externally created cinder vol + + admin_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 3] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_resource : admin2_volume_id_3 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_volume_id_3: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_volume_size_0} + availability_zone: { get_param: availability_zone_0 } + + admin_volume_attachment_0: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: admin_volume_id_2 } + mountpoint: /dev/vdb + instance_uuid: { get_resource: admin_server_2 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_volume_attachment.yaml b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_volume_attachment.yaml new file mode 100644 index 0000000..b07b2c1 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_volume_attachment.yaml @@ -0,0 +1,150 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_volume_id_0: + type: string + description: reference to externally created cinder vol + + admin_volume_id_1: + type: string + description: reference to externally created cinder vol + + admin_volume_id_2: + type: string + description: reference to externally created cinder vol + + admin_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 3] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_resource : admin_volume_id_3 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_volume_id_3: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_volume_size_0} + availability_zone: { get_param: availability_zone_0 } + + admin_volume_attachment_0: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: admin2_volume_id_2 } + mountpoint: /dev/vdb + instance_uuid: { get_resource: admin_server_2 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_volume_attachment_uppercase.yaml b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_volume_attachment_uppercase.yaml new file mode 100644 index 0000000..53e76b9 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_resource_ids/fail/mismatch_vm_type_volume_id_volume_attachment_uppercase.yaml @@ -0,0 +1,150 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_volume_id_0: + type: string + description: reference to externally created cinder vol + + admin_volume_id_1: + type: string + description: reference to externally created cinder vol + + admin_volume_id_2: + type: string + description: reference to externally created cinder vol + + admin_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 3] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_resource : admin_volume_id_3 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_volume_id_3: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_volume_size_0} + availability_zone: { get_param: availability_zone_0 } + + admin_volume_attachment_0: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: admin2_volume_id_2 } + mountpoint: /dev/vdb + instance_uuid: { get_resource: ADMIN_SERVER_2 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_resource_ids/pass/valid_template.yaml b/ice_validator/tests/fixtures/test_volume_resource_ids/pass/valid_template.yaml new file mode 100644 index 0000000..bd18829 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_resource_ids/pass/valid_template.yaml @@ -0,0 +1,150 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +heat_template_version: 2015-04-30 + +description: Heat template description + +parameters: + + vnf_id: + type: string + description: Unique ID for this VNF instance + + vf_module_id: + type: string + description: Unique ID for this VF module + + vnf_name: + type: string + description: Unique name for this VNF instance + + admin_names: + type: comma_delimited_list + description: Names attribute for the VMs + + availability_zone_0: + type: string + description: availability zone to be used + + admin_flavor_name: + type: string + description: flavor to be used to create this vm must be one of the following flavors + + admin_volume_id_0: + type: string + description: reference to externally created cinder vol + + admin_volume_id_1: + type: string + description: reference to externally created cinder vol + + admin_volume_id_2: + type: string + description: reference to externally created cinder vol + + admin_volume_size_0: + type: number + description: Size of the volume to be created. + constraints: + - range: { min: 1, max: 1024 } + description: must be between 1 and 1024 Gb. + +resources: + + admin_server_0: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 0] } + block_device_mapping: [{ device_name: "vda", volume_id: { get_param : admin_volume_id_0 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_1: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 1] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_param : admin_volume_id_1 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + ADMIN_SERVER_2: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 2] } + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_server_3: + type: OS::Nova::Server + properties: + availability_zone: { get_param: availability_zone_0 } + name: { get_param: [admin_names, 3] } + block_device_mapping: [{ device_name: "vda", volume_id : { get_resource : admin_volume_id_3 }, delete_on_termination : "false" }] + flavor: { get_param: admin_flavor_name} + metadata: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vf_module_id: { get_param: vf_module_id } + + admin_volume_id_3: + type: OS::Cinder::Volume + properties: + size: { get_param: admin_volume_size_0} + availability_zone: { get_param: availability_zone_0 } + + admin_volume_attachment_0: + type: OS::Cinder::VolumeAttachment + properties: + volume_id: { get_param: admin_volume_id_2 } + mountpoint: /dev/vdb + instance_uuid: { get_resource: ADMIN_SERVER_2 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates/fail/badly_named_volume_1.yaml b/ice_validator/tests/fixtures/test_volume_templates/fail/badly_named_volume_1.yaml new file mode 100644 index 0000000..946c646 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates/fail/badly_named_volume_1.yaml @@ -0,0 +1,59 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates/fail/missing_keyword.yaml b/ice_validator/tests/fixtures/test_volume_templates/fail/missing_keyword.yaml new file mode 100644 index 0000000..946c646 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates/fail/missing_keyword.yaml @@ -0,0 +1,59 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates/fail/only_nova_severs_in_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates/fail/only_nova_severs_in_volume.yaml new file mode 100644 index 0000000..d7a218e --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates/fail/only_nova_severs_in_volume.yaml @@ -0,0 +1,51 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_0: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_name_0 } + + vm_type_1: + type: OS::Nova::Server + properties: + name: { get_param: vm_type_name_1 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates/pass/well_named_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates/pass/well_named_volume.yaml new file mode 100644 index 0000000..7b29979 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates/pass/well_named_volume.yaml @@ -0,0 +1,59 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates_outputs/fail/missing_outputs_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates_outputs/fail/missing_outputs_volume.yaml new file mode 100644 index 0000000..248bb62 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates_outputs/fail/missing_outputs_volume.yaml @@ -0,0 +1,50 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_volume_id_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates_outputs/pass/well_named_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates_outputs/pass/well_named_volume.yaml new file mode 100644 index 0000000..5ee2cf6 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates_outputs/pass/well_named_volume.yaml @@ -0,0 +1,58 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_volume_id_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_id_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_id_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_id_1 } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_1_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_1_volume.yaml new file mode 100644 index 0000000..a55a4b2 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_1_volume.yaml @@ -0,0 +1,71 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_volume: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + volume_type: { get_param: vm_type_volume_type_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_1 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RSG, refs] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_2_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_2_volume.yaml new file mode 100644 index 0000000..0a196e3 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_2_volume.yaml @@ -0,0 +1,71 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_volume: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + volume_type: { get_param: vm_type_volume_type_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_1 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RS, refs] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_3_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_3_volume.yaml new file mode 100644 index 0000000..6a05126 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/mismatch_resource_keys_outputs_keys_3_volume.yaml @@ -0,0 +1,71 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + volume_type: { get_param: vm_type_volume_type_0 } + + vm_type_volume_0_R: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_1 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RS, refs] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/more_outputs_than_resources_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/more_outputs_than_resources_volume.yaml new file mode 100644 index 0000000..3f9cac7 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/more_outputs_than_resources_volume.yaml @@ -0,0 +1,72 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_id_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_id_1 } + + vm_type_volume_id_2: + value: { get_resource: vm_type_volume_id_2 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RSG, refs] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/more_resources_than_outputs_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/more_resources_than_outputs_volume.yaml new file mode 100644 index 0000000..d446a98 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/fail/more_resources_than_outputs_volume.yaml @@ -0,0 +1,66 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + vm_type_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_id_0 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RSG, refs] } \ No newline at end of file diff --git a/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/pass/valid_template_volume.yaml b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/pass/valid_template_volume.yaml new file mode 100644 index 0000000..1780dc6 --- /dev/null +++ b/ice_validator/tests/fixtures/test_volume_templates_outputs_resources/pass/valid_template_volume.yaml @@ -0,0 +1,71 @@ +# -*- coding: utf8 -*- +# ============LICENSE_START======================================================= +# org.onap.vvp/validation-scripts +# =================================================================== +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# +# Unless otherwise specified, all software contained herein is licensed +# under the Apache License, Version 2.0 (the “License”); +# you may not use this software except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# +# Unless otherwise specified, all documentation contained herein is licensed +# under the Creative Commons License, Attribution 4.0 Intl. (the “License”); +# you may not use this documentation except in compliance with the License. +# You may obtain a copy of the License at +# +# https://creativecommons.org/licenses/by/4.0/ +# +# Unless required by applicable law or agreed to in writing, documentation +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END============================================ +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +--- +resources: + + vm_type_volume_0: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + + vm_type_volume_1: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + volume_type: { get_param: vm_type_volume_type_0 } + + vm_type_volume_0_RSG: + type: OS::Heat::ResourceGroup + count: { get_param: vm_type_volume_count_0_RSG } + resource_def: + type: OS::Cinder::Volume + properties: + size: { get_param: vm_type_volume_size_0 } + +outputs: + + vm_type_volume_id_0: + value: { get_resource: vm_type_volume_0 } + + vm_type_volume_id_1: + value: { get_resource: vm_type_volume_1 } + + vm_type_volume_ids_0: + value: { get_attr: [vm_type_volume_0_RSG, refs] } \ No newline at end of file -- cgit 1.2.3-korg