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-11-22 18:28:21 +0530
committermojahidi <mojahidul.islam@amdocs.com>2017-11-22 18:30:14 +0530
commit8052ce0a3916c4fb6387af169205274a5e78d4ee (patch)
tree2e53c41b82d96e27805543b77bae8303a04b70eb /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test
parent5650c6a9b50287d572e8e040085d0ce2100a82a1 (diff)
NeutronPortResourceValidator
This task is about updating error messages with error codes for NeutronPortResourceValidator Change-Id: I6070dfc4543727a29c3625078a947d0059c92fb7 Issue-ID: SDC-572 Signed-off-by: mojahidi <mojahidul.islam@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/NeutronPortResourceValidatorTest.java41
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/no_neutron_port/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/no_neutron_port/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/no_neutron_port/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/port_no_bind_to_any_nova_server/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/port_no_bind_to_any_nova_server/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/port_no_bind_to_any_nova_server/input/hot-nimbus-psm_v1.0.yaml86
7 files changed, 238 insertions, 5 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/NeutronPortResourceValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidatorTest.java
index 359803f473..83e06ee5b7 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidatorTest.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidatorTest.java
@@ -18,18 +18,49 @@ public class NeutronPortResourceValidatorTest {
HeatResourceValidator baseValidator = new HeatResourceValidator();
NeutronPortResourceValidator resourceValidator = new NeutronPortResourceValidator();
+ private static final String PATH = "/org/openecomp/validation/validators/heat_validator/";
@Test
- public void testOnlyOneNovaPointsToOnePort() throws IOException {
+ public void testMoreThanOneBindFromNovaToPort() throws IOException {
Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
- resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
- "/org/openecomp/validation/validators/heat_validator/one_nova_points_to_one_port/negative_test/input");
+ resourceValidator, HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource(),
+ PATH + "one_nova_points_to_one_port/negative_test/input");
Assert.assertNotNull(messages);
Assert.assertEquals(messages.size(), 1);
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: Resource Port oam1_int_port exceed allowed relations from NovaServer");
+ messages.get("hot-nimbus-psm_v1.0.yaml").getErrorMessageList().get(0).getMessage(),
+ "ERROR: [HPR2]: Resource Port oam1_int_port exceed allowed relations from NovaServer");
+ }
+
+ @Test
+ public void testPortNotBindToAnyNovaServerHPR1() throws IOException {
+ Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
+ resourceValidator, HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource(),
+ PATH + "no_neutron_port/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ 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(),
+ "WARNING: [HPR1]: Port not bind to any NOVA Server, Resource Id [nova_server_1]");
+ }
+
+ @Test
+ public void testPortNotBindToAnyNovaServerHPR3() throws IOException {
+ Map<String, MessageContainer> messages = ValidationTestUtil.testValidator(baseValidator,
+ resourceValidator, HeatResourcesTypes.NOVA_SERVER_RESOURCE_TYPE.getHeatResource(),
+ PATH + "port_no_bind_to_any_nova_server/input");
+
+ Assert.assertNotNull(messages);
+ Assert.assertEquals(messages.size(), 1);
+
+ 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(),
+ "WARNING: [HPR3]: Port not bind to any NOVA Server, Resource Id [nova_server_1]");
}
}
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/no_neutron_port/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/no_neutron_port/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/no_neutron_port/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/no_neutron_port/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/no_neutron_port/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/no_neutron_port/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/no_neutron_port/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/no_neutron_port/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/no_neutron_port/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/port_no_bind_to_any_nova_server/input/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/port_no_bind_to_any_nova_server/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/port_no_bind_to_any_nova_server/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/port_no_bind_to_any_nova_server/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/port_no_bind_to_any_nova_server/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/port_no_bind_to_any_nova_server/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/port_no_bind_to_any_nova_server/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/port_no_bind_to_any_nova_server/input/hot-nimbus-psm_v1.0.yaml
new file mode 100644
index 0000000000..d412ebbce6
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/test/resources/org/openecomp/validation/validators/heat_validator/port_no_bind_to_any_nova_server/input/hot-nimbus-psm_v1.0.yaml
@@ -0,0 +1,86 @@
+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 }
+
+ oam1_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: pcrf_psm_server_names}
+ fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}]
+ security_groups: [{get_param: pcrf_psm_image_name}]
+ replacement_policy: AUTO
+
+ oam2_int_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: pcrf_psm_server_names}
+ fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}]
+ security_groups: [{get_param: pcrf_psm_image_name}]
+ replacement_policy: AUTO
+
+ oam1_mgmt_port:
+ type: OS::Neutron::Port
+ properties:
+ network: {get_param: pcrf_psm_server_names}
+ fixed_ips: [{"ip_address": {get_param: [pcrf_psm_image_name, 0]}}]
+ security_groups: [{get_param: pcrf_psm_image_name}]
+ replacement_policy: AUTO \ No newline at end of file