X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ice_validator%2Ftests%2Ftest_nested_parameters.py;h=97d2f76d47c2e4e814c9b8fb079c12a54d9020b0;hb=refs%2Fchanges%2F44%2F98344%2F1;hp=26220444f2443e2f27aa91ff647c228adc1b1c61;hpb=684ad537becece9df772b04d0d8226bcb7c30ca4;p=vvp%2Fvalidation-scripts.git diff --git a/ice_validator/tests/test_nested_parameters.py b/ice_validator/tests/test_nested_parameters.py index 2622044..97d2f76 100644 --- a/ice_validator/tests/test_nested_parameters.py +++ b/ice_validator/tests/test_nested_parameters.py @@ -81,7 +81,12 @@ def check_nested_parameter_doesnt_change(yaml_file, nresource_type, *nprops): r = Resource(resource_id=resource_id, resource=resource) properties = r.get_nested_properties() resources = r.get_nested_yaml(base_dir).get("resources", {}) - for nrid, nresource_dict in resources.items(): # iterate through nested file until found target r type + for ( + nrid, + nresource_dict, + ) in ( + resources.items() + ): # iterate through nested file until found target r type if ( nresource_dict.get("type") @@ -89,9 +94,19 @@ def check_nested_parameter_doesnt_change(yaml_file, nresource_type, *nprops): ): continue - for nparam in prop_iterator(nresource_dict, *nprops): # get iterator of all target parameters - if nparam: # iterator yields None if parameter isn't found - for k1, v1 in properties.items(): # found nparam, now comparing to parent template + for nparam in prop_iterator( + nresource_dict, *nprops + ): # get iterator of all target parameters + if ( + nparam and "get_param" in nparam + ): # iterator yields None if parameter isn't found + nparam = nparam.get("get_param") + for ( + k1, + v1, + ) in ( + properties.items() + ): # found nparam, now comparing to parent template if isinstance(v1, dict) and "get_param" in v1: parameter = v1.get("get_param") # k1: nested resource parameter definition @@ -104,7 +119,9 @@ def check_nested_parameter_doesnt_change(yaml_file, nresource_type, *nprops): if isinstance(parameter, list): parameter = parameter[0] - if k1 != nparam: # we only care about the parameter we found in nested template + if ( + k1 != nparam + ): # we only care about the parameter we found in nested template continue if k1 != parameter: @@ -128,6 +145,7 @@ def check_nested_parameter_doesnt_change(yaml_file, nresource_type, *nprops): # def test_parameter_name_doesnt_change_in_nested_template(yaml_file): # check_nested_parameter_doesnt_change(yaml_file) + @validates("R-708564") def test_server_name_parameter_name_doesnt_change_in_nested_template(heat_template): check_nested_parameter_doesnt_change(heat_template, "OS::Nova::Server", "name") @@ -256,7 +274,7 @@ def test_vmi_aap_parameter_name_doesnt_change_in_nested_template(heat_template): "virtual_machine_interface_allowed_address_pairs", "virtual_machine_interface_allowed_address_pairs_allowed_address_pair", "virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip", - "virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip_ip_prefix" + "virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip_ip_prefix", ) @@ -265,3 +283,10 @@ def test_iip_instance_ip_parameter_name_doesnt_change_in_nested_template(heat_te check_nested_parameter_doesnt_change( heat_template, "OS::ContrailV2::InstanceIp", "instance_ip_address" ) + + +@validates("R-708564") +def test_iip_subnet_uuid_parameter_name_doesnt_change_in_nested_template(heat_template): + check_nested_parameter_doesnt_change( + heat_template, "OS::ContrailV2::InstanceIp", "subnet_uuid" + )