diff options
25 files changed, 284 insertions, 89 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index da7aad4319..bc4434a70a 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -1471,13 +1471,30 @@ public class ToscaResourceInstaller { generateNamingValue = "true".equalsIgnoreCase(generateNaming); } service.setOnapGeneratedNaming(generateNamingValue); - service.setBlueprintName(serviceMetadata.getValue(CDS_MODEL_NAME)); - service.setBlueprintVersion(serviceMetadata.getValue(CDS_MODEL_VERSION)); - service.setSkipPostInstConf(Boolean.valueOf(serviceMetadata.getValue(SKIP_POST_INST_CONF))); - service.setControllerActor(serviceMetadata.getValue(CONTROLLER_ACTOR)); - } - + List<Input> serviceInputs = toscaResourceStructure.getSdcCsarHelper().getServiceInputs(); + logger.debug("serviceInputs: {} " + serviceInputs); + if (!serviceInputs.isEmpty()) { + serviceInputs.forEach(input -> { + if (CDS_MODEL_NAME.equalsIgnoreCase(input.getName())) { + String value = input.getDefault() != null ? input.getDefault().toString() : null; + service.setBlueprintName(value); + } + if (CDS_MODEL_VERSION.equalsIgnoreCase(input.getName())) { + String value = input.getDefault() != null ? input.getDefault().toString() : null; + service.setBlueprintVersion(value); + } + if (CONTROLLER_ACTOR.equalsIgnoreCase(input.getName())) { + String value = input.getDefault() != null ? input.getDefault().toString() : null; + service.setControllerActor(value); + } + if (SKIP_POST_INST_CONF.equalsIgnoreCase(input.getName())) { + String value = input.getDefault() != null ? input.getDefault().toString() : "false"; + service.setSkipPostInstConf(Boolean.valueOf(value)); + } + }); + } + } toscaResourceStructure.setCatalogService(service); return service; } diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java index e4882119ab..bf327f5bb1 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java @@ -36,6 +36,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -571,6 +572,36 @@ public class ToscaResourceInstallerTest extends BaseTest { doReturn(namingPolicy).when(metadata).getValue("namingPolicy"); doReturn(ecompGeneratedNaming).when(metadata).getValue("ecompGeneratedNaming"); + ISdcCsarHelper iSdcCsarHelper = mock(ISdcCsarHelper.class); + List<Input> serviceInputs = new ArrayList<Input>(); + + LinkedHashMap<String, Object> value = new LinkedHashMap<String, Object>(); + value.put("controller_actor", "SO-REF-DATA"); + value.put("type", "string"); + Input input = new Input("controller_actor", value, null); + serviceInputs.add(0, input); + + value = new LinkedHashMap<String, Object>(); + value.put("cds_model_version", "v1.4.0"); + value.put("type", "string"); + input = new Input("cds_model_version", value, null); + serviceInputs.add(1, input); + + value = new LinkedHashMap<String, Object>(); + value.put("cds_model_name", "Blueprint140"); + value.put("type", "string"); + input = new Input("cds_model_name", value, null); + serviceInputs.add(2, input); + + value = new LinkedHashMap<String, Object>(); + value.put("skip_post_instantiation_configuration", "false"); + value.put("type", "boolean"); + input = new Input("skip_post_instantiation_configuration", value, null); + serviceInputs.add(3, input); + + doReturn(iSdcCsarHelper).when(toscaResourceStructure).getSdcCsarHelper(); + doReturn(serviceInputs).when(iSdcCsarHelper).getServiceInputs(); + Service service = toscaInstaller.createService(toscaResourceStructure, resourceStructure); assertNotNull(service); diff --git a/asdc-controller/src/test/resources/download/service-pnfservice.csar b/asdc-controller/src/test/resources/download/service-pnfservice.csar Binary files differindex 89d24a18ee..a026c7aebe 100644 --- a/asdc-controller/src/test/resources/download/service-pnfservice.csar +++ b/asdc-controller/src/test/resources/download/service-pnfservice.csar diff --git a/asdc-controller/src/test/resources/download/service-vnfservice.csar b/asdc-controller/src/test/resources/download/service-vnfservice.csar Binary files differindex 25d2ebd6c6..1dcfb59442 100644 --- a/asdc-controller/src/test/resources/download/service-vnfservice.csar +++ b/asdc-controller/src/test/resources/download/service-vnfservice.csar diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy index c91316ee5c..69c1c9f8ac 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy @@ -677,7 +677,7 @@ return json.toString() requestInfo.setCallbackUrl(callbackUrl) requestInfo.setSourceId("so") requestInfo.setTimeout(timeOut) - requestInfo.setNumSolutions(100) + requestInfo.setNumSolutions(1) nsiReqBody.setRequestInfo(requestInfo) nsiReqBody.setNSTInfo(nstInfo) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy index b2415e296f..1b09c49124 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AAISliceUtil.groovy @@ -136,7 +136,7 @@ class AAISliceUtil { exceptionUtil.buildAndThrowWorkflowException(execution, 2500, errorMsg) } AAIResultWrapper wrapper = getAAIClient().get(uri, NotFoundException.class) - LOGGER.trace(" *****${PREFIX} Exit queryAAI *****") + LOGGER.trace(" ***** Exit queryAAI *****") return wrapper } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy index a3e245ffea..e4281045bd 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy @@ -428,7 +428,8 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ serviceInfo.serviceInvariantUuid = sliceTaskInfo.NSSTInfo.invariantUUID serviceInfo.serviceUuid = sliceTaskInfo.NSSTInfo.UUID serviceInfo.sST = sliceTaskInfo.sliceProfile.sST ?: sliceParams.serviceProfile.get("sST") - serviceInfo.nssiName = allocateAnNssi.nssiName + serviceInfo.nssiName = sliceTaskInfo.suggestNssiId ? sliceTaskInfo.NSSTInfo.name : allocateAnNssi.nssiName + serviceInfo.nssiId = sliceTaskInfo.suggestNssiId nbiRequest.setServiceInfo(serviceInfo) nbiRequest.setEsrInfo(esrInfo) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy index 91a69b3123..ac959543a2 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateSliceServiceOption.groovy @@ -374,14 +374,15 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ if (solution != null) { if (execution.getVariable("queryNsiFirst")) { if (solution.get("existingNSI")) { + processSharedNSI(solution, sliceTaskParams, execution) execution.setVariable("needQuerySliceProfile", true) } else { - processNewNSI(solution, sliceTaskParams) + processNewSliceProfiles(solution, sliceTaskParams) execution.setVariable("needQuerySliceProfile", false) } execution.setVariable("queryNsiFirst", false) } else { - processSharedNSI(solution, sliceTaskParams, execution) + processNewSliceProfiles(solution, sliceTaskParams) execution.setVariable("needQuerySliceProfile", false) } } @@ -400,18 +401,17 @@ class DoCreateSliceServiceOption extends AbstractServiceTaskProcessor{ List<String> nssiId = aaiSliceUtil.getNSSIIdList(execution,nsiId) List<ServiceInstance> nssiInstances = aaiSliceUtil.getNSSIListFromAAI(execution, nssiId) - List<Map> sliceProfiles = sharedNSISolution.get("sliceProfiles") as List<Map> - handleSliceProfiles(sliceProfiles, sliceParams) Map<String, Object> nssiSolution = new HashMap<>() for(ServiceInstance instance: nssiInstances){ nssiSolution.put("NSSIId", instance.getServiceInstanceId()) nssiSolution.put("NSSIName", instance.getServiceInstanceName()) - processNssiResult(sliceParams, instance.getEnvironmentContext(), nssiSolution) + SubnetType subnetType = instance.getWorkloadContext() as SubnetType + processNssiResult(sliceParams, subnetType, nssiSolution) } } - private void processNewNSI(Map<String, Object> solution, SliceTaskParamsAdapter sliceParams) { + private void processNewSliceProfiles(Map<String, Object> solution, SliceTaskParamsAdapter sliceParams) { Map<String, Object> newNSISolution = solution.get("newNSISolution") as Map List<Map> sliceProfiles = newNSISolution.get("sliceProfiles") as List<Map> handleSliceProfiles(sliceProfiles, sliceParams) diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java index cfaa4040c7..fb15ffa2b3 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/level/ServiceLevelTest.java @@ -21,35 +21,85 @@ package org.onap.so.bpmn.infrastructure.service.level; import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; import java.util.ArrayList; +import java.util.List; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake; +import org.junit.Before; import org.junit.Test; -import java.util.List; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.so.bpmn.infrastructure.service.level.impl.ServiceLevelConstants; +import org.onap.so.client.exception.ExceptionBuilder; +@RunWith(MockitoJUnitRunner.class) public class ServiceLevelTest { private static final String EXECUTION_KEY_PNF_NAME_LIST = "pnfNameList"; private static final String EXECUTION_KEY_PNF_COUNTER = "pnfCounter"; + private static final String PARAM_NAME = "param1"; + private static final String SCOPE = "scope1"; + private static final String PNF_NAME = "pnfName1"; + + @Mock + private ExceptionBuilder exceptionBuilderMock; + @InjectMocks + private ServiceLevel testedObject; + + private DelegateExecution execution; + + @Before + public void init() { + execution = new DelegateExecutionFake(); + } @Test public void pnfCounterExecution_success() { // given - String pnfName = "pnfName1"; - DelegateExecution execution = new DelegateExecutionFake(); - execution.setVariable(EXECUTION_KEY_PNF_NAME_LIST, createPnfNameList(pnfName)); + execution.setVariable(EXECUTION_KEY_PNF_NAME_LIST, createPnfNameList()); execution.setVariable(EXECUTION_KEY_PNF_COUNTER, 0); // when - new ServiceLevel().pnfCounterExecution(execution); + testedObject.pnfCounterExecution(execution); // then - assertThat(execution.getVariable(ServiceLevelConstants.PNF_NAME)).isEqualTo(pnfName); + assertThat(execution.getVariable(ServiceLevelConstants.PNF_NAME)).isEqualTo(PNF_NAME); assertThat(execution.getVariable(EXECUTION_KEY_PNF_COUNTER)).isEqualTo(1); } - private List<String> createPnfNameList(String pnfName) { + @Test + public void validateParams_success_paramExistsInExecution() { + // given + execution.setVariable(PARAM_NAME, "anyValue"); + // when + testedObject.validateParamsWithScope(execution, "anyScope", createParamList()); + // then + verify(exceptionBuilderMock, times(0)).buildAndThrowWorkflowException(any(DelegateExecution.class), + eq(ServiceLevelConstants.ERROR_CODE), any(String.class)); + } + + @Test + public void validateParams_exceptionParamDoesNotExistInExecution() { + // when + testedObject.validateParamsWithScope(execution, SCOPE, createParamList()); + // then + verify(exceptionBuilderMock).buildAndThrowWorkflowException(execution, ServiceLevelConstants.ERROR_CODE, + "Validation of health check workflow parameters failed for the scope: " + SCOPE); + } + + private List<String> createParamList() { + List<String> params = new ArrayList<>(); + params.add(PARAM_NAME); + return params; + } + + private List<String> createPnfNameList() { List<String> pnfNameList = new ArrayList<>(); - pnfNameList.add(pnfName); + pnfNameList.add(PNF_NAME); return pnfNameList; } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoaderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoaderTest.java new file mode 100644 index 0000000000..a9bfde9bab --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoaderTest.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2021 Nokia + * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ + * Modifications Copyright (c) 2021 Nokia + * ================================================================================ + * Modifications Copyright (c) 2020 Tech Mahindra + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader; + + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake; +import org.javatuples.Pair; +import org.junit.Before; +import org.junit.Test; +import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; +import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType; +import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup; +import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource; +import java.util.ArrayList; +import java.util.List; +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + + +public class VnfEBBLoaderTest { + + private String serviceId; + private String vnfId; + private BBInputSetupUtils bbInputSetupUtils; + private BBInputSetup bbInputSetup; + private WorkflowActionExtractResourcesAAI workflowActionUtils; + private ExceptionBuilder exceptionBuilder; + private DelegateExecution delegateExecution; + private VnfEBBLoader cut; + + private org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI; + private ServiceInstance serviceInstanceMSO; + + @Before + public void setup() { + serviceId = "service123"; + vnfId = "vnf123"; + serviceInstanceAAI = mock(org.onap.aai.domain.yang.ServiceInstance.class); + serviceInstanceMSO = mock(ServiceInstance.class); + bbInputSetupUtils = mock(BBInputSetupUtils.class); + bbInputSetup = mock(BBInputSetup.class); + workflowActionUtils = mock(WorkflowActionExtractResourcesAAI.class); + exceptionBuilder = mock(ExceptionBuilder.class); + delegateExecution = new DelegateExecutionFake(); + } + + @Test + public void traverseAAIVnf_shouldAddServiceToResourceList() throws Exception { + List<Resource> resourceList = new ArrayList<>(); + List<Pair<WorkflowType, String>> aaiResourceIds = new ArrayList<>(); + doReturn(serviceInstanceAAI).when(bbInputSetupUtils).getAAIServiceInstanceById(serviceId); + doReturn(serviceInstanceMSO).when(bbInputSetup).getExistingServiceInstance(serviceInstanceAAI); + cut = new VnfEBBLoader(bbInputSetupUtils, bbInputSetup, workflowActionUtils, exceptionBuilder); + cut.traverseAAIVnf(delegateExecution, resourceList, serviceId, vnfId, aaiResourceIds); + assertEquals(WorkflowType.SERVICE, resourceList.get(0).getResourceType()); + } +} diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java index 3d0f70805c..be4833a0c6 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/AnSliceProfile.java @@ -66,4 +66,7 @@ public class AnSliceProfile implements Serializable { @JsonProperty(value = "resourceSharingLevel") private ResourceSharingLevel resourceSharingLevel; + @JsonProperty(value = "maxNumberofPDUSession") + private int maxNumberOfPDUSession; + } diff --git a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java index 90cee2794a..0bd6d64dc3 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java @@ -131,6 +131,7 @@ public class SliceProfileAdapter implements Serializable { anSliceProfile.setUeMobilityLevel(UeMobilityLevel.fromString(this.ueMobilityLevel)); anSliceProfile.setResourceSharingLevel(ResourceSharingLevel.fromString(this.resourceSharingLevel)); + anSliceProfile.setMaxNumberOfPDUSession(this.maxNumberOfPDUSession); anSliceProfile.setPerfReq(generatePerfReq()); return anSliceProfile; @@ -158,6 +159,8 @@ public class SliceProfileAdapter implements Serializable { List<PerfReqEmbb> perfReqEmbbs = new ArrayList<>(); PerfReqEmbb perfReqEmbb = new PerfReqEmbb(); BeanUtils.copyProperties(this, perfReqEmbb); + perfReqEmbb.setExpDataRateDL(this.expDataRateDL); + perfReqEmbb.setExpDataRateUL(this.expDataRateUL); perfReqEmbbs.add(perfReqEmbb); perfReq.setPerfReqEmbbList(perfReqEmbbs); } else if ("ullc".equalsIgnoreCase(sST)) { diff --git a/docs/developer_info/SO_Admin_Cockpit_User_Guide.rst b/docs/developer_info/SO_Admin_Cockpit_User_Guide.rst index 2144bf8c05..ed729664a8 100644 --- a/docs/developer_info/SO_Admin_Cockpit_User_Guide.rst +++ b/docs/developer_info/SO_Admin_Cockpit_User_Guide.rst @@ -68,15 +68,23 @@ Now simply go to the “Application Catalog” tab on the left of the page, then Searching/Viewing BPMN Workflows -------------------------------- +.. image:: ../images/soAdminCockpitUi.png + In order to find the workflow that you are attempting to monitor you will need at least one of the following values of the service instance: Service Instance ID, Request ID, Service Name or the time/date range in which the workflow started/ended. You can use the filter drop-down boxes to the left of the parameter boxes, i.e. “EQUAL”, “NOT EQUAL” and “LIKE”. Also, you can filter by the status of a workflow, with the status drop-down box, to further filter your results. Simply enter any of these pieces of information into the search page, ensure the start and end date range includes when the workflow would have run and press the search button. Once your results list has been returned you can click on a result to see the workflow in the graphical BPMN viewer. +.. image:: ../images/soAdminCockpitUi2.png + From here you can inspect the different calls and variables throughout the workflow, by using the "Activity Instances" and "Variable Instances" tabs. Clicking on one of the sub process call, within the diagram, to open them in the graphical BPMN viewer (The boxes with a + at the bottom of them are call activities to sub processes. This is how you drill down through a workflow, you can also safely traverse back “up” through the flows with your browser’s back button. The cyan highlighting shows the flow of the path taken by the workflow, and this will go down through each of the sub processes as well. +.. image:: ../images/soAdminCockpitUi3.png + In the BPMN viewer, manipulation of the returned illustrated flow is possible by using the following methods. On the left side of the viewer window there are three symbols for Zooming in/out and fitting the flow to the full window. Along with these controls, the user can left-click and drag to move the flow within the canvas to the user desired position. SO-Monitoring Service Statistics -------------------------------- +.. image:: ../images/soAdminCockpitStatistics.png + You can see a summary of the status of all of the workflows from one of your search results by clicking on the "Service Statistics" tab, found just above your list of results. Here you can find a percentile breakdown of each workflow's, in the list of results you received, statuses. Troubleshooting SO-Admin-Cockpit @@ -105,6 +113,8 @@ This can be dealt with in two ways. Either using an extension or by disabling CO Internal Service Error occurred for operation : GET please check backend service log. status code: 500 ------------------------------------------------------------------------------------------------------- +.. image:: ../images/soAdminCockpitGetError.png + This can be checked by following the below steps: - Open the developers mode in your browser diff --git a/docs/images/soAdminCockpitGetError.png b/docs/images/soAdminCockpitGetError.png Binary files differnew file mode 100644 index 0000000000..32325bde47 --- /dev/null +++ b/docs/images/soAdminCockpitGetError.png diff --git a/docs/images/soAdminCockpitStatistics.png b/docs/images/soAdminCockpitStatistics.png Binary files differnew file mode 100644 index 0000000000..bb0a4d3316 --- /dev/null +++ b/docs/images/soAdminCockpitStatistics.png diff --git a/docs/images/soAdminCockpitUi.png b/docs/images/soAdminCockpitUi.png Binary files differnew file mode 100644 index 0000000000..1e1781b3f6 --- /dev/null +++ b/docs/images/soAdminCockpitUi.png diff --git a/docs/images/soAdminCockpitUi2.png b/docs/images/soAdminCockpitUi2.png Binary files differnew file mode 100644 index 0000000000..88ef083034 --- /dev/null +++ b/docs/images/soAdminCockpitUi2.png diff --git a/docs/images/soAdminCockpitUi3.png b/docs/images/soAdminCockpitUi3.png Binary files differnew file mode 100644 index 0000000000..bb2d0563c5 --- /dev/null +++ b/docs/images/soAdminCockpitUi3.png @@ -849,17 +849,17 @@ <dependency> <groupId>org.onap.logging-analytics</groupId> <artifactId>logging-slf4j</artifactId> - <version>1.6.9-SNAPSHOT</version> + <version>1.6.10-SNAPSHOT</version> </dependency> <dependency> <groupId>org.onap.logging-analytics</groupId> <artifactId>logging-filter-base</artifactId> - <version>1.6.9-SNAPSHOT</version> + <version>1.6.10-SNAPSHOT</version> </dependency> <dependency> <groupId>org.onap.logging-analytics</groupId> <artifactId>logging-filter-spring</artifactId> - <version>1.6.9-SNAPSHOT</version> + <version>1.6.10-SNAPSHOT</version> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java index b42441bcae..f7e829335e 100644 --- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java +++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java @@ -1,5 +1,8 @@ package org.onap.so.simulator.actions.aai; +import com.consol.citrus.actions.AbstractTestAction; +import com.consol.citrus.context.TestContext; +import java.security.SecureRandom; import org.onap.aai.domain.yang.L3Network; import org.onap.aaiclient.client.aai.AAIResourcesClient; import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; @@ -7,8 +10,6 @@ import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.consol.citrus.actions.AbstractTestAction; -import com.consol.citrus.context.TestContext; public class ProcessNetwork extends AbstractTestAction { @@ -17,7 +18,7 @@ public class ProcessNetwork extends AbstractTestAction { public void doExecute(TestContext context) { final Logger logger = LoggerFactory.getLogger(ProcessNetwork.class); try { - int random = (int) (Math.random() * 50 + 1); + int random = (new SecureRandom()).nextInt(50) + 1; AAIResourcesClient aaiResourceClient = new AAIResourcesClient(); diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java index 383e1bfd5f..4989e99e20 100644 --- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java +++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java @@ -14,19 +14,21 @@ import com.consol.citrus.context.TestContext; public class ProcessVnfc extends AbstractTestAction { + private static final String VNF_SERVER_1_NAME = "ssc_server_1"; + @Override public void doExecute(TestContext context) { final Logger logger = LoggerFactory.getLogger(ProcessVnfc.class); try { logger.debug("running ProcessVnfc scenario"); - logger.debug("requestAction: " + context.getVariable("requestAction")); - logger.debug("serviceAction: " + context.getVariable("serviceAction")); - logger.debug("cloudOwner: " + context.getVariable("cloudOwner")); - logger.debug("cloundRegion: " + context.getVariable("cloudRegion")); - logger.debug("tenant: " + context.getVariable("tenant")); - logger.debug("vfModuleId: " + context.getVariable("vfModuleId")); - logger.debug("vnfId: " + context.getVariable("vnfId")); + logger.debug("requestAction: {}", context.getVariable("requestAction")); + logger.debug("serviceAction: {}", context.getVariable("serviceAction")); + logger.debug("cloudOwner: {}", context.getVariable("cloudOwner")); + logger.debug("cloundRegion: {}", context.getVariable("cloudRegion")); + logger.debug("tenant: {}", context.getVariable("tenant")); + logger.debug("vfModuleId: {}", context.getVariable("vfModuleId")); + logger.debug("vnfId: {}", context.getVariable("vnfId")); AAIResourcesClient aaiResourceClient = new AAIResourcesClient(); @@ -34,9 +36,9 @@ public class ProcessVnfc extends AbstractTestAction { && context.getVariable("serviceAction").equals("assign")) { AAIResourceUri vnfcURI = - AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc("ssc_server_1")); + AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc(VNF_SERVER_1_NAME)); Vnfc vnfc = new Vnfc(); - vnfc.setVnfcName("ssc_server_1"); + vnfc.setVnfcName(VNF_SERVER_1_NAME); vnfc.setNfcNamingCode("oamfw"); vnfc.setNfcFunction("EPC-OAM-FIREWALL"); vnfc.setProvStatus("PREPROV"); @@ -53,8 +55,8 @@ public class ProcessVnfc extends AbstractTestAction { if (aaiResourceClient.exists(vnfcURI)) { Optional<VfModule> vfModule = aaiResourceClient.get(vfModuleURI).asBean(VfModule.class); - if (vfModule.get().getVfModuleName().contains("macro")) { - String vnfcName = "ssc_server_1" + vfModule.get().getVfModuleName() + if (vfModule.isPresent() && vfModule.get().getVfModuleName().contains("macro")) { + String vnfcName = VNF_SERVER_1_NAME + vfModule.get().getVfModuleName() .substring(vfModule.get().getVfModuleName().length() - 1); vnfc.setVnfcName(vnfcName); vnfcURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc(vnfcName)); diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro1.java index 29a9aff93c..140ac3c532 100644 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro1.java +++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro1.java @@ -1,22 +1,24 @@ package org.onap.so.simulator.scenarios.openstack.macro; -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver; import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; import com.consol.citrus.simulator.scenario.Scenario; import com.consol.citrus.simulator.scenario.ScenarioDesigner; +import org.springframework.core.io.ClassPathResource; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; /** - * This scenario is used by the following test cases: Resume Service Instance Macro 3 Modules 1 To Complete + * This scenario is used by the following test cases: Resume Service Instance Macro 3 Modules 1 To Complete. * */ @Scenario("Openstack-QueryStackByID-Macro1") @RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_1/*", method = RequestMethod.GET) public class QueryStackByIdMacro1 extends AbstractSimulatorScenario { + private static final String FILE_STACK_CREATED_PATH = "openstack/gr_api/Stack_Created.json"; + private static final String FILE_STACK_DELETED_PATH = "openstack/gr_api/Stack_Deleted.json"; @Override public void run(ScenarioDesigner scenario) { @@ -31,38 +33,31 @@ public class QueryStackByIdMacro1 extends AbstractSimulatorScenario { scenario.variable("stackName", "macro_module_1"); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_CREATED_PATH)); // Create (module_2) scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_CREATED_PATH)); // Create (module_3) scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_CREATED_PATH)); // Create (module_2 recreate) scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_CREATED_PATH)); // Delete scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_DELETED_PATH)); // Delete scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_DELETED_PATH)); // Poll scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_DELETED_PATH)); } } diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro2.java index 15f0b611a0..05d87cd314 100644 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro2.java +++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro2.java @@ -1,22 +1,24 @@ package org.onap.so.simulator.scenarios.openstack.macro; -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver; import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; import com.consol.citrus.simulator.scenario.Scenario; import com.consol.citrus.simulator.scenario.ScenarioDesigner; +import org.springframework.core.io.ClassPathResource; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; /** - * This scenario is used by the following test cases: Resume Service Instance Macro 3 Modules 1 To Complete + * This scenario is used by the following test cases: Resume Service Instance Macro 3 Modules 1 To Complete. * */ @Scenario("Openstack-QueryStackByID-Macro2") @RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_2/*", method = RequestMethod.GET) public class QueryStackByIdMacro2 extends AbstractSimulatorScenario { + private static final String FILE_STACK_CREATED_PATH = "openstack/gr_api/Stack_Created.json"; + private static final String FILE_STACK_DELETED_PATH = "openstack/gr_api/Stack_Deleted.json"; @Override public void run(ScenarioDesigner scenario) { @@ -31,22 +33,18 @@ public class QueryStackByIdMacro2 extends AbstractSimulatorScenario { scenario.variable("stackName", "macro_module_2"); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_CREATED_PATH)); // Delete scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_CREATED_PATH)); scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_DELETED_PATH)); // Poll scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_DELETED_PATH)); } } diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro3.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro3.java index b7808dc2ff..15a6fa3029 100644 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro3.java +++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryStackByIdMacro3.java @@ -1,22 +1,24 @@ package org.onap.so.simulator.scenarios.openstack.macro; -import org.springframework.core.io.ClassPathResource; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import com.consol.citrus.endpoint.resolver.DynamicEndpointUriResolver; import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; import com.consol.citrus.simulator.scenario.Scenario; import com.consol.citrus.simulator.scenario.ScenarioDesigner; +import org.springframework.core.io.ClassPathResource; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; /** - * This scenario is used by the following test cases: Resume Service Instance Macro 3 Modules 1 To Complete + * This scenario is used by the following test cases: Resume Service Instance Macro 3 Modules 1 To Complete. * */ @Scenario("Openstack-QueryStackByID-Macro3") @RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_3/*", method = RequestMethod.GET) public class QueryStackByIdMacro3 extends AbstractSimulatorScenario { + private static final String FILE_STACK_CREATED_PATH = "openstack/gr_api/Stack_Created.json"; + private static final String FILE_STACK_DELETED_PATH = "openstack/gr_api/Stack_Deleted.json"; @Override public void run(ScenarioDesigner scenario) { @@ -31,22 +33,18 @@ public class QueryStackByIdMacro3 extends AbstractSimulatorScenario { scenario.variable("stackName", "macro_module_3"); // Poll - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_CREATED_PATH)); // Delete scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Created.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_CREATED_PATH)); scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_DELETED_PATH)); // Poll scenario.http().receive().get(); - scenario.http().send().response(HttpStatus.OK) - .payload(new ClassPathResource("openstack/gr_api/Stack_Deleted.json")); + scenario.http().send().response(HttpStatus.OK).payload(new ClassPathResource(FILE_STACK_DELETED_PATH)); } diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR.java index 4e6b15158c..6e5122f6d1 100644 --- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR.java +++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/sdnc/grapi/QueryVFModuleGR.java @@ -1,12 +1,13 @@ package org.onap.so.simulator.scenarios.sdnc.grapi; +import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; +import com.consol.citrus.simulator.scenario.Scenario; +import com.consol.citrus.simulator.scenario.ScenarioDesigner; +import java.security.SecureRandom; import org.springframework.core.io.ClassPathResource; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario; -import com.consol.citrus.simulator.scenario.Scenario; -import com.consol.citrus.simulator.scenario.ScenarioDesigner; @Scenario("SDNC-GRAPI-QueryVFModule") @RequestMapping( @@ -17,7 +18,7 @@ public class QueryVFModuleGR extends AbstractSimulatorScenario { @Override public void run(ScenarioDesigner scenario) { scenario.http().receive().get(); - int random = (int) (Math.random() * 50 + 1); + int random = (new SecureRandom()).nextInt(50) + 1; scenario.variable("vfModuleName", "vfModuleName" + random); |