From 7bd878afa02d188e687a6958ae999807c2106392 Mon Sep 17 00:00:00 2001 From: mojahidi Date: Tue, 21 Nov 2017 11:38:41 +0530 Subject: ContrailNetworkPolicy ResourceValidator This task is about updating error messages with error codes for ContrailNetworkPolicyResourceValidator Change-Id: Ia011acd6c82b5fee5fdfd0bca27ef527d4b3b039 Issue-ID:SDC-572 Signed-off-by: mojahidi --- .../ContrailNetworkPolicyResourceValidator.java | 55 +++++++++-------- ...ContrailNetworkPolicyResourceValidatorTest.java | 24 ++++++-- .../input/MANIFEST.json | 17 ------ .../input/hot-nimbus-pps_v1.0.env | 11 ---- .../input/hot-nimbus-pps_v1.0.yaml | 69 ---------------------- .../negative/MANIFEST.json | 17 ++++++ .../negative/hot-nimbus-pps_v1.0.env | 11 ++++ .../negative/hot-nimbus-pps_v1.0.yaml | 51 ++++++++++++++++ .../positive/MANIFEST.json | 17 ++++++ .../positive/hot-nimbus-pps_v1.0.env | 11 ++++ .../positive/hot-nimbus-pps_v1.0.yaml | 69 ++++++++++++++++++++++ 11 files changed, 225 insertions(+), 127 deletions(-) delete mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json delete mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env delete mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/negative/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/negative/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/negative/hot-nimbus-pps_v1.0.yaml create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/positive/MANIFEST.json create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/positive/hot-nimbus-pps_v1.0.env create mode 100644 openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/positive/hot-nimbus-pps_v1.0.yaml diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidator.java index 8ca5e69061..8aa5714f2c 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidator.java @@ -1,6 +1,7 @@ package org.openecomp.sdc.validation.impl.validators.heatresource; import org.apache.commons.collections4.MapUtils; +import org.openecomp.core.validation.ErrorMessageCode; import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; import org.openecomp.core.validation.types.GlobalValidationContext; import org.openecomp.sdc.common.errors.Messages; @@ -23,12 +24,14 @@ import java.util.Map; */ public class ContrailNetworkPolicyResourceValidator implements ResourceValidator { private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private static final ErrorMessageCode ERROR_CODE_HNP1 = new ErrorMessageCode("HNP1"); + private static final ErrorMessageCode ERROR_CODE_HNP2 = new ErrorMessageCode("HNP2"); @Override public void validate(String fileName, Map.Entry resourceEntry, GlobalValidationContext globalContext, ValidationContext validationContext) { - validateNetworkPolicyIsUsed - (fileName, resourceEntry, globalContext, (HeatResourceValidationContext)validationContext); + validateNetworkPolicyIsUsed(fileName, resourceEntry, globalContext, + (HeatResourceValidationContext) validationContext); } @@ -39,25 +42,25 @@ public class ContrailNetworkPolicyResourceValidator implements ResourceValidator mdcDataDebugMessage.debugEntryMessage("file", fileName); Map>> referencedNetworkAttachPoliciesResources = - validationContext.getFileLevelResourceDependencies() - .get(HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE.getHeatResource()); + validationContext.getFileLevelResourceDependencies() + .get(HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE.getHeatResource()); if (MapUtils.isEmpty(referencedNetworkAttachPoliciesResources)) { globalContext - .addMessage( - fileName, - ErrorLevel.WARNING, - ErrorMessagesFormatBuilder - .getErrorWithParameters( - Messages.RESOURCE_NOT_IN_USE.getErrorMessage(), - ValidatorConstants.Network_Policy, resourceEntry.getKey()), - LoggerTragetServiceName.VALIDATE_ATTACH_POLICY_IN_USE, - LoggerErrorDescription.NETWORK_ATTACH_POLICY_NOT_IN_USE); + .addMessage( + fileName, + ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(ERROR_CODE_HNP1, + Messages.RESOURCE_NOT_IN_USE.getErrorMessage(), + ValidatorConstants.Network_Policy, resourceEntry.getKey()), + LoggerTragetServiceName.VALIDATE_ATTACH_POLICY_IN_USE, + LoggerErrorDescription.NETWORK_ATTACH_POLICY_NOT_IN_USE); return; } - handleNetworkAttachPolicyReferences - (fileName, resourceEntry, referencedNetworkAttachPoliciesResources, globalContext); + handleNetworkAttachPolicyReferences(fileName, resourceEntry, + referencedNetworkAttachPoliciesResources, globalContext); mdcDataDebugMessage.debugExitMessage("file", fileName); @@ -69,23 +72,23 @@ public class ContrailNetworkPolicyResourceValidator implements ResourceValidator GlobalValidationContext globalContext) { Map> resourcesPointingToCurrNetworkAttachPolicy = - pointedNetworkAttachPolicies.get(resourceEntry.getKey()); + pointedNetworkAttachPolicies.get(resourceEntry.getKey()); if (isNetworkAttachPolicyNotInUse(resourcesPointingToCurrNetworkAttachPolicy)) { globalContext - .addMessage( - fileName, - ErrorLevel.WARNING, - ErrorMessagesFormatBuilder - .getErrorWithParameters( - Messages.RESOURCE_NOT_IN_USE.getErrorMessage(), - ValidatorConstants.Network_Policy, resourceEntry.getKey()), - LoggerTragetServiceName.VALIDATE_ATTACH_POLICY_IN_USE, - LoggerErrorDescription.NETWORK_ATTACH_POLICY_NOT_IN_USE); + .addMessage( + fileName, + ErrorLevel.WARNING, + ErrorMessagesFormatBuilder + .getErrorWithParameters(ERROR_CODE_HNP2, + Messages.RESOURCE_NOT_IN_USE.getErrorMessage(), + ValidatorConstants.Network_Policy, resourceEntry.getKey()), + LoggerTragetServiceName.VALIDATE_ATTACH_POLICY_IN_USE, + LoggerErrorDescription.NETWORK_ATTACH_POLICY_NOT_IN_USE); } } private static boolean isNetworkAttachPolicyNotInUse( - Map> resourcesPointingToCurrNetworkAttachPolicy) { + Map> resourcesPointingToCurrNetworkAttachPolicy) { return MapUtils.isEmpty(resourcesPointingToCurrNetworkAttachPolicy); } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidatorTest.java index a03120c5d6..fd6f1d42bb 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidatorTest.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/ContrailNetworkPolicyResourceValidatorTest.java @@ -19,18 +19,34 @@ public class ContrailNetworkPolicyResourceValidatorTest { ContrailNetworkPolicyResourceValidator resourceValidator = new ContrailNetworkPolicyResourceValidator(); + private static final String PATH = "/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/"; @Test public void testNetworkPolicyAssociatedWithAttachPolicy() throws IOException { Map messages = ValidationTestUtil.testValidator(baseValidator, resourceValidator - , HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE.getHeatResource(), - "/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input"); + , HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE.getHeatResource(), + PATH + "positive"); 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: NetworkPolicy not in use, Resource Id [not_used_server_pcrf_policy]"); + messages.get("hot-nimbus-pps_v1.0.yaml").getErrorMessageList().get(0).getMessage(), + "WARNING: [HNP2]: NetworkPolicy not in use, Resource Id [not_used_server_pcrf_policy]"); + } + + @Test + public void testNonNetworkPolicyResource() throws IOException { + Map messages = ValidationTestUtil.testValidator(baseValidator, resourceValidator + , HeatResourcesTypes.CONTRAIL_VIRTUAL_NETWORK_RESOURCE_TYPE.getHeatResource(), + PATH + "negative"); + + 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: [HNP1]: NetworkPolicy not in use, Resource Id [server_pcrf_network]"); } } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json deleted file mode 100644 index 1e719efb31..0000000000 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/MANIFEST.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "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" - } - ] - } - ] -} \ 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/network_policy_associated_with_attach_policy/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/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env deleted file mode 100644 index 340be2b815..0000000000 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.env +++ /dev/null @@ -1,11 +0,0 @@ -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/network_policy_associated_with_attach_policy/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/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml deleted file mode 100644 index b2b91ec36d..0000000000 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/input/hot-nimbus-pps_v1.0.yaml +++ /dev/null @@ -1,69 +0,0 @@ -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 - -resources: - used_server_pcrf_policy: - type: OS::Contrail::NetworkPolicy - properties: - pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } - pcrf_pps_image_name: { get_param: pcrf_pps_image_name } - - not_used_server_pcrf_policy: - type: OS::Contrail::NetworkPolicy - properties: - pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } - pcrf_pps_image_name: { get_param: pcrf_pps_image_name } - - server_pcrf_network: - type: OS::Contrail::VirtualNetwork - properties: - pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } - pcrf_pps_image_name: { get_param: pcrf_pps_image_name } - - attach_policy_resource: - type: OS::Contrail::AttachPolicy - properties: - network: { get_resource: server_pcrf_network } - policy: { get_attr: [used_server_pcrf_policy, fq_name] } - - - diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/negative/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/negative/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/negative/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-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_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/network_policy_associated_with_attach_policy/negative/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/network_policy_associated_with_attach_policy/negative/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/network_policy_associated_with_attach_policy/negative/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/network_policy_associated_with_attach_policy/negative/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/network_policy_associated_with_attach_policy/negative/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..d0bbe46ffe --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/negative/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,51 @@ +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 + +resources: + server_pcrf_network: + type: OS::Contrail::VirtualNetwork + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + + diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/positive/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/positive/MANIFEST.json new file mode 100644 index 0000000000..1e719efb31 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/positive/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-pps_v1.0.yaml", + "type": "HEAT", + "data": [ + { + "file": "hot-nimbus-pps_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/network_policy_associated_with_attach_policy/positive/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/network_policy_associated_with_attach_policy/positive/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/network_policy_associated_with_attach_policy/positive/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/network_policy_associated_with_attach_policy/positive/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/network_policy_associated_with_attach_policy/positive/hot-nimbus-pps_v1.0.yaml new file mode 100644 index 0000000000..b2b91ec36d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/network_policy_associated_with_attach_policy/positive/hot-nimbus-pps_v1.0.yaml @@ -0,0 +1,69 @@ +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 + +resources: + used_server_pcrf_policy: + type: OS::Contrail::NetworkPolicy + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + not_used_server_pcrf_policy: + type: OS::Contrail::NetworkPolicy + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + server_pcrf_network: + type: OS::Contrail::VirtualNetwork + properties: + pcrf_pps_server_name: { get_param: [pcrf_pps_server_names, 0] } + pcrf_pps_image_name: { get_param: pcrf_pps_image_name } + + attach_policy_resource: + type: OS::Contrail::AttachPolicy + properties: + network: { get_resource: server_pcrf_network } + policy: { get_attr: [used_server_pcrf_policy, fq_name] } + + + -- cgit 1.2.3-korg