NeutronPort validator 21/24421/1
authormojahidi <mojahidul.islam@amdocs.com>
Mon, 20 Nov 2017 13:10:53 +0000 (18:40 +0530)
committermojahidi <mojahidul.islam@amdocs.com>
Mon, 20 Nov 2017 13:11:06 +0000 (18:41 +0530)
This task is about  updating  error messages with error codes for NeutronPortNamingConventionValidator

Change-Id: I045415f026f947661632262676123ff848e582b0
Issue-ID:SDC-572
Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
17 files changed:
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidator.java
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NeutronPortNamingConventionValidatorTest.java
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/missingparam/MANIFEST.json [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/negative/MANIFEST.json with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/missingparam/first.env [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/negative/first.env with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/missingparam/first.yaml [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/missingparam/firstVol.yaml [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/negative/firstVol.yaml with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/missingparam/second.yaml [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/negative/second.yaml with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/negativeFixedIP/MANIFEST.json [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/positive/MANIFEST.json with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/negativeFixedIP/first.env [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/positive/first.env with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/negativeFixedIP/first.yaml [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/negative/first.yaml with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/negativeFixedIP/firstVol.yaml [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/positive/firstVol.yaml with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/negativeFixedIP/second.yaml [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/positive/second.yaml with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/MANIFEST.json [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/first.env [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/first.yaml [moved from openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/positive/first.yaml with 100% similarity]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/firstVol.yaml [new file with mode: 0644]
openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/second.yaml [new file with mode: 0644]

index 3401e15..c12ad9b 100644 (file)
@@ -1,6 +1,7 @@
 package org.openecomp.sdc.validation.impl.validators.namingconvention;
 
 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;
@@ -26,13 +27,16 @@ import static java.util.Objects.nonNull;
  */
 public class NeutronPortNamingConventionValidator implements ResourceValidator {
   private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
+  private static final ErrorMessageCode ERROR_CODE_NNP1 = new ErrorMessageCode("NNP1");
+  private static final ErrorMessageCode ERROR_CODE_NNP2 = new ErrorMessageCode("NNP2");
+  private static final ErrorMessageCode ERROR_CODE_NNP3 = new ErrorMessageCode("NNP3");
 
   @Override
   public void validate(String fileName, Map.Entry<String, Resource> resourceEntry,
                        GlobalValidationContext globalContext, ValidationContext validationContext) {
 
     NamingConventionValidationContext namingConventionValidationContext =
-        (NamingConventionValidationContext)validationContext;
+            (NamingConventionValidationContext)validationContext;
     validatePortNetworkNamingConvention(fileName, namingConventionValidationContext.getHeatOrchestrationTemplate(), globalContext);
     validateFixedIpsNamingConvention(fileName, namingConventionValidationContext.getHeatOrchestrationTemplate(), globalContext);
   }
@@ -50,21 +54,21 @@ public class NeutronPortNamingConventionValidator implements ResourceValidator {
     String[] regexList = new String[]{".*_net_id", ".*_net_name", ".*_net_fqdn"};
 
     heatOrchestrationTemplate
-        .getResources()
-        .entrySet()
-        .stream()
-        .filter(entry -> entry.getValue().getType()
-            .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource()))
-        .forEach(entry -> entry.getValue()
-            .getProperties()
+            .getResources()
             .entrySet()
             .stream()
-            .filter(propertyEntry ->
-                propertyEntry.getKey().toLowerCase().equals("network".toLowerCase())
-                    || propertyEntry.getKey().equals("network_id"))
-            .forEach(propertyEntry -> validateParamNamingConvention(fileName, entry.getKey(),
-                propertyEntry.getValue(), "Port", "Network", regexList,
-                Messages.PARAMETER_NAME_NOT_ALIGNED_WITH_GUIDELINES, globalContext)));
+            .filter(entry -> entry.getValue().getType()
+                    .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource()))
+            .forEach(entry -> entry.getValue()
+                    .getProperties()
+                    .entrySet()
+                    .stream()
+                    .filter(propertyEntry ->
+                            propertyEntry.getKey().toLowerCase().equals("network".toLowerCase())
+                                    || propertyEntry.getKey().equals("network_id"))
+                    .forEach(propertyEntry -> validateParamNamingConvention(fileName, entry.getKey(),
+                            propertyEntry.getValue(), "Port", "Network", regexList,
+                            Messages.PARAMETER_NAME_NOT_ALIGNED_WITH_GUIDELINES, globalContext)));
 
     mdcDataDebugMessage.debugExitMessage("file", fileName);
   }
@@ -81,12 +85,12 @@ public class NeutronPortNamingConventionValidator implements ResourceValidator {
     }
 
     heatOrchestrationTemplate.getResources()
-        .entrySet()
-        .stream()
-        .filter(entry -> HeatResourcesTypes.findByHeatResource(entry.getValue().getType()) != null)
-        .filter(entry -> HeatResourcesTypes.findByHeatResource(entry.getValue().getType())
-            .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE))
-        .forEach(entry -> checkNeutronPortFixedIpsName(fileName, entry, globalContext));
+            .entrySet()
+            .stream()
+            .filter(entry -> HeatResourcesTypes.findByHeatResource(entry.getValue().getType()) != null)
+            .filter(entry -> HeatResourcesTypes.findByHeatResource(entry.getValue().getType())
+                    .equals(HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE))
+            .forEach(entry -> checkNeutronPortFixedIpsName(fileName, entry, globalContext));
 
     mdcDataDebugMessage.debugExitMessage("file", fileName);
   }
@@ -95,8 +99,8 @@ public class NeutronPortNamingConventionValidator implements ResourceValidator {
                                             Map.Entry<String, Resource> resourceEntry,
                                             GlobalValidationContext globalContext) {
     String[] regexList =
-        new String[]{"[^_]+_[^_]+_ips", "[^_]+_[^_]+_v6_ips", "[^_]+_[^_]+_ip_(\\d+)",
-            "[^_]+_[^_]+_v6_ip_(\\d+)"};
+            new String[]{"[^_]+_[^_]+_ips", "[^_]+_[^_]+_v6_ips", "[^_]+_[^_]+_ip_(\\d+)",
+                    "[^_]+_[^_]+_v6_ip_(\\d+)"};
 
     if (MapUtils.isEmpty(resourceEntry.getValue().getProperties())) {
       return;
@@ -108,31 +112,33 @@ public class NeutronPortNamingConventionValidator implements ResourceValidator {
       List<Object> fixedIpsList = (List<Object>) fixedIps;
       for (Object fixedIpsObject : fixedIpsList) {
         Map.Entry<String, Object> fixedIpsEntry =
-            ((Map<String, Object>) fixedIpsObject).entrySet().iterator().next();
+                ((Map<String, Object>) fixedIpsObject).entrySet().iterator().next();
         if (nonNull(fixedIpsEntry)) {
           if (fixedIpsEntry.getValue() instanceof Map) {
             String fixedIpsName = ValidationUtil.getWantedNameFromPropertyValueGetParam
-                (fixedIpsEntry
-                .getValue());
+                    (fixedIpsEntry
+                            .getValue());
             if (nonNull(fixedIpsName)) {
               if (!ValidationUtil.evalPattern(fixedIpsName, regexList)) {
                 globalContext.addMessage(
-                    fileName,
-                    ErrorLevel.WARNING, ErrorMessagesFormatBuilder.getErrorWithParameters(
-                        Messages.PARAMETER_NAME_NOT_ALIGNED_WITH_GUIDELINES.getErrorMessage(),
-                        "Port", "Fixed_IPS", fixedIpsName, resourceEntry.getKey()),
-                    LoggerTragetServiceName.VALIDATE_FIXED_IPS_NAME,
-                    LoggerErrorDescription.NAME_NOT_ALIGNED_WITH_GUIDELINES);
+                        fileName,
+                        ErrorLevel.WARNING, ErrorMessagesFormatBuilder.getErrorWithParameters(
+                                ERROR_CODE_NNP1,
+                                Messages.PARAMETER_NAME_NOT_ALIGNED_WITH_GUIDELINES.getErrorMessage(),
+                                "Port", "Fixed_IPS", fixedIpsName, resourceEntry.getKey()),
+                        LoggerTragetServiceName.VALIDATE_FIXED_IPS_NAME,
+                        LoggerErrorDescription.NAME_NOT_ALIGNED_WITH_GUIDELINES);
               }
             }
           } else {
             globalContext.addMessage(
-                fileName,
-                ErrorLevel.WARNING, ErrorMessagesFormatBuilder
-                    .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(),
-                        "fixed_ips", resourceEntry.getKey()),
-                LoggerTragetServiceName.VALIDATE_FIXED_IPS_NAME,
-                LoggerErrorDescription.MISSING_GET_PARAM);
+                    fileName,
+                    ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+                            .getErrorWithParameters(
+                                    ERROR_CODE_NNP2, Messages.MISSING_GET_PARAM.getErrorMessage(),
+                                    "fixed_ips", resourceEntry.getKey()),
+                    LoggerTragetServiceName.VALIDATE_FIXED_IPS_NAME,
+                    LoggerErrorDescription.MISSING_GET_PARAM);
           }
         }
       }
@@ -153,23 +159,24 @@ public class NeutronPortNamingConventionValidator implements ResourceValidator {
       if (paramName instanceof String) {
         if (!ValidationUtil.evalPattern((String) paramName, regexList)) {
           globalContext.addMessage(
-              fileName,
-              ErrorLevel.WARNING, ErrorMessagesFormatBuilder
-                  .getErrorWithParameters(message.getErrorMessage(), resourceType,
-                      wrongPropertyFormat, (String) paramName, resourceId),
-              LoggerTragetServiceName.VALIDATE_PORT_NETWORK_NAME,
-              LoggerErrorDescription.NAME_NOT_ALIGNED_WITH_GUIDELINES);
+                  fileName,
+                  ErrorLevel.WARNING, ErrorMessagesFormatBuilder
+                          .getErrorWithParameters(ERROR_CODE_NNP3, message.getErrorMessage(), resourceType,
+                                  wrongPropertyFormat, (String) paramName, resourceId),
+                  LoggerTragetServiceName.VALIDATE_PORT_NETWORK_NAME,
+                  LoggerErrorDescription.NAME_NOT_ALIGNED_WITH_GUIDELINES);
         }
       }
     } else {
       globalContext.addMessage(
-          fileName,
-          ErrorLevel.WARNING,
-          ErrorMessagesFormatBuilder
-              .getErrorWithParameters(Messages.MISSING_GET_PARAM.getErrorMessage(),
-                  "network or network_id", resourceId),
-          LoggerTragetServiceName.VALIDATE_PORT_NETWORK_NAME,
-          LoggerErrorDescription.MISSING_GET_PARAM);
+              fileName,
+              ErrorLevel.WARNING,
+              ErrorMessagesFormatBuilder
+                      .getErrorWithParameters(
+                              ERROR_CODE_NNP2, Messages.MISSING_GET_PARAM.getErrorMessage(),
+                              "network or network_id", resourceId),
+              LoggerTragetServiceName.VALIDATE_PORT_NETWORK_NAME,
+              LoggerErrorDescription.MISSING_GET_PARAM);
     }
 
     mdcDataDebugMessage.debugExitMessage("file", fileName);
index 8ba5a27..1a7b608 100644 (file)
@@ -18,46 +18,60 @@ public class NeutronPortNamingConventionValidatorTest {
   NamingConventionGuideLineValidator baseValidator = new NamingConventionGuideLineValidator();
   NeutronPortNamingConventionValidator resourceValidator = new
       NeutronPortNamingConventionValidator();
-
+  private static final  String PATH = "/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/";
   @Test
   public void testHeatPortNetworkNamingConvention() {
     Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
-        resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
-        "/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positive/");
+            resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
+            PATH + "positive/");
     Assert.assertNotNull(messages);
     Assert.assertEquals(messages.size(), 0);
 
     messages = ValidationTestUtil.testValidator(baseValidator,
-        resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
-        "/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/negative/");
+            resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
+            PATH + "negative/");
     Assert.assertNotNull(messages);
     Assert.assertEquals(messages.size(), 1);
     Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 3);
     Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
-        "WARNING: Port 'Network' Parameter Name not aligned with Guidelines, Parameter Name [not_valid_network_name], Resource ID [port_resource]. As a result, VF/VFC Profile may miss this information");
+            "WARNING: [NNP3]: Port 'Network' Parameter Name not aligned with Guidelines, Parameter Name [not_valid_network_name], Resource ID [port_resource]. As a result, VF/VFC Profile may miss this information");
   }
 
   @Test
   public void testNeutronFixedIpName() {
     Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
-        resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
-        "/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/positive");
+            resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
+            PATH + "positiveFixedIP");
     Assert.assertNotNull(messages);
     Assert.assertEquals(messages.size(), 0);
 
     messages = ValidationTestUtil.testValidator(baseValidator,
-        resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
-        "/org/openecomp/validation/validators/guideLineValidator/heatPortFixedIpNamingConvention/negative/");
+            resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
+            PATH + "negativeFixedIP/");
     Assert.assertNotNull(messages);
     Assert.assertEquals(messages.size(), 1);
     Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 4);
     Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
-        "WARNING: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [pcrf_net_v6_ip_a], Resource ID [port_resource_0]. As a result, VF/VFC Profile may miss this information");
+            "WARNING: [NNP1]: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [pcrf_net_v6_ip_a], Resource ID [port_resource_0]. As a result, VF/VFC Profile may miss this information");
     Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(1).getMessage(),
-        "WARNING: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [indx], Resource ID [port_resource_1]. As a result, VF/VFC Profile may miss this information");
+            "WARNING: [NNP1]: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [indx], Resource ID [port_resource_1]. As a result, VF/VFC Profile may miss this information");
+
     Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(2).getMessage(),
-        "WARNING: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [pcrf_net_ipz], Resource ID [port_resource_2]. As a result, VF/VFC Profile may miss this information");
+            "WARNING: [NNP1]: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [pcrf_net_ipz], Resource ID [port_resource_2]. As a result, VF/VFC Profile may miss this information");
+
     Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(3).getMessage(),
-        "WARNING: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [pcrf_net_v0_ip_3], Resource ID [port_resource_2]. As a result, VF/VFC Profile may miss this information");
+            "WARNING: [NNP1]: Port 'Fixed_IPS' Parameter Name not aligned with Guidelines, Parameter Name [pcrf_net_v0_ip_3], Resource ID [port_resource_2]. As a result, VF/VFC Profile may miss this information");
+  }
+
+  @Test
+  public void testMissingParam() {
+    Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
+            resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
+            PATH + "missingparam/");
+    Assert.assertNotNull(messages);
+    Assert.assertEquals(messages.size(), 1);
+    Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().size(), 1);
+    Assert.assertEquals(messages.get("first.yaml").getErrorMessageList().get(0).getMessage(),
+            "WARNING: [NNP2]: Missing get_param in network or network_id, Resource Id [port_resource_2]");
   }
 }
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/missingparam/first.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/missingparam/first.yaml
new file mode 100644 (file)
index 0000000..0fd281d
--- /dev/null
@@ -0,0 +1,33 @@
+heat_template_version: 2013-05-23
+
+description: heat expose volume resource
+
+resources:
+  port_resource_0:
+    type: OS::Neutron::Port
+    properties:
+     network_id: { get_param: Internal1_net_id }
+resources:
+  port_resource_1:
+    type: OS::Neutron::Port
+    properties:
+     network_id: { get_param: Internal1_net_name }
+resources:
+  port_resource_2:
+    type: OS::Neutron::Port
+    properties:
+     network_id: Internal1_net_fqdn
+
+
+outputs:
+  expose_resource_port_output_0:
+    description: the pcrf_server
+    value: { get_resource: port_resource_0 }
+  expose_resource_port_output_1:
+      description: the pcrf_server
+      value: { get_resource: port_resource_1 }
+  expose_resource_port_output_2:
+      description: the pcrf_server
+      value: { get_resource: port_resource_2 }
+
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/MANIFEST.json
new file mode 100644 (file)
index 0000000..76ce6de
--- /dev/null
@@ -0,0 +1,27 @@
+{
+  "name": "validTest",
+  "description": "Valid Test",
+  "version": "1610",
+  "data": [
+    {
+      "file": "first.yaml",
+      "type": "HEAT",
+      "isBase": true,
+      "data": [
+        {
+          "file": "first.env",
+          "type": "HEAT_ENV"
+        },
+        {
+          "file": "firstVol.yaml",
+          "type": "HEAT_VOL"
+        }
+      ]
+    },
+    {
+      "file": "second.yaml",
+      "type": "HEAT",
+      "isBase": false
+    }
+  ]
+}
\ 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/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/first.env b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/first.env
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/firstVol.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/firstVol.yaml
new file mode 100644 (file)
index 0000000..7e82b2a
--- /dev/null
@@ -0,0 +1,19 @@
+
+heat_template_version:  2013-05-23
+
+parameters:
+   not_null:
+     type: number
+     label: not_number
+
+
+resources:
+   volume_expose:
+     type: OS::Cinder::Volume
+     properties:
+       not_null: not_null
+outputs:
+  not_expose_resource_network_output:
+    description: the pcrf_server
+    value: { get_resource: volume_expose }
+
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/second.yaml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/guideLineValidator/heatPortNetworkNamingConvention/positiveFixedIP/second.yaml
new file mode 100644 (file)
index 0000000..bb06b9d
--- /dev/null
@@ -0,0 +1,14 @@
+heat_template_version: 2013-05-23
+
+description: heat second
+
+resources:
+  network_expose:
+    type: OS::Neutron::Net
+
+outputs:
+  expose_resource_network_output:
+    description: the pcrf_server
+    value: { get_resource: network_expose }
+
+