summaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test
diff options
context:
space:
mode:
authoreeginux <henry.xie@est.tech>2019-03-16 16:07:16 +0000
committerXuefeng Xie <henry.xie@est.tech>2019-03-25 13:24:55 +0000
commit66481e1dd76fbfa22f41ec0ce453336221cf9ae8 (patch)
tree68f3fc28cf4c2d38ce6bbe01ad44f5fc35c08462 /asdc-controller/src/test
parente2a3995dd8dba9b9a18635ce37e4805dadcdb0fd (diff)
PNF ingestion in SO catalogdb
Support PNF csar ingestion in SO catalogdb Add integation test for TOSCA installer Fix the VNF resource/resource customization insert https://jira.onap.org/browse/SO-1604 subtask so-1607 and SO-1608 are included The catalogdb table contents are attached in the jira Issue-ID: SO-1604 Change-Id: Ie08c4a1219a6cce96ba081b0dd9d3e5fd997da8f Signed-off-by: eeginux <henry.xie@est.tech>
Diffstat (limited to 'asdc-controller/src/test')
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java442
-rw-r--r--asdc-controller/src/test/resources/ASDC/.gitignore2
-rw-r--r--asdc-controller/src/test/resources/application-test.yaml4
-rw-r--r--asdc-controller/src/test/resources/download/service-Svc140-VF-csar.csarbin0 -> 35636 bytes
-rw-r--r--asdc-controller/src/test/resources/download/service-Testservice140-csar.csarbin0 -> 35457 bytes
-rw-r--r--asdc-controller/src/test/resources/schema.sql55
6 files changed, 482 insertions, 21 deletions
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java
new file mode 100644
index 0000000000..c0c66123eb
--- /dev/null
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCControllerITTest.java
@@ -0,0 +1,442 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.asdc.client;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.ok;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.UUID;
+import javax.persistence.EntityNotFoundException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+import org.onap.so.asdc.BaseTest;
+import org.onap.so.asdc.client.exceptions.ASDCControllerException;
+import org.onap.so.asdc.client.test.emulators.ArtifactInfoImpl;
+import org.onap.so.asdc.client.test.emulators.DistributionClientEmulator;
+import org.onap.so.asdc.client.test.emulators.NotificationDataImpl;
+import org.onap.so.asdc.client.test.emulators.ResourceInfoImpl;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.beans.Service;
+import org.onap.so.db.catalog.beans.ToscaCsar;
+import org.onap.so.db.catalog.beans.VnfResource;
+import org.onap.so.db.catalog.beans.VnfResourceCustomization;
+import org.onap.so.db.catalog.data.repository.PnfCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.PnfResourceRepository;
+import org.onap.so.db.catalog.data.repository.ServiceRepository;
+import org.onap.so.db.catalog.data.repository.ToscaCsarRepository;
+import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository;
+import org.onap.so.db.catalog.data.repository.VnfResourceRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * This is used to run some basic integration test(BIT) for ASDC controller. It will test the csar install and all the
+ * testing csar files are located underneath src/main/resources/download folder,
+ *
+ * PNF csar: service-Testservice140-csar.csar VNF csar: service-Svc140-VF-csar.csar
+ */
+@Transactional
+public class ASDCControllerITTest extends BaseTest {
+
+ private Logger logger = LoggerFactory.getLogger(ASDCControllerITTest.class);
+
+ @Rule
+ public TestName testName = new TestName();
+
+ private String serviceUuid;
+ private String serviceInvariantUuid;
+
+ /**
+ * Random UUID served as distribution UUID.
+ */
+ private String distributionId;
+ private String artifactUuid;
+
+ @Autowired
+ private ASDCController asdcController;
+
+ @Autowired
+ private PnfResourceRepository pnfResourceRepository;
+
+ @Autowired
+ private PnfCustomizationRepository pnfCustomizationRepository;
+
+ @Autowired
+ private VnfResourceRepository vnfResourceRepository;
+
+ @Autowired
+ private VnfCustomizationRepository vnfCustomizationRepository;
+
+ @Autowired
+ private ToscaCsarRepository toscaCsarRepository;
+
+ @Autowired
+ private ServiceRepository serviceRepository;
+
+ private DistributionClientEmulator distributionClient;
+
+ @Before
+ public void setUp() {
+ distributionId = UUID.randomUUID().toString();
+ artifactUuid = UUID.randomUUID().toString();
+ logger.info("Using distributionId: {}, artifactUUID: {} for testcase: {}", distributionId, artifactUuid,
+ testName.getMethodName());
+
+ distributionClient = new DistributionClientEmulator();
+ distributionClient.setResourcePath("src/test/resources");
+ asdcController.setDistributionClient(distributionClient);
+ try {
+ asdcController.initASDC();
+ } catch (ASDCControllerException e) {
+ logger.error(e.getMessage(), e);
+ fail(e.getMessage());
+ }
+ }
+
+ @After
+ public void shutDown() {
+ try {
+ asdcController.closeASDC();
+ } catch (ASDCControllerException e) {
+ logger.error(e.getMessage(), e);
+ fail(e.getMessage());
+ }
+ }
+
+ /**
+ * Mock the AAI using wireshark.
+ */
+ private void initMockAaiServer(final String serviceUuid, final String serviceInvariantUuid) {
+ String modelEndpoint = "/aai/v15/service-design-and-creation/models/model/" + serviceInvariantUuid
+ + "/model-vers/model-ver/" + serviceUuid + "?depth=0";
+
+ stubFor(post(urlEqualTo(modelEndpoint)).willReturn(ok()));
+ }
+
+ /**
+ * Test with service-Testservice140-csar.csar.
+ */
+ @Test
+ public void treatNotification_ValidPnfResource_ExpectedOutput() {
+
+ /**
+ * service UUID/invariantUUID from global metadata in service-Testservice140-template.yml.
+ */
+ String serviceUuid = "efaea486-561f-4159-9191-a8d3cb346728";
+ String serviceInvariantUuid = "f2edfbf4-bb0a-4fe7-a57a-71362d4b0b23";
+
+ initMockAaiServer(serviceUuid, serviceInvariantUuid);
+
+ NotificationDataImpl notificationData = new NotificationDataImpl();
+ notificationData.setServiceUUID(serviceUuid);
+ notificationData.setDistributionID(distributionId);
+ notificationData.setServiceInvariantUUID(serviceInvariantUuid);
+ notificationData.setServiceVersion("1.0");
+
+ ResourceInfoImpl resourceInfo = constructPnfResourceInfo();
+ List<ResourceInfoImpl> resourceInfoList = new ArrayList<>();
+ resourceInfoList.add(resourceInfo);
+ notificationData.setResources(resourceInfoList);
+
+ ArtifactInfoImpl artifactInfo = constructPnfServiceArtifact();
+ List<ArtifactInfoImpl> artifactInfoList = new ArrayList<>();
+ artifactInfoList.add(artifactInfo);
+ notificationData.setServiceArtifacts(artifactInfoList);
+
+ try {
+ asdcController.treatNotification(notificationData);
+ logger.info("Checking the database for PNF ingestion");
+
+ /**
+ * Check the tosca csar entity, it should be the same as provided from NotficationData.
+ */
+ ToscaCsar toscaCsar = toscaCsarRepository.findById(artifactUuid)
+ .orElseThrow(() -> new EntityNotFoundException("Tosca csar: " + artifactUuid + " not found"));
+ assertEquals("tosca csar UUID", artifactUuid, toscaCsar.getArtifactUUID());
+ assertEquals("tosca csar name", "service-Testservice140-csar.csar", toscaCsar.getName());
+ assertEquals("tosca csar version", "1.0", toscaCsar.getVersion());
+ assertNull("tosca csar descrption", toscaCsar.getDescription());
+ assertEquals("tosca csar checksum", "MANUAL_RECORD", toscaCsar.getArtifactChecksum());
+ assertEquals("toscar csar URL", "/download/service-Testservice140-csar.csar", toscaCsar.getUrl());
+
+ /**
+ * Check the service entity, it should be the same as global metadata information in service-Testservice140-template.yml inside csar.
+ */
+ Service service = serviceRepository.findById(serviceUuid)
+ .orElseThrow(() -> new EntityNotFoundException("Service: " + serviceUuid + " not found"));
+ assertEquals("model UUID", "efaea486-561f-4159-9191-a8d3cb346728", service.getModelUUID());
+ assertEquals("model name", "TestService140", service.getModelName());
+ assertEquals("model invariantUUID", "f2edfbf4-bb0a-4fe7-a57a-71362d4b0b23",
+ service.getModelInvariantUUID());
+ assertEquals("model version", "1.0", service.getModelVersion());
+ assertEquals("description", "Test Service for extended attributes of PNF resource",
+ service.getDescription().trim());
+ assertEquals("tosca csar artifact UUID", artifactUuid, service.getCsar().getArtifactUUID());
+ assertEquals("service type", "Network", service.getServiceType());
+ assertEquals("service role", "nfv", service.getServiceRole());
+ assertEquals("environment context", "General_Revenue-Bearing", service.getEnvironmentContext());
+ assertEquals("service category", "Network Service", service.getCategory());
+ assertNull("workload context", service.getWorkloadContext());
+ assertEquals("resource order", "Test140PNF", service.getResourceOrder());
+
+ /**
+ * Check PNF resource, it should be the same as metadata in the topology template in service-Testservice140-template.yml
+ * OR
+ * global metadata in the resource-Test140pnf-template.yml
+ */
+ String pnfResourceKey = "9c54e269-122b-4e8a-8b2a-6eac849b441a";
+ PnfResource pnfResource = pnfResourceRepository.findById(pnfResourceKey)
+ .orElseThrow(() -> new EntityNotFoundException("PNF resource:" + pnfResourceKey + " not found"));
+ assertNull("orchestration mode", pnfResource.getOrchestrationMode());
+ assertEquals("Description", "Oracle", pnfResource.getDescription().trim());
+ assertEquals("model UUID", pnfResourceKey, pnfResource.getModelUUID());
+ assertEquals("model invariant UUID", "d832a027-75f3-455d-9de4-f02fcdee7e7e",
+ pnfResource.getModelInvariantUUID());
+ assertEquals("model version", "1.0", pnfResource.getModelVersion());
+ assertEquals("model name", "Test140PNF", pnfResource.getModelName());
+ assertEquals("tosca node type", "org.openecomp.resource.pnf.Test140pnf", pnfResource.getToscaNodeType());
+ assertEquals("resource category", "Application L4+", pnfResource.getCategory());
+ assertEquals("resource sub category", "Call Control", pnfResource.getSubCategory());
+
+ /**
+ * Check PNF resource customization, it should be the same as metadata in the topology template in service-Testservice140-template.yml
+ * OR
+ * global metadata in the resource-Test140pnf-template.yml
+ */
+ String pnfCustomizationKey = "428a3d73-f962-4cc2-ba62-2483c45d6b12";
+ PnfResourceCustomization pnfCustomization = pnfCustomizationRepository
+ .findById(pnfCustomizationKey).orElseThrow(
+ () -> new EntityNotFoundException(
+ "PNF resource customization: " + pnfCustomizationKey + " not found"));
+ assertEquals("model customizationUUID", pnfCustomizationKey, pnfCustomization.getModelCustomizationUUID());
+ assertEquals("model instance name", "Test140PNF 0", pnfCustomization.getModelInstanceName());
+ assertEquals("NF type", "", pnfCustomization.getNfType());
+ assertEquals("NF Role", "nf", pnfCustomization.getNfRole());
+ assertEquals("NF function", "nf", pnfCustomization.getNfFunction());
+ assertEquals("NF naming code", "", pnfCustomization.getNfNamingCode());
+ assertEquals("PNF resource model UUID", pnfResourceKey, pnfCustomization.getPnfResources().getModelUUID());
+ assertEquals("Multi stage design", "", pnfCustomization.getMultiStageDesign());
+ assertNull("resource input", pnfCustomization.getResourceInput());
+ assertEquals("cds blueprint name(sdnc_model_name property)", pnfCustomization.getBlueprintName(),
+ pnfCustomization.getBlueprintName());
+ assertEquals("cds blueprint version(sdnc_model_version property)", pnfCustomization.getBlueprintVersion(),
+ pnfCustomization.getBlueprintVersion());
+
+ /**
+ * Check the pnf resource customization with service mapping
+ */
+ List<PnfResourceCustomization> pnfCustList = service.getPnfCustomizations();
+ assertEquals("PNF resource customization entity", 1, pnfCustList.size());
+ assertEquals(pnfCustomizationKey, pnfCustList.get(0).getModelCustomizationUUID());
+
+ } catch (Exception e) {
+ logger.info(e.getMessage(), e);
+ fail(e.getMessage());
+ }
+ }
+
+ private ArtifactInfoImpl constructPnfServiceArtifact() {
+ ArtifactInfoImpl artifactInfo = new ArtifactInfoImpl();
+ artifactInfo.setArtifactType(ASDCConfiguration.TOSCA_CSAR);
+ artifactInfo.setArtifactURL("/download/service-Testservice140-csar.csar");
+ artifactInfo.setArtifactName("service-Testservice140-csar.csar");
+ artifactInfo.setArtifactVersion("1.0");
+ artifactInfo.setArtifactUUID(artifactUuid);
+ return artifactInfo;
+ }
+
+ /**
+ * Construct the PnfResourceInfo based on the resource-Test140Pnf-template.yml from
+ * service-Testservice140-csar.csar.
+ */
+ private ResourceInfoImpl constructPnfResourceInfo() {
+ ResourceInfoImpl resourceInfo = new ResourceInfoImpl();
+ resourceInfo.setResourceInstanceName("Test140PNF");
+ resourceInfo.setResourceInvariantUUID("d832a027-75f3-455d-9de4-f02fcdee7e7e");
+ resourceInfo.setResoucreType("PNF");
+ resourceInfo.setCategory("Application L4+");
+ resourceInfo.setSubcategory("Call Control");
+ resourceInfo.setResourceUUID("9c54e269-122b-4e8a-8b2a-6eac849b441a");
+ resourceInfo.setResourceCustomizationUUID("428a3d73-f962-4cc2-ba62-2483c45d6b12");
+ resourceInfo.setResourceVersion("1.0");
+ return resourceInfo;
+ }
+
+ /**
+ * Testing with the service-Svc140-VF-csar.csar.
+ */
+ @Test
+ public void treatNotification_ValidVnfResource_ExpectedOutput() {
+
+ /**
+ * service UUID/invariantUUID from global metadata in resource-Testvf140-template.yml.
+ */
+ String serviceUuid = "28944a37-de3f-46ec-9c60-b57036fbd26d";
+ String serviceInvariantUuid = "9e900d3e-1e2e-4124-a5c2-4345734dc9de";
+
+ initMockAaiServer(serviceUuid, serviceInvariantUuid);
+
+ NotificationDataImpl notificationData = new NotificationDataImpl();
+ notificationData.setServiceUUID(serviceUuid);
+ notificationData.setDistributionID(distributionId);
+ notificationData.setServiceInvariantUUID(serviceInvariantUuid);
+ notificationData.setServiceVersion("1.0");
+
+ ResourceInfoImpl resourceInfo = constructVnfResourceInfo();
+ List<ResourceInfoImpl> resourceInfoList = new ArrayList<>();
+ resourceInfoList.add(resourceInfo);
+ notificationData.setResources(resourceInfoList);
+
+ ArtifactInfoImpl artifactInfo = constructVnfServiceArtifact();
+ List<ArtifactInfoImpl> artifactInfoList = new ArrayList<>();
+ artifactInfoList.add(artifactInfo);
+ notificationData.setServiceArtifacts(artifactInfoList);
+
+ try {
+ asdcController.treatNotification(notificationData);
+ logger.info("Checking the database for VNF ingestion");
+
+ /**
+ * Check the tosca csar entity, it should be the same as provided from NotficationData.
+ */
+ ToscaCsar toscaCsar = toscaCsarRepository.findById(artifactUuid)
+ .orElseThrow(() -> new EntityNotFoundException("Tosca csar: " + artifactUuid + " not found"));
+ assertEquals("tosca csar UUID", artifactUuid, toscaCsar.getArtifactUUID());
+ assertEquals("tosca csar name", "service-Svc140-VF-csar.csar", toscaCsar.getName());
+ assertEquals("tosca csar version", "1.0", toscaCsar.getVersion());
+ assertNull("tosca csar descrption", toscaCsar.getDescription());
+ assertEquals("tosca csar checksum", "MANUAL_RECORD", toscaCsar.getArtifactChecksum());
+ assertEquals("toscar csar URL", "/download/service-Svc140-VF-csar.csar", toscaCsar.getUrl());
+
+ /**
+ * Check the service entity, it should be the same as global metadata information in service-Testservice140-template.yml inside csar.
+ */
+ Service service = serviceRepository.findById(serviceUuid)
+ .orElseThrow(() -> new EntityNotFoundException("Service: " + serviceUuid + " not found"));
+ assertEquals("model UUID", serviceUuid, service.getModelUUID());
+ assertEquals("model name", "SVC140", service.getModelName());
+ assertEquals("model invariantUUID", serviceInvariantUuid,
+ service.getModelInvariantUUID());
+ assertEquals("model version", "1.0", service.getModelVersion());
+ assertEquals("description", "SVC140",
+ service.getDescription().trim());
+ assertEquals("tosca csar artifact UUID", artifactUuid, service.getCsar().getArtifactUUID());
+ assertEquals("service type", "ST", service.getServiceType());
+ assertEquals("service role", "Sr", service.getServiceRole());
+ assertEquals("environment context", "General_Revenue-Bearing", service.getEnvironmentContext());
+ assertEquals("service category", "Network Service", service.getCategory());
+ assertNull("workload context", service.getWorkloadContext());
+ assertEquals("resource order", "TestVF140", service.getResourceOrder());
+
+ /**
+ * Check VNF resource, it should be the same as metadata in the topology template in service-Testservice140-template.yml
+ * OR
+ * global metadata in the resource-Testservice140-template.yml
+ */
+ String vnfResourceKey = "d20d3ea9-2f54-4071-8b5c-fd746dde245e";
+ VnfResource vnfResource = vnfResourceRepository.findById(vnfResourceKey)
+ .orElseThrow(() -> new EntityNotFoundException("VNF resource:" + vnfResourceKey + " not found"));
+ assertEquals("orchestration mode", "HEAT", vnfResource.getOrchestrationMode());
+ assertEquals("Description", "TestPNF140", vnfResource.getDescription().trim());
+ assertEquals("model UUID", vnfResourceKey, vnfResource.getModelUUID());
+ assertEquals("model invariant UUID", "7a4bffa2-fac5-4b8b-b348-0bdf313a1aeb",
+ vnfResource.getModelInvariantUUID());
+ assertEquals("model version", "1.0", vnfResource.getModelVersion());
+ assertEquals("model name", "TestVF140", vnfResource.getModelName());
+ assertEquals("tosca node type", "org.openecomp.resource.vf.Testvf140", vnfResource.getToscaNodeType());
+ assertEquals("resource category", "Application L4+", vnfResource.getCategory());
+ assertEquals("resource sub category", "Database", vnfResource.getSubCategory());
+
+ /**
+ * Check VNF resource customization, it should be the same as metadata in the topology template in service-Testservice140-template.yml
+ * OR
+ * global metadata in the resource-Testservice140-template.yml
+ */
+ String vnfCustomizationKey = "ca1c8455-8ce2-4a76-a037-3f4cf01cffa0";
+ VnfResourceCustomization vnfCustomization = vnfCustomizationRepository
+ .findById(vnfCustomizationKey).orElseThrow(
+ () -> new EntityNotFoundException(
+ "VNF resource customization: " + vnfCustomizationKey + " not found"));
+ assertEquals("model customizationUUID", vnfCustomizationKey, vnfCustomization.getModelCustomizationUUID());
+ assertEquals("model instance name", "TestVF140 0", vnfCustomization.getModelInstanceName());
+ assertNull("NF type", vnfCustomization.getNfType());
+ assertNull("NF Role", vnfCustomization.getNfRole());
+ assertNull("NF function", vnfCustomization.getNfFunction());
+ assertNull("NF naming code", vnfCustomization.getNfNamingCode());
+ assertEquals("VNF resource model UUID", vnfResourceKey, vnfCustomization.getVnfResources().getModelUUID());
+ assertEquals("Multi stage design", "false", vnfCustomization.getMultiStageDesign());
+ assertNull("resource input", vnfCustomization.getResourceInput());
+ assertEquals("cds blueprint name(sdnc_model_name property)", vnfCustomization.getBlueprintName(),
+ vnfCustomization.getBlueprintName());
+ assertEquals("cds blueprint version(sdnc_model_version property)", vnfCustomization.getBlueprintVersion(),
+ vnfCustomization.getBlueprintVersion());
+ /**
+ * Check the vnf resource customization with service mapping
+ */
+ List<VnfResourceCustomization> vnfCustList = service.getVnfCustomizations();
+ assertEquals("VNF resource customization entity", 1, vnfCustList.size());
+ assertEquals(vnfCustomizationKey, vnfCustList.get(0).getModelCustomizationUUID());
+ } catch (Exception e) {
+ logger.info(e.getMessage(), e);
+ fail(e.getMessage());
+ }
+ }
+
+ private ArtifactInfoImpl constructVnfServiceArtifact() {
+ ArtifactInfoImpl artifactInfo = new ArtifactInfoImpl();
+ artifactInfo.setArtifactType(ASDCConfiguration.TOSCA_CSAR);
+ artifactInfo.setArtifactURL("/download/service-Svc140-VF-csar.csar");
+ artifactInfo.setArtifactName("service-Svc140-VF-csar.csar");
+ artifactInfo.setArtifactVersion("1.0");
+ artifactInfo.setArtifactUUID(artifactUuid);
+ return artifactInfo;
+ }
+
+ /**
+ * Construct the PnfResourceInfo based on the resource-Testvf140-template.yml from service-Svc140-VF-csar.csar.
+ */
+ private ResourceInfoImpl constructVnfResourceInfo() {
+ ResourceInfoImpl resourceInfo = new ResourceInfoImpl();
+ resourceInfo.setResourceInstanceName("TestVF140");
+ resourceInfo.setResourceInvariantUUID("7a4bffa2-fac5-4b8b-b348-0bdf313a1aeb");
+ resourceInfo.setResoucreType("VF");
+ resourceInfo.setCategory("Application L4+");
+ resourceInfo.setSubcategory("Database");
+ resourceInfo.setResourceUUID("d20d3ea9-2f54-4071-8b5c-fd746dde245e");
+ resourceInfo.setResourceCustomizationUUID("ca1c8455-8ce2-4a76-a037-3f4cf01cffa0");
+ resourceInfo.setResourceVersion("1.0");
+ resourceInfo.setArtifacts(Collections.EMPTY_LIST);
+ return resourceInfo;
+ }
+}
diff --git a/asdc-controller/src/test/resources/ASDC/.gitignore b/asdc-controller/src/test/resources/ASDC/.gitignore
index e54786bc77..836e68d117 100644
--- a/asdc-controller/src/test/resources/ASDC/.gitignore
+++ b/asdc-controller/src/test/resources/ASDC/.gitignore
@@ -1 +1 @@
-/*.csar
+*.*/*.csar
diff --git a/asdc-controller/src/test/resources/application-test.yaml b/asdc-controller/src/test/resources/application-test.yaml
index caaa5dd3b4..5ba8521b3c 100644
--- a/asdc-controller/src/test/resources/application-test.yaml
+++ b/asdc-controller/src/test/resources/application-test.yaml
@@ -14,7 +14,7 @@ spring:
initialization-mode: always
jpa:
generate-ddl: false
- show-sql: false
+ show-sql: true
hibernate:
ddl-auto: none
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
@@ -97,3 +97,5 @@ mso:
enabled: false
aai:
endpoint: http://localhost:${wiremock.server.port}
+ config:
+ defaultpath: src/test/resources
diff --git a/asdc-controller/src/test/resources/download/service-Svc140-VF-csar.csar b/asdc-controller/src/test/resources/download/service-Svc140-VF-csar.csar
new file mode 100644
index 0000000000..0de1b0b0a0
--- /dev/null
+++ b/asdc-controller/src/test/resources/download/service-Svc140-VF-csar.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/download/service-Testservice140-csar.csar b/asdc-controller/src/test/resources/download/service-Testservice140-csar.csar
new file mode 100644
index 0000000000..bd9a1dc775
--- /dev/null
+++ b/asdc-controller/src/test/resources/download/service-Testservice140-csar.csar
Binary files differ
diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql
index aef33c3aed..1035817c3c 100644
--- a/asdc-controller/src/test/resources/schema.sql
+++ b/asdc-controller/src/test/resources/schema.sql
@@ -399,6 +399,8 @@ create table `vnf_resource_customization` (
`vnf_resource_model_uuid` varchar(200) not null,
`multi_stage_design` varchar(20) default null,
`resource_input` varchar(20000) default null,
+ `cds_blueprint_name` varchar(200) default null,
+ `cds_blueprint_version` varchar(20) default null,
primary key (`model_customization_uuid`),
key `fk_vnf_resource_customization__vnf_resource1_idx` (`vnf_resource_model_uuid`),
constraint `fk_vnf_resource_customization__vnf_resource1` foreign key (`vnf_resource_model_uuid`) references `vnf_resource` (`model_uuid`) on delete cascade on update cascade
@@ -801,27 +803,41 @@ UPDATE CASCADE) ENGINE = InnoDB AUTO_INCREMENT = 20654 DEFAULT CHARACTER SET = l
CREATE TABLE IF NOT EXISTS vnf_vfmodule_cvnfc_configuration_customization (
- `ID` INT(11) NOT NULL AUTO_INCREMENT,
- `MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL,
- `MODEL_INSTANCE_NAME` VARCHAR(200) NOT NULL,
- `CONFIGURATION_TYPE` VARCHAR(200) NULL,
- `CONFIGURATION_ROLE` VARCHAR(200) NULL,
- `CONFIGURATION_FUNCTION` VARCHAR(200) NULL,
- `POLICY_NAME` VARCHAR(200) NULL,
- `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `CONFIGURATION_MODEL_UUID` VARCHAR(200) NOT NULL,
- `VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) DEFAULT NULL,
- `VF_MODULE_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) DEFAULT NULL,
- `CVNFC_CUSTOMIZATION_ID` INT(11) DEFAULT NULL,
- PRIMARY KEY (`ID`),
- INDEX `fk_vnf_vfmodule_cvnfc_config_cust__configuration_idx` (`CONFIGURATION_MODEL_UUID` ASC),
-
- CONSTRAINT `fk_vnf_vfmod_cvnfc_config_cust__configuration_resource` FOREIGN KEY (`CONFIGURATION_MODEL_UUID`)
- REFERENCES `configuration` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE = INNODB AUTO_INCREMENT = 20654 DEFAULT CHARACTER SET = LATIN1;
+ `ID` INT(11) NOT NULL AUTO_INCREMENT,
+ `MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL,
+ `VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL,
+ `VF_MODULE_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL,
+ `CVNFC_MODEL_CUSTOMIZATION_UUID` VARCHAR(200) NOT NULL,
+ `MODEL_INSTANCE_NAME` VARCHAR(200) NOT NULL,
+ `CONFIGURATION_TYPE` VARCHAR(200) NULL,
+ `CONFIGURATION_ROLE` VARCHAR(200) NULL,
+ `CONFIGURATION_FUNCTION` VARCHAR(200) NULL,
+ `POLICY_NAME` VARCHAR(200) NULL,
+ `CREATION_TIMESTAMP` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ `CONFIGURATION_MODEL_UUID` VARCHAR(200) NOT NULL,
+ PRIMARY KEY (`ID`),
+ INDEX `fk_vnf_vfmodule_cvnfc_config_cust__configuration_idx` (`CONFIGURATION_MODEL_UUID` ASC),
+ UNIQUE INDEX `UK_vnf_vfmodule_cvnfc_configuration_customization` (`VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID` ASC , `VF_MODULE_MODEL_CUSTOMIZATION_UUID` ASC , `CVNFC_MODEL_CUSTOMIZATION_UUID` ASC , `MODEL_CUSTOMIZATION_UUID` ASC),
+ INDEX `fk_vnf_vfmodule_cvnfc_config_cust__cvnfc_cust1_idx` (`CVNFC_MODEL_CUSTOMIZATION_UUID` ASC),
+ INDEX `fk_vnf_vfmodule_cvnfc_config_cust__vf_module_cust_idx` (`VF_MODULE_MODEL_CUSTOMIZATION_UUID` ASC),
+ INDEX `fk_vnf_vfmodule_cvnfc_config_cust__vnf_res_cust_idx` (`VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID` ASC),
+ CONSTRAINT `fk_vnf_vfmod_cvnfc_config_cust__configuration_resource` FOREIGN KEY (`CONFIGURATION_MODEL_UUID`)
+ REFERENCES `configuration` (`MODEL_UUID`)
+ ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `fk_cvnfc_configuration_customization__cvnfc_customization1` FOREIGN KEY (`CVNFC_MODEL_CUSTOMIZATION_UUID`)
+ REFERENCES `cvnfc_customization` (`MODEL_CUSTOMIZATION_UUID`)
+ ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `fk_vnf_configuration_cvnfc_customization__vf_module_customiza1` FOREIGN KEY (`VF_MODULE_MODEL_CUSTOMIZATION_UUID`)
+ REFERENCES `vf_module_customization` (`MODEL_CUSTOMIZATION_UUID`)
+ ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `fk_vfmodule_cvnfc_configuration_customization__vnf_resource_c1` FOREIGN KEY (`VNF_RESOURCE_CUST_MODEL_CUSTOMIZATION_UUID`)
+ REFERENCES `vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`)
+ ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=INNODB AUTO_INCREMENT=20654 DEFAULT CHARACTER SET=LATIN1;
+
CREATE TABLE IF NOT EXISTS `pnf_resource` (
- `ORCHESTRATION_MODE` varchar(20) NOT NULL DEFAULT 'HEAT',
+ `ORCHESTRATION_MODE` varchar(20) DEFAULT NULL,
`DESCRIPTION` varchar(1200) DEFAULT NULL,
`CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`MODEL_UUID` varchar(200) NOT NULL,
@@ -857,6 +873,7 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization_to_service` (
`RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`)
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
--------START Request DB SCHEMA --------
CREATE DATABASE requestdb;
USE requestdb;