Merge "Add HTTP to DFC CSIT tests"
diff --git a/plans/ccsdk/healthcheck/setup.sh b/plans/ccsdk/healthcheck/setup.sh
deleted file mode 100644
index 2a5ef4d..0000000
--- a/plans/ccsdk/healthcheck/setup.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2016-2017 Huawei Technologies Co., Ltd.
-#
-# 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.
-#
-# Modifications copyright (c) 2017 AT&T Intellectual Property
-# Modifications copyright (c) 2020 Samsung Electronics Co., Ltd.
-#
-# Place the scripts in run order:
-export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
-export NEXUS_DOCKER_REPO="nexus3.onap.org:10001"
-export NEXUS_USERNAME=docker
-export NEXUS_PASSWD=docker
-export DMAAP_TOPIC=AUTO
-export CCSDK_DOCKER_IMAGE_VERSION=1.1-STAGING-latest
-
-if [ "$MTU" == "" ]; then
- export MTU="1450"
-fi
-
-# Clone CCSDK repo to get docker-compose for CCSDK
-mkdir -p $WORKSPACE/archives/ccsdk
-cd $WORKSPACE/archives
-git clone -b master --single-branch http://gerrit.onap.org/r/ccsdk/distribution.git ccsdk
-cd $WORKSPACE/archives/ccsdk
-git pull
-unset http_proxy https_proxy
-cd $WORKSPACE/archives/ccsdk/src/main/yaml
-
-sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="AUTO"/g" docker-compose.yml
-docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
-
-docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-alpine-image:$CCSDK_DOCKER_IMAGE_VERSION
-
-docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION
-
-# start CCSDK containers with docker compose and configuration from docker-compose.yml
-curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > docker-compose
-chmod +x docker-compose
-./docker-compose up -d
-
-# WAIT 5 minutes maximum and check karaf.log for readiness every 10 seconds
-
-TIME_OUT=300
-INTERVAL=10
-TIME=0
-while [ "$TIME" -lt "$TIME_OUT" ]; do
-
-docker exec ccsdk_odlsli_container cat /opt/opendaylight/data/log/karaf.log | grep 'warp coils'
-
- if [ $? == 0 ] ; then
- echo CCSDK karaf started in $TIME seconds
- break;
- fi
-
- echo Sleep $INTERVAL seconds before testing if CCSDK is up. Total wait time up until now is $TIME seconds. Timeout is $TIME_OUT seconds
- sleep $INTERVAL
- TIME=$(($TIME+$INTERVAL))
-done
-
-if [ "$TIME" -ge "$TIME_OUT" ]; then
- echo TIME OUT: karaf session not started in $TIME_OUT seconds, setup failed
- exit 1;
-fi
-
-num_bundles=$(docker exec -i ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d' ' -f1)
-
- if [ "$num_bundles" -ge 333 ]; then
- num_bundles=$(docker exec -i ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d' ' -f1)
- num_failed_bundles=$(docker exec -i ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l)
- failed_bundles=$(docker exec -i ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | grep Failure)
- echo There is/are $num_failed_bundles failed bundles out of $num_bundles installed bundles.
- fi
-
-if [ "$num_failed_bundles" -ge 1 ]; then
- echo "The following bundle(s) are in a failed state: "
- echo " $failed_bundles"
-fi
-
-# Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}"
-
diff --git a/plans/ccsdk/healthcheck/teardown.sh b/plans/ccsdk/healthcheck/teardown.sh
deleted file mode 100644
index 5682078..0000000
--- a/plans/ccsdk/healthcheck/teardown.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2016-2017 Huawei Technologies Co., Ltd.
-#
-# 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.
-#
-# Modifications copyright (c) 2017 AT&T Intellectual Property
-#
-
-kill-instance.sh ccsdk_db_container
-kill-instance.sh ccsdk_dgbuilder_container
-kill-instance.sh ccsdk_odlsli_container
-
-# $WORKSPACE/archives/appc deleted with archives folder when tests starts so we keep it at the end for debugging
diff --git a/plans/ccsdk/healthcheck/testplan.txt b/plans/ccsdk/healthcheck/testplan.txt
deleted file mode 100644
index 2cd8cda..0000000
--- a/plans/ccsdk/healthcheck/testplan.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Test suites are relative paths under [integration/csit.git]/tests/.
-# Place the suites in run order.
-ccsdk/healthcheck
-
diff --git a/plans/music/music-distributed-kv-store-test-plan/setup.sh b/plans/music/music-distributed-kv-store-test-plan/setup.sh
deleted file mode 100644
index 88becf6..0000000
--- a/plans/music/music-distributed-kv-store-test-plan/setup.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2018 Intel Corporation
-#
-# 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.
-#
-
-# Not sure why this is needed.
-source ${SCRIPTS}/common_functions.sh
-
-# Initial Configuration.
-DATASTORE="consul"
-DATASTORE_IP="localhost"
-
-MOUNTPATH="/dkv_mount_path/configs/"
-DEFAULT_CONFIGS=$(pwd)/mountpath/default
-
-mkdir -p mountpath/default
-
-pushd mountpath/default
-cat << EOF > sampleConfig1.properties
-foo1=bar1
-hello1=world1
-key1=value1
-EOF
-cat << EOF > sampleConfig2.properties
-foo2=bar2
-hello2=world2
-key2=value2
-EOF
-popd
-
-docker login -u docker -p docker nexus3.onap.org:10001
-docker pull nexus3.onap.org:10001/onap/music/distributed-kv-store
-docker run -e DATASTORE=$DATASTORE -e DATASTORE_IP=$DATASTORE_IP -e MOUNTPATH=$MOUNTPATH -d \
- --name dkv \
- -v $DEFAULT_CONFIGS:/dkv_mount_path/configs/default \
- -p 8200:8200 -p 8080:8080 nexus3.onap.org:10001/onap/music/distributed-kv-store
-
-
-echo "###### WAITING FOR DISTRIBUTED KV STORE CONTAINER TO COME UP"
-sleep 10
-
-#
-# add here all ROBOT_VARIABLES settings
-#
-echo "# music robot variables settings";
-ROBOT_VARIABLES="-v DKV_HOSTNAME:http://localhost -v DKV_PORT:8080"
-
-echo ${ROBOT_VARIABLES}
\ No newline at end of file
diff --git a/plans/music/music-distributed-kv-store-test-plan/teardown.sh b/plans/music/music-distributed-kv-store-test-plan/teardown.sh
deleted file mode 100644
index 0abf3a6..0000000
--- a/plans/music/music-distributed-kv-store-test-plan/teardown.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2018 Intel Corporation
-#
-# 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.
-#
-
-rm -rf mountpath
-docker stop dkv
-docker rm dkv
-docker rmi nexus3.onap.org:10001/onap/music/distributed-kv-store
diff --git a/plans/music/music-distributed-kv-store-test-plan/testplan.txt b/plans/music/music-distributed-kv-store-test-plan/testplan.txt
deleted file mode 100644
index 654f078..0000000
--- a/plans/music/music-distributed-kv-store-test-plan/testplan.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Test suites are relative paths under [integration/csit.git]/tests/.
-# Place the suites in run order.
-music/music-distributed-kv-store-suite
\ No newline at end of file
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/setup.sh b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/setup.sh
index 65cd576..6dbe58c 100755
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/setup.sh
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/setup.sh
@@ -57,6 +57,7 @@
##### update pnf simulator ip in config deploy request #######
RES_KEY=$(uuidgen -r)
sed -i "s/pnfaddr/$LOCAL_IP/g" $REQUEST_DATA_PATH/mount.json
+sed -i "s/pnfaddr/$LOCAL_IP/g" $REQUEST_DATA_PATH/mount2.json
##############################################################
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/docker-compose.yml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/docker-compose.yml
index 7b1d5a8..c6657e2 100755
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/docker-compose.yml
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/docker-compose.yml
@@ -9,4 +9,14 @@
- "830:830"
- "6513:6513"
volumes:
+ - ./:/config/modules
+
+ netconf-pnp-simulator-2:
+ image: nexus3.onap.org:10001/onap/integration/simulators/netconf-pnp-simulator:2.8.6
+ container_name: netconf-pnp-simulator-2
+ restart: always
+ ports:
+ - "831:830"
+ - "6514:6513"
+ volumes:
- ./:/config/modules
\ No newline at end of file
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/a51e2bef-961c-496f-b235-b4540400e885.json b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/a51e2bef-961c-496f-b235-b4540400e885.json
new file mode 100644
index 0000000..fc42fa5
--- /dev/null
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/a51e2bef-961c-496f-b235-b4540400e885.json
@@ -0,0 +1,20 @@
+{
+ "model-vers": {
+ "model-ver": [
+ {
+ "model-version-id": "cd4decf6-4f27-4775-9561-0e683ed43635",
+ "model-name": "EricService",
+ "model-version": "1.0",
+ "model-description": "service_instance_1.0",
+ "resource-version": "1594657102313"
+ },
+ {
+ "model-version-id": "4442dfc1-0d2d-46b4-b0bc-a2ac10448269",
+ "model-name": "EricService",
+ "model-version": "2.0",
+ "model-description": "service_instance_2.0",
+ "resource-version": "1594707742646"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/pnf.json b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/pnf.json
index ab39d8c..331b249 100755
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/pnf.json
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/pnf.json
@@ -1,5 +1,5 @@
{
- "pnf-name2":"PNFDemo-pnf-name2-val-78244",
+ "pnf-name2":"6513",
"pnf-name2-source":"PNFDemo-pnf-name2-source-val-99275",
"equip-type":"PNFDemo-equip-type-val-20348",
"equip-vendor":"PNFDemo-equip-vendor-val-52182",
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/pnf2.json b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/pnf2.json
new file mode 100755
index 0000000..07732f2
--- /dev/null
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/pnf2.json
@@ -0,0 +1,16 @@
+{
+ "pnf-name2":"6514",
+ "pnf-name2-source":"PNFDemo1-pnf-name2-source-val-99275",
+ "equip-type":"PNFDemo1-equip-type-val-20348",
+ "equip-vendor":"PNFDemo1-equip-vendor-val-52182",
+ "equip-model":"PNFDemo1-equip-model-val-8370",
+ "management-option":"PNFDemo1-management-option-val-72881",
+ "ipaddress-v4-oam":"pnfaddr",
+ "ipaddress-v6-oam":"0:0:0:0:0:0",
+ "sw-version":"pnf_sw_version-1.0.0",
+ "pnf-name":"PNFDemo1",
+ "pnf-id":"PNFDemo1",
+ "in-maint":false,
+ "resource-version":"1371558818531",
+ "selflink": "http://localhost:9993/pnf/PNFDemo1"
+}
\ No newline at end of file
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/service-instance-aai.json b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/service-instance-aai.json
index 8ea4263..53dc39d 100644
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/service-instance-aai.json
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/service-instance-aai.json
@@ -1,9 +1,9 @@
{
- "service-instance-id": "5df8b6de-2083-11e7-93ae-92361f002676",
+ "service-instance-id": "df4decf6-h727-8875-8761-89683ed43645",
"service-instance-name": "Service_Ete_Name123452c4-3d7f-42ce-8188-818fab951269",
"environment-context": "General_Revenue-Bearing",
"workload-context": "Production",
- "model-version-id": "d88da85c-d9e8-4f73-b837-3a72a431622b",
+ "model-version-id": "cd4decf6-4f27-4775-9561-0e683ed43635",
"modelInvariantId": "fe41489e-1563-46a3-b90a-1db629e4375b",
"resource-version": "1595258335377",
"selflink": "restconf/config/GENERIC-RESOURCE-API:services/service/5df8b6de-2083-11e7-93ae-92361f002676/service-data/service-topology/",
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/apply-workarounds.sh b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/apply-workarounds.sh
index cb61ca3..72e8434 100755
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/apply-workarounds.sh
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/apply-workarounds.sh
@@ -72,6 +72,9 @@
insert into $WORKFLOW_TABLE_NAME(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
('02bffbd9-6af0-4f8d-bf9b-d1dfccd28c84','GenericPnfSWUPDownload','GenericPnfSWUPDownload','GenericPnfSWUPDownload',1.0,'Pnf Workflow to download software',null,'pnf','native');
+ insert into $WORKFLOW_TABLE_NAME(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
+ ('03fcdjf2-6af0-4f8d-bf9b-s3frzca23c19','ServiceLevelUpgrade','ServiceLevelUpgrade','ServiceLevelUpgrade',1.0,'ServiceLevel Upgrade Workflow to upgrade software',null,'service','native');
+
COMMIT;
EOF
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/distribution-test-zip/zipped_sdc_csar_2.0.tar.gz b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/distribution-test-zip/zipped_sdc_csar_2.0.tar.gz
new file mode 100644
index 0000000..357260e
--- /dev/null
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/distribution-test-zip/zipped_sdc_csar_2.0.tar.gz
Binary files differ
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/env b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/env
index ab4e3df..71e9daf 100644
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/env
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/env
@@ -1,6 +1,6 @@
NEXUS_DOCKER_REPO_MSO=nexus3.onap.org:10001
DOCKER_ENVIRONMENT=remote
-TAG=1.7.7-STAGING-latest
+TAG=1.8.0-STAGING-latest
TIME_OUT_DEFAULT_VALUE_SEC=1200
PROJECT_NAME=pnfSwU
DEFAULT_NETWORK_NAME=pnfswu_default
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/populate-aai-simulator.sh b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/populate-aai-simulator.sh
index 26673fc..bbc5b9f 100755
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/populate-aai-simulator.sh
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/populate-aai-simulator.sh
@@ -62,6 +62,7 @@
ESR_SYSTEM_INFO_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/esr-system-info.json
CLOUD_ESR_SYSTEM_INFO_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/cloud-esr-system-info.json
PNF_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/pnf.json
+ PNF2_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/pnf2.json
SERVICE_INSTANCE_JSON_FILE=$AAI_SIMULATOR_DATA_DIR/service-instance-aai.json
STATUS_CODE_ACCEPTED="202"
@@ -157,8 +158,16 @@
exit 1
fi
+ echo "$SCRIPT_NAME $(current_timestamp): Adding PNF_2.0"
+ status_code=$(curl -k --write-out %{http_code} --silent --output /dev/null -H "$BASIC_AUTHORIZATION_HEADER" -H "$ACCEPT_HEADER" -H "$CONTENT_TYPE_HEADER" $BASE_URL/network/pnfs/pnf/PNFDemo1 -X PUT -d @$"$PNF2_JSON_FILE")
+
+ if [[ "$status_code" -ne "$STATUS_CODE_ACCEPTED" ]] ; then
+ echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to put PNF data in AAI Simulator. Status code received: $status_code"
+ exit 1
+ fi
+
echo "$SCRIPT_NAME $(current_timestamp): Adding ServiceInstance"
- status_code=$(curl -k --write-out %{http_code} --silent --output /dev/null -H "$BASIC_AUTHORIZATION_HEADER" -H "$ACCEPT_HEADER" -H "$CONTENT_TYPE_HEADER" $BASE_URL/business/customers/customer/5df8b6de-2083-11e7-93ae-92361f002676/service-subscriptions/service-subscription/pNF/service-instances/service-instance/ETE_Customer_807c7a02-249c-4db8-9fa9-bee973fe08ce -X PUT -d @$"$SERVICE_INSTANCE_JSON_FILE")
+ status_code=$(curl -k --write-out %{http_code} --silent --output /dev/null -H "$BASIC_AUTHORIZATION_HEADER" -H "$ACCEPT_HEADER" -H "$CONTENT_TYPE_HEADER" $BASE_URL/business/customers/customer/807c7a02-249c-4db8-9fa9-bee973fe08ce/service-subscriptions/service-subscription/pNF/service-instances/service-instance/cd4decf6-4f27-4775-9561-0e683ed43635 -X PUT -d @$"$SERVICE_INSTANCE_JSON_FILE")
if [[ "$status_code" -ne "$STATUS_CODE_ACCEPTED" ]] ; then
echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to put ServiceInstance data in AAI Simulator. Status code received: $status_code"
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/docker-compose.yml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/docker-compose.yml
index 0886d9d..4699be3 100755
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/docker-compose.yml
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/docker-compose.yml
@@ -140,6 +140,7 @@
- /etc/localtime:/etc/localtime:ro
- ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates
- ${CONFIG_DIR_PATH}/distribution-test-zip/zipped_sdc_csar.tar.gz:/distribution-test-zip/zipped_sdc_csar.tar.gz
+ - ${CONFIG_DIR_PATH}/distribution-test-zip/zipped_sdc_csar_2.0.tar.gz:/distribution-test-zip/zipped_sdc_csar_2.0.tar.gz
- ${CONFIG_DIR_PATH}/override-files/sdc-controller/onapheat:/app/config
environment:
- APP=sdc-controller
@@ -160,7 +161,7 @@
entrypoint:
- /bin/sh
- -c
- - 'mkdir -p /app/distribution-test-zip/unzipped && cp -R /distribution-test-zip/zipped_sdc_csar.tar.gz /app && tar -xvzf /app/zipped_sdc_csar.tar.gz -C /app/distribution-test-zip/unzipped && /app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"'
+ - 'mkdir -p /app/distribution-test-zip/unzipped && cp -R /distribution-test-zip/zipped_sdc_csar.tar.gz /app && cp -R /distribution-test-zip/zipped_sdc_csar_2.0.tar.gz /app && tar -xvzf /app/zipped_sdc_csar.tar.gz -C /app/distribution-test-zip/unzipped && tar -xvzf /app/zipped_sdc_csar_2.0.tar.gz -C /app/distribution-test-zip/unzipped && /app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"'
################################################################################
bpmn-infra:
user: root
@@ -246,6 +247,7 @@
container_name: aai-simulator
volumes:
- /etc/localtime:/etc/localtime:ro
+ - ${CONFIG_DIR_PATH}/a51e2bef-961c-496f-b235-b4540400e885.json:/app/a51e2bef-961c-496f-b235-b4540400e885.json
ports:
- "9993:9993"
environment:
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/pom.xml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/pom.xml
index 30d2521..9976814 100755
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/pom.xml
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/pom.xml
@@ -55,6 +55,11 @@
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>2.8.5</version>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationController.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationController.java
index ddc2b62..1375387 100644
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationController.java
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationController.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,11 +19,14 @@
*/
package org.onap.aaisimulator.controller;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import javax.ws.rs.core.MediaType;
+import org.onap.aaisimulator.models.ServiceModelVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@@ -50,25 +53,27 @@
@Value("${SERVICE_DESIGN_AND_CREATION_RESPONSES_LOCATION:./}")
private String responsesLocation;
- @GetMapping(path = "/models/model/{model-invariant-id}/model-vers",
- produces = MediaType.APPLICATION_XML_VALUE)
+ @GetMapping(path = "/models/model/{model-invariant-id}/model-vers", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public ResponseEntity<String> getModelVers(@PathVariable("model-invariant-id") String modelInvariantId) {
Path responsesPath = Paths.get(responsesLocation).toAbsolutePath();
LOGGER.info("Will get ModelVer for 'model-invariant-id': {}, looking under {}",
modelInvariantId, responsesPath.toString());
- Path responsePath = responsesPath.resolve(modelInvariantId + ".xml");
+ Path responsePath = responsesPath.resolve(modelInvariantId + ".json");
if (!responsePath.toFile().exists()) {
LOGGER.error("{} not found", responsePath.toString());
return ResponseEntity.notFound().build();
}
try {
String content = new String(Files.readAllBytes(responsePath), StandardCharsets.UTF_8);
+ Gson gson = new GsonBuilder().setPrettyPrinting().create();
+ ServiceModelVersion json = gson.fromJson(content, ServiceModelVersion.class);
+ String jsonInString = gson.toJson(json);
LOGGER.info("{} found with {} characters", responsePath.toString(), content.length());
- return ResponseEntity.ok().body(content);
+ return ResponseEntity.ok().body(jsonInString);
} catch (IOException e) {
LOGGER.error("Failed to read response from {}: {}}", responsePath.toString(), e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
}
}
-}
+}
\ No newline at end of file
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ModelVersion.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ModelVersion.java
new file mode 100644
index 0000000..d682508
--- /dev/null
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ModelVersion.java
@@ -0,0 +1,86 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 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.aaisimulator.models;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class ModelVersion {
+
+ @SerializedName("model-version-id")
+ @Expose
+ private String modelVersionId;
+
+ @SerializedName("model-name")
+ @Expose
+ private String modelName;
+
+ @SerializedName("model-version")
+ @Expose
+ private String modelVersion;
+
+ @SerializedName("model-description")
+ @Expose
+ private String modelDescription;
+
+ @SerializedName("resource-version")
+ @Expose
+ private String resourceVersion;
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ public String getModelDescription() {
+ return modelDescription;
+ }
+
+ public void setModelDescription(String modelDescription) {
+ this.modelDescription = modelDescription;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+}
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ModelVersions.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ModelVersions.java
new file mode 100644
index 0000000..7d74ec3
--- /dev/null
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ModelVersions.java
@@ -0,0 +1,39 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 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.aaisimulator.models;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+import java.util.List;
+
+public class ModelVersions {
+
+ @SerializedName("model-ver")
+ @Expose
+ private List<ModelVersion> modelVer = null;
+
+ public List<ModelVersion> getModelVer() {
+ return modelVer;
+ }
+
+ public void setModelVer(List<ModelVersion> modelVer) {
+ this.modelVer = modelVer;
+ }
+}
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ServiceModelVersion.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ServiceModelVersion.java
new file mode 100644
index 0000000..d0a879c
--- /dev/null
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/models/ServiceModelVersion.java
@@ -0,0 +1,38 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2020 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.aaisimulator.models;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class ServiceModelVersion {
+
+ @SerializedName("model-vers")
+ @Expose
+ private ModelVersions modelVers;
+
+ public ModelVersions getModelVers() {
+ return modelVers;
+ }
+
+ public void setModelVers(ModelVersions modelVers) {
+ this.modelVers = modelVers;
+ }
+}
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationControllerTest.java
index d0e652b..8bda17e 100644
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationControllerTest.java
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationControllerTest.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
package org.onap.aaisimulator.controller;
import org.junit.Test;
+import org.onap.aaisimulator.models.ServiceModelVersion;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.http.HttpStatus;
@@ -37,31 +38,35 @@
@Test
public void should_reply_sample_modelvers_response() {
- final String url = getUrl(SERVICE_DESIGN_AND_CREATION_URL,
- "/models/model/a51e2bef-961c-496f-b235-b4540400e885/model-vers");
- ResponseEntity<String> actual = testRestTemplateService.invokeHttpGet(url, String.class);
- String expectedXml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
- "<model-vers xmlns=\"http://org.onap.aai.inventory/v11\">\n" +
- " <model-ver>\n" +
- " <model-version-id>c0818142-324d-4a8c-8065-45a61df247a5</model-version-id>\n" +
- " <model-name>EricService</model-name>\n" +
- " <model-version>1.0</model-version>\n" +
- " <model-description>blah</model-description>\n" +
- " <resource-version>1594657102313</resource-version>\n" +
- " </model-ver>\n" +
- " <model-ver>\n" +
- " <model-version-id>4442dfc1-0d2d-46b4-b0bc-a2ac10448269</model-version-id>\n" +
- " <model-name>EricService</model-name>\n" +
- " <model-version>2.0</model-version>\n" +
- " <model-description>blahhhh</model-description>\n" +
- " <resource-version>1594707742646</resource-version>\n" +
- " </model-ver>\n" +
- "</model-vers>";
+ final String url = getUrl(SERVICE_DESIGN_AND_CREATION_URL, "/models/model/a51e2bef-961c-496f-b235-b4540400e885/model-vers");
+
+ ResponseEntity<?> actual = testRestTemplateService.invokeHttpGet(url, String.class);
+
+ String expectedXml = "{\n"
+ + " \"model-vers\": {\n"
+ + " \"model-ver\": [\n"
+ + " {\n"
+ + " \"model-version-id\": \"cd4decf6-4f27-4775-9561-0e683ed43635\",\n"
+ + " \"model-name\": \"EricService\",\n"
+ + " \"model-version\": \"1.0\",\n"
+ + " \"model-description\": \"service_instance_1.0\",\n"
+ + " \"resource-version\": \"1594657102313\"\n"
+ + " },\n"
+ + " {\n"
+ + " \"model-version-id\": \"4442dfc1-0d2d-46b4-b0bc-a2ac10448269\",\n"
+ + " \"model-name\": \"EricService\",\n"
+ + " \"model-version\": \"2.0\",\n"
+ + " \"model-description\": \"service_instance_2.0\",\n"
+ + " \"resource-version\": \"1594707742646\"\n"
+ + " }\n"
+ + " ]\n"
+ + " }\n"
+ + "}";
assertEquals(HttpStatus.OK, actual.getStatusCode());
MediaType contentType = actual.getHeaders().getContentType();
assertNotNull(contentType);
- assertTrue(contentType.isCompatibleWith(MediaType.APPLICATION_XML));
+ assertTrue(contentType.isCompatibleWith(MediaType.APPLICATION_JSON));
assertEquals(expectedXml, actual.getBody());
}
}
\ No newline at end of file
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/resources/test-data/service-design-and-creation-responses/a51e2bef-961c-496f-b235-b4540400e885.json b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/resources/test-data/service-design-and-creation-responses/a51e2bef-961c-496f-b235-b4540400e885.json
new file mode 100644
index 0000000..fc42fa5
--- /dev/null
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/resources/test-data/service-design-and-creation-responses/a51e2bef-961c-496f-b235-b4540400e885.json
@@ -0,0 +1,20 @@
+{
+ "model-vers": {
+ "model-ver": [
+ {
+ "model-version-id": "cd4decf6-4f27-4775-9561-0e683ed43635",
+ "model-name": "EricService",
+ "model-version": "1.0",
+ "model-description": "service_instance_1.0",
+ "resource-version": "1594657102313"
+ },
+ {
+ "model-version-id": "4442dfc1-0d2d-46b4-b0bc-a2ac10448269",
+ "model-name": "EricService",
+ "model-version": "2.0",
+ "model-description": "service_instance_2.0",
+ "resource-version": "1594707742646"
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/resources/test-data/service-design-and-creation-responses/a51e2bef-961c-496f-b235-b4540400e885.xml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/resources/test-data/service-design-and-creation-responses/a51e2bef-961c-496f-b235-b4540400e885.xml
deleted file mode 100644
index 55247be..0000000
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/resources/test-data/service-design-and-creation-responses/a51e2bef-961c-496f-b235-b4540400e885.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<model-vers xmlns="http://org.onap.aai.inventory/v11">
- <model-ver>
- <model-version-id>c0818142-324d-4a8c-8065-45a61df247a5</model-version-id>
- <model-name>EricService</model-name>
- <model-version>1.0</model-version>
- <model-description>blah</model-description>
- <resource-version>1594657102313</resource-version>
- </model-ver>
- <model-ver>
- <model-version-id>4442dfc1-0d2d-46b4-b0bc-a2ac10448269</model-version-id>
- <model-name>EricService</model-name>
- <model-version>2.0</model-version>
- <model-description>blahhhh</model-description>
- <resource-version>1594707742646</resource-version>
- </model-ver>
-</model-vers>
\ No newline at end of file
diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/so_setup.sh b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/so_setup.sh
index ed5f6f0..de90c1f 100755
--- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/so_setup.sh
+++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/so_setup.sh
@@ -45,6 +45,7 @@
WAIT_FOR_POPULATE_AAI_SCRIPT=$CONFIG_DIR/"wait-for-aai-config-job.sh"
WAIT_FOR_CONTAINER_SCRIPT=$CONFIG_DIR/"wait-for-container.sh"
PNF_PAYLOAD_PATH=$CONFIG_DIR/aai-simulator-populate-data/pnf.json
+PNF2_PAYLOAD_PATH=$CONFIG_DIR/aai-simulator-populate-data/pnf2.json
echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..."
@@ -142,6 +143,7 @@
echo "updating PNF ip-address in pnf.json"
sed -i "s/pnfaddr/$LOCAL_IP/g" $PNF_PAYLOAD_PATH
+sed -i "s/pnfaddr/$LOCAL_IP/g" $PNF2_PAYLOAD_PATH
if [ "$DOCKER_ENVIRONMENT" == "remote" ]; then
echo "Starting docker containers with remote images ..."
diff --git a/scripts/ccsdk/healthcheck/health_check.sh b/scripts/ccsdk/healthcheck/health_check.sh
deleted file mode 100644
index aed3b5a..0000000
--- a/scripts/ccsdk/healthcheck/health_check.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env bash
-###############################################################################
-# Copyright 2017 Huawei Technologies Co., Ltd.
-#
-# 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.
-#
-# Modifications copyright (c) 2020 Samsung Electronics Co., Ltd.
-#
-###############################################################################
-unset http_proxy https_proxy
-
-response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8383/restconf/operations/SLI-API:healthcheck )
-
-if [ "$response" == "200" ]; then
- echo "CCSDK health check passed."
- exit 0;
-fi
-
-echo "CCSDK health check failed with response code ${response}."
-exit 1
diff --git a/tests/ccsdk/healthcheck/__init__.robot b/tests/ccsdk/healthcheck/__init__.robot
deleted file mode 100644
index 1259b89..0000000
--- a/tests/ccsdk/healthcheck/__init__.robot
+++ /dev/null
@@ -1,2 +0,0 @@
-*** Settings ***
-Documentation CCSDK - healthcheck
diff --git a/tests/ccsdk/healthcheck/test1.robot b/tests/ccsdk/healthcheck/test1.robot
deleted file mode 100644
index fea86c3..0000000
--- a/tests/ccsdk/healthcheck/test1.robot
+++ /dev/null
@@ -1,16 +0,0 @@
-*** Settings ***
-Library OperatingSystem
-Library Process
-
-*** Variables ***
-
-${health_check} ${SCRIPTS}/ccsdk/healthcheck/health_check.sh
-
-
-*** Test Cases ***
-Health check test case for CCSDK
- [Documentation] Health check
- ${result_hc}= Run Process bash ${health_check} > log_hc.txt shell=yes
- Should Be Equal As Integers ${result_hc.rc} 0
-
-
diff --git a/tests/music/music-distributed-kv-store-suite/__init__.robot b/tests/music/music-distributed-kv-store-suite/__init__.robot
deleted file mode 100644
index d1da7f3..0000000
--- a/tests/music/music-distributed-kv-store-suite/__init__.robot
+++ /dev/null
@@ -1,2 +0,0 @@
-*** Settings ***
-Documentation Integration - Suite 1
\ No newline at end of file
diff --git a/tests/music/music-distributed-kv-store-suite/data/register_domain.json b/tests/music/music-distributed-kv-store-suite/data/register_domain.json
deleted file mode 100644
index 96811ee..0000000
--- a/tests/music/music-distributed-kv-store-suite/data/register_domain.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "domain":"test_domain"
-}
\ No newline at end of file
diff --git a/tests/music/music-distributed-kv-store-suite/music-distributed-kv-store-test.robot b/tests/music/music-distributed-kv-store-suite/music-distributed-kv-store-test.robot
deleted file mode 100644
index de26e5f..0000000
--- a/tests/music/music-distributed-kv-store-suite/music-distributed-kv-store-test.robot
+++ /dev/null
@@ -1,53 +0,0 @@
-*** Settings ***
-Library OperatingSystem
-Library RequestsLibrary
-Library json
-
-*** Variables ***
-${MESSAGE} {"ping": "ok"}
-
-#global variables
-${generatedAID}
-
-*** Test Cases ***
-DKV Check Distributed KV Store API Docker Container
- [Documentation] Checks if DKV docker container is running
- ${rc} ${output}= Run and Return RC and Output docker ps
- Log To Console *********************
- Log To Console retrurn_code = ${rc}
- Log To Console output = ${output}
- Should Be Equal As Integers ${rc} 0
- Should Contain ${output} nexus3.onap.org:10001/onap/music/distributed-kv-store
-
-DKV LoadDefaultProperties
- [Documentation] Loads default configuration files into Consul
- Create Session dkv ${DKV_HOSTNAME}:${DKV_PORT}
- &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
- ${resp}= Get Request dkv /v1/config/load-default headers=${headers}
- Log To Console *********************
- Log To Console response = ${resp}
- Log To Console body = ${resp.text}
- Should Be Equal As Integers ${resp.status_code} 200
-
-DKV FetchDefaultProperties
- [Documentation] Fetches all default keys from Consul
- Create Session dkv ${DKV_HOSTNAME}:${DKV_PORT}
- &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
- ${resp}= Get Request dkv /v1/getconfigs headers=${headers}
- Log To Console *********************
- Log To Console response = ${resp}
- Log To Console body = ${resp.text}
- Should Be Equal As Integers ${resp.status_code} 200
-
-#DKV RegisterDomain
-# [Documentation] Send a POST request to create a domain
-# Create Session dkv ${DKV_HOSTNAME}:${DKV_PORT}
-# ${data}= Get Binary File ${CURDIR}${/}data${/}register_domain.json
-# &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
-# ${resp}= Post Request dkv v1/register data=${data} headers=${headers}
-# Log To Console *********************
-# Log To Console response = ${resp}
-# Log To Console body = ${resp.text}
-# Should Be Equal As Integers ${resp.status_code} 200
-
-*** Keywords ***
diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip
index 4edc9de..055d7de 100644
--- a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip
+++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip
Binary files differ
diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/distributeServiceTemplate_2.0.json b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/distributeServiceTemplate_2.0.json
new file mode 100644
index 0000000..e5b3d89
--- /dev/null
+++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/distributeServiceTemplate_2.0.json
@@ -0,0 +1,35 @@
+{
+ "distributionID": "6ac9fa0c-70f0-4213-a8d4-5b58d6a17697",
+ "serviceName": "Demo_svc",
+ "serviceVersion": "2.0",
+ "serviceUUID": "8351245d-50da-4695-8756-3a22618377f7",
+ "serviceDescription": "ServiceLevelUpgrade",
+ "serviceInvariantUUID": "fe41489e-1563-46a3-b90a-1db629e4375b",
+ "resources": [
+ {
+ "resourceInstanceName": "Demo_pnf 0",
+ "resourceCustomizationUUID": "23b43821-4eds-31f4-bfd4-66a7e0fd9bb2",
+ "resourceName": "Demo_pnf",
+ "resourceVersion": "1.0",
+ "resoucreType": "PNF",
+ "resourceUUID": "a42f6566-6a29-43e1-bac9-b91a59d702ac",
+ "resourceInvariantUUID": "fdf44827-35db-4ee5-bd70-7500e633576e",
+ "category": "Network L4+",
+ "subcategory": "Common Network Resources",
+ "artifacts": []
+ }
+ ],
+ "serviceArtifacts": [
+ {
+ "artifactName": "service-DemoSvc-csar_2.0.csar",
+ "artifactType": "TOSCA_CSAR",
+ "artifactURL": "//unzipped_sdc_csar/v1/catalog/services/DemoSvc/2.0/artifacts/service-DemoSvc-csar.csar",
+ "artifactChecksum": "YjFhZWZhOTU2MzljMDI4ZmVlNzlhOTgxYTcxMzg5ODI\u003d",
+ "artifactDescription": "TOSCA definition package of the asset",
+ "artifactTimeout": 0,
+ "artifactVersion": "2",
+ "artifactUUID": "809894a4-c862-4294-b2fb-e016b4268546"
+ }
+ ],
+ "workloadContext": "Production"
+ }
\ No newline at end of file
diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/mount2.json b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/mount2.json
new file mode 100755
index 0000000..efe94b4
--- /dev/null
+++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/mount2.json
@@ -0,0 +1,18 @@
+{
+ "node": [
+ {
+ "node-id": "PNFDemo1",
+ "netconf-node-topology:protocol": {
+ "name": "TLS"
+ },
+ "netconf-node-topology:host": "pnfaddr",
+ "netconf-node-topology:key-based": {
+ "username": "netconf",
+ "key-id": "ODL_private_key_0"
+ },
+ "netconf-node-topology:port": 6514,
+ "netconf-node-topology:tcp-only": false,
+ "netconf-node-topology:max-connection-attempts": 5
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceLevelUpgradeRequest.json b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceLevelUpgradeRequest.json
new file mode 100644
index 0000000..d7a6b57
--- /dev/null
+++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/serviceLevelUpgradeRequest.json
@@ -0,0 +1,38 @@
+{
+ "requestDetails": {
+ "subscriberInfo": {
+ "globalSubscriberId": "807c7a02-249c-4db8-9fa9-bee973fe08ce"
+ },
+ "modelInfo": {
+ "modelVersion": "2.0",
+ "modelVersionId": "8351245d-50da-4695-8756-3a22618377f7",
+ "modelInvariantId": "fe41489e-1563-46a3-b90a-1db629e4375b",
+ "modelName": "Demo_svc",
+ "modelType": "service"
+ },
+ "requestInfo": {
+ "suppressRollback": false,
+ "requestorId": "demo",
+ "instanceName": "testInstanceName",
+ "source": "VID"
+ },
+ "requestParameters": {
+ "subscriptionServiceType": "pNF",
+ "userParams": [
+ {
+ "name": "targetSoftwareVersion",
+ "value": "pnf_sw_version-4.0.0"
+ }
+ ],
+ "aLaCarte": false,
+ "payload": "{\"k1\": \"v1\"}"
+ },
+ "project": {
+ "projectName": "ServiceLevelUpgrade"
+ },
+ "owningEntity": {
+ "owningEntityId": "67f2e84c-734d-4e90-a1e4-d2ffa2e75849",
+ "owningEntityName": "OE-Test"
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/pnf-sw-upgrade.robot b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/pnf-sw-upgrade.robot
index d3762a0..1bb2d71 100644
--- a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/pnf-sw-upgrade.robot
+++ b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/pnf-sw-upgrade.robot
@@ -8,7 +8,9 @@
*** Variables ***
${SDNC_KEYSTORE_CONFIG_PATH} /restconf/config/netconf-keystore:keystore
${SDNC_MOUNT_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo
+${SDNC_MOUNT_PATH2} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo1
${PNFSIM_MOUNT_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/pnf-sw-upgrade:software-upgrade
+${PNFSIM_MOUNT_PATH2} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo1/yang-ext:mount/pnf-sw-upgrade:software-upgrade
${PNFSIM_DELETE_PATH} /restconf/config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo
${BP_UPLOAD_URL} /api/v1/blueprint-model/publish
${BP_PROCESS_URL} /api/v1/execution-service/process
@@ -48,12 +50,14 @@
${serviceInstanceId}= Set Variable cd4decf6-4f27-4775-9561-0e683ed43635
SET GLOBAL VARIABLE ${serviceInstanceId}
${pnfName}= Set Variable PNFDemo
- SET GLOBAL VARIABLE ${pnfName}
+ SET GLOBAL VARIABLE ${pnfName}
+ ${pnfName1}= Set Variable PNFDemo1
+ SET GLOBAL VARIABLE ${pnfName1}
Get pnf workflow
Create Session api_handler_session http://${REPO_IP}:8080
&{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json
- ${get_pnfworkflows_request}= Get Request api_handler_session /onap/so/infra/workflowSpecifications/v1/pnfWorkflows headers=${headers}
+ ${get_pnfworkflows_request}= Get Request api_handler_session /onap/so/infra/workflowSpecifications/v1/workflows headers=${headers}
Run Keyword If '${get_pnfworkflows_request.status_code}' == '200' log to console \nexecuted with expected result
log to console ${get_pnfworkflows_request.content}
${pnfworkflows_json_response}= Evaluate json.loads(r"""${get_pnfworkflows_request.content}""", strict=False) json
@@ -62,6 +66,8 @@
${activate_workflow_name}= Set Variable ""
${download_workflow_uuid}= Set Variable ""
${download_workflow_name}= Set Variable ""
+ ${serviceLevel_workflow_uuid}= Set Variable ""
+ ${serviceLevel_workflow_name}= Set Variable ""
FOR ${member} IN @{all_wf_members}
${workflow_uuid}= Set Variable ${member}[workflowSpecification][artifactInfo][artifactUuid]
${workflow_name}= Set Variable ${member}[workflowSpecification][artifactInfo][artifactName]
@@ -70,14 +76,19 @@
${activate_workflow_name}= Set Variable If '${workflow_name}' == 'GenericPnfSoftwareUpgrade' ${workflow_name} ${activate_workflow_name}
${download_workflow_uuid}= Set Variable If '${workflow_name}' == 'GenericPnfSWUPDownload' ${workflow_uuid} ${download_workflow_uuid}
${download_workflow_name}= Set Variable If '${workflow_name}' == 'GenericPnfSWUPDownload' ${workflow_name} ${download_workflow_name}
+ ${serviceLevel_workflow_uuid}= Set Variable If '${workflow_name}' == 'ServiceLevelUpgrade' ${workflow_uuid} ${serviceLevel_workflow_uuid}
+ ${serviceLevel_workflow_name}= Set Variable If '${workflow_name}' == 'ServiceLevelUpgrade' ${workflow_name} ${serviceLevel_workflow_name}
END
SET GLOBAL VARIABLE ${activate_workflow_uuid}
SET GLOBAL VARIABLE ${download_workflow_uuid}
+ SET GLOBAL VARIABLE ${serviceLevel_workflow_uuid}
Run Keyword If '${activate_workflow_name}' == 'GenericPnfSoftwareUpgrade' log to console \nexecuted with expected result
Run Keyword If '${download_workflow_name}' == 'GenericPnfSWUPDownload' log to console \nexecuted with expected result
+ Run Keyword If '${serviceLevel_workflow_name}' == 'ServiceLevelUpgrade' log to console \nexecuted with expected result
Should Be Equal As Strings '${activate_workflow_name}' 'GenericPnfSoftwareUpgrade'
Should Be Equal As Strings '${download_workflow_name}' 'GenericPnfSWUPDownload'
+ Should Be Equal As Strings '${serviceLevel_workflow_name}' 'ServiceLevelUpgrade'
Invoke Service Instantiation for pnf software download
Create Session api_handler_session http://${REPO_IP}:8080
@@ -194,3 +205,158 @@
Log To Console final target software version received: ${sw_version}
Run Keyword If '${sw_version}' == 'pnf_sw_version-3.0.0' log to console \nexecuted with expected result
Should Be Equal As Strings '${sw_version}' 'pnf_sw_version-3.0.0'
+
+Distribute ServiceLevel Upgrade Template
+ Create Session sdc_controller_session http://${REPO_IP}:8085
+ ${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate_2.0.json
+ &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/app/distribution-test-zip/unzipped/ Content-Type=application/json Accept=application/json
+ ${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers}
+ Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${resp.status_code}' '200'
+ ${model_version_id_2}= Set Variable 8351245d-50da-4695-8756-3a22618377f7
+ SET GLOBAL VARIABLE ${model_version_id_2}
+
+Get Service-Model-Version From AAI Using Service-Model-InVariant-UUId
+ Create Session aai_simulator_session https://${REPO_IP}:9993
+ &{headers}= Create Dictionary Authorization=Basic YWFpOmFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== Content-Type=application/xml Accept=application/xml verify=False
+ ${model-invariant-id}= Set Variable a51e2bef-961c-496f-b235-b4540400e885
+ ${get_serviceVersion}= Get Request aai_simulator_session aai/v11/service-design-and-creation/models/model/${model-invariant-id}/model-vers headers=${headers}
+ Run Keyword If '${get_serviceVersion.status_code}' == '200' log to console \nExecuted with expected
+ Log to console ${get_serviceVersion.content}
+ Should Be Equal As Strings ${get_serviceVersion.status_code} 200
+ ${serviceVersion_json_response}= Evaluate json.loads(r"""${get_serviceVersion.content}""", strict=False) json
+ ${all_service_version}= Set Variable ${serviceVersion_json_response['model-vers']['model-ver']}
+ ${model-version-id_1}= Set Variable ""
+ ${model-version-id_2}= Set Variable ""
+ FOR ${member} IN @{all_service_version}
+ ${model-version}= Set Variable ${member}[model-version]
+ ${model-version-id}= Set Variable ${member}[model-version-id]
+ Log to console The ServiceModel Version ${model-version} has ModelVersion Id : ${model-version-id}
+ ${model-version-id_1}= Set Variable If '${model-version}' == '1.0' ${model-version-id} ${model-version-id_1}
+ ${model-version-id_2}= Set Variable If '${model-version}' == '2.0' ${model-version-id} ${model-version-id_2}
+ END
+ SET GLOBAL VARIABLE ${model-version-id_1}
+ SET GLOBAL VARIABLE ${model-version-id_2}
+
+Invoke Service Instantiation for ServiceLevel Upgrade
+ Create Session api_handler_session http://${REPO_IP}:8080
+ ${data}= Get Binary File ${CURDIR}${/}data${/}serviceLevelUpgradeRequest.json
+ ${serviceInstanceId}= Set Variable ${model-version-id_1}
+ &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json X-ONAP-RequestID=0ffc559c-5513-44bc-8b02-5759d84600f4 X-ONAP-PartnerName=ONAP X-RequestorID=VID
+ ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/instanceManagement/v1/serviceInstances/${serviceInstanceId}/workflows/${serviceLevel_workflow_uuid} data=${data} headers=${headers}
+ Run Keyword If '${service_instantiation_request.status_code}' == '200' log to console \nexecuted with expected result
+ log to console ${service_instantiation_request.content}
+ ${service_instantiation_json_response}= Evaluate json.loads(r"""${service_instantiation_request.content}""", strict=False) json
+ ${request_ID}= Set Variable ${service_instantiation_json_response}[requestReferences][requestId]
+ ${actual_service_request_state}= Set Variable ""
+ FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+ ${orchestration_status_service_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID}
+ Run Keyword If '${orchestration_status_service_request.status_code}' == '200' log to console \nexecuted with expected result
+ log to console ${orchestration_status_service_request.content}
+ ${orchestration_json_service_response}= Evaluate json.loads(r"""${orchestration_status_service_request.content}""", strict=False) json
+ ${actual_service_request_state}= SET VARIABLE ${orchestration_json_service_response}[request][requestStatus][requestState]
+ Log To Console Received actual repsonse status:${actual_service_request_state}
+ RUN KEYWORD IF '${actual_service_request_state}' == 'COMPLETE' or '${actual_service_request_state}' == 'FAILED' Exit For Loop
+ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds
+ SLEEP ${SLEEP_INTERVAL_SEC}s
+ END
+ Log To Console final repsonse status received: ${actual_service_request_state}
+ Run Keyword If '${actual_service_request_state}' == 'COMPLETE' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${actual_service_request_state}' 'COMPLETE'
+
+Test Verify PNF-1 Configuration for Service Level Upgrade
+ [Documentation] Checking PNF configuration params
+ Create Session sdnc http://${REPO_IP}:8282
+ &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json
+ ${mount}= Get File ${CURDIR}${/}data${/}mount.json
+ Log to console ${mount}
+ ${pnf_mount_resp}= Put Request sdnc ${SDNC_MOUNT_PATH} data=${mount} headers=${headers}
+ Should Be Equal As Strings ${pnf_mount_resp.status_code} 201
+ SLEEP 10
+ ${pnfsim_software_resp}= Get Request sdnc ${PNFSIM_MOUNT_PATH} headers=${headers}
+ Should Be Equal As Strings ${pnfsim_software_resp.status_code} 200
+ Log to console ${pnfsim_software_resp.content}
+ ${pnfsim_software_resp_json}= Evaluate json.loads(r"""${pnfsim_software_resp.content}""", strict=False) json
+ ${all_upgp_members}= Set Variable ${pnfsim_software_resp_json['software-upgrade']['upgrade-package']}
+ FOR ${member} IN @{all_upgp_members}
+ ${soft_ver}= Get From Dictionary ${member} software-version
+ ${soft_status}= Get From Dictionary ${member} current-status
+ Log to console The node ${pnfName} has software version ${soft_ver} : ${soft_status}
+ Run Keyword If '${soft_ver}' == 'pnf_sw_version-4.0.0' Exit For Loop
+ END
+ Run Keyword If '${soft_ver}' == 'pnf_sw_version-4.0.0' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${soft_ver}' 'pnf_sw_version-4.0.0'
+ Should Be Equal As Strings '${soft_status}' 'ACTIVATION_COMPLETED'
+
+Test AAI-Update for PNF-1 Target Software Version after Service Level Upgrade
+ Create Session aai_simulator_session https://${REPO_IP}:9993
+ &{headers}= Create Dictionary Authorization=Basic YWFpOmFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== Content-Type=application/json Accept=application/json verify=False
+ FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+ ${get_pnf_request}= Get Request aai_simulator_session aai/v11/network/pnfs/pnf/${pnfName} headers=${headers}
+ Run Keyword If '${get_pnf_request.status_code}' == '200' log to console \nexecuted with expected result
+ ${get_pnf_json_response}= Evaluate json.loads(r"""${get_pnf_request.content}""", strict=False) json
+ Log to console ${get_pnf_json_response}
+ ${sw_version}= Set Variable ${get_pnf_json_response}[sw-version]
+ Log to console ${sw_version}
+ Run Keyword If '${sw_version}' == 'pnf_sw_version-4.0.0' Exit For Loop
+ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds
+ SLEEP ${SLEEP_INTERVAL_SEC}s
+ END
+ Log To Console final target software version received: ${sw_version}
+ Run Keyword If '${sw_version}' == 'pnf_sw_version-4.0.0' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${sw_version}' 'pnf_sw_version-4.0.0'
+
+Test Verify PNF-2 Configuration for Service Level Upgrade
+ [Documentation] Checking PNF configuration params
+ Create Session sdnc http://${REPO_IP}:8282
+ &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json
+ ${mount}= Get File ${CURDIR}${/}data${/}mount2.json
+ Log to console ${mount}
+ ${pnf_mount_resp}= Put Request sdnc ${SDNC_MOUNT_PATH2} data=${mount} headers=${headers}
+ Should Be Equal As Strings ${pnf_mount_resp.status_code} 201
+ SLEEP 10
+ ${pnfsim_software_resp}= Get Request sdnc ${PNFSIM_MOUNT_PATH2} headers=${headers}
+ Should Be Equal As Strings ${pnfsim_software_resp.status_code} 200
+ Log to console ${pnfsim_software_resp.content}
+ ${pnfsim_software_resp_json}= Evaluate json.loads(r"""${pnfsim_software_resp.content}""", strict=False) json
+ ${all_upgp_members}= Set Variable ${pnfsim_software_resp_json['software-upgrade']['upgrade-package']}
+ FOR ${member} IN @{all_upgp_members}
+ ${soft_ver}= Get From Dictionary ${member} software-version
+ ${soft_status}= Get From Dictionary ${member} current-status
+ Log to console The node ${pnfName1} has software version ${soft_ver} : ${soft_status}
+ Run Keyword If '${soft_ver}' == 'pnf_sw_version-4.0.0' Exit For Loop
+ END
+ Run Keyword If '${soft_ver}' == 'pnf_sw_version-4.0.0' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${soft_ver}' 'pnf_sw_version-4.0.0'
+ Should Be Equal As Strings '${soft_status}' 'ACTIVATION_COMPLETED'
+
+Test AAI-Update for PNF-2 Target Software Version after Service Level Upgrade
+ Create Session aai_simulator_session https://${REPO_IP}:9993
+ &{headers}= Create Dictionary Authorization=Basic YWFpOmFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== Content-Type=application/json Accept=application/json verify=False
+ FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+ ${get_pnf_request}= Get Request aai_simulator_session aai/v11/network/pnfs/pnf/${pnfName1} headers=${headers}
+ Run Keyword If '${get_pnf_request.status_code}' == '200' log to console \nexecuted with expected result
+ ${get_pnf_json_response}= Evaluate json.loads(r"""${get_pnf_request.content}""", strict=False) json
+ Log to console ${get_pnf_json_response}
+ ${sw_version}= Set Variable ${get_pnf_json_response}[sw-version]
+ Log to console ${sw_version}
+ Run Keyword If '${sw_version}' == 'pnf_sw_version-4.0.0' Exit For Loop
+ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds
+ SLEEP ${SLEEP_INTERVAL_SEC}s
+ END
+ Log To Console final target software version received: ${sw_version}
+ Run Keyword If '${sw_version}' == 'pnf_sw_version-4.0.0' log to console \nexecuted with expected result
+ Should Be Equal As Strings '${sw_version}' 'pnf_sw_version-4.0.0'
+
+Test AAI-Update for ServiceInstance after Service Level Upgrade
+ ${globalSubscriberId}= Set Variable 807c7a02-249c-4db8-9fa9-bee973fe08ce
+ Create Session aai_simulator_session https://${REPO_IP}:9993
+ &{headers}= Create Dictionary Authorization=Basic YWFpOmFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== Content-Type=application/json Accept=application/json verify=False
+ ${get_service_request}= Get Request aai_simulator_session aai/v17/business/customers/customer/${globalSubscriberId}/service-subscriptions/service-subscription/pNF/service-instances/service-instance/${model_version_id_2} headers=${headers}
+ Run Keyword If '${get_service_request.status_code}' == '200' log to console \nexecuted with expected result
+ ${get_service_json_response}= Evaluate json.loads(r"""${get_service_request.content}""", strict=False) json
+ Log to console ${get_service_json_response}
+ ${service_instance_id}= Set Variable ${get_service_json_response}[service-instance-id]
+ Should Be Equal As Strings '${service_instance_id}' 'df4decf6-h727-8875-8761-89683ed43645'
+ ${model_version_id}= Set Variable ${get_service_json_response}[model-version-id]
+ Should Be Equal As Strings '${model_version_id}' '${model_version_id_2}'
\ No newline at end of file
diff --git a/tests/vnfsdk-refrepo/csar/invalid_with_security.csar b/tests/vnfsdk-refrepo/csar/invalid_with_security.csar
new file mode 100644
index 0000000..1b25855
--- /dev/null
+++ b/tests/vnfsdk-refrepo/csar/invalid_with_security.csar
Binary files differ
diff --git a/tests/vnfsdk-refrepo/csar_validation_tests.robot b/tests/vnfsdk-refrepo/csar_validation_tests.robot
index 9994d56..9097c1a 100644
--- a/tests/vnfsdk-refrepo/csar_validation_tests.robot
+++ b/tests/vnfsdk-refrepo/csar_validation_tests.robot
@@ -18,13 +18,60 @@
# those strings are dependent on validation response and may need to be changed if vnf refrepo response changes
${response}= Remove String ${response} \\\\ \\u003c \\u003e \\"
${json_response}= evaluate json.loads('''${response}''') json
- Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} PASS
+ Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} ${OPERATION_STATUS_PASS}
FOR ${resault} IN @{json_response[0]["results"]["results"]}
Should Be Equal As Strings ${resault["errors"]} []
Should Be Equal As Strings ${resault["passed"]} True
+ run keyword if "${resault["vnfreqName"]}" == "${CERTIFICATION_RULE}"
+ ... Should Be Equal As Strings ${resault["warnings"]} ${expected_valid_no_security_warnings}
END
+Validate secure CSAR with invalid certificate
+ [Documentation] Valid CSAR with cms signature in manifest file and certificate in TOSCA, containing individual signatures for multiple artifacts, using common certificate and individual certificate
+
+ ${response}= Validate CSAR usign Post request ${csar_invalid_with_security} ${execute_security_csar_validation}
+ # Removing strings that are causing errors during evaluation,
+ # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes
+ ${response}= Remove String ${response} \\\\ \\u003c \\u003e \\"
+ ${json_response}= evaluate json.loads('''${response}''') json
+ Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} ${OPERATION_STATUS_FAILED}
+ ${validated_rules}= Get Length ${json_response[0]["results"]["results"]}
+ Should Be Equal As Strings ${validated_rules} 14
+ FOR ${resault} IN @{json_response[0]["results"]["results"]}
+ ${validation_errors}= Get Length ${resault["errors"]}
+ run keyword if "${resault["vnfreqName"]}" == "${CERTIFICATION_RULE}"
+ ... Should Be Equal As Strings ${validation_errors} 9
+ run keyword if "${resault["vnfreqName"]}" == "${PM_DICTIONARY_YAML_RULE}"
+ ... Should Be Equal As Strings ${validation_errors} 1
+ run keyword if "${resault["vnfreqName"]}" == "${MANIFEST_FILE_RULE}"
+ ... Should Be Equal As Strings ${validation_errors} 1
+ run keyword if "${resault["vnfreqName"]}" == "${NON_MANO_FILES_RULE}"
+ ... Should Be Equal As Strings ${validation_errors} 4
+ END
+
+
+Validate CSAR using selected rules
+ [Documentation] Valid CSAR using only selected rules provided in request parameters
+
+ ${response}= Validate CSAR usign Post request ${csar_invalid_with_security} ${execute_security_csar_validation_selected_rules}
+ # Removing strings that are causing errors during evaluation,
+ # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes
+ ${response}= Remove String ${response} \\\\ \\u003c \\u003e \\"
+ ${json_response}= evaluate json.loads('''${response}''') json
+ Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} ${OPERATION_STATUS_FAILED}
+ ${validated_rules}= Get Length ${json_response[0]["results"]["results"]}
+ Should Be Equal As Strings ${validated_rules} 3
+ FOR ${resault} IN @{json_response[0]["results"]["results"]}
+ ${validation_errors}= Get Length ${resault["errors"]}
+ run keyword if "${resault["vnfreqName"]}" == "${CERTIFICATION_RULE}"
+ ... Should Be Equal As Strings ${validation_errors} 9
+ run keyword if "${resault["vnfreqName"]}" == "${PM_DICTIONARY_YAML_RULE}"
+ ... Should Be Equal As Strings ${validation_errors} 1
+ END
+
+
+
Validate CSAR using rule r130206 and use get method to receive outcome
[Documentation] Validate CSAR with invalid PM_Dictionary (r130206) using rule r130206 , then use get method with validation id to receive valdiation outcome
diff --git a/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot b/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot
index e46eba6..bc9684d 100644
--- a/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot
+++ b/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot
@@ -3,8 +3,20 @@
${csarpath}= ${SCRIPTS}/../tests/vnfsdk-refrepo/csar
+${CERTIFICATION_RULE}= r130206
+${PM_DICTIONARY_YAML_RULE}= r816745
+${MANIFEST_FILE_RULE}= r01123
+${NON_MANO_FILES_RULE}= r146092
+${OPERATION_STATUS_FAILED}= FAILED
+${OPERATION_STATUS_PASS}= PASS
+
${csar_valid_no_security}= valid_no_security.csar
${execute_no_security_csar_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_valid_no_security}","pnf":"true"}}]
+${expected_valid_no_security_warnings}= [{u'lineNumber': -1, u'message': u'Warning. Consider adding package integrity and authenticity assurance according to ETSI NFV-SOL 004 Security Option 1', u'code': u'0x1006', u'file': u'', u'vnfreqNo': u'R130206'}]
+
+${csar_invalid_with_security}= invalid_with_security.csar
+${execute_security_csar_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_invalid_with_security}","pnf":"true"}}]
+${execute_security_csar_validation_selected_rules}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_invalid_with_security}","pnf":"true","rules":"${CERTIFICATION_RULE},${PM_DICTIONARY_YAML_RULE}"}}]
${csar_invalid_pm_dictionary}= invalid_pm_dictionary.csar
${execute_invalid_pm_dictionary_r130206_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate-r130206","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}]