diff options
Diffstat (limited to 'plans')
34 files changed, 391 insertions, 110 deletions
diff --git a/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh b/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh index 2d276e51..bdee34ee 100644 --- a/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh +++ b/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh @@ -12,8 +12,7 @@ cd $WORKSPACE/archives/dfc if [ -z "$SIM_ROOT" ] then - #git clone --depth 1 https://gerrit.onap.org/r/integration -b master - git clone https://github.com/yanhuanwang/integration.git + git clone --depth 1 https://gerrit.onap.org/r/integration -b master #Location of all individual simulators for DFC echo "Determine SIM_ROOT based on the WORKSPACE" SIM_ROOT=$WORKSPACE/archives/dfc/integration/test/mocks/datafilecollector-testharness diff --git a/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh b/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh index 0dc2af18..81d85fe5 100644 --- a/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh +++ b/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash -running_containers=$(docker ps --filter name=dfc_ -q) - +running_containers=$(docker ps --filter name=dfc_ -qa) +running_images=$(docker images -q) +docker exec dfc_app0 cat /var/log/ONAP/application.log >> $WORKSPACE/archives/dfc_app0_application.log +docker logs dfc_mr-sim >> $WORKSPACE/archives/dfc_mr-sim.log if [ -z "$running_containers" ] then @@ -10,5 +12,6 @@ else echo "Stopping and removing containers" docker stop $running_containers docker rm $running_containers + docker rmi $running_images fi diff --git a/plans/dcaegen2-collectors-datafile/ManagementInterface-suite/teardown.sh b/plans/dcaegen2-collectors-datafile/ManagementInterface-suite/teardown.sh index d8877fbc..23581a02 100644 --- a/plans/dcaegen2-collectors-datafile/ManagementInterface-suite/teardown.sh +++ b/plans/dcaegen2-collectors-datafile/ManagementInterface-suite/teardown.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set +e -docker exec -it dfc_app0 cat /var/log/ONAP/application.log > $WORKSPACE/archives/dfc_app0_application.log +docker exec dfc_app0 cat /var/log/ONAP/application.log > $WORKSPACE/archives/dfc_app0_application.log kill-instance.sh dfc_app0 set -e exit 0 diff --git a/plans/dcaegen2-collectors-hv-ves/testsuites/docker-compose.yml b/plans/dcaegen2-collectors-hv-ves/testsuites/docker-compose.yml index eb61db97..4b184d38 100644 --- a/plans/dcaegen2-collectors-hv-ves/testsuites/docker-compose.yml +++ b/plans/dcaegen2-collectors-hv-ves/testsuites/docker-compose.yml @@ -84,7 +84,7 @@ services: - hv-ves-default config-binding-service: - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app:2.2.4 + image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding:2.5.2 ports: - "10000:10000" environment: diff --git a/plans/dcaegen2-collectors-hv-ves/testsuites/env.sh b/plans/dcaegen2-collectors-hv-ves/testsuites/env.sh index 08bbb61e..940c757f 100755 --- a/plans/dcaegen2-collectors-hv-ves/testsuites/env.sh +++ b/plans/dcaegen2-collectors-hv-ves/testsuites/env.sh @@ -39,7 +39,7 @@ export HV_VES_GROUP_ID="org.onap.dcaegen2.collectors.hv-ves" export HV_VES_HOSTNAME="dcae-hv-ves-collector" export HV_VES_COLLECTOR_NAMESPACE="onap" export HV_VES_HEALTHCHECK_CMD="curl --request GET --fail --silent --show-error localhost:6060/health/ready && nc -vz localhost 6061" -export HV_VES_VERSION="1.2-SNAPSHOT" +export HV_VES_VERSION="latest" export HV_VES_IMAGE="hv-collector-main" export DCAE_APP_SIMULATOR_IMAGE="hv-collector-dcae-app-simulator" export XNF_SIMULATOR_IMAGE="hv-ves-collector-xnf-simulator" diff --git a/plans/policy/apex-pdp/setup.sh b/plans/policy/apex-pdp/setup.sh index 22e813df..16621241 100644 --- a/plans/policy/apex-pdp/setup.sh +++ b/plans/policy/apex-pdp/setup.sh @@ -49,8 +49,12 @@ fi # bring down maven mkdir maven cd maven -curl -O http://apache.claz.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz -tar -xzvf apache-maven-3.3.9-bin.tar.gz +# download maven from automatically selected mirror server +curl -vLO "https://www.apache.org/dyn/mirrors/mirrors.cgi?cca2=us&preferred=http://apache.claz.org/&action=download&filename=maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz" +if ! tar -xzvf apache-maven-3.3.9-bin.tar.gz ; then + echo "Installation of maven has failed!" + exit 1 +fi ls -l export PATH=${PATH}:${WORK_DIR}/maven/apache-maven-3.3.9/bin ${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn -v diff --git a/plans/policy/distribution/setup.sh b/plans/policy/distribution/setup.sh index 399df0e6..18cb88ed 100644 --- a/plans/policy/distribution/setup.sh +++ b/plans/policy/distribution/setup.sh @@ -50,8 +50,12 @@ fi # bring down maven mkdir maven cd maven -curl -O http://apache.claz.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz -tar -xzvf apache-maven-3.3.9-bin.tar.gz +# download maven from automatically selected mirror server +curl -vLO "https://www.apache.org/dyn/mirrors/mirrors.cgi?cca2=us&preferred=http://apache.claz.org/&action=download&filename=maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz" +if ! tar -xzvf apache-maven-3.3.9-bin.tar.gz ; then + echo "Installation of maven has failed!" + exit 1 +fi ls -l export PATH=${PATH}:${WORK_DIR}/maven/apache-maven-3.3.9/bin ${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn -v diff --git a/plans/policy/xacml-pdp/setup.sh b/plans/policy/xacml-pdp/setup.sh index 1d4325bd..9a2e92fe 100644 --- a/plans/policy/xacml-pdp/setup.sh +++ b/plans/policy/xacml-pdp/setup.sh @@ -47,8 +47,12 @@ fi # bring down maven mkdir maven cd maven -curl -O http://apache.claz.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz -tar -xzvf apache-maven-3.3.9-bin.tar.gz +# download maven from automatically selected mirror server +curl -vLO "https://www.apache.org/dyn/mirrors/mirrors.cgi?cca2=us&preferred=http://apache.claz.org/&action=download&filename=maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz" +if ! tar -xzvf apache-maven-3.3.9-bin.tar.gz ; then + echo "Installation of maven has failed!" + exit 1 +fi ls -l export PATH=${PATH}:${WORK_DIR}/maven/apache-maven-3.3.9/bin ${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn -v diff --git a/plans/sdc/sanity/setup.sh b/plans/sdc/sanity/setup.sh index 0e652f86..20a8eac3 100644 --- a/plans/sdc/sanity/setup.sh +++ b/plans/sdc/sanity/setup.sh @@ -15,4 +15,26 @@ # limitations under the License. # +# By default all images are from remote upstream registry, this option +# provides the chance to test locally built images +export SDC_LOCAL_IMAGES="${SDC_LOCAL_IMAGES:-false}" + +# For this to take effect SDC_LOCAL_IMAGES must be enabled... +# +# The path to the local sdc git repo from which the local images have +# been built - it also affects the tag used - if left empty *AND* +# local images are used *AND* SDC_LOCAL_TAG is unset then the tag +# will be set to: 'latest' +# +# BEWARE: Using local images with an incorrect git repo could lead to +# problems...set SDC_LOCAL_GITREPO or GERRIT_BRANCH properly... +export SDC_LOCAL_GITREPO="${SDC_LOCAL_GITREPO}" + +# For this to take effect SDC_LOCAL_IMAGES must be enabled... +# +# This will set the tag for local images - leaving this empty *AND* +# with unset SDC_LOCAL_GITREPO the local images will fallback to the +# tag: 'latest' +export SDC_LOCAL_TAG="${SDC_LOCAL_TAG}" + source ${WORKSPACE}/scripts/sdc/setup_sdc_for_sanity.sh tad diff --git a/plans/sdc/uiSanity/setup.sh b/plans/sdc/uiSanity/setup.sh index 3d315098..b02cd7be 100644 --- a/plans/sdc/uiSanity/setup.sh +++ b/plans/sdc/uiSanity/setup.sh @@ -13,5 +13,28 @@ # 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. +# + +# By default all images are from remote upstream registry, this option +# provides the chance to test locally built images +export SDC_LOCAL_IMAGES="${SDC_LOCAL_IMAGES:-false}" + +# For this to take effect SDC_LOCAL_IMAGES must be enabled... +# +# The path to the local sdc git repo from which the local images have +# been built - it also affects the tag used - if left empty *AND* +# local images are used *AND* SDC_LOCAL_TAG is unset then the tag +# will be set to: 'latest' +# +# BEWARE: Using local images with an incorrect git repo could lead to +# problems...set SDC_LOCAL_GITREPO or GERRIT_BRANCH properly... +export SDC_LOCAL_GITREPO="${SDC_LOCAL_GITREPO}" + +# For this to take effect SDC_LOCAL_IMAGES must be enabled... +# +# This will set the tag for local images - leaving this empty *AND* +# with unset SDC_LOCAL_GITREPO the local images will fallback to the +# tag: 'latest' +export SDC_LOCAL_TAG="${SDC_LOCAL_TAG}" source ${WORKSPACE}/scripts/sdc/setup_sdc_for_sanity.sh tud diff --git a/plans/so/integration-etsi-testing/config/distribution-test-zip/distributionTestZip.zip b/plans/so/integration-etsi-testing/config/distribution-test-zip/distributionTestZip.zip Binary files differdeleted file mode 100644 index ac96bd94..00000000 --- a/plans/so/integration-etsi-testing/config/distribution-test-zip/distributionTestZip.zip +++ /dev/null diff --git a/plans/so/integration-etsi-testing/config/distribution-test-zip/zipped_sdc_csar.tar.gz b/plans/so/integration-etsi-testing/config/distribution-test-zip/zipped_sdc_csar.tar.gz Binary files differnew file mode 100644 index 00000000..fcf828c8 --- /dev/null +++ b/plans/so/integration-etsi-testing/config/distribution-test-zip/zipped_sdc_csar.tar.gz diff --git a/plans/so/integration-etsi-testing/config/env b/plans/so/integration-etsi-testing/config/env index 61603aac..583be0af 100644 --- a/plans/so/integration-etsi-testing/config/env +++ b/plans/so/integration-etsi-testing/config/env @@ -1,4 +1,5 @@ NEXUS_DOCKER_REPO_MSO=nexus3.onap.org:10001 +DOCKER_ENVIRONMENT=remote TAG=1.4.3-STAGING-latest TIME_OUT_DEFAULT_VALUE_SEC=1200 PROJECT_NAME=etsiintegrationtesting diff --git a/plans/so/integration-etsi-testing/config/wait-for-container.sh b/plans/so/integration-etsi-testing/config/wait-for-container.sh index 598715d9..35ee2641 100755 --- a/plans/so/integration-etsi-testing/config/wait-for-container.sh +++ b/plans/so/integration-etsi-testing/config/wait-for-container.sh @@ -118,16 +118,23 @@ process_arguments() exit 1 fi + result=$(docker inspect --format '{{.State.Running}}' $CONTAINER_NAME) + + if [ $result != "true" ] ; then + echo "$SCRIPT_NAME $(current_timestamp) ERROR: $CONTAINER_NAME container is not running" + exit 1 + fi + HOST_IP=$(docker inspect --format '{{ index .NetworkSettings.Networks "'$NETWORK_NAME'" "IPAddress"}}' $CONTAINER_NAME) - if [ $? -ne 0 ]; then + if [ $? -ne 0 ] || [ -z $HOST_IP ] ; then echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to find HOST IP using network name: $NETWORK_NAME and container name: $CONTAINER_NAME" exit 1 fi PORT=$(docker port $CONTAINER_NAME | cut -c1-$(docker port $CONTAINER_NAME | grep -aob '/' | grep -oE '[0-9]+')) - if [ $? -ne 0 ]; then + if [ $? -ne 0 ] || [ -z $PORT ] ; then echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to find PORT using project name: $PROJECT_NAME and container name: $CONTAINER_NAME" exit 1 fi diff --git a/plans/so/integration-etsi-testing/docker-compose.local.yml b/plans/so/integration-etsi-testing/docker-compose.local.yml new file mode 100644 index 00000000..ae15e6f6 --- /dev/null +++ b/plans/so/integration-etsi-testing/docker-compose.local.yml @@ -0,0 +1,33 @@ +version: '3' +services: +################################################################################ + mariadb: + image: mariadb:10.1.11 +################################################################################ + catalog-db-adapter: + image: onap/so/catalog-db-adapter:${TAG} +################################################################################ + request-db-adapter: + image: onap/so/request-db-adapter:${TAG} +################################################################################ + sdnc-adapter: + image: onap/so/sdnc-adapter:${TAG} +################################################################################ + sdc-controller: + image: onap/so/sdc-controller:${TAG} +################################################################################ + bpmn-infra: + image: onap/so/bpmn-infra:${TAG} +################################################################################ + api-handler-infra: + image: onap/so/api-handler-infra:${TAG} +############################################################################# + so-monitoring: + image: onap/so/so-monitoring:${TAG} +################################################################################ + vnfm-adapter: + image: onap/so/vnfm-adapter:${TAG} +################################################################################ + vnfm-simulator: + image: onap/so/vnfm-simulator:${TAG} +################################################################################ diff --git a/plans/so/integration-etsi-testing/docker-compose.yml b/plans/so/integration-etsi-testing/docker-compose.yml index 76dd7b6a..ae20b0df 100644 --- a/plans/so/integration-etsi-testing/docker-compose.yml +++ b/plans/so/integration-etsi-testing/docker-compose.yml @@ -130,7 +130,7 @@ services: volumes: - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates - ${TEST_LAB_DIR}/volumes/so/config/sdc-controller/onapheat:/app/config - - ${CONFIG_DIR_PATH}/distribution-test-zip/distributionTestZip.zip:/distribution-test-zip/distributionTestZip.zip + - ${CONFIG_DIR_PATH}/distribution-test-zip/zipped_sdc_csar.tar.gz:/distribution-test-zip/zipped_sdc_csar.tar.gz environment: - APP=sdc-controller - JVM_ARGS=-Xms64m -Xmx512m @@ -154,7 +154,7 @@ services: command: - /bin/sh - -c - - 'mkdir -p /distribution-test-zip/unzipped && unzip /distribution-test-zip/distributionTestZip.zip -d /distribution-test-zip/unzipped && /app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' + - 'mkdir -p /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/zipped_sdc_csar.tar.gz -C /distribution-test-zip/unzipped && /app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' ################################################################################ bpmn-infra: image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/bpmn-infra:${TAG} diff --git a/plans/so/integration-etsi-testing/setup.sh b/plans/so/integration-etsi-testing/setup.sh index 5af56460..ce6637c1 100755 --- a/plans/so/integration-etsi-testing/setup.sh +++ b/plans/so/integration-etsi-testing/setup.sh @@ -31,6 +31,7 @@ ENV_FILE=$CONFIG_DIR/env TEMP_DIR_PATH=$SCRIPT_HOME/temp TEST_LAB_DIR_PATH=$TEMP_DIR_PATH/test_lab DOCKER_COMPOSE_FILE_PATH=$SCRIPT_HOME/docker-compose.yml +DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE=$SCRIPT_HOME/docker-compose.local.yml TEAR_DOWN_SCRIPT=$SCRIPT_HOME/teardown.sh MAVEN_DIR=$TEMP_DIR_PATH/maven @@ -48,7 +49,7 @@ echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..." export $(egrep -v '^#' $ENV_FILE | xargs) -MANDATORY_VARIABLES_NAMES=( "NEXUS_DOCKER_REPO_MSO" "TAG" "TIME_OUT_DEFAULT_VALUE_SEC" "PROJECT_NAME" "DEFAULT_NETWORK_NAME") +MANDATORY_VARIABLES_NAMES=( "NEXUS_DOCKER_REPO_MSO" "DOCKER_ENVIRONMENT" "TAG" "TIME_OUT_DEFAULT_VALUE_SEC" "PROJECT_NAME" "DEFAULT_NETWORK_NAME") for var in "${MANDATORY_VARIABLES_NAMES[@]}" do @@ -138,7 +139,16 @@ git clone http://gerrit.onap.org/r/so/docker-config.git $TEST_LAB_DIR_PATH export TEST_LAB_DIR=$TEST_LAB_DIR_PATH export CONFIG_DIR_PATH=$CONFIG_DIR -docker-compose -f $DOCKER_COMPOSE_FILE_PATH -p $PROJECT_NAME up -d +if [ "$DOCKER_ENVIRONMENT" == "remote" ]; then + echo "Starting docker containers with remote images ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -p $PROJECT_NAME up -d +elif [ "$DOCKER_ENVIRONMENT" == "local" ]; then + echo "Starting docker containers with local images ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -f $DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE -p $PROJECT_NAME up -d +else + echo "DOCKER_ENVIRONMENT not set correctly in $ENV_FILE. Allowed values: local | remote" + exit 1 +fi echo "Sleeping for 3m" sleep 3m diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java index 64284b5f..43fe47da 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java @@ -45,6 +45,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -194,4 +195,21 @@ public class GenericVnfsController { return ResponseEntity.ok(genericVnfs); } + @DeleteMapping(value = "/generic-vnf/{vnf-id}", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity<?> deleteGenericVnf(@PathVariable("vnf-id") final String vnfId, + @RequestParam(name = "resource-version") final String resourceVersion, final HttpServletRequest request) { + LOGGER.info("Will delete GenericVnf for 'vnf-id': {} and 'resource-version': {}", vnfId, resourceVersion); + + if (cacheServiceProvider.deleteGenericVnf(vnfId, resourceVersion)) { + LOGGER.info("Successfully delete GenericVnf from cache for 'vnf-id': {} and 'resource-version': {}", vnfId, + resourceVersion); + return ResponseEntity.noContent().build(); + } + + LOGGER.error("Unable to delete GenericVnf for 'vnf-id': {} and 'resource-version': {} ...", vnfId, + resourceVersion); + return getRequestErrorResponseEntity(request, GENERIC_VNF); + + } + } diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/GenericVnfCacheServiceProvider.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/GenericVnfCacheServiceProvider.java index 8dd19cfa..901c2594 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/GenericVnfCacheServiceProvider.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/GenericVnfCacheServiceProvider.java @@ -47,5 +47,7 @@ public interface GenericVnfCacheServiceProvider extends Clearable { List<GenericVnf> getGenericVnfs(final String selflink); + boolean deleteGenericVnf(final String vnfId, final String resourceVersion); + } diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/GenericVnfCacheServiceProviderImpl.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/GenericVnfCacheServiceProviderImpl.java index 81a74f25..3a12dfdc 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/GenericVnfCacheServiceProviderImpl.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/GenericVnfCacheServiceProviderImpl.java @@ -214,6 +214,22 @@ public class GenericVnfCacheServiceProviderImpl extends AbstractCacheServiceProv return Collections.emptyList(); } + @Override + public boolean deleteGenericVnf(final String vnfId, final String resourceVersion) { + final Optional<GenericVnf> optional = getGenericVnf(vnfId); + if (optional.isPresent()) { + final GenericVnf genericVnf = optional.get(); + if (genericVnf.getResourceVersion() != null && genericVnf.getResourceVersion().equals(resourceVersion)) { + final Cache cache = getCache(GENERIC_VNF_CACHE.getName()); + LOGGER.info("Will evict GenericVnf from cache with vnfId: {}", genericVnf.getVnfId()); + cache.evict(vnfId); + return true; + } + } + LOGGER.error("Unable to find GenericVnf for vnfId: {} and resourceVersion: {} ...", vnfId, resourceVersion); + return false; + } + private Relationship getRelationship(final String relatedLink, final GenericVnf genericVnf) { final Relationship relationShip = new Relationship(); relationShip.setRelatedTo(GENERIC_VNF); diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java index dd749db4..711dcd11 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java @@ -389,6 +389,24 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest { assertEquals(VNF_ID, actualGenericVnf.getVnfId()); } + @Test + public void test_deleteGenericVnf_usingVnfIdAndResourceVersion_removedFromCache() throws Exception { + + addCustomerServiceAndGenericVnf(); + + final Optional<GenericVnf> genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); + assertTrue(genericVnfOptional.isPresent()); + final GenericVnf genericVnf = genericVnfOptional.get(); + + final String genericVnfDeleteUrl = + getUrl(GENERIC_VNF_URL, genericVnf.getVnfId()) + "?resource-version=" + genericVnf.getResourceVersion(); + + final ResponseEntity<Void> responseEntity = + testRestTemplateService.invokeHttpDelete(genericVnfDeleteUrl, Void.class); + assertEquals(HttpStatus.NO_CONTENT, responseEntity.getStatusCode()); + + } + private void addCustomerServiceAndGenericVnf() throws Exception, IOException { final ResponseEntity<Void> customerResponse = testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), TestUtils.getCustomer(), Void.class); diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestRestTemplateService.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestRestTemplateService.java index 018c056a..e49e6d49 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestRestTemplateService.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestRestTemplateService.java @@ -52,6 +52,11 @@ public class TestRestTemplateService { return restTemplate.exchange(url, HttpMethod.PUT, httpEntity, clazz); } + public <T> ResponseEntity<T> invokeHttpDelete(final String url, final Class<T> clazz) { + final HttpEntity<?> request = new HttpEntity<>(getHttpHeaders()); + return restTemplate.exchange(url, HttpMethod.DELETE, request, clazz); + } + public <T> ResponseEntity<T> invokeHttpPost(final String url, final Object obj, final Class<T> clazz) { final HttpEntity<?> httpEntity = getHttpEntity(obj); return restTemplate.exchange(url, HttpMethod.POST, httpEntity, clazz); diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/controller/OperationsController.java b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/controller/OperationsController.java index 2d901c42..88970e74 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/controller/OperationsController.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/controller/OperationsController.java @@ -19,9 +19,12 @@ */ package org.onap.so.sdncsimulator.controller; +import static org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration.DELETEVNFINSTANCE; import static org.onap.so.sdncsimulator.utils.Constants.OPERATIONS_URL; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.MediaType; +import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestActionEnumeration; +import org.onap.sdnc.northbound.client.model.GenericResourceApiRequestinformationRequestInformation; import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation; import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation; import org.onap.so.sdncsimulator.models.InputRequest; @@ -96,7 +99,8 @@ public class OperationsController { return ResponseEntity.badRequest().build(); } - final Output output = cacheServiceProvider.putVnfOperationInformation(apiVnfOperationInformation); + final Output output = getOutput(apiVnfOperationInformation); + final OutputRequest outputRequest = new OutputRequest(output); if (output.getResponseCode().equals(HttpStatus.OK.toString())) { @@ -109,4 +113,17 @@ public class OperationsController { } + private Output getOutput(final GenericResourceApiVnfOperationInformation apiVnfOperationInformation) { + final GenericResourceApiRequestinformationRequestInformation requestInformation = + apiVnfOperationInformation.getRequestInformation(); + if (requestInformation != null) { + final GenericResourceApiRequestActionEnumeration requestAction = requestInformation.getRequestAction(); + if (DELETEVNFINSTANCE.equals(requestAction)) { + LOGGER.info("RequestAction: {} will delete vnf instance from cache ...", requestAction); + return cacheServiceProvider.deleteVnfOperationInformation(apiVnfOperationInformation); + } + } + return cacheServiceProvider.putVnfOperationInformation(apiVnfOperationInformation); + } + } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/providers/ServiceOperationsCacheServiceProvider.java b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/providers/ServiceOperationsCacheServiceProvider.java index 97dc7b11..5b32b91f 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/providers/ServiceOperationsCacheServiceProvider.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/providers/ServiceOperationsCacheServiceProvider.java @@ -39,6 +39,8 @@ public interface ServiceOperationsCacheServiceProvider { Output putVnfOperationInformation(final GenericResourceApiVnfOperationInformation apiVnfOperationInformation); + Output deleteVnfOperationInformation(final GenericResourceApiVnfOperationInformation apiVnfOperationInformation); + void clearAll(); } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/providers/ServiceOperationsCacheServiceProviderimpl.java b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/providers/ServiceOperationsCacheServiceProviderimpl.java index d5e991a8..616a56c4 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/providers/ServiceOperationsCacheServiceProviderimpl.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/providers/ServiceOperationsCacheServiceProviderimpl.java @@ -78,6 +78,7 @@ import org.springframework.stereotype.Service; public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServiceProvider implements ServiceOperationsCacheServiceProvider { + private static final String EMPTY_STRING = ""; private static final Logger LOGGER = LoggerFactory.getLogger(ServiceOperationsCacheServiceProviderimpl.class); @Autowired @@ -89,7 +90,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ public Output putServiceOperationInformation(final GenericResourceApiServiceOperationInformation input) { final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader(); - final String svcRequestId = requestHeader != null ? requestHeader.getSvcRequestId() : null; + final String svcRequestId = getSvcRequestId(requestHeader); final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation(); if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId())) { @@ -140,7 +141,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ final GenericResourceApiVnfinformationVnfInformation vnfInformation = input.getVnfInformation(); final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader(); - final String svcRequestId = requestHeader != null ? requestHeader.getSvcRequestId() : null; + final String svcRequestId = getSvcRequestId(requestHeader); if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId()) && vnfInformation != null && isValid(vnfInformation.getVnfId())) { @@ -187,6 +188,55 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ } @Override + public Output deleteVnfOperationInformation(final GenericResourceApiVnfOperationInformation input) { + final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation(); + final GenericResourceApiVnfinformationVnfInformation vnfInformation = input.getVnfInformation(); + + final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader(); + final String svcRequestId = getSvcRequestId(requestHeader); + + if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId()) && vnfInformation != null + && isValid(vnfInformation.getVnfId())) { + final String serviceInstanceId = serviceInformation.getServiceInstanceId(); + final String vnfId = vnfInformation.getVnfId(); + final Optional<GenericResourceApiServicemodelinfrastructureService> optional = + getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId); + if (optional.isPresent()) { + final GenericResourceApiServicemodelinfrastructureService service = optional.get(); + final GenericResourceApiServicedataServiceData serviceData = service.getServiceData(); + if (serviceData != null) { + final List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList = getVnfs(serviceData); + final Optional<GenericResourceApiServicedataServicedataVnfsVnf> vnfInstanceOptional = + getExistingVnf(vnfId, vnfsList); + + if (vnfInstanceOptional.isPresent()) { + vnfsList.removeIf(vnf -> vnf.getVnfId() != null && vnf.getVnfId().equals(vnfId)); + + return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.OK.toString()) + .responseMessage(EMPTY_STRING).svcRequestId(svcRequestId) + .serviceResponseInformation( + new GenericResourceApiInstanceReference().instanceId(serviceInstanceId)) + .vnfResponseInformation(new GenericResourceApiInstanceReference().instanceId(vnfId)); + } + + } + } + LOGGER.error( + "Unable to find existing GenericResourceApiServiceModelInfrastructure in cache using service instance id: {}", + serviceInstanceId); + + } + LOGGER.error("Unable to remove vnf instance from cache due to invalid input: {}... ", input); + return new Output().ackFinalIndicator(YES).responseCode(HttpStatus.BAD_REQUEST.toString()) + .responseMessage("Unable to remove vnf").svcRequestId(svcRequestId); + + } + + private String getSvcRequestId(final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader) { + return requestHeader != null ? requestHeader.getSvcRequestId() : null; + } + + @Override public void clearAll() { clearCache(SERVICE_TOPOLOGY_OPERATION_CACHE); } @@ -228,9 +278,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ private Optional<GenericResourceApiServicedataServicedataVnfsVnf> getExistingVnf(final String vnfId, final List<GenericResourceApiServicedataServicedataVnfsVnf> vnfsList) { - final Optional<GenericResourceApiServicedataServicedataVnfsVnf> optional = - vnfsList.stream().filter(vnf -> vnf.getVnfId() != null && vnf.getVnfId().equals(vnfId)).findFirst(); - return optional; + return vnfsList.stream().filter(vnf -> vnf.getVnfId() != null && vnf.getVnfId().equals(vnfId)).findFirst(); } private List<GenericResourceApiServicedataServicedataVnfsVnf> getVnfs( @@ -313,17 +361,13 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ apiServicedataServiceData.serviceLevelOperStatus(getServiceLevelOperStatus(input)); final GenericResourceApiServicestatusServiceStatus serviceStatus = - getServiceStatus(getSvcAction(input.getSdncRequestHeader()), getAction(input.getRequestInformation()), - HttpStatus.OK.toString()); + getServiceStatus(getSvcAction(input.getSdncRequestHeader()), + getRequestAction(input.getRequestInformation()), HttpStatus.OK.toString()); return new GenericResourceApiServicemodelinfrastructureService().serviceData(apiServicedataServiceData) .serviceStatus(serviceStatus).serviceInstanceId(serviceInstanceId); } - private String getAction(final GenericResourceApiRequestinformationRequestInformation input) { - return getString(input.getRequestAction(), ""); - } - private String getSvcAction(final GenericResourceApiSdncrequestheaderSdncRequestHeader input) { return input != null ? getStringOrNull(input.getSvcAction()) : null; } @@ -333,7 +377,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ return new GenericResourceApiServicestatusServiceStatus().finalIndicator(YES) .rpcAction(GenericResourceApiRpcActionEnumeration.fromValue(rpcAction)) .rpcName(SERVICE_TOPOLOGY_OPERATION).responseTimestamp(LocalDateTime.now().toString()) - .responseCode(responseCode).requestStatus(SYNCCOMPLETE).responseMessage("").action(action); + .responseCode(responseCode).requestStatus(SYNCCOMPLETE).responseMessage(EMPTY_STRING).action(action); } private GenericResourceApiOperStatusData getServiceLevelOperStatus( @@ -351,7 +395,12 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ } private String getRequestAction(final GenericResourceApiRequestinformationRequestInformation input) { - return input != null ? getStringOrNull(input.getRequestAction()) : null; + return getRequestAction(input, EMPTY_STRING); + } + + private String getRequestAction(final GenericResourceApiRequestinformationRequestInformation input, + final String defaultValue) { + return input != null ? getString(input.getRequestAction(), defaultValue) : defaultValue; } private GenericResourceApiServicetopologyServiceTopology getServiceTopology( diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/utils/ObjectUtils.java b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/utils/ObjectUtils.java index 833da414..b4d6da38 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/utils/ObjectUtils.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/utils/ObjectUtils.java @@ -33,7 +33,7 @@ public class ObjectUtils { return getString(obj, null); } - public static String getString(final Object obj, String defaultValue) { + public static String getString(final Object obj, final String defaultValue) { return obj != null ? obj.toString() : defaultValue; } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/java/org/onap/so/sdncsimulator/controller/OperationsControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/java/org/onap/so/sdncsimulator/controller/OperationsControllerTest.java index b1ede082..a338283c 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/java/org/onap/so/sdncsimulator/controller/OperationsControllerTest.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/java/org/onap/so/sdncsimulator/controller/OperationsControllerTest.java @@ -20,11 +20,13 @@ package org.onap.so.sdncsimulator.controller; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.onap.so.sdncsimulator.controller.TestUtils.getInvalidRequestInput; import static org.onap.so.sdncsimulator.controller.TestUtils.getRequestInput; import static org.onap.so.sdncsimulator.controller.TestUtils.getVnfRequestInput; +import static org.onap.so.sdncsimulator.controller.TestUtils.getVnfRequestWithRequestActionDeleteVnfInput; import static org.onap.so.sdncsimulator.controller.TestUtils.getVnfRequestWithSvcActionActivateInput; import java.util.Optional; import org.junit.After; @@ -306,6 +308,61 @@ public class OperationsControllerTest { } + @Test + public void test_postVnfOperationInformation_successfullyRemoveVnfFromExistingServiceInCache() throws Exception { + final HttpEntity<?> httpEntity = new HttpEntity<>(getRequestInput(), getHttpHeaders()); + final ResponseEntity<OutputRequest> responseEntity = + restTemplate.exchange(getUrl(), HttpMethod.POST, httpEntity, OutputRequest.class); + + assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); + + final HttpEntity<?> httpAddVnfEntity = new HttpEntity<>(getVnfRequestInput(), getHttpHeaders()); + final ResponseEntity<OutputRequest> responseAddVnfEntity = + restTemplate.exchange(getVnfUrl(), HttpMethod.POST, httpAddVnfEntity, OutputRequest.class); + assertEquals(HttpStatus.OK, responseAddVnfEntity.getStatusCode()); + + Optional<GenericResourceApiServicemodelinfrastructureService> serviceOptional = + cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID); + assertTrue(serviceOptional.isPresent()); + + GenericResourceApiServicemodelinfrastructureService service = serviceOptional.get(); + assertNotNull(service.getServiceInstanceId()); + assertNotNull(service.getServiceData().getVnfs().getVnf()); + assertNotNull(service.getServiceData()); + assertNotNull(service.getServiceData().getVnfs()); + assertNotNull(service.getServiceData().getVnfs().getVnf()); + assertFalse(service.getServiceData().getVnfs().getVnf().isEmpty()); + + final HttpEntity<?> httpRemoveVnfEntity = + new HttpEntity<>(getVnfRequestWithRequestActionDeleteVnfInput(), getHttpHeaders()); + final ResponseEntity<OutputRequest> responseRemoveVnfEntity = + restTemplate.exchange(getVnfUrl(), HttpMethod.POST, httpRemoveVnfEntity, OutputRequest.class); + assertEquals(HttpStatus.OK, responseRemoveVnfEntity.getStatusCode()); + + final OutputRequest actualOutputRequest = responseRemoveVnfEntity.getBody(); + assertNotNull(actualOutputRequest); + assertNotNull(actualOutputRequest.getOutput()); + + final Output actualObject = actualOutputRequest.getOutput(); + + assertEquals(HttpStatus.OK.toString(), actualObject.getResponseCode()); + assertEquals(Constants.YES, actualObject.getAckFinalIndicator()); + assertEquals(VNF_SVC_REQUEST_ID, actualObject.getSvcRequestId()); + + serviceOptional = + cacheServiceProvider.getGenericResourceApiServicemodelinfrastructureService(SERVICE_INSTANCE_ID); + assertTrue(serviceOptional.isPresent()); + + service = serviceOptional.get(); + assertNotNull(service.getServiceInstanceId()); + assertNotNull(service.getServiceData().getVnfs().getVnf()); + assertNotNull(service.getServiceData()); + assertNotNull(service.getServiceData().getVnfs()); + assertNotNull(service.getServiceData().getVnfs().getVnf()); + assertTrue(service.getServiceData().getVnfs().getVnf().isEmpty()); + + + } private HttpHeaders getHttpHeaders() { return TestUtils.getHttpHeaders(userCredentials.getUsers().iterator().next().getUsername()); diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/java/org/onap/so/sdncsimulator/controller/TestUtils.java b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/java/org/onap/so/sdncsimulator/controller/TestUtils.java index 220ec7d3..b43ecf4c 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/java/org/onap/so/sdncsimulator/controller/TestUtils.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/java/org/onap/so/sdncsimulator/controller/TestUtils.java @@ -45,7 +45,7 @@ public class TestUtils { public static String getVnfRequestInput() throws IOException { return getFileAsString(getFile("test-data/vnfInput.json").toPath()); } - + public static String getVnfRequestWithSvcActionActivateInput() throws IOException { return getFileAsString(getFile("test-data/activateVnfInput.json").toPath()); } @@ -54,6 +54,10 @@ public class TestUtils { return getFileAsString(getFile("test-data/InvalidInput.json").toPath()); } + public static String getVnfRequestWithRequestActionDeleteVnfInput() throws IOException { + return getFileAsString(getFile("test-data/deleteVnfInput.json").toPath()); + } + public static String getFileAsString(final Path path) throws IOException { return new String(Files.readAllBytes(path)); } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/resources/test-data/deleteVnfInput.json b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/resources/test-data/deleteVnfInput.json new file mode 100644 index 00000000..dda16b5d --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/test/resources/test-data/deleteVnfInput.json @@ -0,0 +1,46 @@ +{ + "input": { + "request-information": { + "request-action": "DeleteVnfInstance", + "source": "MSO", + "request-id": "1a545ea9-2a5e-4df9-9c73-529b1d0b2012" + }, + "sdnc-request-header": { + "svc-request-id": "8fd2622b-01fc-424d-bfc8-f48bcd64e546", + "svc-notification-url": "http://so-bpmn-infra.onap:8081/mso/WorkflowMessage/SDNCCallback/fd40ea09-3245-476a-b6ff-58cb042edb9d", + "svc-action": "UNASSIGN" + }, + "service-information": { + "onap-model-information": { + "model-name": "Sol004Zip4Service", + "model-version": "1.0", + "model-uuid": "99d59273-4450-4034-9141-027f0c1a807a", + "model-invariant-uuid": "51672777-9b8d-4e5e-b488-5f9092e03a82" + }, + "subscription-service-type": "vCPE", + "service-id": "ccece8fe-13da-456a-baf6-41b3a4a2bc2b", + "global-customer-id": "NordixDemoCustomer", + "service-instance-id": "ccece8fe-13da-456a-baf6-41b3a4a2bc2b" + }, + "vnf-information": { + "onap-model-information": { + "model-name": "Sol004Zip3VSP", + "model-version": "1.0", + "model-customization-uuid": "50a90cd7-a84e-4ee1-b5ba-bfa5a26f5e15", + "model-uuid": "84b9649a-4eb9-4967-9abe-e8702f55518b", + "model-invariant-uuid": "b0f14066-2b65-40d2-b5a4-c8f2116fb5fc" + }, + "vnf-id": "dfd02fb5-d7fb-4aac-b3c4-cd6b60058701", + "vnf-name": "EsyVnfInstantiationTest2", + "vnf-type": "Sol004Zip4Service/Sol004Zip3VSP 0" + }, + "vnf-request-input": { + "aic-cloud-region": "nordixcloud", + "cloud-owner": "CloudOwner", + "tenant": "693c7729b2364a26a3ca602e6f66187d", + "vnf-network-instance-group-ids": [], + "vnf-input-parameters": {}, + "vnf-name": "EsyVnfInstantiationTest2" + } + } +}
\ No newline at end of file diff --git a/plans/so/integration-etsi-testing/teardown.sh b/plans/so/integration-etsi-testing/teardown.sh index 61edc7df..e92b7314 100755 --- a/plans/so/integration-etsi-testing/teardown.sh +++ b/plans/so/integration-etsi-testing/teardown.sh @@ -28,12 +28,23 @@ ENV_FILE=$CONFIG_DIR/env TEMP_DIR_PATH=$SCRIPT_HOME/temp TEST_LAB_DIR_PATH=$TEMP_DIR_PATH/test_lab DOCKER_COMPOSE_FILE_PATH=$SCRIPT_HOME/docker-compose.yml +DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE=$SCRIPT_HOME/docker-compose.local.yml echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..." export $(egrep -v '^#' $ENV_FILE | xargs) export TEST_LAB_DIR=$TEST_LAB_DIR_PATH export CONFIG_DIR_PATH=$CONFIG_DIR -docker-compose -f $DOCKER_COMPOSE_FILE_PATH -p $PROJECT_NAME down +if [ "$DOCKER_ENVIRONMENT" == "remote" ]; then + echo "Tearing down docker containers from remote images ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -p $PROJECT_NAME down +elif [ "$DOCKER_ENVIRONMENT" == "local" ]; then + echo "Tearing down docker containers from local images ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -f $DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE -p $PROJECT_NAME down +else + echo "Couldn't find valid property for DOCKER_ENVIRONMENT in $ENV_FILE." + echo "Attempting normal teardown ..." + docker-compose -f $DOCKER_COMPOSE_FILE_PATH -p $PROJECT_NAME down +fi echo "Finished executing $SCRIPT_HOME/$SCRIPT_NAME" diff --git a/plans/so/vnfm_adapter/docker-compose.yml b/plans/so/vnfm_adapter/docker-compose.yml deleted file mode 100644 index 95195710..00000000 --- a/plans/so/vnfm_adapter/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: '3' -services: -################################################################################ - VNFM-adapter: - image: nexus3.onap.org:10001/onap/so/vnfm-adapter:1.4.4 - ports: - - "9092:9092" - environment: - - APP=VNFM-adapter - - JVM_ARGS=-Xms64m -Xmx512m - hostname: - vnfm-adapter-test - logging: - driver: "json-file" - options: - max-size: "30m" - max-file: "5" -################################################################################ diff --git a/plans/so/vnfm_adapter/setup.sh b/plans/so/vnfm_adapter/setup.sh deleted file mode 100644 index 518358b2..00000000 --- a/plans/so/vnfm_adapter/setup.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# ============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========================================================= -# - -export NEXUS_DOCKER_REPO_MSO=nexus3.onap.org:10001 -export TAG=1.4.0-STAGING-latest - -docker-compose pull -docker-compose up -d - -sleep 2m - -REPO_IP='127.0.0.1' -ROBOT_VARIABLES="-v REPO_IP:${REPO_IP}" diff --git a/plans/so/vnfm_adapter/teardown.sh b/plans/so/vnfm_adapter/teardown.sh deleted file mode 100644 index 8b778a57..00000000 --- a/plans/so/vnfm_adapter/teardown.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -# ============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========================================================= -# - -docker-compose down diff --git a/plans/so/vnfm_adapter/testplan.txt b/plans/so/vnfm_adapter/testplan.txt deleted file mode 100644 index 823990af..00000000 --- a/plans/so/vnfm_adapter/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -so/vnfm_adapter/vnfm_adapter_test.robot |