summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test
diff options
context:
space:
mode:
authormojahidi <mojahidul.islam@amdocs.com>2017-12-11 15:24:11 +0530
committerAvi Gaffa <avi.gaffa@amdocs.com>2017-12-13 09:56:50 +0000
commit4b1c2aaab1c3200076138d8702bc324d78a69fa8 (patch)
tree2da433920b70dad02e544a46bc31502403620a33 /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test
parentb61cc21c17744ef927d4fca32aef6149f1b3910c (diff)
Adding Error code in HEAT Validators
added error code in NestedResourceValidator and ResourceGroupResourceValidator fixed sonar issues Change-Id: I1705b7103a3b3c42338f97cb4a7a255a6c85e88f Issue-ID: SDC-572 Signed-off-by: mojahidi <mojahidul.islam@amdocs.com> Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test')
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidatorTest.java102
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidatorTest.java120
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/MANIFEST.json17
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/hot-nimbus-psm_v1.0.yaml62
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/MANIFEST.json51
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-pps_v1.0.env11
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-pps_v1.0.yaml58
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-psm_v1.0.env10
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-psm_v1.0.yaml199
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/nested-pps_v1.0.yaml101
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/nested-psm_v1.0.yaml99
12 files changed, 773 insertions, 67 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidatorTest.java
index 96aa631a69..14a23d66d9 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NestedResourceValidatorTest.java
@@ -1,70 +1,124 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.
+ */
+
package org.openecomp.sdc.validation.impl.validators.heatresource;
+import org.openecomp.core.validation.types.GlobalValidationContext;
import org.openecomp.core.validation.types.MessageContainer;
+import org.openecomp.sdc.heat.datatypes.model.Resource;
import org.openecomp.sdc.validation.impl.validators.HeatResourceValidator;
import org.openecomp.sdc.validation.util.ValidationTestUtil;
import org.testng.Assert;
import org.testng.annotations.Test;
-import java.io.IOException;
import java.util.Map;
+import java.util.Optional;
/**
* Created by TALIO on 2/28/2017.
*/
public class NestedResourceValidatorTest {
- HeatResourceValidator baseValidator = new HeatResourceValidator();
- NestedResourceValidator resourceValidator = new NestedResourceValidator();
+ private final HeatResourceValidator baseValidator = new HeatResourceValidator();
+ private final NestedResourceValidator resourceValidator = new NestedResourceValidator();
+ private static final String PATH = "/org/openecomp/validation/validators/heat_validator/";
@Test
- public void testNoLoopsNesting() throws IOException {
+ public void testNoLoopsNesting() {
+
Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
- resourceValidator, null,
- "/org/openecomp/validation/validators/heat_validator/no_loops_nesting/negative_test/input");
+ resourceValidator, null,
+ PATH + "no_loops_nesting/negative_test/input");
Assert.assertNotNull(messages);
Assert.assertEquals(messages.size(), 4);
Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 1);
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Nested files loop - [hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "ERROR: [HNR2]: Nested files loop - [hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml]");
Assert.assertEquals(
- messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().size(), 2);
+ messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().size(), 2);
Assert.assertEquals(
- messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().get(0)
- .getMessage(),
- "ERROR: Nested files loop - [nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml]");
+ messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().get(0)
+ .getMessage(),
+ "ERROR: [HNR2]: Nested files loop - [nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml]");
Assert.assertEquals(
- messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().get(1)
- .getMessage(),
- "ERROR: Nested files loop - [nested-points-to-hot-nimbus-psm.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml]");
+ messages.get("nested-points-to-hot-nimbus-psm.yaml").getErrorMessageList().get(1)
+ .getMessage(),
+ "ERROR: [HNR2]: Nested files loop - [nested-points-to-hot-nimbus-psm.yaml -- nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml]");
Assert.assertEquals(messages.get("yaml-point-to-itself.yaml").getErrorMessageList().size(), 1);
Assert.assertEquals(
- messages.get("yaml-point-to-itself.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Nested files loop - [yaml-point-to-itself.yaml -- yaml-point-to-itself.yaml]");
+ messages.get("yaml-point-to-itself.yaml").getErrorMessageList().get(0).getMessage(),
+ "ERROR: [HNR2]: Nested files loop - [yaml-point-to-itself.yaml -- yaml-point-to-itself.yaml]");
Assert.assertEquals(messages.get("nested-psm_v1.0.yaml").getErrorMessageList().size(), 1);
Assert.assertEquals(
- messages.get("nested-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Nested files loop - [nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml]");
+ messages.get("nested-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "ERROR: [HNR2]: Nested files loop - [nested-psm_v1.0.yaml -- nested-points-to-hot-nimbus-psm.yaml -- hot-nimbus-psm_v1.0.yaml -- nested-psm_v1.0.yaml]");
}
@Test
- public void testPropertiesMatchNestedParameters() throws IOException {
+ public void testPropertiesMatchNestedParameters() {
Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
- resourceValidator, null,
- "/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/negative_test/input");
+ resourceValidator, null,
+ PATH + "properties_match_nested_parameters/negative_test/input");
Assert.assertNotNull(messages);
Assert.assertEquals(messages.size(), 1);
Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
Assert.assertEquals(
- messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Referenced parameter not found in nested file - nested-pps_v1.0.yaml, parameter name [server_pcrf_pps_001], Resource ID [parameter_not_existing_in_nested]");
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "ERROR: [HNR3]: Referenced parameter not found in nested file - nested-pps_v1.0.yaml, parameter name [server_pcrf_pps_001], Resource ID [parameter_not_existing_in_nested]");
+ }
+
+ @Test
+ public void testWrongValueTypeAssigned() {
+ Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
+ resourceValidator, null,
+ PATH + "properties_match_nested_parameters/wrong_value_type_assigned/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(
+ messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "WARNING: [HNR4]: Wrong value type assigned to a nested input parameter, nested resource [server_pcrf_pps_001], property name [index_integer], nested file [nested-pps_v1.0.yaml]");
+ }
+
+ @Test
+ public void testMissingNestedFile() {
+ final Resource resource = new Resource();
+ resource.setType("nested-pps_v1.0.yaml");
+
+ final GlobalValidationContext globalValidationContext = ValidationTestUtil.createGlobalContextFromPath(PATH + "missing_nested_file/input");
+
+ NestedResourceValidator.validateAllPropertiesMatchNestedParameters(null, null, resource, Optional.empty(), globalValidationContext);
+
+ Map<String, MessageContainer> messages = globalValidationContext.getContextMessageContainers();
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ Assert.assertEquals(messages.get("nested-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(
+ messages.get("nested-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "ERROR: [HNR1]: Missing nested file - nested-pps_v1.0.yaml");
}
}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidatorTest.java
index 4b255ae967..4948c53cde 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ResourceGroupResourceValidatorTest.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.
+ */
+
package org.openecomp.sdc.validation.impl.validators.heatresource;
import org.openecomp.core.validation.types.MessageContainer;
@@ -7,7 +23,6 @@ import org.openecomp.sdc.validation.util.ValidationTestUtil;
import org.testng.Assert;
import org.testng.annotations.Test;
-import java.io.IOException;
import java.util.Map;
/**
@@ -15,92 +30,111 @@ import java.util.Map;
*/
public class ResourceGroupResourceValidatorTest {
- HeatResourceValidator baseValidator = new HeatResourceValidator();
- ResourceGroupResourceValidator resourceValidator = new ResourceGroupResourceValidator();
+ private final HeatResourceValidator baseValidator = new HeatResourceValidator();
+ private final ResourceGroupResourceValidator resourceValidator = new ResourceGroupResourceValidator();
+ private static final String PATH = "/org/openecomp/validation/validators/heat_validator/";
@Test
public void testResourceGroupWithInvalidIndexVar() {
Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
- resourceValidator, HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource(),
- "/org/openecomp/validation/validators/heat_validator/resource_group_invalid_indexvar/negative_test/input");
+ resourceValidator, HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource(),
+ PATH + "resource_group_invalid_indexvar/negative_test/input");
Assert.assertNotNull(messages);
Assert.assertEquals(messages.size(), 1);
- Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 8);
+ Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 14);
+ Assert.assertEquals(
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "WARNING: [HRR8]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_1], resource_def type [yamlFile.yaml]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
+ "ERROR: [HRR1]: Wrong value assigned to a ResourceGroup index_var property (functions are not allowed but only strings), Resource ID [resource_with_resources_group_1]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(2).getMessage(),
+ "WARNING: [HRR8]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_2], resource_def type [yamlFile.yaml]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(3).getMessage(),
+ "WARNING: [HRR5]: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_2], property name [index_boolean], nested file [yamlFile.yaml]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(4).getMessage(),
+ "WARNING: [HRR8]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_3], resource_def type [yamlFile.yaml]");
+ Assert.assertEquals(
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(5).getMessage(),
+ "WARNING: [HRR5]: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_3], property name [index_boolean], nested file [yamlFile.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Wrong value assigned to a ResourceGroup index_var property (functions are not allowed but only strings), Resource ID [resource_with_resources_group_1]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(6).getMessage(),
+ "WARNING: [HRR5]: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_3], property name [index_number], nested file [yamlFile.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
- "WARNING: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_2], property name [index_boolean], nested file [yamlFile.yaml]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(7).getMessage(),
+ "WARNING: [HRR8]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_4], resource_def type [yamlFile.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(2).getMessage(),
- "WARNING: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_3], property name [index_boolean], nested file [yamlFile.yaml]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(8).getMessage(),
+ "WARNING: [HRR5]: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_4], property name [index_boolean], nested file [yamlFile.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(3).getMessage(),
- "WARNING: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_3], property name [index_number], nested file [yamlFile.yaml]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(9).getMessage(),
+ "WARNING: [HRR8]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_5], resource_def type [yamlFile.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(4).getMessage(),
- "WARNING: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_4], property name [index_boolean], nested file [yamlFile.yaml]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(10).getMessage(),
+ "WARNING: [HRR5]: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_5], property name [index_boolean], nested file [yamlFile.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(5).getMessage(),
- "WARNING: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_5], property name [index_boolean], nested file [yamlFile.yaml]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(11).getMessage(),
+ "WARNING: [HRR5]: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_5], property name [index_number], nested file [yamlFile.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(6).getMessage(),
- "WARNING: Wrong value type assigned to a nested input parameter, nested resource [resource_with_resources_group_5], property name [index_number], nested file [yamlFile.yaml]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(12).getMessage(),
+ "WARNING: [HRR8]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_6], resource_def type [yamlFile.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(7).getMessage(),
- "ERROR: Wrong value assigned to a ResourceGroup index_var property (functions are not allowed but only strings), Resource ID [resource_with_resources_group_6]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(13).getMessage(),
+ "ERROR: [HRR1]: Wrong value assigned to a ResourceGroup index_var property (functions are not allowed but only strings), Resource ID [resource_with_resources_group_6]");
}
@Test
public void testResourceGroupWithInvalidType() {
Map<String, MessageContainer> messages =ValidationTestUtil.testValidator(baseValidator,
- resourceValidator, HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource(),
- "/org/openecomp/validation/validators/heat_validator/resource_group_invalid_type/negative_test/input");
+ resourceValidator, HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource(),
+ PATH + "resource_group_invalid_type/negative_test/input");
Assert.assertNotNull(messages);
Assert.assertEquals(messages.size(), 1);
Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 3);
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
- "WARNING: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_1], resource_def type [{get_param=pcrf_vnf_id}]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "WARNING: [HRR7]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_1], resource_def type [{get_param=pcrf_vnf_id}]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
- "WARNING: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_2], resource_def type [OS::Nova::Server]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
+ "WARNING: [HRR6]: A resource has an invalid or unsupported type - null, Resource ID [resource_with_resources_group_3]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(2).getMessage(),
- "WARNING: A resource has an invalid or unsupported type - null, Resource ID [resource_with_resources_group_3]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(2).getMessage(),
+ "WARNING: [HRR8]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group_4], resource_def type [yamlFile.yaml]");
}
@Test
- public void testResourcesGroupWithNested() throws IOException {
+ public void testResourcesGroupWithNested() {
Map<String, MessageContainer> messages =ValidationTestUtil.testValidator(baseValidator,
- resourceValidator, HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource(),
- "/org/openecomp/validation/validators/heat_validator/resources_group_with_nested/negative_test/input");
+ resourceValidator, HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource(),
+ PATH + "resources_group_with_nested/negative_test/input");
Assert.assertNotNull(messages);
- Assert.assertEquals(messages.size(), 3);
+ Assert.assertEquals(messages.size(), 4);
Assert.assertEquals(messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().size(), 2);
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Referenced parameter not found in nested file - nested-from-resources-group.yaml, parameter name [resource_with_resources_group], Resource ID [property_not_in_nested]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "WARNING: [HRR8]: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_with_resources_group], resource_def type [nested-from-resources-group.yaml]");
Assert.assertEquals(
- messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
- "WARNING: OS::Heat::ResourceGroup resource with resource_def which is not pointing to nested heat file is not supported, Resource ID [resource_without_resources_group], resource_def type [OS::Nova::Server]");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
+ "ERROR: [HRR4]: Referenced parameter not found in nested file - nested-from-resources-group.yaml, parameter name [resource_with_resources_group], Resource ID [property_not_in_nested]");
- Assert.assertEquals(messages.get("nested-pps_v1.0.yaml").getErrorMessageList().size(), 1);
+ Assert.assertEquals(messages.get("nested-pps_v1.0.yaml").getErrorMessageList().size(), 2);
Assert.assertEquals(
- messages.get("nested-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Nested files loop - [nested-pps_v1.0.yaml -- nested-from-resources-group.yaml -- hot-nimbus-pps_v1.0.yaml -- nested-pps_v1.0.yaml]");
+ messages.get("nested-pps_v1.0.yaml").getErrorMessageList().get(1).getMessage(),
+ "ERROR: [HRR3]: Nested files loop - [nested-pps_v1.0.yaml -- nested-from-resources-group.yaml -- hot-nimbus-pps_v1.0.yaml -- nested-pps_v1.0.yaml]");
Assert.assertEquals(messages.get("nested-not-exist.yaml").getErrorMessageList().size(), 1);
Assert.assertEquals(
- messages.get("nested-not-exist.yaml").getErrorMessageList().get(0).getMessage(),
- "ERROR: Missing nested file - nested-not-exist.yaml");
+ messages.get("nested-not-exist.yaml").getErrorMessageList().get(0).getMessage(),
+ "ERROR: [HRR2]: Missing nested file - nested-not-exist.yaml");
}
}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/MANIFEST.json
new file mode 100644
index 0000000000..dd26e5ac45
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/MANIFEST.json
@@ -0,0 +1,17 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..e5298fe389
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/missing_nested_file/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,62 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ vnf_id:
+ type: string
+
+resources:
+ nova_server_1:
+ type: OS::Nova::Server
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: oam1_int_port }
+ fixed_ip: 10.0.0.0
+ floating_ip: 10.0.0.1
+ network: 100_1000_0011
+ port_extra_properties: {admin_state_up: true , allowed_address_pairs: 10}
+ subnet: 10.0.0.2
+ - port: { get_resource: oam1_mgmt_port }
+ metadata:
+ vnf_id: { get_param: vnf_id } \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/MANIFEST.json
new file mode 100644
index 0000000000..fe7d8bdf5a
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/MANIFEST.json
@@ -0,0 +1,51 @@
+{
+ "name": "hot-mog",
+ "description": "HOT template to create hot mog server",
+ "version": "2013-05-23",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-pps_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "hot-nimbus-psm_v1.0.yaml",
+ "type": "HEAT",
+ "data": [
+ {
+ "file": "hot-nimbus-psm_v1.0.env",
+ "type": "HEAT_ENV"
+ }
+ ]
+ },
+ {
+ "file": "nested-pps_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "nested-psm_v1.0.yaml",
+ "type": "HEAT"
+ },
+ {
+ "file": "mount_iso_script.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "cloud-nimbus.sh",
+ "type": "SHELL"
+ },
+ {
+ "file": "nimbus-ethernet",
+ "type": "OTHER"
+ },
+ {
+ "file": "nimbus-ethernet-gw",
+ "type": "OTHER"
+ }
+ ]
+} \ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-pps_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-pps_v1.0.env
new file mode 100644
index 0000000000..340be2b815
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-pps_v1.0.env
@@ -0,0 +1,11 @@
+parameters:
+ pcrf_pps_server_names: ZRDM1PCRF01PPS001,ZRDM1PCRF01PPS002,ZRDM1PCRF01PPS003,ZRDM1PCRF01PPS004,ZRDM1PCRF01PPS005,ZRDM1PCRF01PPS006
+ pcrf_pps_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_pps_flavor_name: lc.3xlarge
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.7,172.26.16.8,172.26.16.9,172.26.16.10,172.26.16.11,172.26.16.12
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-pps_v1.0.yaml
new file mode 100644
index 0000000000..2fe32fa078
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-pps_v1.0.yaml
@@ -0,0 +1,58 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_names:
+ type: comma_delimited_list
+ label: PCRF PS server names
+ description: PCRF PS server names
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ index_integer:
+ type: integer
+
+resources:
+ server_pcrf_pps_001:
+ type: nested-pps_v1.0.yaml
+ properties:
+ pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] }
+ pcrf_pps_image_name: { get_param: pcrf_pps_image_name }
+ pcrf_pps_flavor_name: { get_param: pcrf_pps_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+ index_integer: "TEST_ME"
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-psm_v1.0.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-psm_v1.0.env
new file mode 100644
index 0000000000..f24e4763c6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-psm_v1.0.env
@@ -0,0 +1,10 @@
+parameters:
+ pcrf_psm_server_names: ZRDM1PCRF01PSM001,ZRDM1PCRF01PSM002,ZRDM1PCRF01PSM003,ZRDM1PCRF01PSM004,ZRDM1PCRF01PSM005,ZRDM1PCRF01PSM006,ZRDM1PCRF01PSM007,ZRDM1PCRF01PSM008,ZRDM1PCRF01PSM009,ZRDM1PCRF01PSM010,ZRDM1PCRF01PSM011,ZRDM1PCRF01PSM012
+ pcrf_psm_image_name: PCRF_8.995-ATTM1.0.3.qcow2
+ pcrf_psm_flavor_name: lc.4xlarge4
+ availabilityzone_name: nova
+ pcrf_cps_net_name: Mobisupport-25193-I-INT1_int_pcrf_net_0
+ pcrf_cps_net_ips: 172.26.16.63,172.26.16.64,172.26.16.65,172.26.16.66,172.26.16.67,172.26.16.68,172.26.16.69,172.26.16.70,172.26.16.71,172.26.16.72,172.26.16.73,172.26.16.74
+ pcrf_cps_net_mask: 255.255.255.0
+ pcrf_security_group_name: nimbus_security_group
+ pcrf_vnf_id: 730797234b4a40aa99335157b02871cd
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..c2d7b05ead
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,199 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_names:
+ type: comma_delimited_list
+ label: PCRF SM server names
+ description: name of the PCRF SM instance
+ pcrf_psm_image_name:
+ type: string
+ label: PCRF SM image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ips:
+ type: comma_delimited_list
+ label: CPS network ips
+ description: CPS network ips
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ server_pcrf_psm_001:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 0] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 0] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_002:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 1] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 1] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_003:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 2] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 2] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_004:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 3] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 3] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_005:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 4] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 4] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_006:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 5] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 5] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_007:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 6] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 6] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_008:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 7] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 7] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_009:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 8] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 8] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_010:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 9] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 9] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_011:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 10] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 10] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
+ server_pcrf_psm_012:
+ type: nested-psm_v1.0.yaml
+ properties:
+ pcrf_psm_server_name: { get_param: [pcrf_psm_server_names, 11] }
+ pcrf_psm_image_name: { get_param: pcrf_psm_image_name }
+ pcrf_psm_flavor_name: { get_param: pcrf_psm_flavor_name }
+ availabilityzone_name: { get_param: availabilityzone_name }
+ pcrf_security_group_name: { get_param: pcrf_security_group_name }
+ pcrf_cps_net_name: { get_param: pcrf_cps_net_name }
+ pcrf_cps_net_ip: { get_param: [pcrf_cps_net_ips, 11] }
+ pcrf_cps_net_mask: { get_param: pcrf_cps_net_mask }
+ pcrf_vnf_id: {get_param: pcrf_vnf_id}
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/nested-pps_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/nested-pps_v1.0.yaml
new file mode 100644
index 0000000000..6b7d84635d
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/nested-pps_v1.0.yaml
@@ -0,0 +1,101 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Policy Server stack
+
+parameters:
+ pcrf_pps_server_name:
+ type: string
+ label: PCRF PS server name
+ description: PCRF PS server name
+ pcrf_pps_image_name:
+ type: string
+ label: PCRF PS image name
+ description: PCRF PS image name
+ pcrf_pps_flavor_name:
+ type: string
+ label: PCRF PS flavor name
+ description: flavor name of PCRF PS instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+ index_integer:
+ type: integer
+
+resources:
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_pps_server_name }
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_pps:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_pps_server_name }
+ image: { get_param: pcrf_pps_image_name }
+ flavor: { get_param: pcrf_pps_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: pcrf_pps_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+
+ pcrf_pps_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }]
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/nested-psm_v1.0.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/nested-psm_v1.0.yaml
new file mode 100644
index 0000000000..c86aa34713
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/properties_match_nested_parameters/wrong_value_type_assigned/input/nested-psm_v1.0.yaml
@@ -0,0 +1,99 @@
+heat_template_version: 2013-05-23
+
+description: heat template that creates PCRF Session Manager stack
+
+parameters:
+ pcrf_psm_server_name:
+ type: string
+ label: PCRF SM server name
+ description: PCRF SM server name
+ pcrf_psm_image_name:
+ type: string
+ label: image name
+ description: PCRF SM image name
+ pcrf_psm_flavor_name:
+ type: string
+ label: PCRF SM flavor name
+ description: flavor name of PCRF SM instance
+ availabilityzone_name:
+ type: string
+ label: availabilityzone name
+ description: availabilityzone name
+ pcrf_cps_net_name:
+ type: string
+ label: CPS network name
+ description: CPS network name
+ pcrf_cps_net_ip:
+ type: string
+ label: CPS network ip
+ description: CPS network ip
+ pcrf_cps_net_mask:
+ type: string
+ label: CPS network mask
+ description: CPS network mask
+ pcrf_security_group_name:
+ type: string
+ label: security group name
+ description: the name of security group
+ pcrf_vnf_id:
+ type: string
+ label: PCRF VNF Id
+ description: PCRF VNF Id
+
+resources:
+ network:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ write_files:
+ - path: /etc/sysconfig/network-scripts/ifcfg-eth0
+ permissions: "0644"
+ content:
+ str_replace:
+ template: { get_file: nimbus-ethernet }
+ params:
+ $dev: eth0
+ $ip: { get_param: pcrf_cps_net_ip }
+ $netmask: { get_param: pcrf_cps_net_mask }
+ runcmd:
+ - ifdown eth0 && ifup eth0
+ script_init:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: ungrouped
+ config:
+ str_replace:
+ template: { get_file: cloud-nimbus.sh }
+ params:
+ $vm_name: { get_param: pcrf_psm_server_name }
+ pcrf_server_init:
+ type: OS::Heat::MultipartMime
+ properties:
+ parts:
+ - config: { get_resource: network}
+ - config: { get_resource: script_init}
+
+ pcrf_server_psm:
+ type: OS::Nova::Server
+ properties:
+ config_drive: "True"
+ name: { get_param: pcrf_psm_server_name }
+ image: { get_param: pcrf_psm_image_name }
+ flavor: { get_param: pcrf_psm_flavor_name }
+ availability_zone: { get_param: availabilityzone_name }
+ networks:
+ - port: { get_resource: psm01_port_0}
+ user_data_format: RAW
+ user_data:
+ get_resource: pcrf_server_init
+ metadata:
+ vnf_id: {get_param: pcrf_vnf_id}
+ #scheduler_hints: {group: { get_resource: servergroup_nimbus }}
+
+ psm01_port_0:
+ type: OS::Neutron::Port
+ properties:
+ network: { get_param: pcrf_cps_net_name }
+ fixed_ips:
+ - ip_address: { get_param: pcrf_cps_net_ip }
+ security_groups: [{ get_param: pcrf_security_group_name }] \ No newline at end of file