From: Morgan Richomme Date: Tue, 6 Apr 2021 12:56:15 +0000 (+0000) Subject: Merge "[ADMIN] Add Illia Halych in INFO.yaml " X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=b7e9993ce237092ce54d0e753d5f7173a4976f37;hp=5c1f05e603e8c7967351f0748e45316728a9a60c;p=integration%2Fcsit.git Merge "[ADMIN] Add Illia Halych in INFO.yaml " --- diff --git a/plans/ccsdk-oran/polmansuite/FTC1.sh b/plans/ccsdk-oran/polmansuite/FTC1.sh deleted file mode 100755 index ce9aa73b..00000000 --- a/plans/ccsdk-oran/polmansuite/FTC1.sh +++ /dev/null @@ -1,244 +0,0 @@ -#!/bin/bash - -# ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. -# ======================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END================================================= -# - - -TC_ONELINE_DESCR="Sanity test, create service and then create,update and delete a policy using http/https and Agent REST/DMAAP with/without SDNC controller" - -#App names to include in the test, space separated list -INCLUDED_IMAGES="CBS CONSUL CP CR MR PA RICSIM SDNC" - -#Supported test env file (profile) -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN" - -. ../common/testcase_common.sh $@ -. ../common/agent_api_functions.sh -. ../common/ricsimulator_api_functions.sh -. ../common/cr_api_functions.sh - -#### TEST BEGIN #### - - -generate_uuid - -# Tested variants of REST/DMAAP/SDNC config -TESTED_VARIANTS="REST DMAAP" -#Test agent and simulator protocol versions (others are http only) -TESTED_PROTOCOLS="HTTP HTTPS" - -for __httpx in $TESTED_PROTOCOLS ; do - for interface in $TESTED_VARIANTS ; do - - echo "#####################################################################" - echo "#####################################################################" - echo "### Testing agent: $interface using $__httpx" - echo "#####################################################################" - echo "#####################################################################" - - # Clean container and start all needed containers # - clean_containers - - if [ $__httpx == "HTTPS" ]; then - use_cr_https - #echo "Using secure ports between agent and MR" - use_mr_https - #"Using secure ports towards simulators" - use_simulator_https - use_agent_rest_https - else - use_cr_http - #"Using non-secure ports between agent and MR" - use_mr_http - #"Using non-secure ports towards simulators" - use_simulator_http - use_agent_rest_http - fi - - start_ric_simulators ricsim_g1 1 OSC_2.1.0 - start_ric_simulators ricsim_g2 1 STD_1.1.3 - - start_mr - - start_cr - - start_policy_agent - - set_agent_debug - - # Create service to be able to receive events when rics becomes available - # Must use rest towards the agent since dmaap is not configured yet - api_put_service 201 "ric-registration" 0 "$CR_PATH/ric-registration" - - if [ $interface == "REST+SDNC" ] || [ $interface == "DMAAP+SDNC" ]; then - - start_sdnc - - if [ $__httpx == "HTTPS" ]; then - # "Using secure ports towards SDNC" - use_sdnc_https - else - #"Using non-secure ports towards SDNC" - use_sdnc_http - fi - fi - - cr_equal received_callbacks 0 - - start_consul_cbs - - if [ $interface == "REST+SDNC" ] || [ $interface == "DMAAP+SDNC" ]; then - prepare_consul_config SDNC ".consul_config.json" - else - prepare_consul_config NOSDNC ".consul_config.json" - fi - - consul_config_app ".consul_config.json" - - start_control_panel - - if [ $interface == "DMAAP" ] || [ $interface == "DMAAP+SDNC" ]; then - if [ $__httpx == "HTTPS" ]; then - echo "Using secure ports towards dmaap" - use_agent_dmaap_https - else - echo "Using non-secure ports towards dmaap" - use_agent_dmaap_http - fi - else - if [ $__httpx == "HTTPS" ]; then - echo "Using secure ports towards the agent" - use_agent_rest_https - else - echo "Using non-secure ports towards the agent" - use_agent_rest_http - fi - fi - - mr_equal requests_submitted 0 - - sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json - - if [ "$PMS_VERSION" == "V2" ]; then - api_equal json:rics 2 60 - - api_equal json:policy-types 2 120 - - api_equal json:policies 0 - - api_equal json:policy-instances 0 - else - api_equal json:rics 2 60 - - api_equal json:policy_schemas 2 120 - - api_equal json:policy_types 2 - - api_equal json:policies 0 - - api_equal json:policy_ids 0 - fi - - echo "############################################" - echo "############## Health check ################" - echo "############################################" - - api_get_status 200 - - echo "############################################" - echo "##### Service registry and supervision #####" - echo "############################################" - - api_put_service 201 "serv1" 1000 "$CR_PATH/1" - - api_get_service_ids 200 "serv1" "ric-registration" - - api_put_services_keepalive 200 "serv1" - - echo "############################################" - echo "############## RIC Repository ##############" - echo "############################################" - - api_get_rics 200 NOTYPE "ricsim_g1_1:me1_ricsim_g1_1,me2_ricsim_g1_1:1:AVAILABLE ricsim_g2_1:me1_ricsim_g2_1,me2_ricsim_g2_1:EMPTYTYPE:AVAILABLE" - - echo "############################################" - echo "########### A1 Policy Management ###########" - echo "############################################" - - if [ "$PMS_VERSION" == "V2" ]; then - notificationurl=$CR_PATH/2 - else - notificationurl="" - fi - api_put_policy 201 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json - api_put_policy 200 "serv1" ricsim_g1_1 1 5000 NOTRANSIENT $notificationurl testdata/OSC/pi1_template.json - - api_put_policy 201 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json - api_put_policy 200 "serv1" ricsim_g2_1 NOTYPE 5100 NOTRANSIENT $notificationurl testdata/STD/pi1_template.json - - api_delete_policy 204 5000 - - api_delete_policy 204 5100 - - api_equal json:policies 0 - - if [ "$PMS_VERSION" == "V2" ]; then - api_equal json:policy-instances 0 - else - api_equal json:policy_ids 0 - fi - - if [ "$PMS_VERSION" == "V2" ]; then - cr_equal received_callbacks?id=ric-registration 2 - - cr_api_check_all_sync_events 200 ric-registration ricsim_g1_1 ricsim_g2_1 - fi - - if [ $interface == "DMAAP" ] || [ $interface == "DMAAP+SDNC" ]; then - VAL=11 # Number of Agent API calls over DMAAP - mr_equal requests_fetched $VAL - mr_equal responses_submitted $VAL - mr_equal responses_fetched $VAL - mr_equal current_requests 0 - mr_equal current_responses 0 - else - mr_equal requests_submitted 0 - fi - - if [ $interface == "REST+SDNC" ] || [ $interface == "DMAAP+SDNC" ]; then - sim_contains_str ricsim_g1_1 remote_hosts "a1-controller" - sim_contains_str ricsim_g2_1 remote_hosts "a1-controller" - else - sim_contains_str ricsim_g1_1 remote_hosts "policy-agent" - sim_contains_str ricsim_g2_1 remote_hosts "policy-agent" - fi - - check_policy_agent_logs - check_control_panel_logs - - store_logs "${__httpx}__${interface}" - - done - -done - -#### TEST COMPLETE #### - - -print_result - -auto_clean_containers diff --git a/plans/ccsdk-oran/polmansuite/FTC150.sh b/plans/ccsdk-oran/polmansuite/FTC150.sh deleted file mode 100755 index fd30dcbb..00000000 --- a/plans/ccsdk-oran/polmansuite/FTC150.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -# ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. -# ======================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END================================================= -# - - -TC_ONELINE_DESCR="Sample tests of the SDNC A1 controller restconf API using http/https (no agent)" - -#App names to include in the test, space separated list -INCLUDED_IMAGES="RICSIM SDNC" - -#SUPPORTED TEST ENV FILE -SUPPORTED_PROFILES="ONAP-MASTER ONAP-GUILIN" - -. ../common/testcase_common.sh $@ -. ../common/controller_api_functions.sh -. ../common/ricsimulator_api_functions.sh - -#### TEST BEGIN #### - -generate_uuid - -#Test agent and simulator protocol versions (others are http only) -NB_TESTED_PROTOCOLS="HTTP HTTPS" -SB_TESTED_PROTOCOLS="HTTP HTTPS" - -for __nb_httpx in $NB_TESTED_PROTOCOLS ; do - for __sb_httpx in $SB_TESTED_PROTOCOLS ; do - - echo "#####################################################################" - echo "#####################################################################" - echo "### Testing SDNC using Northbound: $__nb_httpx and Southbound: $__sb_httpx" - echo "#####################################################################" - echo "#####################################################################" - - - # Clean container and start all needed containers # - clean_containers - - start_ric_simulators ricsim_g1 1 OSC_2.1.0 - start_ric_simulators ricsim_g2 1 STD_1.1.3 - - start_sdnc - - if [ $__nb_httpx == "HTTPS" ]; then - # "Using secure ports towards SDNC" - use_sdnc_https - else - #"Using non-secure ports towards SDNC" - use_sdnc_http - fi - - if [ $__sb_httpx == "HTTPS" ]; then - # "Using secure ports towards SDNC" - use_simulator_https - else - #"Using non-secure ports towards SDNC" - use_simulator_http - fi - - # API tests - - controller_api_get_A1_policy_type 404 OSC ricsim_g1_1 1 - - sim_put_policy_type 201 ricsim_g1_1 1 testdata/OSC/sim_1.json - - - controller_api_get_A1_policy_ids 200 OSC ricsim_g1_1 1 - controller_api_get_A1_policy_ids 200 STD ricsim_g2_1 - - controller_api_get_A1_policy_type 200 OSC ricsim_g1_1 1 - controller_api_get_A1_policy_type 200 OSC ricsim_g1_1 1 testdata/OSC/sim_1.json - controller_api_get_A1_policy_type 404 OSC ricsim_g1_1 99 - - controller_api_put_A1_policy 200 OSC ricsim_g1_1 1 4000 testdata/OSC/pi1_template.json - controller_api_put_A1_policy 404 OSC ricsim_g1_1 5 1001 testdata/OSC/pi1_template.json - controller_api_put_A1_policy 200 STD ricsim_g2_1 5000 testdata/STD/pi1_template.json - - controller_api_get_A1_policy_ids 200 OSC ricsim_g1_1 1 4000 - controller_api_get_A1_policy_ids 200 STD ricsim_g2_1 5000 - - controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000 - controller_api_get_A1_policy_status 200 STD ricsim_g2_1 5000 - - VAL='NOT IN EFFECT' - controller_api_get_A1_policy_status 200 OSC ricsim_g1_1 1 4000 "$VAL" "false" - controller_api_get_A1_policy_status 200 STD ricsim_g2_1 5000 "UNDEFINED" - - controller_api_delete_A1_policy 200 OSC ricsim_g1_1 1 4000 - controller_api_delete_A1_policy 200 STD ricsim_g2_1 5000 - - store_logs "NB_"$__nb_httpx"_SB_"$__sb_httpx - - done - -done - -#### TEST COMPLETE #### - -print_result - -auto_clean_containers \ No newline at end of file diff --git a/plans/ccsdk-oran/polmansuite/setup.sh b/plans/ccsdk-oran/polmansuite/setup.sh deleted file mode 100755 index b02d9db3..00000000 --- a/plans/ccsdk-oran/polmansuite/setup.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. -# ======================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END================================================= - - -cd $WORKSPACE/archives - -git clone "https://gerrit.o-ran-sc.org/r/nonrtric" - -AUTOTEST_ROOT=$WORKSPACE/archives/nonrtric/test/auto-test -POLMAN_PLANS=$WORKSPACE/plans/ccsdk-oran/polmansuite - -#Copy test script, adapted to ONAP images -cp $POLMAN_PLANS/FTC1.sh $WORKSPACE/archives/nonrtric/test/auto-test/FTC1.sh -cp $POLMAN_PLANS/FTC150.sh $WORKSPACE/archives/nonrtric/test/auto-test/FTC150.sh - -TEST_ENV=$POLMAN_PLANS/test_env-${GERRIT_BRANCH}.sh - -#Make the env vars availble to the robot scripts -ROBOT_VARIABLES="-b debug.log -v AUTOTEST_ROOT:${AUTOTEST_ROOT} -v TEST_ENV:${TEST_ENV}" - diff --git a/plans/ccsdk-oran/polmansuite/teardown.sh b/plans/ccsdk-oran/polmansuite/teardown.sh deleted file mode 100755 index 6b0c5f6b..00000000 --- a/plans/ccsdk-oran/polmansuite/teardown.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. -# ======================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END================================================= - -# All started containers stopped and removed by the test case - - -# Fix ownership. Mounted resources to consul changes ownership which prevents csit test cleanup -cd $WORKSPACE/archives/nonrtric/test/simulator-group/ -sudo chown $(id -u):$(id -g) consul_cbs -sudo chown $(id -u):$(id -g) consul_cbs/consul - diff --git a/plans/ccsdk-oran/polmansuite/test_env-guilin.sh b/plans/ccsdk-oran/polmansuite/test_env-guilin.sh deleted file mode 100644 index 37bde360..00000000 --- a/plans/ccsdk-oran/polmansuite/test_env-guilin.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/bash - -# ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. -# ======================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END================================================= -# - -#Profile for guilin release -TEST_ENV_PROFILE="ONAP-GUILIN" -NEXUS_PROXY_REPO="nexus3.onap.org:10001/" - -# Set up the image and tags for the test. Do not add the image tag to the image names. - -# NOTE: A env var for each container is created by the test script. -# This var will point to the local or remote var depending on how -# the test script is started. The name format is _IMAGE, ie with 'LOCAL' or 'REMOTE'. - -# Tag for guilin branch -# Remote Policy Agent image and tag -POLICY_AGENT_REMOTE_IMAGE="nexus3.onap.org:10003/onap/ccsdk-oran-a1policymanagementservice" -POLICY_AGENT_REMOTE_IMAGE_TAG="1.0.2-SNAPSHOT" - - -# Control Panel remote image and tag -CONTROL_PANEL_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel" -CONTROL_PANEL_REMOTE_IMAGE_TAG="2.0.0" - -# Tag for guilin branch -# SDNC A1 Controller remote image and tag -SDNC_A1_CONTROLLER_REMOTE_IMAGE="nexus3.onap.org:10003/onap/sdnc-image" -SDNC_A1_CONTROLLER_REMOTE_IMAGE_TAG="2.0.3-STAGING-latest" - - -#SDNC DB remote image and tag -SDNC_DB_REMOTE_IMAGE=$NEXUS_PROXY_REPO"mysql/mysql-server" -SDNC_DB_REMOTE_IMAGE_TAG="5.6" -#No local image for DB, remote image always used - - -# Near RT RIC Simulator remote image and tag -RIC_SIM_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator" -RIC_SIM_REMOTE_IMAGE_TAG="2.0.0" - - -#Consul remote image and tag -CONSUL_REMOTE_IMAGE=$NEXUS_PROXY_REPO"consul" -CONSUL_REMOTE_IMAGE_TAG="1.7.2" -#No local image for Consul, remote image always used - - -#CBS remote image and tag -CBS_REMOTE_IMAGE="nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app" -CBS_REMOTE_IMAGE_TAG="2.3.0" -#No local image for CBS, remote image always used - - -#MR stub image and tag -MRSTUB_LOCAL_IMAGE="mrstub" -MRSTUB_LOCAL_IMAGE_TAG="latest" -#No remote image for MR stub, local image always used - -#Callback receiver image and tag -CR_LOCAL_IMAGE="callback-receiver" -CR_LOCAL_IMAGE_TAG="latest" -#No remote image for CR, local image always used - -# Common env var for auto-test. Vars used by docker-compose need to be exported -export DOCKER_SIM_NWNAME="nonrtric-docker-net" # Name of docker private network - -export POLICY_AGENT_EXTERNAL_PORT=8081 # Policy Agent container external port (host -> container) -export POLICY_AGENT_INTERNAL_PORT=8081 # Policy Agent container internal port (container -> container) -export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433 # Policy Agent container external secure port (host -> container) -export POLICY_AGENT_INTERNAL_SECURE_PORT=8433 # Policy Agent container internal secure port (container -> container) - -export POLICY_AGENT_APP_NAME="policy-agent" # Name for Policy Agent container -POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log" # Path the application log in the Policy Agent container -export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container" # Alias name, name used by the control panel - -export MR_EXTERNAL_PORT=3905 # MR stub container external port (host -> container) -export MR_INTERNAL_PORT=3905 # MR stub container internal port (container -> container) -export MR_EXTERNAL_SECURE_PORT=3906 # MR stub container external secure port (host -> container) -export MR_INTERNAL_SECURE_PORT=3906 # MR stub container internal secure port (container -> container) -export MR_APP_NAME="message-router" # Name for the MR -export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR -export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE" # Path write messages to MR - -export CR_EXTERNAL_PORT=8090 # Callback receiver container external port (host -> container) -export CR_INTERNAL_PORT=8090 # Callback receiver container internal port (container -> container) -export CR_EXTERNAL_SECURE_PORT=8091 # Callback receiver container external secure port (host -> container) -export CR_INTERNAL_SECURE_PORT=8091 # Callback receiver container internal secure port (container -> container) -export CR_APP_NAME="callback-receiver" # Name for the Callback receiver -export CR_APP_CALLBACK="/callbacks" # Url for callbacks - -export CONSUL_HOST="consul-server" # Host name of consul -export CONSUL_EXTERNAL_PORT=8500 # Consul container external port (host -> container) -export CONSUL_INTERNAL_PORT=8500 # Consul container internal port (container -> container) -export CONSUL_APP_NAME="polman-consul" # Name for consul container - -export CBS_APP_NAME="polman-cbs" # Name for CBS container -export CBS_EXTERNAL_PORT=10000 # CBS container external port (host -> container) -export CBS_INTERNAL_PORT=10000 # CBS container internal port (container -> container) -export CONFIG_BINDING_SERVICE="config-binding-service" # Host name of CBS - -export RIC_SIM_BASE="g" # Base name of the RIC Simulator container, shall be the group code - # Note, a prefix is added to each container name by the .env file in the 'ric' dir -RIC_SIM_PREFIX="ricsim" # Prefix added to ric container name, added in the .env file in the 'ric' dir - # This prefix can be changed from the command line -export RIC_SIM_INTERNAL_PORT=8085 # RIC Simulator container internal port (container -> container). - # (external ports allocated by docker) -export RIC_SIM_INTERNAL_SECURE_PORT=8185 # RIC Simulator container internal secure port (container -> container). - # (external ports allocated by docker) - -export SDNC_APP_NAME="a1-controller" # Name of the SNDC A1 Controller container -export SDNC_EXTERNAL_PORT=8282 # SNDC A1 Controller container external port (host -> container) -export SDNC_INTERNAL_PORT=8181 # SNDC A1 Controller container internal port (container -> container) -export SDNC_EXTERNAL_SECURE_PORT=8443 # SNDC A1 Controller container external securee port (host -> container) -export SDNC_INTERNAL_SECURE_PORT=8443 # SNDC A1 Controller container internal secure port (container -> container) -export SDNC_DB_APP_NAME="sdnc-db" # Name of the SDNC DB container -export SDNC_A1_TRUSTSTORE_PASSWORD="a1adapter" # SDNC truststore password -SDNC_USER="admin" # SDNC username -SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" # SNDC PWD -SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:" # Base url path for SNDC API -SDNC_ALIVE_URL="/apidoc/explorer/" # Base url path for SNDC API docs (for alive check) -SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log" # Path to karaf log - - -export CONTROL_PANEL_APP_NAME="control-panel" # Name of the Control Panel container -export CONTROL_PANEL_EXTERNAL_PORT=8080 # Control Panel container external port (host -> container) -export CONTROL_PANEL_INTERNAL_PORT=8080 # Control Panel container external port (host -> container) -CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log" # Path the application log in the Control Panel container - -UUID="" # UUID used as prefix to the policy id to simulate a real UUID - # Testscript need to set the UUID to use other this empty prefix is used - -RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT # Base url to the Agent NB REST interface -RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface -DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT # Base url to the Dmaap adapter, http -DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT # Base url to the Dmaap adapter, https -ADAPTER=$RESTBASE # Adapter holds the address the agent R-APP interface (REST OR DMAAP) - # The values of this var is swiched between the two base url when needed - -CR_RESTBASE="http://localhost:"$CR_EXTERNAL_PORT # Base url to the Callback receiver REST interface -CR_RESTBASE_SECURE="https://localhost:"$CR_EXTERNAL_SECURE_PORT # Base url to the secure Callback receiver REST interface -CR_ADAPTER=$CR_RESTBASE # Adapter holds the address the CR admin interface (REST only) - # The values of this var is swiched between the two base url when needed \ No newline at end of file diff --git a/plans/ccsdk-oran/polmansuite/test_env-master.sh b/plans/ccsdk-oran/polmansuite/test_env-master.sh deleted file mode 100644 index 2b41fe8e..00000000 --- a/plans/ccsdk-oran/polmansuite/test_env-master.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/bin/bash - -# ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. -# ======================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END================================================= -# - -#Profile for current master branch -TEST_ENV_PROFILE="ONAP-MASTER" -NEXUS_PROXY_REPO="nexus3.onap.org:10001/" - -# Set up the image and tags for the test. Do not add the image tag to the image names. - -# NOTE: A env var for each container is created by the test script. -# This var will point to the local or remote var depending on how -# the test script is started. The name format is _IMAGE, ie with 'LOCAL' or 'REMOTE'. - - -# Remote Policy Agent image and tag -POLICY_AGENT_REMOTE_IMAGE="nexus3.onap.org:10003/onap/ccsdk-oran-a1policymanagementservice" -POLICY_AGENT_REMOTE_IMAGE_TAG="1.1.0-SNAPSHOT" - - -# Control Panel remote image and tag -CONTROL_PANEL_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel" -CONTROL_PANEL_REMOTE_IMAGE_TAG="2.0.0" - - -# SDNC A1 Controller remote image and tag -SDNC_A1_CONTROLLER_REMOTE_IMAGE="nexus3.onap.org:10003/onap/sdnc-image" -SDNC_A1_CONTROLLER_REMOTE_IMAGE_TAG="2.1.0-STAGING-latest" - - -#SDNC DB remote image and tag -SDNC_DB_REMOTE_IMAGE=$NEXUS_PROXY_REPO"mysql/mysql-server" -SDNC_DB_REMOTE_IMAGE_TAG="5.6" -#No local image for DB, remote image always used - - -# Near RT RIC Simulator remote image and tag -RIC_SIM_REMOTE_IMAGE="nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator" -RIC_SIM_REMOTE_IMAGE_TAG="2.0.0" - - -#Consul remote image and tag -CONSUL_REMOTE_IMAGE=$NEXUS_PROXY_REPO"consul" -CONSUL_REMOTE_IMAGE_TAG="1.7.2" -#No local image for Consul, remote image always used - - -#CBS remote image and tag -CBS_REMOTE_IMAGE="nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app" -CBS_REMOTE_IMAGE_TAG="2.3.0" -#No local image for CBS, remote image always used - - -#MR stub image and tag -MRSTUB_LOCAL_IMAGE="mrstub" -MRSTUB_LOCAL_IMAGE_TAG="latest" -#No remote image for MR stub, local image always used - -#Callback receiver image and tag -CR_LOCAL_IMAGE="callback-receiver" -CR_LOCAL_IMAGE_TAG="latest" -#No remote image for CR, local image always used - -# Common env var for auto-test. Vars used by docker-compose need to be exported -export DOCKER_SIM_NWNAME="nonrtric-docker-net" # Name of docker private network - -export POLICY_AGENT_EXTERNAL_PORT=8081 # Policy Agent container external port (host -> container) -export POLICY_AGENT_INTERNAL_PORT=8081 # Policy Agent container internal port (container -> container) -export POLICY_AGENT_EXTERNAL_SECURE_PORT=8433 # Policy Agent container external secure port (host -> container) -export POLICY_AGENT_INTERNAL_SECURE_PORT=8433 # Policy Agent container internal secure port (container -> container) -export PMS_VERSION="V2" - -export POLICY_AGENT_APP_NAME="policy-agent" # Name for Policy Agent container -POLICY_AGENT_LOGPATH="/var/log/policy-agent/application.log" # Path the application log in the Policy Agent container -export POLICY_AGENT_APP_NAME_ALIAS="policy-agent-container" # Alias name, name used by the control panel - -export MR_EXTERNAL_PORT=3905 # MR stub container external port (host -> container) -export MR_INTERNAL_PORT=3905 # MR stub container internal port (container -> container) -export MR_EXTERNAL_SECURE_PORT=3906 # MR stub container external secure port (host -> container) -export MR_INTERNAL_SECURE_PORT=3906 # MR stub container internal secure port (container -> container) -export MR_APP_NAME="message-router" # Name for the MR -export MR_READ_URL="/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" # Path to read messages from MR -export MR_WRITE_URL="/events/A1-POLICY-AGENT-WRITE" # Path write messages to MR - -export CR_EXTERNAL_PORT=8090 # Callback receiver container external port (host -> container) -export CR_INTERNAL_PORT=8090 # Callback receiver container internal port (container -> container) -export CR_EXTERNAL_SECURE_PORT=8091 # Callback receiver container external secure port (host -> container) -export CR_INTERNAL_SECURE_PORT=8091 # Callback receiver container internal secure port (container -> container) -export CR_APP_NAME="callback-receiver" # Name for the Callback receiver -export CR_APP_CALLBACK="/callbacks" # Url for callbacks - -export CONSUL_HOST="consul-server" # Host name of consul -export CONSUL_EXTERNAL_PORT=8500 # Consul container external port (host -> container) -export CONSUL_INTERNAL_PORT=8500 # Consul container internal port (container -> container) -export CONSUL_APP_NAME="polman-consul" # Name for consul container - -export CBS_APP_NAME="polman-cbs" # Name for CBS container -export CBS_EXTERNAL_PORT=10000 # CBS container external port (host -> container) -export CBS_INTERNAL_PORT=10000 # CBS container internal port (container -> container) -export CONFIG_BINDING_SERVICE="config-binding-service" # Host name of CBS - -export RIC_SIM_BASE="g" # Base name of the RIC Simulator container, shall be the group code - # Note, a prefix is added to each container name by the .env file in the 'ric' dir -RIC_SIM_PREFIX="ricsim" # Prefix added to ric container name, added in the .env file in the 'ric' dir - # This prefix can be changed from the command line -export RIC_SIM_INTERNAL_PORT=8085 # RIC Simulator container internal port (container -> container). - # (external ports allocated by docker) -export RIC_SIM_INTERNAL_SECURE_PORT=8185 # RIC Simulator container internal secure port (container -> container). - # (external ports allocated by docker) - -export SDNC_APP_NAME="a1-controller" # Name of the SNDC A1 Controller container -export SDNC_EXTERNAL_PORT=8282 # SNDC A1 Controller container external port (host -> container) -export SDNC_INTERNAL_PORT=8181 # SNDC A1 Controller container internal port (container -> container) -export SDNC_EXTERNAL_SECURE_PORT=8443 # SNDC A1 Controller container external securee port (host -> container) -export SDNC_INTERNAL_SECURE_PORT=8443 # SNDC A1 Controller container internal secure port (container -> container) -export SDNC_DB_APP_NAME="sdnc-db" # Name of the SDNC DB container -export SDNC_A1_TRUSTSTORE_PASSWORD="a1adapter" # SDNC truststore password -SDNC_USER="admin" # SDNC username -SDNC_PWD="Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" # SNDC PWD -SDNC_API_URL="/restconf/operations/A1-ADAPTER-API:" # Base url path for SNDC API -SDNC_ALIVE_URL="/apidoc/explorer/" # Base url path for SNDC API docs (for alive check) -SDNC_KARAF_LOG="/opt/opendaylight/data/log/karaf.log" # Path to karaf log - - -export CONTROL_PANEL_APP_NAME="control-panel" # Name of the Control Panel container -export CONTROL_PANEL_EXTERNAL_PORT=8080 # Control Panel container external port (host -> container) -export CONTROL_PANEL_INTERNAL_PORT=8080 # Control Panel container external port (host -> container) -CONTROL_PANEL_LOGPATH="/logs/nonrtric-controlpanel.log" # Path the application log in the Control Panel container - -UUID="" # UUID used as prefix to the policy id to simulate a real UUID - # Testscript need to set the UUID to use other this empty prefix is used - -RESTBASE="http://localhost:"$POLICY_AGENT_EXTERNAL_PORT # Base url to the Agent NB REST interface -RESTBASE_SECURE="https://localhost:"$POLICY_AGENT_EXTERNAL_SECURE_PORT # Base url to the secure Agent NB REST interface -DMAAPBASE="http://localhost:"$MR_EXTERNAL_PORT # Base url to the Dmaap adapter, http -DMAAPBASE_SECURE="https://localhost:"$MR_EXTERNAL_SECURE_PORT # Base url to the Dmaap adapter, https -ADAPTER=$RESTBASE # Adapter holds the address the agent R-APP interface (REST OR DMAAP) - # The values of this var is swiched between the two base url when needed - -CR_RESTBASE="http://localhost:"$CR_EXTERNAL_PORT # Base url to the Callback receiver REST interface -CR_RESTBASE_SECURE="https://localhost:"$CR_EXTERNAL_SECURE_PORT # Base url to the secure Callback receiver REST interface -CR_ADAPTER=$CR_RESTBASE # Adapter holds the address the CR admin interface (REST only) - # The values of this var is swiched between the two base url when needed \ No newline at end of file diff --git a/plans/ccsdk-oran/polmansuite/testplan.txt b/plans/ccsdk-oran/polmansuite/testplan.txt deleted file mode 100644 index 29191bd8..00000000 --- a/plans/ccsdk-oran/polmansuite/testplan.txt +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# ============LICENSE_START=============================================== -# Copyright (C) 2020 Nordix Foundation. All rights reserved. -# ======================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END================================================= - - -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -# Temporary change to trigger verify job. -ccsdk-oran/polmansuite - diff --git a/plans/ccsdk/healthcheck/setup.sh b/plans/ccsdk/healthcheck/setup.sh deleted file mode 100644 index 6a3841ec..00000000 --- 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 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 56820786..00000000 --- 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/dcaegen2-collectors-datafile/Functional-suite/setup.sh b/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh index 7736d4a7..e85c0eea 100644 --- a/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh +++ b/plans/dcaegen2-collectors-datafile/Functional-suite/setup.sh @@ -58,6 +58,5 @@ cp -r ../ftpes-sftp-server/tls . cd ../ftpes-sftp-server docker build -t ftpes_vsftpd:latest -f Dockerfile-ftpes . - #All containers will be started and stopped via the robot tests. diff --git a/plans/dcaegen2-collectors-datafile/Functional-suite/testplan.txt b/plans/dcaegen2-collectors-datafile/Functional-suite/testplan.txt index 052ab7c8..25a7d8c2 100755 --- a/plans/dcaegen2-collectors-datafile/Functional-suite/testplan.txt +++ b/plans/dcaegen2-collectors-datafile/Functional-suite/testplan.txt @@ -1,4 +1,6 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite +dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite +dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite +dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addPmMapperSubscriber.json b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/addSubscriber.json similarity index 100% rename from plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addPmMapperSubscriber.json rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/addSubscriber.json diff --git a/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/cbs.json b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/cbs.json new file mode 100644 index 00000000..a29956fb --- /dev/null +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/cbs.json @@ -0,0 +1,7 @@ +{ + "ID": "cbs", + "Name": "config_binding_service", + "Tags": ["cbs"], + "Address": "ipaddress", + "Port": 10000 +} \ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/cert.jks b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/cert.jks similarity index 100% rename from plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/cert.jks rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/cert.jks diff --git a/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config.json b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config.json new file mode 100644 index 00000000..3f1009d4 --- /dev/null +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config.json @@ -0,0 +1,35 @@ +{ + "pm-mapper-filter": { "filters":[]}, + "key_store_path": "/opt/app/pm-mapper/etc/certs/cert.jks", + "key_store_pass_path": "/opt/app/pm-mapper/etc/certs/jks.pass", + "trust_store_path": "/opt/app/pm-mapper/etc/certs/trust.jks", + "trust_store_pass_path": "/opt/app/pm-mapper/etc/certs/trust.pass", + "dmaap_dr_delete_endpoint": "https://dmaap-dr-node:8443/delete", + "dmaap_dr_feed_name": "1", + "aaf_identity": "aaf_admin@people.osaaf.org", + "aaf_password": "demo123456!", + "enable_http": true, + "streams_publishes": { + "dmaap_publisher": { + "type": "message_router", + "dmaap_info": { + "topic_url": "http://message-router:3904/events/org.onap.dmaap.mr.VES_PM", + "client_role": "org.onap.dcae.pmPublisher", + "location": "csit-pmmapper", + "client_id": "1562763644939" + } + } + }, + "streams_subscribes": { + "dmaap_subscriber": { + "type": "data_router", + "dmaap_info": { + "username": "username", + "password": "password", + "location": "csit-pmmapper", + "delivery_url": "http://dcae-pm-mapper:8081/delivery", + "subscriber_id": 1 + } + } + } +} \ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/createFeed.json b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/createFeed.json similarity index 57% rename from plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/createFeed.json rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/createFeed.json index fdcc7eef..f93633dc 100644 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/createFeed.json +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/createFeed.json @@ -1,8 +1,8 @@ { - "name": "DefaultFeed", + "name": "PM Mapper Feed", "version": "m1.0", - "description": "Default feed", - "business_description": "Default Feed", + "description": "PM Mapper Feed", + "business_description": "PM Mapper", "suspend": false, "deleted": false, "changeowner": true, @@ -11,8 +11,8 @@ "endpoint_addrs": [], "endpoint_ids": [ { - "password": "dradmin", - "id": "dradmin" + "password": "pmmapper", + "id": "pmmapper" }] } } \ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/jks.pass b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/jks.pass similarity index 100% rename from plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/jks.pass rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/jks.pass diff --git a/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/mrserver.js b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/mrserver.js new file mode 100644 index 00000000..cc845712 --- /dev/null +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/mrserver.js @@ -0,0 +1,28 @@ +var httpServer = function () { + var http = require('http'), + url = require('url'), + fs = require('fs'), + + start = function (port) { + var server = http.createServer(function (req, res) { + processHttpRequest(res); + }); + server.listen(port, function () { + console.log('Listening on ' + port + '...'); + }); + }, + + processHttpRequest = function (res) { + res.writeHead(200, {'Content-Type': 'text/plain'}); + console.log('received message'); + setTimeout(() => { + res.end('Published Successfully.\n'); + }, 100); + }; + + return { + start: start + } +}(); + +httpServer.start(3904); diff --git a/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/node.properties b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/node.properties similarity index 93% rename from plans/dmaap-datarouter/ssl-dr-suite/docker-compose/node.properties rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/node.properties index 1d7a5d42..7abaf60a 100644 --- a/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/node.properties +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/node.properties @@ -2,7 +2,9 @@ # ============LICENSE_START================================================== # * org.onap.dmaap # * =========================================================================== -# * Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# * Copyright � 2017 AT&T Intellectual Property. All rights reserved. +# * =========================================================================== +# * Modifications Copyright (C) 2021 Nokia Intellectual Property # * =========================================================================== # * Licensed under the Apache License, Version 2.0 (the "License"); # * you may not use this file except in compliance with the License. diff --git a/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/provserver.properties b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/provserver.properties old mode 100755 new mode 100644 similarity index 93% rename from plans/dmaap-datarouter/ssl-dr-suite/docker-compose/provserver.properties rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/provserver.properties index 3930bd09..cd333efb --- a/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/provserver.properties +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/provserver.properties @@ -2,8 +2,9 @@ # ============LICENSE_START================================================== # * org.onap.dmaap # * =========================================================================== -# * Copyright © 2017 AT&T Intellectual Property. All rights reserved. -# * Modifications Copyright (C) 2018 Nokia. All rights reserved. +# * Copyright � 2017 AT&T Intellectual Property. All rights reserved. +# * =========================================================================== +# * Modifications Copyright (C) 2021 Nokia Intellectual Property # * =========================================================================== # * Licensed under the Apache License, Version 2.0 (the "License"); # * you may not use this file except in compliance with the License. @@ -58,4 +59,4 @@ org.onap.dmaap.datarouter.provserver.aaf.feed.type = org.onap.dmaap-dr.fe org.onap.dmaap.datarouter.provserver.aaf.sub.type = org.onap.dmaap-dr.sub org.onap.dmaap.datarouter.provserver.aaf.instance = legacy org.onap.dmaap.datarouter.provserver.aaf.action.publish = publish -org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe \ No newline at end of file +org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.jks b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/trust.jks similarity index 100% rename from plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.jks rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/trust.jks diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.pass b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/trust.pass similarity index 100% rename from plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/trust.pass rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/trust.pass diff --git a/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/docker-compose.yml b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/docker-compose.yml new file mode 100644 index 00000000..66946ea0 --- /dev/null +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/docker-compose.yml @@ -0,0 +1,119 @@ +version: '3.3' + +services: + datarouter-prov: + image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov + container_name: datarouter-prov + hostname: dmaap-dr-prov + ports: + - "443:8443" + - "8443:8443" + - "8080:8080" + volumes: + - /var/tmp/provserver.properties:/opt/app/datartr/etc/provserver.properties + depends_on: + - mariadb + healthcheck: + test: ["CMD", "curl", "-f", "http://dmaap-dr-prov:8080/internal/prov"] + interval: 10s + timeout: 10s + retries: 5 + networks: + pmmapper-network: + ipv4_address: $DR_PROV_IP + extra_hosts: + - "dmaap-dr-node:$DR_NODE_IP" + - "dcae-pm-mapper:$PMMAPPER_IP" + + datarouter-node: + image: nexus3.onap.org:10001/onap/dmaap/datarouter-node + container_name: datarouter-node + hostname: dmaap-dr-node + ports: + - "9443:8443" + - "9090:8080" + volumes: + - /var/tmp/node.properties:/opt/app/datartr/etc/node.properties + depends_on: + - datarouter-prov + networks: + pmmapper-network: + ipv4_address: $DR_NODE_IP + extra_hosts: + - "dmaap-dr-prov:$DR_PROV_IP" + - "dcae-pm-mapper:$PMMAPPER_IP" + + node: + image: nexus3.onap.org:10001/node:10-slim + container_name: mr-simulator + volumes: + - /var/tmp/mrserver.js:/tmp/mrserver.js + command: + nodejs /tmp/mrserver.js + networks: + pmmapper-network: + ipv4_address: $NODE_IP + + mariadb: + image: nexus3.onap.org:10001/mariadb:10.2.14 + container_name: mariadb + ports: + - "3306:3306" + environment: + MYSQL_ROOT_PASSWORD: datarouter + MYSQL_DATABASE: datarouter + MYSQL_USER: datarouter + MYSQL_PASSWORD: datarouter + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "--silent"] + interval: 10s + timeout: 30s + retries: 5 + networks: + pmmapper-network: + ipv4_address: $MARIADB_IP + + consul: + container_name: consul + image: nexus3.onap.org:10001/consul:latest + networks: + pmmapper-network: + ipv4_address: $CONSUL_IP + + cbs: + container_name: cbs + image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app:latest + environment: + CONSUL_HOST: $CONSUL_IP + networks: + pmmapper-network: + ipv4_address: $CBS_IP + + pmmapper: + container_name: pmmapper + image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:latest + ports: + - "8081:8081" + volumes: + - /var/tmp/:/opt/app/pm-mapper/etc/certs/ + depends_on: + - datarouter-prov + environment: + CONFIG_BINDING_SERVICE_SERVICE_HOST: $CBS_IP + CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000 + HOSTNAME: pmmapper + networks: + pmmapper-network: + ipv4_address: $PMMAPPER_IP + extra_hosts: + - "dmaap-dr-node:$DR_NODE_IP" + - "message-router:$NODE_IP" + + +networks: + pmmapper-network: + driver: bridge + ipam: + config: + - subnet: 172.18.0.0/16 + diff --git a/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/setup.sh b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/setup.sh new file mode 100644 index 00000000..f314055e --- /dev/null +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/setup.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Place the scripts in run order: +source ${SCRIPTS}/common_functions.sh + +docker login -u docker -p docker nexus3.onap.org:10001 + +TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-pmmapper/files-processing-config-pmmapper + +export GATEWAY_IP=172.18.0.1 +export DR_NODE_IP=172.18.0.2 +export DR_PROV_IP=172.18.0.3 +export CONSUL_IP=172.18.0.4 +export CBS_IP=172.18.0.5 +export MARIADB_IP=172.18.0.6 +export NODE_IP=172.18.0.7 +export PMMAPPER_IP=172.18.0.8 + +for asset in provserver.properties node.properties cbs.json mrserver.js cert.jks jks.pass trust.jks trust.pass; do + cp $TEST_PLANS_DIR/assets/${asset} /var/tmp/ +done + +sed -i 's/datarouter-mariadb/'$MARIADB_IP'/g' /var/tmp/provserver.properties +sed -i 's/ipaddress//g' /var/tmp/cbs.json + +# ------------------------------------ +#Prepare enviroment for client +#install docker sdk +echo "Uninstall docker-py and reinstall docker." +pip uninstall -y docker-py +pip uninstall -y docker +pip install -U docker==2.7.0 + +docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d mariadb consul cbs node + +echo "Waiting for MariaDB to come up healthy..." +for i in {1..30}; do + mariadb_state=$(docker inspect --format='{{json .State.Health.Status}}' mariadb) + if [ $mariadb_state = '"healthy"' ] + then + break + else + sleep 2 + fi +done +[ "$mariadb_state" != '"healthy"' ] && echo "Error: MariaDB container state not healthy" && exit 1 + +docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d datarouter-node datarouter-prov + +unset http_proxy +unset https_proxy +curl --request PUT --data @/var/tmp/cbs.json http://$CONSUL_IP:8500/v1/agent/service/register +curl 'http://'$CONSUL_IP':8500/v1/kv/pmmapper?dc=dc1' -X PUT \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'X-Requested-With: XMLHttpRequest' \ + --data @$TEST_PLANS_DIR/assets/config.json + +docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d pmmapper +sleep 2 + +# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb, Consul, CBS +containers_ok=false +for i in {1..5}; do + if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' mariadb) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' mr-simulator) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' consul) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' cbs) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' pmmapper) ] + then + echo "All required docker containers are up." + containers_ok=true + break + else + sleep $i + fi +done +[ "$containers_ok" = "false" ] && echo "Error: required container not running." && exit 1 + +# Data Router Configuration. +docker exec -i datarouter-prov sh -c \ + "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$GATEWAY_IP" +docker exec -i datarouter-prov sh -c \ + "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$GATEWAY_IP" + +# Create PM Mapper feed and create PM Mapper subscriber on data router +curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" \ + --data-ascii @$TEST_PLANS_DIR/assets/createFeed.json \ + --post301 --location-trusted -k https://${DR_PROV_IP}:8443 +curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" \ + --data-ascii @$TEST_PLANS_DIR/assets/addSubscriber.json \ + --post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1 + +docker cp pmmapper:/var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log /tmp/pmmapper.log +sleep 10 +docker exec -it datarouter-prov sh -c "curl http://dmaap-dr-node:8080/internal/fetchProv" +curl -k https://$DR_PROV_IP:8443/internal/prov + +#Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v CONSUL_IP:${CONSUL_IP} -v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v CBS_IP:${CBS_IP} -v PMMAPPER_IP:${PMMAPPER_IP} -v DR_NODE_IP:${DR_NODE_IP} -v NODE_IP:${NODE_IP}" diff --git a/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/teardown.sh b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/teardown.sh new file mode 100644 index 00000000..ffa2da60 --- /dev/null +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/teardown.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo "Starting teardown script" +TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-pmmapper/files-processing-config-pmmapper +mkdir -p $WORKSPACE/archives +docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" +kill-instance.sh pmmapper +docker-compose -f $TEST_PLANS_DIR/docker-compose.yml logs > $WORKSPACE/archives/files-processing-config-pmmapper-docker-compose.log +docker-compose -f $TEST_PLANS_DIR/docker-compose.yml down -v diff --git a/plans/dmaap-buscontroller/mock_downstream/testplan.txt b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/testplan.txt similarity index 66% rename from plans/dmaap-buscontroller/mock_downstream/testplan.txt rename to plans/dcaegen2-pmmapper/files-processing-config-pmmapper/testplan.txt index 484fb295..543973d0 100644 --- a/plans/dmaap-buscontroller/mock_downstream/testplan.txt +++ b/plans/dcaegen2-pmmapper/files-processing-config-pmmapper/testplan.txt @@ -1,4 +1,3 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -dmaap-buscontroller/suite1 - +dcaegen2-pmmapper/files-processing-config-pmmapper diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json index 8caf2001..5bb2e6f0 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/cbs_sim/cbs-initializer.json @@ -24,11 +24,14 @@ "^pnf.*", "^vnf.*" ], - "modelInvariantUUIDs": [ + "modelInvariantIDs": [ "7129e420-d396-4efb-af02-6b83499b12f8" ], "modelVersionIDs": [ + ], + "modelNames": [ + ] }, "measurementGroups": [ @@ -86,7 +89,7 @@ "dmaap_info": { "client_id": "1475976809466", "client_role": "org.onap.dcae.pmPublisher", - "topic_url": "https://mr-sim:3095/events/unauthenticated.DCAE_CL_OUTPUT", + "topic_url": "http://dmaap:3904/events/unauthenticated.DCAE_CL_OUTPUT", "location": "san-francisco" }, "type": "message_router" @@ -98,14 +101,14 @@ "dmaap_info": { "client_id": "1575976809466", "client_role": "org.onap.dcae.aaiSub", - "topic_url": "https://mr-sim:3095/events/AAI_EVENT", + "topic_url": "http://dmaap:3904/events/AAI_EVENT", "location": "san-francisco" } }, "policy_pm_subscriber": { "dmaap_info": { "location": "san-francisco", - "topic_url": "https://mr-sim:3095/events/unauthenticated.PMSH_CL_INPUT", + "topic_url": "http://dmaap:3904/events/unauthenticated.PMSH_CL_INPUT", "client_role": "org.onap.dcae.pmSubscriber", "client_id": "1575876809456" }, diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json deleted file mode 100644 index 6c2c4809..00000000 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json +++ /dev/null @@ -1,53 +0,0 @@ -[ - { - "httpRequest": { - "path": "/events/AAI_EVENT/.*", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [] - } - }, - { - "httpRequest": { - "path": "/events/unauthenticated.DCAE_CL_OUTPUT", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [] - } - }, - { - "httpRequest": { - "path": "/events/unauthenticated.PMSH_CL_INPUT/.*", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [] - } - } -] diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties deleted file mode 100644 index 9c592303..00000000 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr_mockserver.properties +++ /dev/null @@ -1,26 +0,0 @@ -####################################### -# MockServer & Proxy Example Settings # -####################################### - -# Socket & Port Settings - -# socket timeout in milliseconds (default 120000) -mockserver.maxSocketTimeout=120000 - -# Certificate Generation - -# delete KeyStore file on JVM shutdown (default true) -mockserver.deleteGeneratedKeyStoreOnExit=true -# certificate domain name (default "localhost") -mockserver.sslCertificateDomainName=localhost -# comma separated list of domain names for Subject Alternative Name domain names (default empty list) -mockserver.sslSubjectAlternativeNameDomains=www.example.com,www.another.com -# comma separated list of ip addresses for Subject Alternative Name ips (default empty list) -mockserver.sslSubjectAlternativeNameIps=127.0.0.1 - -# CORS - -# enable CORS for MockServer REST API -mockserver.enableCORSForAPI=true -# enable CORS for all responses -mockserver.enableCORSForAllResponses=true diff --git a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml index 6df60f1e..6541ddbf 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml +++ b/plans/dcaegen2-services-pmsh/testsuite/docker-compose.yml @@ -9,7 +9,9 @@ services: POSTGRES_PASSWORD: $DB_PASSWORD POSTGRES_USER: $DB_USER networks: - pmsh-network: + dockercompose_net: + aliases: + - db aai: container_name: aai-sim @@ -24,7 +26,9 @@ services: - ./assets/ssl_certs/mock_server_cacert.pem:/var/tmp/mock_server_cacert.pem - ./assets/ssl_certs/mock_server_key.pem:/var/tmp/mock_server_key.pem networks: - pmsh-network: + dockercompose_net: + aliases: + - aai-sim cbs-sim: container_name: cbs-sim @@ -40,21 +44,9 @@ services: - ./assets/ssl_certs/mock_server_cacert.pem:/var/tmp/mock_server_cacert.pem - ./assets/ssl_certs/mock_server_key.pem:/var/tmp/mock_server_key.pem networks: - pmsh-network: - - mr-sim: - container_name: mr-sim - image: mockserver/mockserver:mockserver-5.9.0 - environment: - MOCKSERVER_PROPERTY_FILE: /config/mockserver.properties - MOCKSERVER_INITIALIZATION_JSON_PATH: /config/mr-initializer.json - LOG_LEVEL: "DEBUG" - SERVER_PORT: 3095 - volumes: - - ./assets/mr_sim/mr_mockserver.properties:/config/mockserver.properties - - ./assets/mr_sim/mr-initializer.json:/config/mr-initializer.json - networks: - pmsh-network: + dockercompose_net: + aliases: + - cbs-sim pmsh: container_name: pmsh @@ -74,8 +66,11 @@ services: AAI_SERVICE_PORT: 1080 DCAE_CA_CERTPATH: '/opt/app/pmsh/etc/certs/cacert.pem' networks: - pmsh-network: + dockercompose_net: + aliases: + - pmsh networks: - pmsh-network: - driver: bridge + dockercompose_net: + external: true + diff --git a/plans/dcaegen2-services-pmsh/testsuite/setup.sh b/plans/dcaegen2-services-pmsh/testsuite/setup.sh index 4b939fd0..d7b988e4 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/setup.sh +++ b/plans/dcaegen2-services-pmsh/testsuite/setup.sh @@ -1,12 +1,16 @@ #!/bin/bash # Place the scripts in run order: +source ${WORKSPACE}/scripts/dmaap-message-router/dmaap-mr-launch.sh +dmaap_mr_launch +DMAAP_MR_IP=${IP} + export DB_USER=pmsh export DB_PASSWORD=pmsh TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-pmsh/testsuite -docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d db aai cbs-sim mr-sim +docker-compose -f ${TEST_PLANS_DIR}/docker-compose.yml up -d db aai cbs-sim # Slow machine running CSITs can affect db coming up in time for PMSH echo "Waiting for postgres db to come up..." @@ -82,7 +86,6 @@ for i in {0..5}; do fi if [[ $(docker inspect --format '{{ .State.Running }}' cbs-sim) ]] && \ [[ $(docker inspect --format '{{ .State.Running }}' aai-sim) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' mr-sim) ]] && \ [[ $(docker inspect --format '{{ .State.Running }}' db) ]] && \ [[ $(docker inspect --format '{{ .State.Running }}' pmsh) ]] then @@ -91,9 +94,14 @@ for i in {0..5}; do done [[ "$containers_ok" == "false" ]] && echo "Error: required container not running." && exit 1 +# Create topics on MR +curl -X POST http://${DMAAP_MR_IP}:3904/events/AAI_EVENT --header 'Content-Type: application/json' --data-raw '{"message": "dummy message"}' +sleep 2 +curl -X POST http://${DMAAP_MR_IP}:3904/events/unauthenticated.PMSH_CL_INPUT --header 'Content-Type: application/json' --data-raw '{"message": "dummy message"}' + + DB_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" db) -MR_SIM_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" mr-sim) CBS_SIM_IP_ADDRESS=$(docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" cbs-sim) #Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v PMSH_IP:${PMSH_IP} -v MR_SIM_IP_ADDRESS:${MR_SIM_IP_ADDRESS} -v DB_IP_ADDRESS:${DB_IP_ADDRESS} -v CBS_SIM_IP_ADDRESS:${CBS_SIM_IP_ADDRESS}" +ROBOT_VARIABLES="-v PMSH_IP:${PMSH_IP} -v MR_IP_ADDRESS:${DMAAP_MR_IP} -v DB_IP_ADDRESS:${DB_IP_ADDRESS} -v CBS_SIM_IP_ADDRESS:${CBS_SIM_IP_ADDRESS}" diff --git a/plans/dcaegen2-services-pmsh/testsuite/teardown.sh b/plans/dcaegen2-services-pmsh/testsuite/teardown.sh index a01dfda0..75e624e5 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/teardown.sh +++ b/plans/dcaegen2-services-pmsh/testsuite/teardown.sh @@ -1,5 +1,7 @@ #!/bin/bash echo "Starting teardown script" +source ${WORKSPACE}/scripts/dmaap-message-router/dmaap-mr-teardown.sh +dmaap_mr_teardown TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-pmsh/testsuite mkdir -p $WORKSPACE/archives docker exec pmsh /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pmsh/*" diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/dmaap/MsgRtrApi.properties b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/dmaap/MsgRtrApi.properties new file mode 100644 index 00000000..61f3f033 --- /dev/null +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/dmaap/MsgRtrApi.properties @@ -0,0 +1,171 @@ +# LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2020 Wipro Limited. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +############################################################################### +############################################################################### +## +## Cambria API Server config +## +## - Default values are shown as commented settings. +## + +############################################################################### +## +## HTTP service +## +## - 3904 is standard as of 7/29/14. +# +## Zookeeper Connection +## +## Both Cambria and Kafka make use of Zookeeper. +## +#config.zk.servers=172.18.1.1 +config.zk.servers=zookeeper:2181 +#config.zk.root=/fe3c/cambria/config + + +############################################################################### +## +## Kafka Connection +## +## Items below are passed through to Kafka's producer and consumer +## configurations (after removing "kafka.") +## if you want to change request.required.acks it can take this one value +#kafka.metadata.broker.list=localhost:9092,localhost:9093 +kafka.metadata.broker.list=kafka:9092 +##kafka.request.required.acks=-1 +#kafka.client.zookeeper=${config.zk.servers} +consumer.timeout.ms=100 +zookeeper.connection.timeout.ms=6000 +zookeeper.session.timeout.ms=20000 +zookeeper.sync.time.ms=2000 +auto.commit.interval.ms=1000 +fetch.message.max.bytes =1000000 +auto.commit.enable=false + +#(backoff*retries > zksessiontimeout) +kafka.rebalance.backoff.ms=10000 +kafka.rebalance.max.retries=6 + + +############################################################################### +## +## Secured Config +## +## Some data stored in the config system is sensitive -- API keys and secrets, +## for example. to protect it, we use an encryption layer for this section +## of the config. +## +## The key is a base64 encode AES key. This must be created/configured for +## each installation. +#cambria.secureConfig.key= +## +## The initialization vector is a 16 byte value specific to the secured store. +## This must be created/configured for each installation. +#cambria.secureConfig.iv= + +## Southfield Sandbox +cambria.secureConfig.key=b/7ouTn9FfEw2PQwL0ov/Q== +cambria.secureConfig.iv=wR9xP5k5vbz/xD0LmtqQLw== +authentication.adminSecret=fe3cCompound +#cambria.secureConfig.key[pc569h]=YT3XPyxEmKCTLI2NK+Sjbw== +#cambria.secureConfig.iv[pc569h]=rMm2jhR3yVnU+u2V9Ugu3Q== + + +############################################################################### +## +## Consumer Caching +## +## Kafka expects live connections from the consumer to the broker, which +## obviously doesn't work over connectionless HTTP requests. The Cambria +## server proxies HTTP requests into Kafka consumer sessions that are kept +## around for later re-use. Not doing so is costly for setup per request, +## which would substantially impact a high volume consumer's performance. +## +## This complicates Cambria server failover, because we often need server +## A to close its connection before server B brings up the replacement. +## + +## The consumer cache is normally enabled. +#cambria.consumer.cache.enabled=true + +## Cached consumers are cleaned up after a period of disuse. The server inspects +## consumers every sweepFreqSeconds and will clean up any connections that are +## dormant for touchFreqMs. +#cambria.consumer.cache.sweepFreqSeconds=15 +cambria.consumer.cache.touchFreqMs=120000 +##stickforallconsumerrequests=false +## The cache is managed through ZK. The default value for the ZK connection +## string is the same as config.zk.servers. +#cambria.consumer.cache.zkConnect=${config.zk.servers} + +## +## Shared cache information is associated with this node's name. The default +## name is the hostname plus the HTTP service port this host runs on. (The +## hostname is determined via InetAddress.getLocalHost ().getCanonicalHostName(), +## which is not always adequate.) You can set this value explicitly here. +## +#cambria.api.node.identifier= + +#cambria.rateLimit.maxEmptyPollsPerMinute=30 +#cambria.rateLimitActual.delay.ms=10 + +############################################################################### +## +## Metrics Reporting +## +## This server can report its metrics periodically on a topic. +## +#metrics.send.cambria.enabled=true +#metrics.send.cambria.topic=cambria.apinode.metrics #msgrtr.apinode.metrics.dmaap +#metrics.send.cambria.sendEverySeconds=60 + +cambria.consumer.cache.zkBasePath=/fe3c/cambria/consumerCache +consumer.timeout=17 +default.partitions=3 +default.replicas=3 +############################################################################## +#100mb +maxcontentlength=10000 + + +############################################################################## +#AAF Properties +msgRtr.namespace.aaf=org.onap.dmaap.mr.topic +msgRtr.topicfactory.aaf=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic: +enforced.topic.name.AAF=org.onap +forceAAF=false +transidUEBtopicreqd=false +defaultNSforUEB=org.onap.dmaap.mr +############################################################################## +#Mirror Maker Agent +msgRtr.mirrormakeradmin.aaf=com.onap.dmaap.mr.dev.mirrormaker|*|admin +msgRtr.mirrormakeruser.aaf=com.onap.dmaap.mr.dev.mirrormaker|*|user +msgRtr.mirrormakeruser.aaf.create=com.onap.dmaap.mr.dev.topicFactory|:com.onap.dmaap.mr.dev.topic: +msgRtr.mirrormaker.timeout=15000 +msgRtr.mirrormaker.topic=com.onap.dmaap.mr.prod.mm.agent +msgRtr.mirrormaker.consumergroup=mmagentserver +msgRtr.mirrormaker.consumerid=1 + +kafka.max.poll.interval.ms=300000 +kafka.heartbeat.interval.ms=60000 +kafka.session.timeout.ms=240000 +kafka.max.poll.records=1000 + diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/config_all.json b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/config_all.json new file mode 100644 index 00000000..b084b57d --- /dev/null +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/config_all.json @@ -0,0 +1,86 @@ +{ + "config": { + "streams_subscribes": { + "performance_management_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.PERFORMANCE_MEASUREMENTS", + "client_role": "sliceanalysis-subscriber", + "location": "onap", + "client_id": "sdnr-sliceanalysis-1" + }, + "aaf_username": null + }, + "dcae_cl_response_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "http://message-router.onap.svc.cluster.local:3904/events/DCAE_CL_RSP", + "client_role": "sliceanalysis-subscriber", + "location": "onap", + "client_id": "sdnr-sliceanalysis-1" + }, + "aaf_username": null + }, + "intelligent_slicing_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "http://message-router.onap.svc.cluster.local::3904/events/unauthenticated.ML_RESPONSE_TOPIC", + "client_role": "sliceanalysis-subscriber", + "location": "onap", + "client_id": "sdnr-sliceanalysis-1" + }, + "aaf_username": null + } + }, + "streams_publishes": { + "CL_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "http://message-router.onap.svc.cluster.local::3904/events/unauthenticated.DCAE_CL_OUTPUT", + "client_role": "sliceanalysis-subscriber", + "location": "onap", + "client_id": "sdnr-sliceanalysis-1" + }, + "aaf_username": null + } + }, + "postgres.password": "postgres", + "postgres.username": "sliceanalysisms_admin", + "postgres.host": "postgres", + "postgres.port": "5432", + "sliceanalysisms.dmaap.server": [ + "dmaap" + ], + "cbsPollingInterval": 60, + "sliceanalysisms.cg": "sliceanalysisms-cg", + "sliceanalysisms.pollingInterval": 20, + "sliceanalysisms.samples": 3, + "sliceanalysisms.minPercentageChange": 5, + "sliceanalysisms.initialDelaySeconds": 300000, + "sliceanalysisms.pollingTimeout": 60, + "sliceanalysisms.cid": "sliceanalysisms-cid", + "sliceanalysisms.configDb.service": "http://configdb_sim:5000", + "service_calls": { + "policy-req": [] + }, + "trust_store_path": "/opt/app/sliceanalysisms/etc/cert/trust.jks", + "trust_store_pass_path": "/opt/app/sliceanalysisms/etc/cert/trust.pass" + }, + "policies": { + "event": { + "action": "gathered", + "timestamp": "2019-09-18T14:57:55.320Z", + "update_id": "dbb88da8-8df1-489d-b51d-8d5cbbfbcd99", + "policies_count": 1 + }, + "items": [ + { + "policyName": "com.Config_PCIMS_CONFIG_POLICY.1.xml" + } + ] + } +} diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/trust.jks b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/trust.jks new file mode 100644 index 00000000..33d9c569 Binary files /dev/null and b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/trust.jks differ diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/trust.pass b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/trust.pass new file mode 100644 index 00000000..86edc20c --- /dev/null +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/trust.pass @@ -0,0 +1 @@ +YPHcOFZP}sptD;*RV8N!46rG \ No newline at end of file diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/docker-compose.yaml b/plans/dcaegen2-services-slice-analysis-ms/testsuites/docker-compose.yaml new file mode 100644 index 00000000..cac148c3 --- /dev/null +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/docker-compose.yaml @@ -0,0 +1,97 @@ +# ============LICENSE_START======================================================= +# slice-analysis-ms +# ================================================================================ +# Copyright (C) 2020 Wipro Limited. +# ============================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= + +version: '3.3' +networks: + slice-analysis-ms-default: + driver: bridge + driver_opts: + com.docker.network.driver.mtu: 1400 +services: + zookeeper: + image: wurstmeister/zookeeper + container_name: zookeeper + ports: + - "2181:2181" + networks: + - slice-analysis-ms-default + kafka: + image: wurstmeister/kafka + container_name: kafka + ports: + - "9092:9092" + environment: + KAFKA_ADVERTISED_HOST_NAME: "kafka" + KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' + KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" + KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + depends_on: + - zookeeper + networks: + - slice-analysis-ms-default + dmaap: + image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.1.8 + container_name: dmaap + ports: + - "3904:3904" + - "3905:3905" + volumes: + - ./config/dmaap/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties + depends_on: + - zookeeper + - kafka + networks: + - slice-analysis-ms-default + postgres: + image: 'postgres:12-alpine' + container_name: slice-analysis-ms-postgres + hostname: postgres + environment: + - POSTGRES_USER=sliceanalysisms_admin + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=sliceanalysisms + ports: + - 5432 + healthcheck: + test: ["CMD", "nc", "-z", "localhost", "5432"] + interval: 30s + timeout: 10s + retries: 5 + networks: + - slice-analysis-ms-default + sliceanalysisms: + image: "nexus3.onap.org:10003/onap/org.onap.dcaegen2.services.components.slice-analysis-ms:latest" + container_name: sliceanalysisms + hostname: sliceanalysisms + environment: + - STANDALONE=true + - CONFIG_FILE=/etc/config_all.json + ports: + - "8080:8080" + volumes: + - ./config/sliceanalysisms/config_all.json:/etc/config_all.json + - ./config/sliceanalysisms/trust12.jks:/opt/app/sliceanalysisms/etc/cert/trust.jks + - ./config/sliceanalysisms/trust.pass:/opt/app/sliceanalysisms/etc/cert/trust.pass + # - ./config/sliceanalysisms/trust.jks:/opt/app/sliceanalysisms/etc/cert/trustjss.jks + depends_on: + - postgres + networks: + - slice-analysis-ms-default + diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/setup.sh b/plans/dcaegen2-services-slice-analysis-ms/testsuites/setup.sh new file mode 100644 index 00000000..1c52d718 --- /dev/null +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/setup.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +docker login -u docker -p docker nexus3.onap.org:10001 + +TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-slice-analysis-ms/testsuites +TEST_SCRIPTS_DIR=$WORKSPACE/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms +TEST_ROBOT_DIR=$WORKSPACE/tests/dcaegen2-services-slice-analysis-ms/testcases + +docker-compose up -d + +ZOOKEEPER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' zookeeper) +KAFKA_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kafka) +DMAAP_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap) +SLICE_ANALYSIS_MS_POSTGRES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' slice-analysis-ms-postgres) +SLICE_ANALYSIS_MS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sliceanalysisms) + +echo "Waiting for dmaap to come up ..." +for i in {1..10}; do + dmaap_state=$(curl --write-out '%{http_code}' --silent --output /dev/null $DMAAP_IP:3904/topics) + if [ $dmaap_state == "200" ] + then + break + else + sleep 60 + fi +done + +#create topics in dmaap +curl --header "Content-type: application/json" \ +--request POST \ +--data '{"topicName": "org.onap.dmaap.mr.PERFORMANCE_MEASUREMENTS"}' \ +http://$DMAAP_IP:3904/events/unauthenticated.PERFORMANCE_MEASUREMENTS + +curl --header "Content-type: application/json" \ +--request POST \ +--data '{"topicName": "DCAE_CL_RSP"}' \ +http://$DMAAP_IP:3904/events/DCAE_CL_RSP + +curl --header "Content-type: application/json" \ +--request POST \ +--data '{"topicName": "unauthenticated.ML_RESPONSE_TOPIC"}' \ +http://$DMAAP_IP:3904/events/unauthenticated.ML_RESPONSE_TOPIC + +curl --header "Content-type: application/json" \ +--request POST \ +--data '{"topicName": "unauthenticated.DCAE_CL_OUTPUT"}' \ +http://$DMAAP_IP:3904/events/unauthenticated.DCAE_CL_OUTPUT + +#build configdb-sim image +cd $TEST_SCRIPTS_DIR +docker build -t configdb_sim . + +#run configdb-sim +docker run -d --name configdb_sim --network=testsuites_slice-analysis-ms-default -p "5000:5000" configdb_sim:latest; +sleep 10 +CONFIGDB_SIM_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' configdb_sim) +echo "CONFIGDB_SIM_IP=${CONFIGDB_SIM_IP}" + + +ROBOT_VARIABLES="-v ZOOKEEPER_IP:${ZOOKEEPER_IP} -v KAFKA_IP:${KAFKA_IP} -v DMAAP_IP:${DMAAP_IP} -v SLICE_ANALYSIS_MS_POSTGRES_IP:${SLICE_ANALYSIS_MS_POSTGRES_IP} -v SLICE_ANALYSIS_MS_IP:${SLICE_ANALYSIS_MS_IP} -v CONFIGDB_SIM_IP:${CONFIGDB_SIM_IP} -v TEST_ROBOT_DIR:${TEST_ROBOT_DIR}" diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/teardown.sh b/plans/dcaegen2-services-slice-analysis-ms/testsuites/teardown.sh new file mode 100644 index 00000000..516bf8cb --- /dev/null +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/teardown.sh @@ -0,0 +1,9 @@ +#!/bin/bash +echo "Starting teardown script" +TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-slice-analysis-ms/testsuites +mkdir -p $WORKSPACE/archives + +docker container stop configdb_sim +docker container rm configdb_sim +docker-compose -f $TEST_PLANS_DIR/docker-compose.yaml logs > $WORKSPACE/archives/sonhandler-docker-compose.log +docker-compose -f $TEST_PLANS_DIR/docker-compose.yaml down -v diff --git a/plans/music/music-distributed-kv-store-test-plan/testplan.txt b/plans/dcaegen2-services-slice-analysis-ms/testsuites/testplan.txt similarity index 69% rename from plans/music/music-distributed-kv-store-test-plan/testplan.txt rename to plans/dcaegen2-services-slice-analysis-ms/testsuites/testplan.txt index 654f0785..a8b2bdab 100644 --- a/plans/music/music-distributed-kv-store-test-plan/testplan.txt +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/testplan.txt @@ -1,3 +1,3 @@ # 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 +dcaegen2-services-slice-analysis-ms/testcases diff --git a/plans/dmaap-buscontroller/mock_downstream/setup.sh b/plans/dmaap-buscontroller/mock_downstream/setup.sh deleted file mode 100755 index 9f5dbbc6..00000000 --- a/plans/dmaap-buscontroller/mock_downstream/setup.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# - - -# Place the scripts in run order: -source ${WORKSPACE}/scripts/dmaap-buscontroller/start-mock.sh -start_mock "aaf" -AAF_IP=${IP} -start_mock "mrc" 3904 -MRC_IP=${IP} -start_mock "drps" -DRPS_IP=${IP} - -source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh -dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP -DMAAPBC_IP=${IP} - - -echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" - -set -x -${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} -set +x diff --git a/plans/dmaap-buscontroller/mock_downstream/teardown.sh b/plans/dmaap-buscontroller/mock_downstream/teardown.sh deleted file mode 100644 index 1b041a42..00000000 --- a/plans/dmaap-buscontroller/mock_downstream/teardown.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# -kill-instance.sh aaf-mock -kill-instance.sh drps-mock -kill-instance.sh mrc-mock -kill-instance.sh dmaapbc - diff --git a/plans/dmaap-buscontroller/ssl/setup.sh b/plans/dmaap-buscontroller/ssl/setup.sh deleted file mode 100755 index 6ab50ed1..00000000 --- a/plans/dmaap-buscontroller/ssl/setup.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# - - -# Place the scripts in run order: -source ${WORKSPACE}/scripts/dmaap-buscontroller/start-mock.sh -start_mock "aaf" -AAF_IP=${IP} -start_mock "mrc" 3905 -MRC_IP=${IP} -start_mock "drps" 8443 -DRPS_IP=${IP} - -source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh -dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP -DMAAPBC_IP=${IP} - - -echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" - -# Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" - -set -x -${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} https -set +x diff --git a/plans/dmaap-buscontroller/ssl/teardown.sh b/plans/dmaap-buscontroller/ssl/teardown.sh deleted file mode 100644 index 1b041a42..00000000 --- a/plans/dmaap-buscontroller/ssl/teardown.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# org.onap.dmaap -# ================================================================================ -# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -# -# -kill-instance.sh aaf-mock -kill-instance.sh drps-mock -kill-instance.sh mrc-mock -kill-instance.sh dmaapbc - diff --git a/plans/dmaap-buscontroller/with_dr/setup.sh b/plans/dmaap-buscontroller/with_dr/setup.sh index d9d8574f..822f6a7e 100755 --- a/plans/dmaap-buscontroller/with_dr/setup.sh +++ b/plans/dmaap-buscontroller/with_dr/setup.sh @@ -19,39 +19,27 @@ # ============LICENSE_END========================================================= # # - source ${SCRIPTS}/common_functions.sh +COMPOSE_PREFIX=${COMPOSE_PROJECT_NAME:-dockercompose} +export COMPOSE_PROJECT_NAME=$COMPOSE_PREFIX +echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME" +echo "COMPOSE_PREFIX=$COMPOSE_PREFIX" -if [ "$USE_EXISTING_DMAAP" = "Y" ] -then - ROBOT_VARIABLES="-v AAF_IP:0.0.0 -v MRC_IP:0.0.0.0 -v DRPS_IP:172.17.0.3 -v DMAAPBC_IP:172.17.0.4" -else - - # Place the scripts in run order: - source ${WORKSPACE}/scripts/dmaap-buscontroller/dr-launch.sh - dmaap_dr_launch - DRPS_IP=${IP} - - #source ${WORKSPACE}/scripts/dmaap-buscontroller/start-mock.sh - #start_mock "aaf" - #AAF_IP=${IP} - AAF_IP=0.0.0.0 - #start_mock "drps" - #DRPS_IP=${IP} - MRC_IP=0.0.0.0 - - source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh - dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP - DMAAPBC_IP=${IP} +source ${WORKSPACE}/scripts/dmaap-datarouter/datarouter-launch.sh +# Launch DR. If true is passed, 2 subscriber containers are also deployed, else false. +dmaap_dr_launch false +DRPS_IP=${DR_PROV_IP} +source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh +dmaapbc_launch ${DRPS_IP} +DMAAPBC_IP=${DMAAP_BC_IP} - echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" +echo "DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" - # Pass any variables required by Robot test suites in ROBOT_VARIABLES - ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" - set -x - ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} https - set +x -fi +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" +set -x +${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} +set +x diff --git a/plans/dmaap-buscontroller/with_dr/teardown.sh b/plans/dmaap-buscontroller/with_dr/teardown.sh index c7a2d6d8..5e801423 100755 --- a/plans/dmaap-buscontroller/with_dr/teardown.sh +++ b/plans/dmaap-buscontroller/with_dr/teardown.sh @@ -18,9 +18,17 @@ # limitations under the License. # ============LICENSE_END========================================================= -if [ "$KEEP_DMAAP" != "Y" ] -then -kill-instance.sh dmaapbc -cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources -docker-compose down -v -fi +#kill-instance.sh dmaapbc +cd ${WORKSPACE}/archives/dmaap/dr +rm -rf last_run_logs/* +docker cp datarouter-prov:/opt/app/datartr/logs last_run_logs/prov_logs +docker cp datarouter-node:/opt/app/datartr/logs last_run_logs/node_event_logs +docker cp datarouter-node:/var/log/onap/datarouter last_run_logs/node_server_logs +docker cp subscriber-node:/var/log/onap/datarouter last_run_logs/sub1_logs +docker cp subscriber-node2:/var/log/onap/datarouter last_run_logs/sub2_logs +docker cp dmaap-bc:/opt/app/dmaapbc/logs/ONAP last_run_logs/bc_logs + +sudo sed -i".bak" '/dmaap-dr-prov/d' /etc/hosts +sudo sed -i".bak" '/dmaap-dr-node/d' /etc/hosts +docker-compose -f ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose/docker-compose.yml rm -sf +docker-compose -f ${WORKSPACE}/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml rm -sf diff --git a/plans/dmaap-buscontroller/with_mr/setup.sh b/plans/dmaap-buscontroller/with_mr/setup.sh index 01636867..74bfb0c5 100755 --- a/plans/dmaap-buscontroller/with_mr/setup.sh +++ b/plans/dmaap-buscontroller/with_mr/setup.sh @@ -19,36 +19,21 @@ # ============LICENSE_END========================================================= # # +# Place the scripts in run order: +source ${WORKSPACE}/scripts/dmaap-message-router/dmaap-mr-launch.sh +dmaap_mr_launch +MRC_IP=${IP} -if [ "$USE_EXISTING_DMAAP" = "Y" ] -then - ROBOT_VARIABLES="-v AAF_IP:0.0.0 -v MRC_IP:172.18.0.3 -v DRPS_IP:0.0.0.0 -v DMAAPBC_IP:172.17.0.4" -else +mkdir -p ${WORKSPACE}/archives/dmaapmr/last_run_logs - # Place the scripts in run order: - source ${WORKSPACE}/scripts/dmaap-message-router/dmaap-mr-launch.sh - dmaap_mr_launch - MRC_IP=${IP} +source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh +dmaapbc_launch $MRC_IP +DMAAP_BC_IP=${DMAAP_BC_IP} - source ${WORKSPACE}/scripts/dmaap-buscontroller/start-mock.sh - start_mock "aaf" - AAF_IP=${IP} - #AAF_IP=0.0.0.0 - #start_mock "drps" - #DRPS_IP=${IP} - DRPS_IP=0.0.0.0 - - source ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-launch.sh - dmaapbc_launch $AAF_IP $MRC_IP $DRPS_IP - DMAAPBC_IP=${IP} - - - echo "AAF_IP=$AAF_IP MRC_IP=$MRC_IP DRPS_IP=$DRPS_IP DMAAPBC_IP=$DMAAPBC_IP" - - # Pass any variables required by Robot test suites in ROBOT_VARIABLES - ROBOT_VARIABLES="-v AAF_IP:${AAF_IP} -v MRC_IP:${MRC_IP} -v DRPS_IP:${DRPS_IP} -v DMAAPBC_IP:${DMAAPBC_IP}" - set -x - ${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAPBC_IP} ${DRPS_IP} ${MRC_IP} - set +x -fi +echo "DMAAP_BC_IP=$DMAAP_BC_IP" +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES=" -v DMAAP_BC_IP:${DMAAP_BC_IP}" +set -x +${WORKSPACE}/scripts/dmaap-buscontroller/dmaapbc-init.sh ${DMAAP_BC_IP} +set +x diff --git a/plans/dmaap-buscontroller/with_mr/teardown.sh b/plans/dmaap-buscontroller/with_mr/teardown.sh index ae064814..5149743a 100644 --- a/plans/dmaap-buscontroller/with_mr/teardown.sh +++ b/plans/dmaap-buscontroller/with_mr/teardown.sh @@ -19,12 +19,12 @@ # ============LICENSE_END========================================================= # # +cd ${WORKSPACE}/archives/dmaapmr source ${WORKSPACE}/scripts/dmaap-message-router/dmaap-mr-teardown.sh - -if [ "$KEEP_DMAAP" != "Y" ] -then dmaap_mr_teardown -kill-instance.sh dmaapbc -kill-instance.sh aaf-mock -fi +rm -rf last_run_logs/* +docker cp dmaap-bc:/opt/app/dmaapbc/logs/ONAP last_run_logs/bc_logs +docker-compose -f ${WORKSPACE}/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml rm -sf + + diff --git a/plans/dmaap-buscontroller/with_mr/testplan.txt b/plans/dmaap-buscontroller/with_mr/testplan.txt index 0728bd44..a8fe876a 100644 --- a/plans/dmaap-buscontroller/with_mr/testplan.txt +++ b/plans/dmaap-buscontroller/with_mr/testplan.txt @@ -1,3 +1,3 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -dmaap-buscontroller/single-mr-suite +dmaap-buscontroller/with_mr diff --git a/plans/dmaap-datarouter/ssl-dr-suite/setup.sh b/plans/dmaap-datarouter/ssl-dr-suite/setup.sh index e1f2cb46..53b4387c 100755 --- a/plans/dmaap-datarouter/ssl-dr-suite/setup.sh +++ b/plans/dmaap-datarouter/ssl-dr-suite/setup.sh @@ -1,8 +1,7 @@ #!/bin/bash -# -# ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. -# ================================================================================ +# ============LICENSE_START=================================================== +# Copyright (C) 2019-2021 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 @@ -16,83 +15,11 @@ # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END========================================================= -# - - -source ${SCRIPTS}/common_functions.sh - -# Clone DMaaP Data Router repo -mkdir -p $WORKSPACE/archives/dmaapdr -cd $WORKSPACE/archives/dmaapdr - -git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master -cd datarouter -git pull -cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources -cp $WORKSPACE/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/docker-compose.yml . -cp $WORKSPACE/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/provserver.properties ./prov_data/provserver.properties -cp $WORKSPACE/plans/dmaap-datarouter/ssl-dr-suite/docker-compose/node.properties ./node_data/node.properties - -# start DMaaP DR containers with docker compose and configuration from docker-compose.yml -docker login -u docker -p docker nexus3.onap.org:10001 -docker-compose up -d - -# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb -for i in {1..10}; do - if [ $(docker inspect --format '{{ .State.Running }}' subscriber-node2) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' subscriber-node) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' mariadb) ] - then - echo "DR Service Running" - break - else - echo sleep $i - sleep $i - fi -done - -# Wait for healthy container datarouter-prov -for i in {1..10}; do - if [ "$(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov)" = 'healthy' ] - then - echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov) - echo "DR Service Running, datarouter-prov container is healthy" - break - else - echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov) - echo sleep $i - sleep $i - if [ $i = 10 ] - then - echo datarouter-prov container is not in healthy state - the test is not made, teardown... - cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources - docker-compose rm -sf - exit 1 - fi - fi -done - -DR_PROV_IP=`get-instance-ip.sh datarouter-prov` -DR_NODE_IP=`get-instance-ip.sh datarouter-node` -DR_SUB_IP=`get-instance-ip.sh subscriber-node` -DR_SUB2_IP=`get-instance-ip.sh subscriber-node2` -DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) - -echo DR_PROV_IP=${DR_PROV_IP} -echo DR_NODE_IP=${DR_NODE_IP} -echo DR_SUB_IP=${DR_SUB_IP} -echo DR_SUB2_IP=${DR_SUB2_IP} -echo DR_GATEWAY_IP=${DR_GATEWAY_IP} - -sudo sed -i "$ a $DR_PROV_IP dmaap-dr-prov" /etc/hosts -sudo sed -i "$ a $DR_NODE_IP dmaap-dr-node" /etc/hosts - -python $WORKSPACE/scripts/dmaap-datarouter/update_ca.py - -docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" - -#Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP} -v DR_SUB_IP:${DR_SUB_IP} -v DR_SUB2_IP:${DR_SUB2_IP}" \ No newline at end of file +# ============LICENSE_END===================================================== + +source ${WORKSPACE}/scripts/dmaap-datarouter/datarouter-launch.sh +# Launch DR. If true is passed, 2 subscriber containers are also deployed, else false. +dmaap_dr_launch true +cd ${WORKSPACE}/scripts/dmaap-datarouter/robot_ssl +# Add the root CA to robot framework. This is then removed on teardown. +python -c 'import update_ca; update_ca.add_onap_ca_cert()' \ No newline at end of file diff --git a/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh b/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh index d8ec4dc9..536863bc 100755 --- a/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh +++ b/plans/dmaap-datarouter/ssl-dr-suite/teardown.sh @@ -1,8 +1,7 @@ #!/bin/bash -# -# ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. -# ================================================================================ +# ============LICENSE_START=================================================== +# Copyright (C) 2019-2021 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 @@ -16,11 +15,7 @@ # limitations under the License. # # SPDX-License-Identifier: Apache-2.0 -# ============LICENSE_END========================================================= -# +# ============LICENSE_END===================================================== -cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources -sudo sed -i".bak" '/dmaap-dr-prov/d' /etc/hosts -sudo sed -i".bak" '/dmaap-dr-node/d' /etc/hosts -docker-compose rm -sf -python $WORKSPACE/scripts/dmaap-datarouter/remove_cert_from_ca.py +source ${WORKSPACE}/scripts/dmaap-datarouter/datarouter-teardown.sh +teardown_dmaap_dr \ No newline at end of file diff --git a/plans/integration-simulators-nf-simulator-netconf-server/testsuites/setup.sh b/plans/integration-simulators-nf-simulator-netconf-server/testsuites/setup.sh new file mode 100755 index 00000000..4fc9a358 --- /dev/null +++ b/plans/integration-simulators-nf-simulator-netconf-server/testsuites/setup.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Copyright (C) 2021 Nokia. All rights reserved. +# +# 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. + +# Start netconf-server image with dependencies +${WORKSPACE}/scripts/integration/nfsimulator/netconf-server/start-netconf-server.sh + +# Setup IP for netconf-server +NETCONF_SERVER_NAME=netconf-server +NETCONF_SERVER_REST_PORT=6555 + +# Wait until container ready +for i in {1..9} +do + NETCONF_SERVER_IP=`get-instance-ip.sh $NETCONF_SERVER_NAME` + RESP_CODE=$(curl -I -s -o /dev/null -w "%{http_code}" http://${NETCONF_SERVER_IP}:${NETCONF_SERVER_REST_PORT}/readiness) + if [[ "$RESP_CODE" == '200' ]]; then + echo 'Netconf Server is ready' + export NETCONF_SERVER_IP=${NETCONF_SERVER_IP} + export NETCONF_SERVER_REST_PORT=${NETCONF_SERVER_REST_PORT} + break + fi + echo 'Waiting for Netconf Server to start up...' + sleep 5s +done diff --git a/plans/music/music-distributed-kv-store-test-plan/teardown.sh b/plans/integration-simulators-nf-simulator-netconf-server/testsuites/teardown.sh old mode 100644 new mode 100755 similarity index 76% rename from plans/music/music-distributed-kv-store-test-plan/teardown.sh rename to plans/integration-simulators-nf-simulator-netconf-server/testsuites/teardown.sh index 0abf3a62..9638754a --- a/plans/music/music-distributed-kv-store-test-plan/teardown.sh +++ b/plans/integration-simulators-nf-simulator-netconf-server/testsuites/teardown.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2018 Intel Corporation +# Copyright (C) 2021 Nokia. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,9 +13,6 @@ # 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 +# Stop netconf-server image and dependencies +${WORKSPACE}/scripts/integration/nfsimulator/netconf-server/stop-netconf-server.sh diff --git a/plans/dmaap-buscontroller/ssl/testplan.txt b/plans/integration-simulators-nf-simulator-netconf-server/testsuites/testplan.txt similarity index 55% rename from plans/dmaap-buscontroller/ssl/testplan.txt rename to plans/integration-simulators-nf-simulator-netconf-server/testsuites/testplan.txt index 54ce4df1..aa7f7db2 100644 --- a/plans/dmaap-buscontroller/ssl/testplan.txt +++ b/plans/integration-simulators-nf-simulator-netconf-server/testsuites/testplan.txt @@ -1,4 +1,4 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -dmaap-buscontroller/ssl_suite - +# Temporary change to trigger verify job. +integration/nfsimulator/netconf-server 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 88becf69..00000000 --- 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/oom-platform-cert-service/certservice/docker-compose.yml b/plans/oom-platform-cert-service/certservice/docker-compose.yml index b281101a..329bc1c0 100644 --- a/plans/oom-platform-cert-service/certservice/docker-compose.yml +++ b/plans/oom-platform-cert-service/certservice/docker-compose.yml @@ -9,7 +9,9 @@ services: - "80:8080" - "443:8443" volumes: - - $SCRIPTS_PATH:/opt/primekey/scripts + - $RESOURCES_PATH/ejbca-configuration.sh:/opt/primekey/scripts/ejbca-configuration.sh + - $RESOURCES_PATH/certprofile_CUSTOM_ENDUSER-1834889499.xml:/opt/primekey/custom_profiles/certprofile_CUSTOM_ENDUSER-1834889499.xml + - $RESOURCES_PATH/entityprofile_Custom_EndEntity-1356531849.xml:/opt/primekey/custom_profiles/entityprofile_Custom_EndEntity-1356531849.xml healthcheck: test: ["CMD-SHELL", "curl -kI https://localhost:8443/ejbca/publicweb/healthcheck/ejbcahealth"] interval: 20s diff --git a/plans/oom-platform-cert-service/certservice/resources/certprofile_CUSTOM_ENDUSER-1834889499.xml b/plans/oom-platform-cert-service/certservice/resources/certprofile_CUSTOM_ENDUSER-1834889499.xml new file mode 100644 index 00000000..e163aed8 --- /dev/null +++ b/plans/oom-platform-cert-service/certservice/resources/certprofile_CUSTOM_ENDUSER-1834889499.xml @@ -0,0 +1,595 @@ + + + + + version + 46.0 + + + type + 1 + + + certversion + X509v3 + + + encodedvalidity + 2y + + + usecertificatevalidityoffset + false + + + certificatevalidityoffset + -10m + + + useexpirationrestrictionforweekdays + false + + + expirationrestrictionforweekdaysbefore + true + + + expirationrestrictionweekdays + + + true + + + true + + + false + + + false + + + false + + + true + + + true + + + + + allowvalidityoverride + false + + + allowextensionoverride + false + + + allowdnoverride + false + + + allowdnoverridebyeei + false + + + allowbackdatedrevokation + false + + + usecertificatestorage + true + + + storecertificatedata + true + + + storesubjectaltname + true + + + usebasicconstrants + true + + + basicconstraintscritical + true + + + usesubjectkeyidentifier + true + + + subjectkeyidentifiercritical + false + + + useauthoritykeyidentifier + true + + + authoritykeyidentifiercritical + false + + + usesubjectalternativename + true + + + subjectalternativenamecritical + false + + + useissueralternativename + true + + + issueralternativenamecritical + false + + + usecrldistributionpoint + false + + + usedefaultcrldistributionpoint + false + + + crldistributionpointcritical + false + + + crldistributionpointuri + + + + usefreshestcrl + false + + + usecadefinedfreshestcrl + false + + + freshestcrluri + + + + crlissuer + + + + usecertificatepolicies + false + + + certificatepoliciescritical + false + + + certificatepolicies + + + + availablekeyalgorithms + + + DSA + + + ECDSA + + + RSA + + + + + availableeccurves + + + ANY_EC_CURVE + + + + + availablebitlengths + + + 0 + + + 192 + + + 224 + + + 239 + + + 256 + + + 384 + + + 512 + + + 521 + + + 1024 + + + 1536 + + + 2048 + + + 3072 + + + 4096 + + + 6144 + + + 8192 + + + + + minimumavailablebitlength + 0 + + + maximumavailablebitlength + 8192 + + + signaturealgorithm + + + + usekeyusage + true + + + keyusage + + + true + + + true + + + true + + + false + + + false + + + false + + + false + + + false + + + false + + + + + allowkeyusageoverride + false + + + keyusagecritical + true + + + useextendedkeyusage + true + + + extendedkeyusage + + + 1.3.6.1.5.5.7.3.2 + + + 1.3.6.1.5.5.7.3.4 + + + 1.3.6.1.5.5.7.3.1 + + + + + extendedkeyusagecritical + false + + + usedocumenttypelist + false + + + documenttypelistcritical + false + + + documenttypelist + + + + availablecas + + + -1 + + + + + usedpublishers + + + + useocspnocheck + false + + + useldapdnorder + true + + + usecustomdnorder + false + + + usemicrosofttemplate + false + + + microsofttemplate + + + + usecardnumber + false + + + usecnpostfix + false + + + cnpostfix + + + + usesubjectdnsubset + false + + + subjectdnsubset + + + + usesubjectaltnamesubset + false + + + subjectaltnamesubset + + + + usepathlengthconstraint + false + + + pathlengthconstraint + 0 + + + useqcstatement + false + + + usepkixqcsyntaxv2 + false + + + useqcstatementcritical + false + + + useqcstatementraname + + + + useqcsematicsid + + + + useqcetsiqccompliance + false + + + useqcetsisignaturedevice + false + + + useqcetsivaluelimit + false + + + qcetsivaluelimit + 0 + + + qcetsivaluelimitexp + 0 + + + qcetsivaluelimitcurrency + + + + useqcetsiretentionperiod + false + + + qcetsiretentionperiod + 0 + + + useqccustomstring + false + + + qccustomstringoid + + + + qccustomstringtext + + + + qcetsipds + + + + qcetsitype + + + + usecertificatetransparencyincerts + false + + + usecertificatetransparencyinocsp + false + + + usecertificatetransparencyinpublisher + false + + + usesubjectdirattributes + false + + + usenameconstraints + false + + + useauthorityinformationaccess + false + + + caissuers + + + + usedefaultcaissuer + false + + + usedefaultocspservicelocator + false + + + ocspservicelocatoruri + + + + cvcaccessrights + 3 + + + usedcertificateextensions + + + + approvals + + + + org.cesecore.certificates.ca.ApprovalRequestType + REVOCATION + + -1 + + + + org.cesecore.certificates.ca.ApprovalRequestType + KEYRECOVER + + -1 + + + + org.cesecore.certificates.ca.ApprovalRequestType + ADDEDITENDENTITY + + -1 + + + + + useprivkeyusageperiodnotbefore + false + + + useprivkeyusageperiod + false + + + useprivkeyusageperiodnotafter + false + + + privkeyusageperiodstartoffset + 0 + + + privkeyusageperiodlength + 63072000 + + + usesingleactivecertificateconstraint + false + + + overridableextensionoids + + + + nonoverridableextensionoids + + + + allowcertsnoverride + false + + + usecustomdnorderldap + false + + + diff --git a/plans/oom-platform-cert-service/certservice/scripts/ejbca-configuration.sh b/plans/oom-platform-cert-service/certservice/resources/ejbca-configuration.sh similarity index 70% rename from plans/oom-platform-cert-service/certservice/scripts/ejbca-configuration.sh rename to plans/oom-platform-cert-service/certservice/resources/ejbca-configuration.sh index 77f5c555..3eb146db 100755 --- a/plans/oom-platform-cert-service/certservice/scripts/ejbca-configuration.sh +++ b/plans/oom-platform-cert-service/certservice/resources/ejbca-configuration.sh @@ -5,6 +5,11 @@ configureEjbca() { ejbca.sh config cmp updatealias --alias cmpRA --key operationmode --value ra ejbca.sh ca editca --caname ManagementCA --field cmpRaAuthSecret --value mypassword ejbca.sh config cmp updatealias --alias cmpRA --key responseprotection --value pbe + ejbca.sh ca importprofiles -d /opt/primekey/custom_profiles + #Profile name taken from certprofile filename (certprofile_-.xml) + ejbca.sh config cmp updatealias --alias cmpRA --key ra.certificateprofile --value CUSTOM_ENDUSER + #ID taken from entityprofile filename (entityprofile_-.xml) + ejbca.sh config cmp updatealias --alias cmpRA --key ra.endentityprofileid --value 1356531849 ejbca.sh config cmp dumpalias --alias cmpRA ejbca.sh config cmp addalias --alias cmp ejbca.sh config cmp updatealias --alias cmp --key allowautomatickeyupdate --value true diff --git a/plans/oom-platform-cert-service/certservice/resources/entityprofile_Custom_EndEntity-1356531849.xml b/plans/oom-platform-cert-service/certservice/resources/entityprofile_Custom_EndEntity-1356531849.xml new file mode 100644 index 00000000..ec51a80d --- /dev/null +++ b/plans/oom-platform-cert-service/certservice/resources/entityprofile_Custom_EndEntity-1356531849.xml @@ -0,0 +1,1107 @@ + + + + + version + 14.0 + + + NUMBERARRAY + + + 1 + + + 1 + + + 0 + + + 0 + + + 0 + + + 1 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + 1 + + + 3 + + + 3 + + + 3 + + + 0 + + + 3 + + + 0 + + + 0 + + + 0 + + + 0 + + + 1 + + + 0 + + + 0 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + 1 + + + 1 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 1 + + + 1 + + + 0 + + + 1 + + + 0 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + 0 + + + 0 + + + + + SUBJECTDNFIELDORDER + + + 500 + + + 1100 + + + 1200 + + + 1300 + + + 1400 + + + 1600 + + + + + SUBJECTALTNAMEFIELDORDER + + + 1800 + + + 1801 + + + 1802 + + + 1700 + + + 1701 + + + 1702 + + + 1900 + + + 1901 + + + 1902 + + + 2100 + + + 2101 + + + 2102 + + + + + SUBJECTDIRATTRFIELDORDER + + + + 0 + + + + 20000 + true + + + 10000 + true + + + 30000 + true + + + 1 + + + + 20001 + true + + + 10001 + true + + + 30001 + true + + + 95 + + + + 20095 + false + + + 10095 + true + + + 30095 + true + + + 96 + + + + 20096 + false + + + 10096 + true + + + 30096 + true + + + 5 + + + + 20005 + true + + + 10005 + true + + + 30005 + true + + + 26 + + + + 20026 + false + + + 10026 + true + + + 30026 + true + + + 29 + 1834889499 + + + 20029 + true + + + 10029 + true + + + 30029 + true + + + 30 + 1834889499 + + + 20030 + true + + + 10030 + true + + + 30030 + true + + + 31 + 1 + + + 20031 + true + + + 10031 + true + + + 30031 + true + + + 32 + 1;2;3;4 + + + 20032 + true + + + 10032 + true + + + 30032 + true + + + 33 + + + + 20033 + true + + + 10033 + true + + + 30033 + true + + + 34 + + + + 20034 + true + + + 10034 + false + + + 30034 + true + + + 38 + 1 + + + 20038 + true + + + 10038 + true + + + 30038 + true + + + 37 + -29939301 + + + 20037 + true + + + 10037 + true + + + 30037 + true + + + 98 + + + + 20098 + false + + + 10098 + false + + + 30098 + true + + + 99 + + + + 20099 + false + + + 10099 + false + + + 30099 + true + + + 97 + + + + 20097 + false + + + 10097 + false + + + 30097 + true + + + 91 + false + + + 20091 + false + + + 10091 + false + + + 30091 + true + + + 94 + -1 + + + 20094 + true + + + 10094 + false + + + 30094 + false + + + 93 + -1 + + + 20093 + false + + + 10093 + false + + + 30093 + false + + + 89 + + + + 20089 + false + + + 10089 + false + + + 30089 + true + + + 88 + + + + 20088 + false + + + 10088 + false + + + 30088 + true + + + ALLOW_MERGEDN_WEBSERVICES + false + + + 2 + + + + 20002 + false + + + 10002 + false + + + 10090 + true + + + 90 + 0 + + + REVERSEFFIELDCHECKS + false + + + 28 + false + + + 20028 + false + + + 10028 + false + + + REUSECERTIFICATE + false + + + 35 + false + + + 20035 + false + + + 10035 + false + + + 10092 + false + + + USEEXTENSIONDATA + false + + + PRINTINGUSE + false + + + PRINTINGDEFAULT + false + + + PRINTINGREQUIRED + false + + + PRINTINGCOPIES + 1 + + + PRINTINGPRINTERNAME + + + + PRINTINGSVGDATA + + + + PRINTINGSVGFILENAME + + + + 11 + + + + 20011 + false + + + 10011 + true + + + 30011 + true + + + 12 + + + + 20012 + true + + + 10012 + true + + + 30012 + true + + + 13 + + + + 20013 + false + + + 10013 + true + + + 30013 + true + + + 14 + + + + 20014 + true + + + 10014 + true + + + 30014 + true + + + 16 + + + + 20016 + true + + + 10016 + true + + + 30016 + true + + + 18 + + + + 20018 + false + + + 10018 + true + + + 30018 + true + + + 118 + + + + 20118 + false + + + 10118 + true + + + 30118 + true + + + 218 + + + + 20218 + false + + + 10218 + true + + + 30218 + true + + + 17 + + + + 20017 + false + + + 10017 + false + + + 30017 + true + + + 117 + + + + 20117 + false + + + 10117 + false + + + 30117 + true + + + 217 + + + + 20217 + false + + + 10217 + false + + + 30217 + true + + + 19 + + + + 20019 + false + + + 10019 + true + + + 30019 + true + + + 119 + + + + 20119 + false + + + 10119 + true + + + 30119 + true + + + 219 + + + + 20219 + false + + + 10219 + true + + + 30219 + true + + + 21 + + + + 20021 + false + + + 10021 + true + + + 30021 + true + + + 121 + + + + 20121 + false + + + 10121 + true + + + 30121 + true + + + 221 + + + + 20221 + false + + + 10221 + true + + + 30221 + true + + + diff --git a/plans/oom-platform-cert-service/certservice/setup.sh b/plans/oom-platform-cert-service/certservice/setup.sh index bee54cde..0e2a4653 100644 --- a/plans/oom-platform-cert-service/certservice/setup.sh +++ b/plans/oom-platform-cert-service/certservice/setup.sh @@ -22,10 +22,10 @@ SCRIPT=`realpath $0` CURRENT_WORKDIR_PATH=`dirname $SCRIPT` PROJECT_DIRECTORY="plans/oom-platform-cert-service/certservice" -SCRIPTS_DIRECTORY="scripts" +RESOURCES_DIRECTORY="resources" -JENKINS_SCRIPTS_PATH="$CURRENT_WORKDIR_PATH/$PROJECT_DIRECTORY/$SCRIPTS_DIRECTORY" -LOCAL_SCRIPTS_PATH="$CURRENT_WORKDIR_PATH/$SCRIPTS_DIRECTORY" +JENKINS_RESOURCES_PATH="$CURRENT_WORKDIR_PATH/$PROJECT_DIRECTORY/$RESOURCES_DIRECTORY" +LOCAL_RESOURCES_PATH="$CURRENT_WORKDIR_PATH/$RESOURCES_DIRECTORY" # ------------------------------------ #Prepare enviroment for client @@ -50,12 +50,12 @@ unset http_proxy https_proxy export ClientContainerName=CertServiceClient # ------------------------------------ -if test -d "$JENKINS_SCRIPTS_PATH"; then - SCRIPTS_PATH=$JENKINS_SCRIPTS_PATH -else test -f "$LOCAL_SCRIPTS_PATH"; - SCRIPTS_PATH=$LOCAL_SCRIPTS_PATH +if test -d "$JENKINS_RESOURCES_PATH"; then + RESOURCES_PATH=$JENKINS_RESOURCES_PATH +else test -f "$LOCAL_RESOURCES_PATH"; + RESOURCES_PATH=$LOCAL_RESOURCES_PATH fi -echo "Use scripts from: $SCRIPTS_PATH" +echo "Use resources from: $RESOURCES_PATH" CONFIGURATION_FILE="cmpServers.json" @@ -72,7 +72,7 @@ echo "Use configuration from: $CONFIGURATION_PATH" # ------------------------------------- export CONFIGURATION_PATH=${CONFIGURATION_PATH} -export SCRIPTS_PATH=${SCRIPTS_PATH} +export RESOURCES_PATH=${RESOURCES_PATH} #Generate keystores, truststores, certificates and keys mkdir -p ${WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs/ diff --git a/plans/oom-platform-cert-service/certservice/teardown.sh b/plans/oom-platform-cert-service/certservice/teardown.sh index f531180e..46aa25a8 100644 --- a/plans/oom-platform-cert-service/certservice/teardown.sh +++ b/plans/oom-platform-cert-service/certservice/teardown.sh @@ -22,4 +22,4 @@ echo "Removed old keystores" rm -rf ${WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs echo "Removed old certificates" -kill-instance.sh ${ClientContainerName} \ No newline at end of file +kill-instance.sh ${ClientContainerName} diff --git a/plans/optf-has/has/setup.sh b/plans/optf-has/has/setup.sh deleted file mode 100755 index db3ec7c7..00000000 --- a/plans/optf-has/has/setup.sh +++ /dev/null @@ -1,59 +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. -# -echo "# aaf-sms setup.sh script"; -source ${WORKSPACE}/scripts/optf-has/has/setup-sms.sh - -# -# add here eventual scripts needed for music -# -echo "# music scripts calling"; -source ${WORKSPACE}/scripts/optf-has/has/music_script.sh - - -# -echo "# simulator scripts calling"; -source ${WORKSPACE}/scripts/optf-has/has/simulator_script.sh - -# add here eventual scripts needed for optf/has -# -echo "# optf/has scripts calling"; -source ${WORKSPACE}/scripts/optf-has/has/has_script.sh - -# -# add here below the start of all docker containers needed for optf/has CSIT testing -# -echo "# optf/has scripts docker containers spinoff"; - -# -# add here all the configuration steps eventually needed to be carried out for optf/has CSIT testing -# -echo "# optf/has configuration step"; - - -# -# add here all ROBOT_VARIABLES settings -# -echo "# optf/has robot variables settings"; -echo "conductor ip = ${COND_IP}" -echo "music ip = ${TOMCAT_IP}" - -ROBOT_VARIABLES="-v MUSIC_HOSTNAME:http://${TOMCAT_IP} -v MUSIC_PORT:8080 -v COND_HOSTNAME:http://${COND_IP} -v COND_PORT:8091" - -echo ${ROBOT_VARIABLES} - - - diff --git a/plans/optf-has/has/teardown.sh b/plans/optf-has/has/teardown.sh deleted file mode 100755 index 0b2b6299..00000000 --- a/plans/optf-has/has/teardown.sh +++ /dev/null @@ -1,38 +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. -# - - -# -# add here below the killing of all docker containers used for optf/has CSIT testing -# - -# -# optf/has scripts docker containers killing"; -# -echo "# optf/has has scripts calling"; -source ${WORKSPACE}/scripts/optf-has/has/has_teardown_script.sh - -echo "# optf/has simulator scripts calling"; -source ${WORKSPACE}/scripts/optf-has/has/simulator_teardown_script.sh - -echo "# optf/has music scripts calling"; -source ${WORKSPACE}/scripts/optf-has/has/music_teardown_script.sh - -echo "# aaf-sms teardown.sh script"; -kill-instance.sh sms -kill-instance.sh vault - diff --git a/plans/optf-osdf/osdf/setup.sh b/plans/optf-osdf/osdf/setup.sh deleted file mode 100755 index 42e9aecf..00000000 --- a/plans/optf-osdf/osdf/setup.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# -# ------------------------------------------------------------------------- -# Copyright (c) 2018 AT&T Intellectual Property -# -# 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. -# -# ------------------------------------------------------------------------- -# - -# -echo "# aaf-sms setup.sh script"; -source ${WORKSPACE}/scripts/optf-osdf/osdf/setup-sms.sh - -echo "# simulator scripts calling"; -source ${WORKSPACE}/scripts/optf-osdf/osdf/simulator_script.sh - -# add here eventual scripts needed for optf/osdf -# -echo "# optf/osdf scripts calling"; -source ${WORKSPACE}/scripts/optf-osdf/osdf/osdf_script.sh - -# -# add here below the start of all docker containers needed for optf/osdf CSIT testing -# -echo "# optf/osdf scripts docker containers spinoff"; - -# -# add here all the configuration steps eventually needed to be carried out for optf/osdf CSIT testing -# -echo "# optf/osdf configuration step"; - - -# -# add here all ROBOT_VARIABLES settings -# -echo "# optf/osdf robot variables settings"; -echo "osdf ip = ${OSDF_IP}" - -ROBOT_VARIABLES="-v OSDF_HOSTNAME:http://${OSDF_IP} -v OSDF_PORT:8699" - -echo ${ROBOT_VARIABLES} - - - diff --git a/plans/optf-osdf/osdf/teardown.sh b/plans/optf-osdf/osdf/teardown.sh deleted file mode 100755 index 3457295d..00000000 --- a/plans/optf-osdf/osdf/teardown.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# ------------------------------------------------------------------------- -# Copyright (c) 2018 AT&T Intellectual Property -# -# 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. -# -# ------------------------------------------------------------------------- -# - - -# -# add here below the killing of all docker containers used for optf/osdf CSIT testing -# - -# -# optf/osdf scripts docker containers killing"; -# - -kill-instance.sh optf-osdf -kill-instance.sh osdf_sim - -echo "# aaf-sms teardown.sh script"; -kill-instance.sh sms -kill-instance.sh vault - diff --git a/plans/optf-osdf/osdf/testplan.txt b/plans/optf-osdf/osdf/testplan.txt deleted file mode 100644 index 87a2d545..00000000 --- a/plans/optf-osdf/osdf/testplan.txt +++ /dev/null @@ -1,22 +0,0 @@ -# -# ------------------------------------------------------------------------- -# Copyright (c) 2015-2017 AT&T Intellectual Property -# -# 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. -# -# ------------------------------------------------------------------------- -# - -# Test suites are relative paths under [integration.git]/test/csit/tests/. -# Place the suites in run order. -optf-osdf/osdf diff --git a/plans/policy/apex-pdp/setup.sh b/plans/policy/apex-pdp/setup.sh deleted file mode 100644 index 02238e90..00000000 --- a/plans/policy/apex-pdp/setup.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2018 Ericsson. All rights reserved. -# -# Modifications copyright (c) 2019 Nordix Foundation. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. -# ================================================================================ -# 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========================================================= -source ${SCRIPTS}/policy/config/policy-csit.conf - -echo "Uninstall docker-py and reinstall docker." -pip uninstall -y docker-py -pip uninstall -y docker -pip install -U docker==2.7.0 - -sudo apt-get -y install libxml2-utils - -source ${SCRIPTS}/policy/detmVers.sh - -docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d apex-pdp - -unset http_proxy https_proxy - -POLICY_API_IP=`get-instance-ip.sh policy-api` -POLICY_PAP_IP=`get-instance-ip.sh policy-pap` -MARIADB_IP=`get-instance-ip.sh mariadb` -APEX_IP=`get-instance-ip.sh policy-apex-pdp` -DMAAP_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org` - -echo PAP IP IS ${POLICY_PAP_IP} -echo MARIADB IP IS ${MARIADB_IP} -echo API IP IS ${POLICY_API_IP} -echo APEX IP IS ${APEX_IP} -echo DMAAP_IP IS ${DMAAP_IP} - -# wait for the app to start up -${SCRIPTS}/policy/wait_for_port.sh ${APEX_IP} 6969 - -ROBOT_VARIABLES="" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}" diff --git a/plans/policy/apex-pdp/teardown.sh b/plans/policy/apex-pdp/teardown.sh deleted file mode 100644 index 86416e6e..00000000 --- a/plans/policy/apex-pdp/teardown.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2018 Ericsson. All rights reserved. -# -# Modifications copyright (c) 2019 Nordix Foundation. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. -# ================================================================================ -# 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 -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v diff --git a/plans/policy/apex-pdp/testplan.txt b/plans/policy/apex-pdp/testplan.txt deleted file mode 100644 index 07096cfa..00000000 --- a/plans/policy/apex-pdp/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -policy/apex-pdp/apex-pdp-test.robot diff --git a/plans/policy/api/setup.sh b/plans/policy/api/setup.sh deleted file mode 100644 index 550337e9..00000000 --- a/plans/policy/api/setup.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# 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========================================================= - -# Select branch -source ${SCRIPTS}/policy/config/policy-csit.conf - -echo "Uninstall docker-py and reinstall docker." -pip uninstall -y docker-py -pip uninstall -y docker -pip install -U docker==2.7.0 - - -sudo apt-get -y install libxml2-utils -bash ${SCRIPTS}/policy/get-models-examples.sh - -source ${SCRIPTS}/policy/detmVers.sh - -DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies - -# create a couple of variations of the policy definitions -sed -e 's!Measurement_vGMUX!ADifferentValue!' \ - ${DATA}/vCPE.policy.monitoring.input.tosca.json \ - >${DATA}/vCPE.policy.monitoring.input.tosca.v1_2.json - -sed -e 's!"version": "1.0.0"!"version": "2.0.0"!' \ - -e 's!"policy-version": 1!"policy-version": 2!' \ - ${DATA}/vCPE.policy.monitoring.input.tosca.json \ - >${DATA}/vCPE.policy.monitoring.input.tosca.v2.json - -echo ${POLICY_API_VERSION} - -docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d api - - -unset http_proxy https_proxy - -POLICY_API_IP=`get-instance-ip.sh policy-api` -MARIADB_IP=`get-instance-ip.sh mariadb` - -echo API IP IS ${POLICY_API_IP} -echo MARIADB IP IS ${MARIADB_IP} - -# wait for the app to start up -${SCRIPTS}/policy/wait_for_port.sh ${POLICY_API_IP} 6969 - -ROBOT_VARIABLES="" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}" diff --git a/plans/policy/api/teardown.sh b/plans/policy/api/teardown.sh deleted file mode 100755 index 6942e353..00000000 --- a/plans/policy/api/teardown.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# 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 -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v diff --git a/plans/policy/api/testplan.txt b/plans/policy/api/testplan.txt deleted file mode 100644 index 1bfec142..00000000 --- a/plans/policy/api/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -policy/api/api-test.robot diff --git a/plans/policy/distribution/setup.sh b/plans/policy/distribution/setup.sh deleted file mode 100644 index 73226140..00000000 --- a/plans/policy/distribution/setup.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2018 Ericsson. All rights reserved. -# -# Modifications copyright (c) 2019 Nordix Foundation. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. -# ================================================================================ -# 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========================================================= -source ${SCRIPTS}/policy/config/policy-csit.conf - -echo "Uninstall docker-py and reinstall docker." -pip uninstall -y docker-py -pip uninstall -y docker -pip install -U docker==2.7.0 - -sudo apt-get -y install libxml2-utils - -source ${SCRIPTS}/policy/detmVers.sh - -SCRIPT_DIR=${SCRIPTS}/policy/policy-distribution - -# Remaking the csar file in case if the file got corrupted -zip -F ${SCRIPT_DIR}/config/distribution/csar/sample_csar_with_apex_policy.csar --out ${SCRIPT_DIR}/config/distribution/csar/csar_temp.csar - -# Remake temp directory -rm -rf ${SCRIPT_DIR}/config/distribution/temp -mkdir ${SCRIPT_DIR}/config/distribution/temp - -docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d distribution - -unset http_proxy https_proxy - -POLICY_API_IP=`get-instance-ip.sh policy-api` -POLICY_PAP_IP=`get-instance-ip.sh policy-pap` -MARIADB_IP=`get-instance-ip.sh mariadb` -APEX_IP=`get-instance-ip.sh policy-apex-pdp` -DMAAP_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org` -POLICY_DISTRIBUTION_IP=`get-instance-ip.sh policy-distribution` - -echo PAP IP IS ${POLICY_PAP_IP} -echo MARIADB IP IS ${MARIADB_IP} -echo API IP IS ${POLICY_API_IP} -echo APEX IP IS ${APEX_IP} -echo DMAAP_IP IS ${DMAAP_IP} -echo POLICY_DISTRIBUTION_IP IS ${POLICY_DISTRIBUTION_IP} - -# wait for the app to start up -${SCRIPTS}/policy/wait_for_port.sh ${POLICY_DISTRIBUTION_IP} 6969 - -ROBOT_VARIABLES="" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCRIPT_DIR:${SCRIPT_DIR}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_DISTRIBUTION_IP:${POLICY_DISTRIBUTION_IP}" diff --git a/plans/policy/distribution/teardown.sh b/plans/policy/distribution/teardown.sh deleted file mode 100644 index 86416e6e..00000000 --- a/plans/policy/distribution/teardown.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2018 Ericsson. All rights reserved. -# -# Modifications copyright (c) 2019 Nordix Foundation. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. -# ================================================================================ -# 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 -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v diff --git a/plans/policy/distribution/testplan.txt b/plans/policy/distribution/testplan.txt deleted file mode 100644 index bfd8192e..00000000 --- a/plans/policy/distribution/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -policy/distribution/distribution-test.robot diff --git a/plans/policy/drools-applications/setup.sh b/plans/policy/drools-applications/setup.sh deleted file mode 100755 index c4cbfa60..00000000 --- a/plans/policy/drools-applications/setup.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# -# ===========LICENSE_START==================================================== -# Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END===================================================== -# - -# OS upgrades - -source ${SCRIPTS}/policy/config/policy-csit.conf - -SCR2=${WORKSPACE}/scripts/policy/drools-apps - -echo "Uninstall docker-py and reinstall docker." -pip uninstall -y docker-py -pip uninstall -y docker -pip install -U docker==2.7.0 - -sudo apt-get -y install libxml2-utils -bash ${SCRIPTS}/policy/get-models-examples.sh - -source ${SCRIPTS}/policy/detmVers.sh - -docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d drools-apps - -unset http_proxy https_proxy - -DROOLS_IP=`get-instance-ip.sh drools-apps` -API_IP=`get-instance-ip.sh policy-api` -PAP_IP=`get-instance-ip.sh policy-pap` -XACML_IP=`get-instance-ip.sh policy-xacml-pdp` -SIM_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org` -export SIM_IP - -echo DROOLS IP IS ${DROOLS_IP} -echo API IP IS ${API_IP} -echo PAP IP IS ${PAP_IP} -echo XACML IP IS ${XACML_IP} -echo SIMULATORS IP IS ${SIM_IP} - -# wait for the app to start up -${SCRIPTS}/policy/wait_for_port.sh ${DROOLS_IP} 6969 - -# give enough time for the controllers to come up -sleep 15 - -DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies - -ROBOT_VARIABLES="" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCR2}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}" diff --git a/plans/policy/drools-applications/teardown.sh b/plans/policy/drools-applications/teardown.sh deleted file mode 100755 index 67de4a1a..00000000 --- a/plans/policy/drools-applications/teardown.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# -# ===========LICENSE_START==================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END===================================================== -# - -mkdir -p $WORKSPACE/archives/ -docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml logs > $WORKSPACE/archives/docker-compose-drools-apps.log - -docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v diff --git a/plans/policy/drools-applications/testplan.txt b/plans/policy/drools-applications/testplan.txt deleted file mode 100644 index 3878a4e2..00000000 --- a/plans/policy/drools-applications/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -policy/drools-applications diff --git a/plans/policy/drools-pdp/setup.sh b/plans/policy/drools-pdp/setup.sh deleted file mode 100755 index 6b951356..00000000 --- a/plans/policy/drools-pdp/setup.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright 2017-2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# 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========================================================= - -# OS upgrades - -echo "Uninstall docker-py and reinstall docker." -pip uninstall -y docker-py -pip uninstall -y docker -pip install -U docker==2.7.0 - -# Component Versions - -source ${SCRIPTS}/policy/config/policy-csit.conf - -sudo apt-get -y install libxml2-utils - -source ${SCRIPTS}/policy/detmVers.sh - -docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d drools - -POLICY_DROOLS_IP=`get-instance-ip.sh drools` -MARIADB_IP=`get-instance-ip.sh mariadb` - -echo DROOLS IP IS ${POLICY_DROOLS_IP} -echo MARIADB IP IS ${MARIADB_IP} - -# wait for the app to start up - looking for telemtry service on port 9696 -${SCRIPTS}/policy/wait_for_port.sh ${POLICY_DROOLS_IP} 9696 - -# give enough time for the controllers to come up -sleep 15 - -ROBOT_VARIABLES="-v POLICY_DROOLS_IP:${POLICY_DROOLS_IP}" diff --git a/plans/policy/drools-pdp/teardown.sh b/plans/policy/drools-pdp/teardown.sh deleted file mode 100755 index 5a3f16e5..00000000 --- a/plans/policy/drools-pdp/teardown.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# -# Copyright 2017-2020 AT&T Intellectual Property. All rights reserved. -# -# 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. -# - -mkdir -p $WORKSPACE/archives/ -docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml logs > $WORKSPACE/archives/docker-compose-drools.log -docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v diff --git a/plans/policy/drools-pdp/testplan.txt b/plans/policy/drools-pdp/testplan.txt deleted file mode 100644 index ccdc8ff9..00000000 --- a/plans/policy/drools-pdp/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -policy/drools-pdp diff --git a/plans/policy/pap/setup.sh b/plans/policy/pap/setup.sh deleted file mode 100644 index a1d153f8..00000000 --- a/plans/policy/pap/setup.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. -# Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. -# ================================================================================ -# 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========================================================= - -source ${SCRIPTS}/policy/config/policy-csit.conf - -echo "Uninstall docker-py and reinstall docker." -pip uninstall -y docker-py -pip uninstall -y docker -pip install -U docker==2.7.0 - -sudo apt-get -y install libxml2-utils -bash ${SCRIPTS}/policy/get-models-examples.sh - -source ${SCRIPTS}/policy/detmVers.sh - -docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d pap - -unset http_proxy https_proxy - -POLICY_PAP_IP=`get-instance-ip.sh policy-pap` -POLICY_API_IP=`get-instance-ip.sh policy-api` -MARIADB_IP=`get-instance-ip.sh mariadb` - -echo PAP IP IS ${POLICY_PAP_IP} -echo API IP IS ${POLICY_API_IP} -echo MARIADB IP IS ${MARIADB_IP} - - -# wait for the app to start up -${SCRIPTS}/policy/wait_for_port.sh ${POLICY_PAP_IP} 6969 - - -DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies - -ROBOT_VARIABLES="" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}" diff --git a/plans/policy/pap/teardown.sh b/plans/policy/pap/teardown.sh deleted file mode 100644 index cfed2097..00000000 --- a/plans/policy/pap/teardown.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. -# Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. -# ================================================================================ -# 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 -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v diff --git a/plans/policy/pap/testplan.txt b/plans/policy/pap/testplan.txt deleted file mode 100644 index 6a5aa205..00000000 --- a/plans/policy/pap/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -policy/pap/pap-test.robot diff --git a/plans/policy/xacml-pdp/setup.sh b/plans/policy/xacml-pdp/setup.sh deleted file mode 100644 index 7f557d13..00000000 --- a/plans/policy/xacml-pdp/setup.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# 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========================================================= - -source ${SCRIPTS}/policy/config/policy-csit.conf - -echo "Uninstall docker-py and reinstall docker." -pip uninstall -y docker-py -pip uninstall -y docker -pip install -U docker==2.7.0 - -SCR_DMAAP=${SCRIPTS}/policy/drools-apps - -sudo apt-get -y install libxml2-utils -bash ${SCRIPTS}/policy/get-models-examples.sh - -source ${SCRIPTS}/policy/detmVers.sh - -docker-compose -f ${SCRIPTS}/policy/docker-compose-all.yml up -d xacml-pdp - - -unset http_proxy https_proxy - -POLICY_API_IP=`get-instance-ip.sh policy-api` -MARIADB_IP=`get-instance-ip.sh mariadb` -POLICY_PDPX_IP=`get-instance-ip.sh policy-xacml-pdp` -DMAAP_IP=`get-instance-ip.sh policy.api.simpledemo.onap.org` -POLICY_PAP_IP=`get-instance-ip.sh policy-pap` - -echo PDP IP IS ${POLICY_PDPX_IP} -echo API IP IS ${POLICY_API_IP} -echo PAP IP IS ${POLICY_PAP_IP} -echo MARIADB IP IS ${MARIADB_IP} -echo DMAAP_IP IS ${DMAAP_IP} - -# wait for the app to start up -${SCRIPTS}/policy/wait_for_port.sh ${POLICY_PDPX_IP} 6969 - -DATA2=${WORKSPACE}/models/models-examples/src/main/resources/policies - -ROBOT_VARIABLES="" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR_DMAAP:${SCR_DMAAP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PDPX_IP:${POLICY_PDPX_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}" -ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}" diff --git a/plans/policy/xacml-pdp/teardown.sh b/plans/policy/xacml-pdp/teardown.sh deleted file mode 100644 index 6942e353..00000000 --- a/plans/policy/xacml-pdp/teardown.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# ============LICENSE_START======================================================= -# Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# 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 -f ${WORKSPACE}/scripts/policy/docker-compose-all.yml down -v diff --git a/plans/policy/xacml-pdp/testplan.txt b/plans/policy/xacml-pdp/testplan.txt deleted file mode 100644 index 2b641dfd..00000000 --- a/plans/policy/xacml-pdp/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -policy/xacml-pdp/xacml-pdp-test.robot diff --git a/plans/sdc/sdc-helm-validator/setup.sh b/plans/sdc/sdc-helm-validator/setup.sh new file mode 100644 index 00000000..6d079679 --- /dev/null +++ b/plans/sdc/sdc-helm-validator/setup.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +export SDC_HELM_VALIDATOR="sdc-helm-validator" +export SDC_HELM_VALIDATOR_IMAGE="nexus3.onap.org:10001/onap/org.onap.sdc.sdc-helm-validator:latest" + +unset http_proxy +unset https_proxy + +docker run -p 8080:8080 -d --name ${SDC_HELM_VALIDATOR} ${SDC_HELM_VALIDATOR_IMAGE} + +# Wait container ready +HELM_VALIDATOR_IP='none' +for i in {1..5} +do + HELM_VALIDATOR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${SDC_HELM_VALIDATOR}) + RESP_CODE=$(curl -s http://${HELM_VALIDATOR_IP}:8080/actuator/health | python2 -c 'import json,sys;obj=json.load(sys.stdin);print obj["status"]') + if [[ "$RESP_CODE" == "UP" ]]; then + echo 'SDC Helm Validator is ready' + break + fi + + echo 'Waiting for SDC Helm Validator to start up...' + sleep 10s +done + +echo HELM_VALIDATOR_IP=${HELM_VALIDATOR_IP} + +# Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v VALIDATOR:${HELM_VALIDATOR_IP}:8080" diff --git a/plans/sdc/sdc-helm-validator/teardown.sh b/plans/sdc/sdc-helm-validator/teardown.sh new file mode 100644 index 00000000..9916a424 --- /dev/null +++ b/plans/sdc/sdc-helm-validator/teardown.sh @@ -0,0 +1,7 @@ +#!/bin/bash +echo "Starting teardown script" + +running_container=$(docker ps --filter name=sdc-helm-validator -qa) + +docker stop $running_container +docker rm $running_container diff --git a/plans/optf-has/has/testplan.txt b/plans/sdc/sdc-helm-validator/testplan.txt similarity index 81% rename from plans/optf-has/has/testplan.txt rename to plans/sdc/sdc-helm-validator/testplan.txt index bf922705..9133005c 100644 --- a/plans/optf-has/has/testplan.txt +++ b/plans/sdc/sdc-helm-validator/testplan.txt @@ -1,3 +1,3 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -optf-has/has +sdc/sdc-helm-validator diff --git a/plans/sdnc/healthcheck/setup.sh b/plans/sdnc/healthcheck/setup.sh index a11a3aa5..2934cd58 100755 --- a/plans/sdnc/healthcheck/setup.sh +++ b/plans/sdnc/healthcheck/setup.sh @@ -15,17 +15,49 @@ # 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: -SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source ${WORKSPACE}/scripts/sdnc/script1.sh - +set -x export NEXUS_USERNAME=docker export NEXUS_PASSWD=docker export NEXUS_DOCKER_REPO=nexus3.onap.org:10001 export DMAAP_TOPIC=AUTO -export DOCKER_IMAGE_VERSION=1.8-STAGING-latest -export CCSDK_DOCKER_IMAGE_VERSION=0.7-STAGING-latest +export DOCKER_IMAGE_VERSION=2.1-STAGING-latest +export CCSDK_DOCKER_IMAGE_VERSION=1.1-STAGING-latest + +# Set credentials +export MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-mySecretPassword} +export MYSQL_USER=${MYSQL_USER:-sdnc} +export MYSQL_PASSWORD=${MYSQL_PASSWORD:-test123} +export MYSQL_DATABASE=${MYSQL_DATABASE:-sdncdb} +export ODL_USER=${ODL_USER:-admin} +export ODL_PASSWORD=${ODL_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} +export ODL_ADMIN_USER=${ODL_ADMIN_USER:-${ODL_USER}} +export ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-${ODL_PASSWORD}} +export DMAAP_USER=${DMAAP_USER:-admin} +export DMAAP_PASSWORD=${DMAAP_PASSWORD:-admin} +export DMAAP_AUTHKEY=${DMAAP_AUTHKEY:-""} +export AAI_TRUSTSTORE_PASSWORD=${AAI_TRUSTSTORE_PASSWORD:-changeit} +export AAI_CLIENT_NAME=${AAI_CLIENT_NAME:-sdnc@sdnc.onap.org} +export AAI_CLIENT_PASSWORD=${AAI_CLIENT_PASSWORD:-demo123456!} +export ANSIBLE_TRUSTSTORE_PASSWORD=${ANSIBLE_TRUSTSTURE_PASSWORD:-changeit} +export HONEYCOMB_USER=${HONEYCOMB_USER:-admin} +export HONEYCOMB_PASSWORD=${HONEYCOMB_PASSWORD:-admin} +export TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD:-changeit} +export KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD:-adminadmin} +export NENG_USER=${NENG_USER:-ccsdkapps} +export NENG_PASSWORD=${NENG_PASSWORD:-ccsdkapps} +export SO_USER=${SO_USER:-sdncaBpmn} +export SO_PASSWORD=${SO_PASSWORD:-password1$} +export CDS_USER=${CDS_USER:-ccsdkapps} +export CDS_PASSWORD=${CDS_PASSWORD:-ccsdkapps} +export ANSIBLE_USER=${ANSIBLE_USER:-sdnc} +export ANSIBLE_PASSWORD=${ANSIBLE_PASSWORD:-sdnc} +export SQL_CRYPTKEY=${SQL_CRYPTKEY:-fakECryptKey} +export ASDC_USER=${ASDC_USER:-sdnc} +export ASDC_PASSWORD=${ASDC_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} + export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) @@ -55,9 +87,6 @@ docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ansible-server-image:$DOCKER_IMAGE_VERSI docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:latest -docker pull $NEXUS_DOCKER_REPO/onap/admportal-sdnc-image:$DOCKER_IMAGE_VERSION -docker tag $NEXUS_DOCKER_REPO/onap/admportal-sdnc-image:$DOCKER_IMAGE_VERSION onap/admportal-sdnc-image:latest - docker pull $NEXUS_DOCKER_REPO/onap/sdnc-ueb-listener-image:$DOCKER_IMAGE_VERSION docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ueb-listener-image:$DOCKER_IMAGE_VERSION onap/sdnc-ueb-listener-image:latest @@ -69,36 +98,17 @@ docker tag $NEXUS_DOCKER_REPO/onap/sdnc-dmaap-listener-image:$DOCKER_IMAGE_VERSI # start SDNC containers with docker compose and configuration from docker-compose.yml docker-compose up -d -# WAIT 10 minutes maximum and test every 5 seconds if SDNC is up using HealthCheck API -TIME_OUT=1000 -INTERVAL=30 -TIME=0 -while [ "$TIME" -lt "$TIME_OUT" ]; do - 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-sdnc" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8282/restconf/operations/SLI-API:healthcheck ); echo $response - - if [ "$response" == "200" ]; then - echo SDNC started in $TIME seconds - break; - fi - - echo Sleep: $INTERVAL seconds before testing if SDNC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds - sleep $INTERVAL - TIME=$(($TIME+$INTERVAL)) -done - -if [ "$TIME" -ge "$TIME_OUT" ]; then - echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for testing activities... -fi +# WAIT 5 minutes maximum and check karaf.log for readiness every 10 seconds -#sleep 800 +TIME_OUT=300 +INTERVAL=10 -TIME_OUT=1500 -INTERVAL=60 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do - response=$(docker exec -ti sdnc_controller_container /opt/opendaylight/current/bin/client system:start-level) - if grep -q 'Level 100' <<< ${response}; then +docker exec sdnc_controller_container cat /opt/opendaylight/data/log/karaf.log | grep 'warp coils' + + if [ $? == 0 ] ; then echo SDNC karaf started in $TIME seconds break; fi @@ -109,24 +119,19 @@ while [ "$TIME" -lt "$TIME_OUT" ]; do done if [ "$TIME" -ge "$TIME_OUT" ]; then - echo TIME OUT: karaf session not started in $TIME_OUT seconds... Could cause problems for testing activities... + echo TIME OUT: karaf session not started in $TIME_OUT seconds, setup failed + exit 1; fi -response=$(docker exec -ti sdnc_controller_container /opt/opendaylight/current/bin/client system:start-level) - -if grep -q 'Level 100' <<< ${response} ; then - num_failed_bundles=$(docker exec sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l) - failed_bundles=$(docker exec sdnc_controller_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 +num_bundles=$(docker exec -i sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d' ' -f1) +num_failed_bundles=$(docker exec -i sdnc_controller_container /opt/opendaylight/current/bin/client bundle:list | grep Failure | wc -l) +failed_bundles=$(docker exec -i sdnc_controller_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. if [ "$num_failed_bundles" -ge 1 ]; then echo "The following bundle(s) are in a failed state: " echo " $failed_bundles" fi -# Sleep additional 5 minutes (300 secs) to give application time to finish -sleep 300 - # Pass any variables required by Robot test suites in ROBOT_VARIABLES ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}" diff --git a/plans/sdnc/sdnc_netconf_tls_post_deploy/sdnc-csit.env b/plans/sdnc/sdnc_netconf_tls_post_deploy/sdnc-csit.env index 45a0a204..d10b9b1c 100644 --- a/plans/sdnc/sdnc_netconf_tls_post_deploy/sdnc-csit.env +++ b/plans/sdnc/sdnc_netconf_tls_post_deploy/sdnc-csit.env @@ -2,7 +2,7 @@ GERRIT_BRANCH=master NEXUS_USERNAME=docker NEXUS_PASSWD=docker SDNC_CONTAINER_NAME=sdnc -SDNC_IMAGE_TAG=1.8.3-STAGING-latest +SDNC_IMAGE_TAG=2.1-STAGING-latest NEXUS_DOCKER_REPO=nexus3.onap.org:10001 CLIENT_CONTAINER_NAME=CertServiceClient SDNC_CERT_PATH=${SCRIPTS}/sdnc/sdnc/certs @@ -13,4 +13,36 @@ AAF_CERTSERVICE_SCRIPTS_PATH=${SCRIPTS}/sdnc/certservice/scripts TEMP_DIR_PATH=${WORKSPACE}/tests/sdnc/sdnc_netconf_tls_post_deploy/tmp NETCONF_CONFIG_PATH=${SCRIPTS}/sdnc/netconf-pnp-simulator/netconf-config AAF_INITIAL_CERTS=${WORKSPACE}/plans/sdnc/sdnc_netconf_tls_post_deploy/certs -AAF_CERTSERVICE_CONFIG_PATH=${SCRIPTS}/sdnc/certservice/config/cmpServers.json \ No newline at end of file +AAF_CERTSERVICE_CONFIG_PATH=${SCRIPTS}/sdnc/certservice/config/cmpServers.json + +# Set vars with default credentials +export MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-mySecretPassword} +export MYSQL_USER=${MYSQL_USER:-sdnc} +export MYSQL_PASSWORD=${MYSQL_PASSWORD:-test123} +export MYSQL_DATABASE=${MYSQL_DATABASE:-sdncdb} +export ODL_USER=${ODL_USER:-admin} +export ODL_PASSWORD=${ODL_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} +export ODL_ADMIN_USER=${ODL_ADMIN_USER:-${ODL_USER}} +export ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-${ODL_PASSWORD}} +export DMAAP_USER=${DMAAP_USER:-admin} +export DMAAP_PASSWORD=${DMAAP_PASSWORD:-admin} +export DMAAP_AUTHKEY=${DMAAP_AUTHKEY:-""} +export AAI_TRUSTSTORE_PASSWORD=${AAI_TRUSTSTORE_PASSWORD:-changeit} +export AAI_CLIENT_NAME=${AAI_CLIENT_NAME:-sdnc@sdnc.onap.org} +export AAI_CLIENT_PASSWORD=${AAI_CLIENT_PASSWORD:-demo123456!} +export ANSIBLE_TRUSTSTORE_PASSWORD=${ANSIBLE_TRUSTSTURE_PASSWORD:-changeit} +export HONEYCOMB_USER=${HONEYCOMB_USER:-admin} +export HONEYCOMB_PASSWORD=${HONEYCOMB_PASSWORD:-admin} +export TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD:-changeit} +export KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD:-adminadmin} +export NENG_USER=${NENG_USER:-ccsdkapps} +export NENG_PASSWORD=${NENG_PASSWORD:-ccsdkapps} +export SO_USER=${SO_USER:-sdncaBpmn} +export SO_PASSWORD=${SO_PASSWORD:-password1$} +export CDS_USER=${CDS_USER:-ccsdkapps} +export CDS_PASSWORD=${CDS_PASSWORD:-ccsdkapps} +export ANSIBLE_USER=${ANSIBLE_USER:-sdnc} +export ANSIBLE_PASSWORD=${ANSIBLE_PASSWORD:-sdnc} +export SQL_CRYPTKEY=${SQL_CRYPTKEY:-fakECryptKey} +export ASDC_USER=${ASDC_USER:-sdnc} +export ASDC_PASSWORD=${ASDC_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} diff --git a/plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh b/plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh index a2020aee..6f4e547e 100644 --- a/plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh +++ b/plans/sdnc/sdnc_netconf_tls_post_deploy/setup.sh @@ -2,6 +2,7 @@ # # ============LICENSE_START======================================================= # Copyright (C) 2020 Nordix Foundation. +# Modification copyright (C) 2021 Samsung Electronics, Co., Ltd. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,9 +30,6 @@ chmod +x "${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config # Export temp directory export TEMP_DIR_PATH=${TEMP_DIR_PATH} -# Create temp directory to bind with docker containers -mkdir -m 755 -p "${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/certs -mkdir -m 755 -p "${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/cert-data export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) @@ -59,55 +57,57 @@ pip install pyjks # Disable Proxy - for local run unset http_proxy https_proxy -# Export AAF Certservice config path -export AAF_INITIAL_CERTS -export EJBCA_CERTPROFILE_PATH -export AAF_CERTSERVICE_CONFIG_PATH -export AAF_CERTSERVICE_SCRIPTS_PATH -export CERT_PROFILE=${EJBCA_CERTPROFILE_PATH} -export SCRIPTS_PATH=${AAF_CERTSERVICE_SCRIPTS_PATH} -export CONFIGURATION_PATH=${AAF_CERTSERVICE_CONFIG_PATH} - -# Generate Keystores, Truststores, Certificates and Keys -make all -C ./certs/ - -cp "${WORKSPACE}"/plans/sdnc/sdnc_netconf_tls_post_deploy/certs/root.crt "${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/certs/root.crt -openssl pkcs12 -in "${WORKSPACE}"/plans/sdnc/sdnc_netconf_tls_post_deploy/certs/certServiceServer-keystore.p12 -clcerts -nokeys -password pass:secret | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' >"${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/certs/certServiceServer.crt -openssl pkcs12 -in "${WORKSPACE}"/plans/sdnc/sdnc_netconf_tls_post_deploy/certs/certServiceServer-keystore.p12 -nocerts -nodes -password pass:secret | sed -ne '/-BEGIN PRIVATE KEY-/,/-END PRIVATE KEY-/p' >"${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/certs/certServiceServer.key - -echo "Generated KeyStores, Server Certificate and Key" - -# Start EJBCA, AAF-CertService Containers with docker-compose and configuration from docker-compose.yml -docker-compose -f "${SCRIPTS}"/sdnc/certservice/docker-compose.yml up -d - -# Check if AAF-Certservice Service is healthy and ready -AAFCERT_IP='none' -for i in {1..9}; do - AAFCERT_IP=$(get-instance-ip.sh aaf-cert-service) - RESP_CODE=$(curl -s https://localhost:8443/actuator/health --cacert ./certs/root.crt --cert-type p12 --cert ./certs/certServiceServer-keystore.p12 --pass secret | - python2 -c 'import json,sys;obj=json.load(sys.stdin);print obj["status"]') - if [[ "${RESP_CODE}" == "UP" ]]; then - echo "AAF Cert Service is Ready." - export AAFCERT_IP=${AAFCERT_IP} - docker exec aafcert-ejbca /opt/primekey/scripts/ejbca-configuration.sh - break - fi - echo "Waiting for AAF Cert Service to Start Up..." - sleep 2m -done +###################### Netconf Simulator Setup ###################### -if [[ "${AAFCERT_IP}" == "none" || "${AAFCERT_IP}" == '' || "${RESP_CODE}" != "UP" ]]; then - echo "AAF CertService not started Could cause problems for testing activities...!" +# Get integration/simulators +if [ -d ${SCRIPTS}/sdnc/pnf-simulator ] +then + rm -rf ${SCRIPTS}/sdnc/pnf-simulator fi +mkdir ${SCRIPTS}/sdnc/pnf-simulator +git clone "https://gerrit.onap.org/r/integration/simulators/pnf-simulator" ${SCRIPTS}/sdnc/pnf-simulator + +# Fix docker-compose to add nexus repo for onap dockers +mv ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/docker-compose.yml ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/docker-compose.yml.orig +cat ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/docker-compose.yml.orig | sed -e "s/image: onap/image: nexus3.onap.org:10001\/onap/" > ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/docker-compose.yml + +# Remove carriage returns (if any) from netopeer start script +mv ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh.orig +cat ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh.orig | sed -e "s/\r$//g" > ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh +chmod 755 ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/netconf/initialize_netopeer.sh + + +# Start Netconf Simulator Container with docker-compose and configuration from docker-compose.yml +docker-compose -f "${SCRIPTS}"/sdnc/pnf-simulator/netconfsimulator/docker-compose.yml up -d + +# Add test user in netopeer container +sleep 60 +docker exec netconfsimulator_netopeer_1 useradd --system test + ############################## SDNC Setup ############################## +# Copy client certs from netconf simulator to SDNC certs directory +mkdir /tmp/keys0 +cp ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/tls/client.crt /tmp/keys0 +cp ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/tls/client.key /tmp/keys0 +cp ${SCRIPTS}/sdnc/pnf-simulator/netconfsimulator/tls/ca.crt /tmp/keys0/trustedCertificates.crt +cwd=$(pwd) +cd /tmp +zip -r $SDNC_CERT_PATH/keys0.zip keys0 +rm -rf /tmp/keys0 + # Export Mariadb, SDNC tmp, cert directory path export SDNC_CERT_PATH=${SDNC_CERT_PATH} docker pull "${NEXUS_DOCKER_REPO}"/onap/sdnc-image:"${SDNC_IMAGE_TAG}" docker tag "${NEXUS_DOCKER_REPO}"/onap/sdnc-image:"${SDNC_IMAGE_TAG}" onap/sdnc-image:latest +# Fix permissions on certs directory to guarantee directory is read/ +# writable and that files are readable +chmod ugo+rwx ${SCRIPTS}/sdnc/sdnc/certs +chmod ugo+r ${SCRIPTS}/sdnc/sdnc/certs/* + # Start Mariadb, SDNC Containers with docker-compose and configuration from docker-compose.yml docker-compose -f "${SCRIPTS}"/sdnc/sdnc/docker-compose.yml up -d @@ -120,47 +120,65 @@ for i in {1..10}; do break fi echo "Waiting for SDNC Service to Start Up..." - sleep 2m + sleep 30s done if [[ "${SDNC_IP}" == 'none' || "${SDNC_IP}" == '' || "${RESP_CODE}" != '200' ]]; then - echo "SDNC Service not started Could cause problems for testing activities...!" + echo "SDNC Service not started, setup failed" + exit 1 fi # Check if SDNC-ODL Karaf Session started -for i in {1..15}; do - EXEC_RESP=$(docker exec -it sdnc /opt/opendaylight/current/bin/client system:start-level) - if grep -q 'Level 100' <<<"${EXEC_RESP}"; then - echo "SDNC-ODL Karaf Session Started." - break +TIME_OUT=300 +INTERVAL=10 +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do + + docker exec sdnc cat /opt/opendaylight/data/log/karaf.log | grep 'warp coils' + + if [ $? == 0 ] ; then + echo SDNC karaf started in $TIME seconds + break; fi - echo "Waiting for SDNC-ODL Karaf Session to Start Up..." - sleep 2m + + echo Sleep: $INTERVAL seconds before testing if SDNC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds + sleep $INTERVAL + TIME=$(($TIME+$INTERVAL)) done -if ! grep -q 'Level 100' <<<"${EXEC_RESP}"; then - echo "SDNC-ODL Karaf Session not Started, Could cause problems for testing activities...!" +if [ "$TIME" -ge "$TIME_OUT" ]; then + echo TIME OUT: karaf session not started in $TIME_OUT seconds, setup failed + exit 1; fi -echo "Sleeping 5 minutes" -sleep 5m +# Check if certificate installation is done +TIME_OUT=300 +INTERVAL=10 +TIME=0 +while [ "$TIME" -lt "$TIME_OUT" ]; do -###################### Netconf-PNP-Simulator Setup ###################### + docker-compose -f "${SCRIPTS}"/sdnc/sdnc/docker-compose.yml logs sdnc | grep 'Everything OK in Certificate Installation' -# Export netconf-pnp simulator conf path -export NETCONF_CONFIG_PATH=${NETCONF_CONFIG_PATH} + if [ $? == 0 ] ; then + echo SDNC karaf started in $TIME seconds + break; + fi -# Start Netconf-Pnp-Simulator Container with docker-compose and configuration from docker-compose.yml -docker-compose -f "${SCRIPTS}"/sdnc/netconf-pnp-simulator/docker-compose.yml up -d + echo Sleep: $INTERVAL seconds before testing if SDNC is up. Total wait time up 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 # Update default Networking bridge IP in mount.json file sed -i "s/pnfaddr/${LOCAL_IP}/g" "${REQUEST_DATA_PATH}"/mount.xml ######################################################################### -echo "Sleeping additional for 3 minutes to give application time to finish" -sleep 3m - # Export SDNC, AAF-Certservice-Cient, Netconf-Pnp-Simulator Continer Names export REQUEST_DATA_PATH="${REQUEST_DATA_PATH}" export SDNC_CONTAINER_NAME="${SDNC_CONTAINER_NAME}" diff --git a/plans/sdnc/sdnc_netconf_tls_post_deploy/teardown.sh b/plans/sdnc/sdnc_netconf_tls_post_deploy/teardown.sh index b780ed49..bbf4d075 100644 --- a/plans/sdnc/sdnc_netconf_tls_post_deploy/teardown.sh +++ b/plans/sdnc/sdnc_netconf_tls_post_deploy/teardown.sh @@ -15,11 +15,8 @@ # limitations under the License. # -docker-compose -f "${SCRIPTS}"/sdnc/certservice/docker-compose.yml down -v + docker-compose -f "${SCRIPTS}"/sdnc/sdnc/docker-compose.yml down -v -docker-compose -f "${SCRIPTS}"/sdnc/netconf-pnp-simulator/docker-compose.yml down -v +docker-compose -f "${SCRIPTS}"/sdnc/pnf-simulator/netconfsimulator/docker-compose.yml down -v -make clear -C "${WORKSPACE}"/plans/sdnc/sdnc_netconf_tls_post_deploy/certs -rm -rf "${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/certs -rm -rf "${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/cert-data \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/customer.json b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/customer.json index 6c53c056..931e31eb 100644 --- a/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/customer.json +++ b/plans/so/integration-etsi-testing/config/aai-simulator-populate-data/customer.json @@ -67,6 +67,38 @@ } ] } + }, + { + "service-type": "NetworkService", + "relationship-list": { + "relationship": [ + { + "related-to": "tenant", + "relationship-label": "org.onap.relationships.inventory.Uses", + "related-link": "/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/xyzcloud/tenants/tenant/693c7729b2364a26a3ca602e6f66187d", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "CloudOwner" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "xyzcloud" + }, + { + "relationship-key": "tenant.tenant-id", + "relationship-value": "693c7729b2364a26a3ca602e6f66187d" + } + ], + "related-to-property": [ + { + "property-key": "tenant.tenant-name", + "property-value": "admin" + } + ] + } + ] + } } ] } diff --git a/plans/so/integration-etsi-testing/config/apply-workarounds.sh b/plans/so/integration-etsi-testing/config/apply-workarounds.sh index 21a3aeb8..4ecf880f 100755 --- a/plans/so/integration-etsi-testing/config/apply-workarounds.sh +++ b/plans/so/integration-etsi-testing/config/apply-workarounds.sh @@ -109,6 +109,8 @@ mysql -h $DB_HOST -uroot -p$MYSQL_ROOT_PASSWORD $CATALOG_DB << EOF UPDATE orchestration_status_state_transition_directive SET FLOW_DIRECTIVE='CONTINUE' WHERE RESOURCE_TYPE='VNF' AND ORCHESTRATION_STATUS='CREATED' AND TARGET_ACTION='ACTIVATE' AND FLOW_DIRECTIVE='FAIL'; + insert into cloud_sites(ID, REGION_ID, IDENTITY_SERVICE_ID, CLOUD_VERSION, CLLI, ORCHESTRATOR) values("EtsiCloudRegion", "EtsiCloudRegion", "DEFAULT_KEYSTONE", "2.5", "clli2", "multicloud"); + COMMIT; EOF diff --git a/plans/so/integration-etsi-testing/config/camunda-sql/mariadb_engine_7.10.0.sql b/plans/so/integration-etsi-testing/config/camunda-sql/mariadb_engine_7.10.0.sql new file mode 100644 index 00000000..b8062107 --- /dev/null +++ b/plans/so/integration-etsi-testing/config/camunda-sql/mariadb_engine_7.10.0.sql @@ -0,0 +1,1361 @@ +-- +-- Copyright © 2012 - 2018 camunda services GmbH and various authors (info@camunda.com) +-- +-- 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. +-- + +USE `camundabpmn`; + + +create table ACT_GE_PROPERTY ( + NAME_ varchar(64), + VALUE_ varchar(300), + REV_ integer, + primary key (NAME_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +insert into ACT_GE_PROPERTY +values ('schema.version', 'fox', 1); + +insert into ACT_GE_PROPERTY +values ('schema.history', 'create(fox)', 1); + +insert into ACT_GE_PROPERTY +values ('next.dbid', '1', 1); + +insert into ACT_GE_PROPERTY +values ('deployment.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('history.cleanup.job.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('startup.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('telemetry.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('installationId.lock', '0', 1); + +create table ACT_GE_BYTEARRAY ( + ID_ varchar(64), + REV_ integer, + NAME_ varchar(255), + DEPLOYMENT_ID_ varchar(64), + BYTES_ LONGBLOB, + GENERATED_ TINYINT, + TENANT_ID_ varchar(64), + TYPE_ integer, + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_GE_SCHEMA_LOG ( + ID_ varchar(64), + TIMESTAMP_ datetime(3), + VERSION_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +insert into ACT_GE_SCHEMA_LOG +values ('0', CURRENT_TIMESTAMP, '7.14.0'); + +create table ACT_RE_DEPLOYMENT ( + ID_ varchar(64), + NAME_ varchar(255), + DEPLOY_TIME_ datetime(3), + SOURCE_ varchar(255), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EXECUTION ( + ID_ varchar(64), + REV_ integer, + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + BUSINESS_KEY_ varchar(255), + PARENT_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SUPER_EXEC_ varchar(64), + SUPER_CASE_EXEC_ varchar(64), + CASE_INST_ID_ varchar(64), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + IS_ACTIVE_ TINYINT, + IS_CONCURRENT_ TINYINT, + IS_SCOPE_ TINYINT, + IS_EVENT_SCOPE_ TINYINT, + SUSPENSION_STATE_ integer, + CACHED_ENT_STATE_ integer, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ datetime(3) NULL, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROCESS_DEF_ID_ varchar(64), + PROCESS_DEF_KEY_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + FAILED_ACT_ID_ varchar(255), + DUEDATE_ datetime(3) NULL, + REPEAT_ varchar(255), + REPEAT_OFFSET_ bigint DEFAULT 0, + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + DEPLOYMENT_ID_ varchar(64), + SUSPENSION_STATE_ integer NOT NULL DEFAULT 1, + JOB_DEF_ID_ varchar(64), + PRIORITY_ bigint NOT NULL DEFAULT 0, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_JOBDEF ( + ID_ varchar(64) NOT NULL, + REV_ integer, + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ACT_ID_ varchar(255), + JOB_TYPE_ varchar(255) NOT NULL, + JOB_CONFIGURATION_ varchar(255), + SUSPENSION_STATE_ integer, + JOB_PRIORITY_ bigint, + TENANT_ID_ varchar(64), + DEPLOYMENT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RE_PROCDEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + HAS_START_FORM_KEY_ TINYINT, + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(64), + VERSION_TAG_ varchar(64), + HISTORY_TTL_ integer, + STARTABLE_ boolean NOT NULL default TRUE, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_TASK ( + ID_ varchar(64), + REV_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + TASK_DEF_KEY_ varchar(255), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + DELEGATION_ varchar(64), + PRIORITY_ integer, + CREATE_TIME_ datetime(3), + DUE_DATE_ datetime(3), + FOLLOW_UP_DATE_ datetime(3), + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_IDENTITYLINK ( + ID_ varchar(64), + REV_ integer, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_VARIABLE ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + TASK_ID_ varchar(64), + BATCH_ID_ varchar(64), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + VAR_SCOPE_ varchar(64) not null, + SEQUENCE_COUNTER_ bigint, + IS_CONCURRENT_LOCAL_ TINYINT, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EVENT_SUBSCR ( + ID_ varchar(64) not null, + REV_ integer, + EVENT_TYPE_ varchar(255) not null, + EVENT_NAME_ varchar(255), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTIVITY_ID_ varchar(255), + CONFIGURATION_ varchar(255), + CREATED_ datetime(3) not null, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_INCIDENT ( + ID_ varchar(64) not null, + REV_ integer not null, + INCIDENT_TIMESTAMP_ datetime(3) not null, + INCIDENT_MSG_ varchar(4000), + INCIDENT_TYPE_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + ACTIVITY_ID_ varchar(255), + FAILED_ACTIVITY_ID_ varchar(255), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CAUSE_INCIDENT_ID_ varchar(64), + ROOT_CAUSE_INCIDENT_ID_ varchar(64), + CONFIGURATION_ varchar(255), + TENANT_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_AUTHORIZATION ( + ID_ varchar(64) not null, + REV_ integer not null, + TYPE_ integer not null, + GROUP_ID_ varchar(255), + USER_ID_ varchar(255), + RESOURCE_TYPE_ integer not null, + RESOURCE_ID_ varchar(255), + PERMS_ integer, + REMOVAL_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_FILTER ( + ID_ varchar(64) not null, + REV_ integer not null, + RESOURCE_TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + OWNER_ varchar(255), + QUERY_ LONGTEXT not null, + PROPERTIES_ LONGTEXT, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_METER_LOG ( + ID_ varchar(64) not null, + NAME_ varchar(64) not null, + REPORTER_ varchar(255), + VALUE_ bigint, + TIMESTAMP_ datetime(3), + MILLISECONDS_ bigint DEFAULT 0, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EXT_TASK ( + ID_ varchar(64) not null, + REV_ integer not null, + WORKER_ID_ varchar(255), + TOPIC_NAME_ varchar(255), + RETRIES_ integer, + ERROR_MSG_ varchar(4000), + ERROR_DETAILS_ID_ varchar(64), + LOCK_EXP_TIME_ datetime(3) NULL, + SUSPENSION_STATE_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + TENANT_ID_ varchar(64), + PRIORITY_ bigint NOT NULL DEFAULT 0, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer not null, + TYPE_ varchar(255), + TOTAL_JOBS_ integer, + JOBS_CREATED_ integer, + JOBS_PER_SEED_ integer, + INVOCATIONS_PER_JOB_ integer, + SEED_JOB_DEF_ID_ varchar(64), + BATCH_JOB_DEF_ID_ varchar(64), + MONITOR_JOB_DEF_ID_ varchar(64), + SUSPENSION_STATE_ integer, + CONFIGURATION_ varchar(255), + TENANT_ID_ varchar(64), + CREATE_USER_ID_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_EXEC_ROOT_PI on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_); +create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_); +create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_); +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_); +create index ACT_IDX_TASK_OWNER on ACT_RU_TASK(OWNER_); +create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_); +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR_TENANT_ID on ACT_RU_EVENT_SUBSCR(TENANT_ID_); + +create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_); +create index ACT_IDX_VARIABLE_TENANT_ID on ACT_RU_VARIABLE(TENANT_ID_); +create index ACT_IDX_VARIABLE_TASK_NAME_TYPE on ACT_RU_VARIABLE(TASK_ID_, NAME_, TYPE_); + +create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_); +create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_); +create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_); +-- CAM-5914 +create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_); +-- this index needs to be limited in mariadb see CAM-6938 +create index ACT_IDX_JOB_HANDLER on ACT_RU_JOB(HANDLER_TYPE_(100),HANDLER_CFG_(155)); +create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_); +create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_); +create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_); + +-- new metric milliseconds column +CREATE INDEX ACT_IDX_METER_LOG_MS ON ACT_RU_METER_LOG(MILLISECONDS_); +CREATE INDEX ACT_IDX_METER_LOG_NAME_MS ON ACT_RU_METER_LOG(NAME_, MILLISECONDS_); +CREATE INDEX ACT_IDX_METER_LOG_REPORT ON ACT_RU_METER_LOG(NAME_, REPORTER_, MILLISECONDS_); + +-- old metric timestamp column +CREATE INDEX ACT_IDX_METER_LOG_TIME ON ACT_RU_METER_LOG(TIMESTAMP_); +CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_); + +create index ACT_IDX_EXT_TASK_TOPIC on ACT_RU_EXT_TASK(TOPIC_NAME_); +create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_); +create index ACT_IDX_EXT_TASK_PRIORITY ON ACT_RU_EXT_TASK(PRIORITY_); +create index ACT_IDX_EXT_TASK_ERR_DETAILS ON ACT_RU_EXT_TASK(ERROR_DETAILS_ID_); +create index ACT_IDX_AUTH_GROUP_ID ON ACT_RU_AUTHORIZATION(GROUP_ID_); +create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_); + +alter table ACT_GE_BYTEARRAY + add constraint ACT_FK_BYTEARR_DEPL + foreign key (DEPLOYMENT_ID_) + references ACT_RE_DEPLOYMENT (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade; + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PARENT + foreign key (PARENT_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_SUPER + foreign key (SUPER_EXEC_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_IDENTITYLINK + add constraint ACT_FK_TSKASS_TASK + foreign key (TASK_ID_) + references ACT_RU_TASK (ID_); + +alter table ACT_RU_IDENTITYLINK + add constraint ACT_FK_ATHRZ_PROCEDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF(ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION(ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EVENT_SUBSCR + add constraint ACT_FK_EVENT_EXEC + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION(ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_CAUSE + foreign key (CAUSE_INCIDENT_ID_) + references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade; + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_RCAUSE + foreign key (ROOT_CAUSE_INCIDENT_ID_) + references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade; + +alter table ACT_RU_EXT_TASK + add constraint ACT_FK_EXT_TASK_ERROR_DETAILS + foreign key (ERROR_DETAILS_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_INC_JOB_DEF on ACT_RU_INCIDENT(JOB_DEF_ID_); +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_JOB_DEF + foreign key (JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +alter table ACT_RU_AUTHORIZATION + add constraint ACT_UNIQ_AUTH_USER + unique (USER_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_); + +alter table ACT_RU_AUTHORIZATION + add constraint ACT_UNIQ_AUTH_GROUP + unique (GROUP_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_UNIQ_VARIABLE + unique (VAR_SCOPE_, NAME_); + +alter table ACT_RU_EXT_TASK + add constraint ACT_FK_EXT_TASK_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +create index ACT_IDX_BATCH_SEED_JOB_DEF ON ACT_RU_BATCH(SEED_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_SEED_JOB_DEF + foreign key (SEED_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_MONITOR_JOB_DEF ON ACT_RU_BATCH(MONITOR_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_MONITOR_JOB_DEF + foreign key (MONITOR_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_JOB_DEF ON ACT_RU_BATCH(BATCH_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_JOB_DEF + foreign key (BATCH_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_ID ON ACT_RU_VARIABLE(BATCH_ID_); +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BATCH + foreign key (BATCH_ID_) + references ACT_RU_BATCH (ID_); + +-- indexes for deadlock problems - https://app.camunda.com/jira/browse/CAM-2567 -- +create index ACT_IDX_INC_CAUSEINCID on ACT_RU_INCIDENT(CAUSE_INCIDENT_ID_); +create index ACT_IDX_INC_EXID on ACT_RU_INCIDENT(EXECUTION_ID_); +create index ACT_IDX_INC_PROCDEFID on ACT_RU_INCIDENT(PROC_DEF_ID_); +create index ACT_IDX_INC_PROCINSTID on ACT_RU_INCIDENT(PROC_INST_ID_); +create index ACT_IDX_INC_ROOTCAUSEINCID on ACT_RU_INCIDENT(ROOT_CAUSE_INCIDENT_ID_); +-- index for deadlock problem - https://app.camunda.com/jira/browse/CAM-4440 -- +create index ACT_IDX_AUTH_RESOURCE_ID on ACT_RU_AUTHORIZATION(RESOURCE_ID_); +-- index to prevent deadlock on fk constraint - https://app.camunda.com/jira/browse/CAM-5440 -- +create index ACT_IDX_EXT_TASK_EXEC on ACT_RU_EXT_TASK(EXECUTION_ID_); + +-- indexes to improve deployment +create index ACT_IDX_BYTEARRAY_ROOT_PI on ACT_GE_BYTEARRAY(ROOT_PROC_INST_ID_); +create index ACT_IDX_BYTEARRAY_RM_TIME on ACT_GE_BYTEARRAY(REMOVAL_TIME_); +create index ACT_IDX_BYTEARRAY_NAME on ACT_GE_BYTEARRAY(NAME_); +create index ACT_IDX_DEPLOYMENT_NAME on ACT_RE_DEPLOYMENT(NAME_); +create index ACT_IDX_DEPLOYMENT_TENANT_ID on ACT_RE_DEPLOYMENT(TENANT_ID_); +create index ACT_IDX_JOBDEF_PROC_DEF_ID ON ACT_RU_JOBDEF(PROC_DEF_ID_); +create index ACT_IDX_JOB_HANDLER_TYPE ON ACT_RU_JOB(HANDLER_TYPE_); +create index ACT_IDX_EVENT_SUBSCR_EVT_NAME ON ACT_RU_EVENT_SUBSCR(EVENT_NAME_); +create index ACT_IDX_PROCDEF_DEPLOYMENT_ID ON ACT_RE_PROCDEF(DEPLOYMENT_ID_); +create index ACT_IDX_PROCDEF_TENANT_ID ON ACT_RE_PROCDEF(TENANT_ID_); +create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); + +-- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 +create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +-- create case definition table -- +create table ACT_RE_CASE_DEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + TENANT_ID_ varchar(64), + HISTORY_TTL_ integer, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create case execution table -- +create table ACT_RU_CASE_EXECUTION ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CASE_INST_ID_ varchar(64), + SUPER_CASE_EXEC_ varchar(64), + SUPER_EXEC_ varchar(64), + BUSINESS_KEY_ varchar(255), + PARENT_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + ACT_ID_ varchar(255), + PREV_STATE_ integer, + CURRENT_STATE_ integer, + REQUIRED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create case sentry part table -- + +create table ACT_RU_CASE_SENTRY_PART ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CASE_INST_ID_ varchar(64), + CASE_EXEC_ID_ varchar(64), + SENTRY_ID_ varchar(255), + TYPE_ varchar(255), + SOURCE_CASE_EXEC_ID_ varchar(64), + STANDARD_EVENT_ varchar(255), + SOURCE_ varchar(255), + VARIABLE_EVENT_ varchar(255), + VARIABLE_NAME_ varchar(255), + SATISFIED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create index on business key -- +create index ACT_IDX_CASE_EXEC_BUSKEY on ACT_RU_CASE_EXECUTION(BUSINESS_KEY_); + +-- https://app.camunda.com/jira/browse/CAM-9165 +create index ACT_IDX_CASE_EXE_CASE_INST on ACT_RU_CASE_EXECUTION(CASE_INST_ID_); + +-- create foreign key constraints on ACT_RU_CASE_EXECUTION -- +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_) on delete cascade on update cascade; + +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_PARENT + foreign key (PARENT_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_CASE_DEF + foreign key (CASE_DEF_ID_) + references ACT_RE_CASE_DEF(ID_); + +-- create foreign key constraints on ACT_RU_VARIABLE -- +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_CASE_EXE + foreign key (CASE_EXECUTION_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +-- create foreign key constraints on ACT_RU_TASK -- +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_CASE_EXE + foreign key (CASE_EXECUTION_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_CASE_DEF + foreign key (CASE_DEF_ID_) + references ACT_RE_CASE_DEF(ID_); + +-- create foreign key constraints on ACT_RU_CASE_SENTRY_PART -- +alter table ACT_RU_CASE_SENTRY_PART + add constraint ACT_FK_CASE_SENTRY_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_CASE_SENTRY_PART + add constraint ACT_FK_CASE_SENTRY_CASE_EXEC + foreign key (CASE_EXEC_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +create index ACT_IDX_CASE_DEF_TENANT_ID on ACT_RE_CASE_DEF(TENANT_ID_); +create index ACT_IDX_CASE_EXEC_TENANT_ID on ACT_RU_CASE_EXECUTION(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +-- create decision definition table -- +create table ACT_RE_DECISION_DEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + DEC_REQ_ID_ varchar(64), + DEC_REQ_KEY_ varchar(255), + TENANT_ID_ varchar(64), + HISTORY_TTL_ integer, + VERSION_TAG_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create decision requirements definition table -- +create table ACT_RE_DECISION_REQ_DEF ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) NOT NULL, + VERSION_ integer NOT NULL, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +alter table ACT_RE_DECISION_DEF + add constraint ACT_FK_DEC_REQ + foreign key (DEC_REQ_ID_) + references ACT_RE_DECISION_REQ_DEF(ID_); + +create index ACT_IDX_DEC_DEF_TENANT_ID on ACT_RE_DECISION_DEF(TENANT_ID_); +create index ACT_IDX_DEC_DEF_REQ_ID on ACT_RE_DECISION_DEF(DEC_REQ_ID_); +create index ACT_IDX_DEC_REQ_DEF_TENANT_ID on ACT_RE_DECISION_REQ_DEF(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +create table ACT_HI_PROCINST ( + ID_ varchar(64) not null, + PROC_INST_ID_ varchar(64) not null, + BUSINESS_KEY_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64) not null, + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + DURATION_ bigint, + START_USER_ID_ varchar(255), + START_ACT_ID_ varchar(255), + END_ACT_ID_ varchar(255), + SUPER_PROCESS_INSTANCE_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + SUPER_CASE_INSTANCE_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + DELETE_REASON_ varchar(4000), + TENANT_ID_ varchar(64), + STATE_ varchar(255), + primary key (ID_), + unique (PROC_INST_ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_ACTINST ( + ID_ varchar(64) not null, + PARENT_ACT_INST_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64) not null, + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64) not null, + EXECUTION_ID_ varchar(64) not null, + ACT_ID_ varchar(255) not null, + TASK_ID_ varchar(64), + CALL_PROC_INST_ID_ varchar(64), + CALL_CASE_INST_ID_ varchar(64), + ACT_NAME_ varchar(255), + ACT_TYPE_ varchar(255) not null, + ASSIGNEE_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + ACT_INST_STATE_ integer, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_TASKINST ( + ID_ varchar(64) not null, + TASK_DEF_KEY_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + DELETE_REASON_ varchar(4000), + PRIORITY_ integer, + DUE_DATE_ datetime(3), + FOLLOW_UP_DATE_ datetime(3), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_VARINST ( + ID_ varchar(64) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(100), + CREATE_TIME_ datetime(3), + REV_ integer, + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + STATE_ varchar(20), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_DETAIL ( + ID_ varchar(64) not null, + TYPE_ varchar(255) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + VAR_INST_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(255), + REV_ integer, + TIME_ datetime(3) not null, + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + OPERATION_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + INITIAL_ boolean, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_IDENTITYLINK ( + ID_ varchar(64) not null, + TIMESTAMP_ timestamp(3) not null, + TYPE_ varchar(255), + USER_ID_ varchar(255), + GROUP_ID_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + OPERATION_TYPE_ varchar(64), + ASSIGNER_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_COMMENT ( + ID_ varchar(64) not null, + TYPE_ varchar(255), + TIME_ datetime(3) not null, + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTION_ varchar(255), + MESSAGE_ varchar(4000), + FULL_MSG_ LONGBLOB, + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_ATTACHMENT ( + ID_ varchar(64) not null, + REV_ integer, + USER_ID_ varchar(255), + NAME_ varchar(255), + DESCRIPTION_ varchar(4000), + TYPE_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + URL_ varchar(4000), + CONTENT_ID_ varchar(64), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_OP_LOG ( + ID_ varchar(64) not null, + DEPLOYMENT_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + JOB_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + BATCH_ID_ varchar(64), + USER_ID_ varchar(255), + TIMESTAMP_ timestamp(3) not null, + OPERATION_TYPE_ varchar(64), + OPERATION_ID_ varchar(64), + ENTITY_TYPE_ varchar(30), + PROPERTY_ varchar(64), + ORG_VALUE_ varchar(4000), + NEW_VALUE_ varchar(4000), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + CATEGORY_ varchar(64), + EXTERNAL_TASK_ID_ varchar(64), + ANNOTATION_ varchar(4000), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_INCIDENT ( + ID_ varchar(64) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CREATE_TIME_ timestamp(3) not null, + END_TIME_ timestamp(3) null, + INCIDENT_MSG_ varchar(4000), + INCIDENT_TYPE_ varchar(255) not null, + ACTIVITY_ID_ varchar(255), + FAILED_ACTIVITY_ID_ varchar(255), + CAUSE_INCIDENT_ID_ varchar(64), + ROOT_CAUSE_INCIDENT_ID_ varchar(64), + CONFIGURATION_ varchar(255), + HISTORY_CONFIGURATION_ varchar(255), + INCIDENT_STATE_ integer, + TENANT_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_JOB_LOG ( + ID_ varchar(64) not null, + TIMESTAMP_ datetime(3) not null, + JOB_ID_ varchar(64) not null, + JOB_DUEDATE_ datetime(3) NULL, + JOB_RETRIES_ integer, + JOB_PRIORITY_ bigint NOT NULL DEFAULT 0, + JOB_EXCEPTION_MSG_ varchar(4000), + JOB_EXCEPTION_STACK_ID_ varchar(64), + JOB_STATE_ integer, + JOB_DEF_ID_ varchar(64), + JOB_DEF_TYPE_ varchar(255), + JOB_DEF_CONFIGURATION_ varchar(255), + ACT_ID_ varchar(255), + FAILED_ACT_ID_ varchar(255), + ROOT_PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROCESS_DEF_ID_ varchar(64), + PROCESS_DEF_KEY_ varchar(255), + DEPLOYMENT_ID_ varchar(64), + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + HOSTNAME_ varchar(255), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_BATCH ( + ID_ varchar(64) not null, + TYPE_ varchar(255), + TOTAL_JOBS_ integer, + JOBS_PER_SEED_ integer, + INVOCATIONS_PER_JOB_ integer, + SEED_JOB_DEF_ID_ varchar(64), + MONITOR_JOB_DEF_ID_ varchar(64), + BATCH_JOB_DEF_ID_ varchar(64), + TENANT_ID_ varchar(64), + CREATE_USER_ID_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_EXT_TASK_LOG ( + ID_ varchar(64) not null, + TIMESTAMP_ timestamp(3) not null, + EXT_TASK_ID_ varchar(64) not null, + RETRIES_ integer, + TOPIC_NAME_ varchar(255), + WORKER_ID_ varchar(255), + PRIORITY_ bigint NOT NULL DEFAULT 0, + ERROR_MSG_ varchar(4000), + ERROR_DETAILS_ID_ varchar(64), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + TENANT_ID_ varchar(64), + STATE_ integer, + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_); +create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_); +create index ACT_IDX_HI_PRO_INST_TENANT_ID on ACT_HI_PROCINST(TENANT_ID_); +create index ACT_IDX_HI_PRO_INST_PROC_DEF_KEY on ACT_HI_PROCINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_PRO_INST_PROC_TIME on ACT_HI_PROCINST(START_TIME_, END_TIME_); +create index ACT_IDX_HI_PI_PDEFID_END_TIME on ACT_HI_PROCINST(PROC_DEF_ID_, END_TIME_); +create index ACT_IDX_HI_PRO_INST_ROOT_PI on ACT_HI_PROCINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_PRO_INST_RM_TIME on ACT_HI_PROCINST(REMOVAL_TIME_); + +create index ACT_IDX_HI_ACTINST_ROOT_PI on ACT_HI_ACTINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_ACT_INST_START_END on ACT_HI_ACTINST(START_TIME_, END_TIME_); +create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_); +create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_); +create index ACT_IDX_HI_ACT_INST_COMP on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_, END_TIME_, ID_); +create index ACT_IDX_HI_ACT_INST_STATS on ACT_HI_ACTINST(PROC_DEF_ID_, PROC_INST_ID_, ACT_ID_, END_TIME_, ACT_INST_STATE_); +create index ACT_IDX_HI_ACT_INST_TENANT_ID on ACT_HI_ACTINST(TENANT_ID_); +create index ACT_IDX_HI_ACT_INST_PROC_DEF_KEY on ACT_HI_ACTINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_AI_PDEFID_END_TIME on ACT_HI_ACTINST(PROC_DEF_ID_, END_TIME_); +create index ACT_IDX_HI_ACT_INST_RM_TIME on ACT_HI_ACTINST(REMOVAL_TIME_); + +create index ACT_IDX_HI_TASKINST_ROOT_PI on ACT_HI_TASKINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_TASK_INST_TENANT_ID on ACT_HI_TASKINST(TENANT_ID_); +create index ACT_IDX_HI_TASK_INST_PROC_DEF_KEY on ACT_HI_TASKINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_TASKINST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_); +create index ACT_IDX_HI_TASKINSTID_PROCINST on ACT_HI_TASKINST(ID_,PROC_INST_ID_); +create index ACT_IDX_HI_TASK_INST_RM_TIME on ACT_HI_TASKINST(REMOVAL_TIME_); +create index ACT_IDX_HI_TASK_INST_START on ACT_HI_TASKINST(START_TIME_); +create index ACT_IDX_HI_TASK_INST_END on ACT_HI_TASKINST(END_TIME_); + +create index ACT_IDX_HI_DETAIL_ROOT_PI on ACT_HI_DETAIL(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_); +create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_); +create index ACT_IDX_HI_DETAIL_CASE_INST on ACT_HI_DETAIL(CASE_INST_ID_); +create index ACT_IDX_HI_DETAIL_CASE_EXEC on ACT_HI_DETAIL(CASE_EXECUTION_ID_); +create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_); +create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_); +create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_); +create index ACT_IDX_HI_DETAIL_TENANT_ID on ACT_HI_DETAIL(TENANT_ID_); +create index ACT_IDX_HI_DETAIL_PROC_DEF_KEY on ACT_HI_DETAIL(PROC_DEF_KEY_); +create index ACT_IDX_HI_DETAIL_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_); +create index ACT_IDX_HI_DETAIL_RM_TIME on ACT_HI_DETAIL(REMOVAL_TIME_); +create index ACT_IDX_HI_DETAIL_TASK_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_, TASK_ID_); +create index ACT_IDX_HI_DETAIL_VAR_INST_ID on ACT_HI_DETAIL(VAR_INST_ID_); + +create index ACT_IDX_HI_IDENT_LNK_ROOT_PI on ACT_HI_IDENTITYLINK(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_GROUP on ACT_HI_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_HI_IDENT_LNK_TENANT_ID on ACT_HI_IDENTITYLINK(TENANT_ID_); +create index ACT_IDX_HI_IDENT_LNK_PROC_DEF_KEY on ACT_HI_IDENTITYLINK(PROC_DEF_KEY_); +create index ACT_IDX_HI_IDENT_LINK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_); +create index ACT_IDX_HI_IDENT_LINK_RM_TIME on ACT_HI_IDENTITYLINK(REMOVAL_TIME_); +create index ACT_IDX_HI_IDENT_LNK_TIMESTAMP on ACT_HI_IDENTITYLINK(TIMESTAMP_); + +create index ACT_IDX_HI_VARINST_ROOT_PI on ACT_HI_VARINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_); +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_CASEVAR_CASE_INST on ACT_HI_VARINST(CASE_INST_ID_); +create index ACT_IDX_HI_VAR_INST_TENANT_ID on ACT_HI_VARINST(TENANT_ID_); +create index ACT_IDX_HI_VAR_INST_PROC_DEF_KEY on ACT_HI_VARINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_VARINST_BYTEAR on ACT_HI_VARINST(BYTEARRAY_ID_); +create index ACT_IDX_HI_VARINST_RM_TIME on ACT_HI_VARINST(REMOVAL_TIME_); +create index ACT_IDX_HI_VAR_PI_NAME_TYPE on ACT_HI_VARINST(PROC_INST_ID_, NAME_, VAR_TYPE_); + +create index ACT_IDX_HI_INCIDENT_TENANT_ID on ACT_HI_INCIDENT(TENANT_ID_); +create index ACT_IDX_HI_INCIDENT_PROC_DEF_KEY on ACT_HI_INCIDENT(PROC_DEF_KEY_); +create index ACT_IDX_HI_INCIDENT_ROOT_PI on ACT_HI_INCIDENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_INCIDENT_PROCINST on ACT_HI_INCIDENT(PROC_INST_ID_); +create index ACT_IDX_HI_INCIDENT_RM_TIME on ACT_HI_INCIDENT(REMOVAL_TIME_); +create index ACT_IDX_HI_INCIDENT_CREATE_TIME on ACT_HI_INCIDENT(CREATE_TIME_); +create index ACT_IDX_HI_INCIDENT_END_TIME on ACT_HI_INCIDENT(END_TIME_); + +create index ACT_IDX_HI_JOB_LOG_ROOT_PI on ACT_HI_JOB_LOG(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_JOB_LOG_PROCINST on ACT_HI_JOB_LOG(PROCESS_INSTANCE_ID_); +create index ACT_IDX_HI_JOB_LOG_PROCDEF on ACT_HI_JOB_LOG(PROCESS_DEF_ID_); +create index ACT_IDX_HI_JOB_LOG_TENANT_ID on ACT_HI_JOB_LOG(TENANT_ID_); +create index ACT_IDX_HI_JOB_LOG_JOB_DEF_ID on ACT_HI_JOB_LOG(JOB_DEF_ID_); +create index ACT_IDX_HI_JOB_LOG_PROC_DEF_KEY on ACT_HI_JOB_LOG(PROCESS_DEF_KEY_); +create index ACT_IDX_HI_JOB_LOG_EX_STACK on ACT_HI_JOB_LOG(JOB_EXCEPTION_STACK_ID_); +create index ACT_IDX_HI_JOB_LOG_RM_TIME on ACT_HI_JOB_LOG(REMOVAL_TIME_); +create index ACT_IDX_HI_JOB_LOG_JOB_CONF on ACT_HI_JOB_LOG(JOB_DEF_CONFIGURATION_); + +create index ACT_HI_BAT_RM_TIME on ACT_HI_BATCH(REMOVAL_TIME_); + +create index ACT_HI_EXT_TASK_LOG_ROOT_PI on ACT_HI_EXT_TASK_LOG(ROOT_PROC_INST_ID_); +create index ACT_HI_EXT_TASK_LOG_PROCINST on ACT_HI_EXT_TASK_LOG(PROC_INST_ID_); +create index ACT_HI_EXT_TASK_LOG_PROCDEF on ACT_HI_EXT_TASK_LOG(PROC_DEF_ID_); +create index ACT_HI_EXT_TASK_LOG_PROC_DEF_KEY on ACT_HI_EXT_TASK_LOG(PROC_DEF_KEY_); +create index ACT_HI_EXT_TASK_LOG_TENANT_ID on ACT_HI_EXT_TASK_LOG(TENANT_ID_); +create index ACT_IDX_HI_EXTTASKLOG_ERRORDET on ACT_HI_EXT_TASK_LOG(ERROR_DETAILS_ID_); +create index ACT_HI_EXT_TASK_LOG_RM_TIME on ACT_HI_EXT_TASK_LOG(REMOVAL_TIME_); + +create index ACT_IDX_HI_OP_LOG_ROOT_PI on ACT_HI_OP_LOG(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_OP_LOG_PROCINST on ACT_HI_OP_LOG(PROC_INST_ID_); +create index ACT_IDX_HI_OP_LOG_PROCDEF on ACT_HI_OP_LOG(PROC_DEF_ID_); +create index ACT_IDX_HI_OP_LOG_TASK on ACT_HI_OP_LOG(TASK_ID_); +create index ACT_IDX_HI_OP_LOG_RM_TIME on ACT_HI_OP_LOG(REMOVAL_TIME_); +create index ACT_IDX_HI_OP_LOG_TIMESTAMP on ACT_HI_OP_LOG(TIMESTAMP_); +create index ACT_IDX_HI_OP_LOG_USER_ID on ACT_HI_OP_LOG(USER_ID_); +create index ACT_IDX_HI_OP_LOG_OP_TYPE on ACT_HI_OP_LOG(OPERATION_TYPE_); +create index ACT_IDX_HI_OP_LOG_ENTITY_TYPE on ACT_HI_OP_LOG(ENTITY_TYPE_); + +create index ACT_IDX_HI_COMMENT_TASK on ACT_HI_COMMENT(TASK_ID_); +create index ACT_IDX_HI_COMMENT_ROOT_PI on ACT_HI_COMMENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_COMMENT_PROCINST on ACT_HI_COMMENT(PROC_INST_ID_); +create index ACT_IDX_HI_COMMENT_RM_TIME on ACT_HI_COMMENT(REMOVAL_TIME_); + +create index ACT_IDX_HI_ATTACHMENT_CONTENT on ACT_HI_ATTACHMENT(CONTENT_ID_); +create index ACT_IDX_HI_ATTACHMENT_ROOT_PI on ACT_HI_ATTACHMENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_ATTACHMENT_PROCINST on ACT_HI_ATTACHMENT(PROC_INST_ID_); +create index ACT_IDX_HI_ATTACHMENT_TASK on ACT_HI_ATTACHMENT(TASK_ID_); +create index ACT_IDX_HI_ATTACHMENT_RM_TIME on ACT_HI_ATTACHMENT(REMOVAL_TIME_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +create table ACT_HI_CASEINST ( + ID_ varchar(64) not null, + CASE_INST_ID_ varchar(64) not null, + BUSINESS_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64) not null, + CREATE_TIME_ datetime(3) not null, + CLOSE_TIME_ datetime(3), + DURATION_ bigint, + STATE_ integer, + CREATE_USER_ID_ varchar(255), + SUPER_CASE_INSTANCE_ID_ varchar(64), + SUPER_PROCESS_INSTANCE_ID_ varchar(64), + TENANT_ID_ varchar(64), + primary key (ID_), + unique (CASE_INST_ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_CASEACTINST ( + ID_ varchar(64) not null, + PARENT_ACT_INST_ID_ varchar(64), + CASE_DEF_ID_ varchar(64) not null, + CASE_INST_ID_ varchar(64) not null, + CASE_ACT_ID_ varchar(255) not null, + TASK_ID_ varchar(64), + CALL_PROC_INST_ID_ varchar(64), + CALL_CASE_INST_ID_ varchar(64), + CASE_ACT_NAME_ varchar(255), + CASE_ACT_TYPE_ varchar(255), + CREATE_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + STATE_ integer, + REQUIRED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_CAS_I_CLOSE on ACT_HI_CASEINST(CLOSE_TIME_); +create index ACT_IDX_HI_CAS_I_BUSKEY on ACT_HI_CASEINST(BUSINESS_KEY_); +create index ACT_IDX_HI_CAS_I_TENANT_ID on ACT_HI_CASEINST(TENANT_ID_); +create index ACT_IDX_HI_CAS_A_I_CREATE on ACT_HI_CASEACTINST(CREATE_TIME_); +create index ACT_IDX_HI_CAS_A_I_END on ACT_HI_CASEACTINST(END_TIME_); +create index ACT_IDX_HI_CAS_A_I_COMP on ACT_HI_CASEACTINST(CASE_ACT_ID_, END_TIME_, ID_); +create index ACT_IDX_HI_CAS_A_I_CASEINST on ACT_HI_CASEACTINST(CASE_INST_ID_, CASE_ACT_ID_); +create index ACT_IDX_HI_CAS_A_I_TENANT_ID on ACT_HI_CASEACTINST(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +-- create history decision instance table -- +create table ACT_HI_DECINST ( + ID_ varchar(64) NOT NULL, + DEC_DEF_ID_ varchar(64) NOT NULL, + DEC_DEF_KEY_ varchar(255) NOT NULL, + DEC_DEF_NAME_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + ACT_ID_ varchar(255), + EVAL_TIME_ datetime(3) not null, + REMOVAL_TIME_ datetime(3), + COLLECT_VALUE_ double, + USER_ID_ varchar(255), + ROOT_DEC_INST_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + DEC_REQ_ID_ varchar(64), + DEC_REQ_KEY_ varchar(255), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create history decision input table -- +create table ACT_HI_DEC_IN ( + ID_ varchar(64) NOT NULL, + DEC_INST_ID_ varchar(64) NOT NULL, + CLAUSE_ID_ varchar(64), + CLAUSE_NAME_ varchar(255), + VAR_TYPE_ varchar(100), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create history decision output table -- +create table ACT_HI_DEC_OUT ( + ID_ varchar(64) NOT NULL, + DEC_INST_ID_ varchar(64) NOT NULL, + CLAUSE_ID_ varchar(64), + CLAUSE_NAME_ varchar(255), + RULE_ID_ varchar(64), + RULE_ORDER_ integer, + VAR_NAME_ varchar(255), + VAR_TYPE_ varchar(100), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + + +create index ACT_IDX_HI_DEC_INST_ID on ACT_HI_DECINST(DEC_DEF_ID_); +create index ACT_IDX_HI_DEC_INST_KEY on ACT_HI_DECINST(DEC_DEF_KEY_); +create index ACT_IDX_HI_DEC_INST_PI on ACT_HI_DECINST(PROC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_CI on ACT_HI_DECINST(CASE_INST_ID_); +create index ACT_IDX_HI_DEC_INST_ACT on ACT_HI_DECINST(ACT_ID_); +create index ACT_IDX_HI_DEC_INST_ACT_INST on ACT_HI_DECINST(ACT_INST_ID_); +create index ACT_IDX_HI_DEC_INST_TIME on ACT_HI_DECINST(EVAL_TIME_); +create index ACT_IDX_HI_DEC_INST_TENANT_ID on ACT_HI_DECINST(TENANT_ID_); +create index ACT_IDX_HI_DEC_INST_ROOT_ID on ACT_HI_DECINST(ROOT_DEC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_REQ_ID on ACT_HI_DECINST(DEC_REQ_ID_); +create index ACT_IDX_HI_DEC_INST_REQ_KEY on ACT_HI_DECINST(DEC_REQ_KEY_); +create index ACT_IDX_HI_DEC_INST_ROOT_PI on ACT_HI_DECINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_RM_TIME on ACT_HI_DECINST(REMOVAL_TIME_); + + +create index ACT_IDX_HI_DEC_IN_INST on ACT_HI_DEC_IN(DEC_INST_ID_); +create index ACT_IDX_HI_DEC_IN_CLAUSE on ACT_HI_DEC_IN(DEC_INST_ID_, CLAUSE_ID_); +create index ACT_IDX_HI_DEC_IN_ROOT_PI on ACT_HI_DEC_IN(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_IN_RM_TIME on ACT_HI_DEC_IN(REMOVAL_TIME_); + +create index ACT_IDX_HI_DEC_OUT_INST on ACT_HI_DEC_OUT(DEC_INST_ID_); +create index ACT_IDX_HI_DEC_OUT_RULE on ACT_HI_DEC_OUT(RULE_ORDER_, CLAUSE_ID_); +create index ACT_IDX_HI_DEC_OUT_ROOT_PI on ACT_HI_DEC_OUT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_OUT_RM_TIME on ACT_HI_DEC_OUT(REMOVAL_TIME_); + diff --git a/plans/so/integration-etsi-testing/config/distribution-test-zip/macro_zipped_sdc_csar.tar.gz b/plans/so/integration-etsi-testing/config/distribution-test-zip/macro_zipped_sdc_csar.tar.gz new file mode 100755 index 00000000..f826c2eb Binary files /dev/null and b/plans/so/integration-etsi-testing/config/distribution-test-zip/macro_zipped_sdc_csar.tar.gz differ 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 old mode 100644 new mode 100755 index d0e346f3..209dfca4 Binary files a/plans/so/integration-etsi-testing/config/distribution-test-zip/zipped_sdc_csar.tar.gz and b/plans/so/integration-etsi-testing/config/distribution-test-zip/zipped_sdc_csar.tar.gz differ diff --git a/plans/so/integration-etsi-testing/config/env b/plans/so/integration-etsi-testing/config/env index 647f53a6..77e6d564 100644 --- a/plans/so/integration-etsi-testing/config/env +++ b/plans/so/integration-etsi-testing/config/env @@ -1,6 +1,11 @@ NEXUS_DOCKER_REPO_MSO=nexus3.onap.org:10001 DOCKER_ENVIRONMENT=remote -TAG=1.6.0 +TAG=1.8.0-STAGING-latest TIME_OUT_DEFAULT_VALUE_SEC=1200 PROJECT_NAME=etsiintegrationtesting DEFAULT_NETWORK_NAME=etsiintegrationtesting_default +ETSI_CATALOG_IMAGE_VERSION=1.0.9 +SOL_003_ADAPTER_IMAGE_VERSION=1.8.2 +ETSI_NFVO_NS_LCM_IMAGE_VERSION=1.8.2 +SO_ADMIN_COCKPIT_IMAGE_VERSION=1.8.2 +MARIADB_VERSION=10.5.8 diff --git a/plans/so/integration-etsi-testing/config/override-files/api-handler-infra/onapheat/override.yaml b/plans/so/integration-etsi-testing/config/override-files/api-handler-infra/onapheat/override.yaml index bdf5c4de..327e7987 100644 --- a/plans/so/integration-etsi-testing/config/override-files/api-handler-infra/onapheat/override.yaml +++ b/plans/so/integration-etsi-testing/config/override-files/api-handler-infra/onapheat/override.yaml @@ -131,3 +131,5 @@ org: adapters: network: encryptionKey: 07a7159d3bf51a0e53be7a8f89699be7 +aai: + auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885 diff --git a/plans/so/integration-etsi-testing/config/override-files/bpmn-infra/onapheat/override.yaml b/plans/so/integration-etsi-testing/config/override-files/bpmn-infra/onapheat/override.yaml index 684c675e..df831c0b 100644 --- a/plans/so/integration-etsi-testing/config/override-files/bpmn-infra/onapheat/override.yaml +++ b/plans/so/integration-etsi-testing/config/override-files/bpmn-infra/onapheat/override.yaml @@ -358,7 +358,7 @@ spring: so: vnfm: adapter: - url: http://so-vnfm-adapter:9092/so/vnfm-adapter/v1/ + url: http://so-etsi-sol003-adapter.onap:9092/so/vnfm-adapter/v1/ auth: Basic dm5mbTpwYXNzd29yZDEk org: onap: diff --git a/plans/so/integration-etsi-testing/config/override-files/openstack-adapter/onapheat/override.yaml b/plans/so/integration-etsi-testing/config/override-files/openstack-adapter/onapheat/override.yaml new file mode 100644 index 00000000..7e2afa85 --- /dev/null +++ b/plans/so/integration-etsi-testing/config/override-files/openstack-adapter/onapheat/override.yaml @@ -0,0 +1,147 @@ +server: + port: 8087 + +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: false + + security: + usercredentials: + - + username: sdnc + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SDNC-Client + - + username: sitecontrol + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SiteControl-Client + - + username: bpel + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - + username: sniro + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SNIRO-Client + - + username: apih + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: MSO-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR + + +org: + onap: + so: + adapters: + default_keystone_url_version: /v2.0 + default_keystone_reg_ex: "/[vV][0-9]" + vnf: + bpelauth: D1A67FA93B6A6419132D0F83CC771AF774FD3C60853C50C22C8C6FC5088CC79E9E81EDE9EA39F22B2F66A0068E + checkRequiredParameters: true + addGetFilesOnVolumeReq: false + sockettimeout: 30 + connecttimeout: 30 + retrycount: 5 + retryinterval: -15 + retrylist: 408,429,500,502,503,504,900 + valet_enabled: false + fail_requests_on_valet_failure: false + network: + bpelauth: D1A67FA93B6A6419132D0F83CC771AF774FD3C60853C50C22C8C6FC5088CC79E9E81EDE9EA39F22B2F66A0068E + sockettimeout: 5 + connecttimeout: 5 + retrycount: 5 + retryinterval: -15 + retrylist: 408,429,500,502,503,504,900 + encryptionKey: 07a7159d3bf51a0e53be7a8f89699be7 + tenant: + default_keystone_url_version: /v2.0 + default_keystone_reg_ex: "/[vV][0-9]" + default_tenant_description: Tenant + default_region_type: single + default_user_role: admin + default_success_status_string: Success + default_no_regions_status_string: no regions + default_quota_value: 10 + set_default_quota: false + +ecomp: + mso: + adapters: + po: + retryCodes: 504 + retryDelay: 5 + retryCount: 3 + pollTimeout: 7500 + pollInterval: 15 + +mso: + adapters: + requestDb: + endpoint: http://so-request-db-adapter.onap:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + auth: BEA8637716A7EB617DF472BA6552D22F68C1CB17B0D094D77DDA562F4ADAAC4457CAB848E1A4 + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + logPath: ./logs/openstack + msb-ip: multicloud-simulator + msb-port: 9996 + msb-scheme: http + workflow: + endpoint: http://bpmn-infra:8081/sobpmnengine + config: + cadi: + aafId: poBpmn + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + site-name: localDevEnv + async: + core-pool-size: 50 + max-pool-size: 50 + queue-capacity: 500 + +cloud_config: + identity_services: + RAX_KEYSTONE: + identity_url: "https://identity.api.rackspacecloud.com/v2.0" + mso_id: "RACKSPACE_ACCOUNT_ID" + mso_pass: "RACKSPACE_ACCOUNT_APIKEY" + admin_tenant: "service" + member_role: "admin" + tenant_metadata: true + identity_server_type: "KEYSTONE" + identity_authentication_type: "RACKSPACE_APIKEY" + cloud_sites: + Dallas: + region_id: "DFW" + clli: "DFW" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + Northern Virginia: + region_id: "IAD" + clli: "IAD" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + Chicago: + region_id: "ORD" + clli: "ORD" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + DEFAULT: + region_id: "DFW" + clli: "DFW" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" diff --git a/plans/so/integration-etsi-testing/config/override-files/so-etsi-nfvo-ns-lcm/onapheat/override.yaml b/plans/so/integration-etsi-testing/config/override-files/so-etsi-nfvo-ns-lcm/onapheat/override.yaml new file mode 100644 index 00000000..8b1a72c6 --- /dev/null +++ b/plans/so/integration-etsi-testing/config/override-files/so-etsi-nfvo-ns-lcm/onapheat/override.yaml @@ -0,0 +1,47 @@ +aai: + auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885 + version: v15 + endpoint: https://aai-simulator:9993 +spring: + datasource: + hikari: + camunda: + jdbcUrl: jdbc:mariadb://mariadb:3306/camundabpmn + username: so_user + password: so_User123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: bpmn-pool + registerMbeans: true + nfvo: + jdbcUrl: jdbc:mariadb://mariadb:3306/nfvo + username: so_admin + password: so_Admin123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: nfvo-pool + registerMbeans: true + security: + usercredentials: + - username: so-etsi-nfvo-ns-lcm + password: $2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke + role: ETSI-NFVO-Client +server: + port: 9095 + tomcat: + max-threads: 50 +mso: + key: 07a7159d3bf51a0e53be7a8f89699be7 +so: + adapters: + sol003-adapter: + url: http://so-etsi-sol003-adapter:9092/so/vnfm-adapter/v1 + auth: Basic dm5mbTpwYXNzd29yZDEk +etsi-catalog-manager: + base: + endpoint: http://modeling-etsicatalog:8806/api +camunda: + bpm: + history-level: full + job-execution: + max-pool-size: 30 + core-pool-size: 3 + deployment-aware: true diff --git a/plans/so/integration-etsi-testing/config/override-files/so-vnfm-adapter/onapheat/override.yaml b/plans/so/integration-etsi-testing/config/override-files/so-vnfm-adapter/onapheat/override.yaml index 99c9dbd0..ee939021 100644 --- a/plans/so/integration-etsi-testing/config/override-files/so-vnfm-adapter/onapheat/override.yaml +++ b/plans/so/integration-etsi-testing/config/override-files/so-vnfm-adapter/onapheat/override.yaml @@ -28,7 +28,7 @@ sdc: endpoint: http://sdc-simulator:9991/ toscametapath: Artifacts/Deployment/OTHER/TOSCA.meta vnfmadapter: - endpoint: http://so-vnfm-adapter:9092 + endpoint: http://so-etsi-sol003-adapter.onap:9092 etsi-catalog-manager: vnfpkgm: endpoint: http://modeling-etsicatalog:8806/api/vnfpkgm/v1 diff --git a/plans/so/integration-etsi-testing/config/override-files/vnfm-simulator/onapheat/override.yaml b/plans/so/integration-etsi-testing/config/override-files/vnfm-simulator/onapheat/override.yaml index 05cb1e56..3adfe78d 100644 --- a/plans/so/integration-etsi-testing/config/override-files/vnfm-simulator/onapheat/override.yaml +++ b/plans/so/integration-etsi-testing/config/override-files/vnfm-simulator/onapheat/override.yaml @@ -21,17 +21,17 @@ server: tomcat: max-threads: 50 ssl: - client-auth: need - key-alias: so@so.onap.org - key--store-password: '7Em3&j4.19xYiMelhD5?xbQ.' - key-store: classpath:so-vnfm-simulator.p12 - key-store-type: PKCS12 + enabled: false request: grant: - auth: twowaytls + auth: none dns: name: so-vnfm-simulator +vnfm-adapter: + base: + endpoint: http://so-etsi-sol003-adapter.onap:9092 + vnfds: vnfdlist: - vnfdid: sgsn-mme_12df452s04131 @@ -54,3 +54,23 @@ vnfds: resourceTemplateId: vnfd2_vnfc4 vduId: vnfd2_vduForVnfc4 type: COMPUTE + - vnfdid: b1bb0ce7-2222-4fa7-95ed-4840d70a1177 + vnfclist: + - vnfcid: VNFC5 + resourceTemplateId: vnfd3_vnfc4 + vduId: vnfd3_vduForVnfc4 + type: COMPUTE + - vnfcid: VNFC6 + resourceTemplateId: vnfd3_vnfc5 + vduId: vnfd3_vduForVnfc5 + type: COMPUTE + - vnfdid: 0c960b3a-d88f-11ea-87d0-0242ac130003 + vnfclist: + - vnfcid: VNFC7 + resourceTemplateId: vnfd4_vnfc5 + vduId: vnfd4_vduForVnfc5 + type: COMPUTE + - vnfcid: VNFC8 + resourceTemplateId: vnfd4_vnfc6 + vduId: vnfd4_vduForVnfc6 + type: COMPUTE 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 35ee2641..11e32bce 100755 --- a/plans/so/integration-etsi-testing/config/wait-for-container.sh +++ b/plans/so/integration-etsi-testing/config/wait-for-container.sh @@ -121,6 +121,7 @@ process_arguments() result=$(docker inspect --format '{{.State.Running}}' $CONTAINER_NAME) if [ $result != "true" ] ; then + docker logs $CONTAINER_NAME echo "$SCRIPT_NAME $(current_timestamp) ERROR: $CONTAINER_NAME container is not running" exit 1 fi @@ -142,6 +143,7 @@ process_arguments() $WAIT_FOR_SCRIPT -t "$TIME_OUT" -h "$HOST_IP" -p "$PORT" if [ $? -ne 0 ]; then + docker logs $CONTAINER_NAME echo "$SCRIPT_NAME $(current_timestamp) ERROR: wait-for.sh failed ..." 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 index e11b8006..1f07a032 100644 --- a/plans/so/integration-etsi-testing/docker-compose.local.yml +++ b/plans/so/integration-etsi-testing/docker-compose.local.yml @@ -2,7 +2,7 @@ version: '3' services: ################################################################################ mariadb: - image: mariadb:10.1.11 + image: mariadb:${MARIADB_VERSION} ################################################################################ catalog-db-adapter: image: onap/so/catalog-db-adapter:${TAG} @@ -22,12 +22,14 @@ services: api-handler-infra: image: onap/so/api-handler-infra:${TAG} ############################################################################# - so-monitoring: - image: onap/so/so-monitoring:${TAG} + so-admin-cockpit: + image: onap/so/so-admin-cockpit:${SO_ADMIN_COCKPIT_IMAGE_VERSION} ################################################################################ - so-vnfm-adapter: - image: onap/so/vnfm-adapter:${TAG} + so-etsi-sol003-adapter: + image: onap/so/so-etsi-sol003-adapter:${SOL_003_ADAPTER_IMAGE_VERSION} ################################################################################ - ve-vnfm-adapter: - image: onap/so/ve-vnfm-adapter:${TAG} + modeling-etsicatalog: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/modeling/etsicatalog:${ETSI_CATALOG_IMAGE_VERSION} ################################################################################ + so-etsi-nfvo-ns-lcm: + image: onap/so/so-etsi-nfvo-ns-lcm:${ETSI_NFVO_NS_LCM_IMAGE_VERSION} diff --git a/plans/so/integration-etsi-testing/docker-compose.yml b/plans/so/integration-etsi-testing/docker-compose.yml index 2ee5026a..0c4d03f0 100644 --- a/plans/so/integration-etsi-testing/docker-compose.yml +++ b/plans/so/integration-etsi-testing/docker-compose.yml @@ -2,14 +2,18 @@ version: '3' services: ################################################################################ mariadb: - image: ${NEXUS_DOCKER_REPO_MSO}/mariadb:10.1.11 + image: ${NEXUS_DOCKER_REPO_MSO}/mariadb:${MARIADB_VERSION} ports: - "3306:3306" volumes: + - /var/lib/mysql - ${TEST_LAB_DIR}/volumes/mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - ${TEST_LAB_DIR}/volumes/mariadb/conf.d:/etc/mysql/conf.d environment: - MYSQL_ROOT_PASSWORD=password + - MYSQL_USER=etsicatalog + - MYSQL_PASSWORD=etsicatalog + - MYSQL_DATABASE=etsicatalog hostname: mariadb.so.testlab.onap.org logging: @@ -104,6 +108,36 @@ services: max-file: "5" user: root entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' +################################################################################ + openstack-adapter: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/openstack-adapter:1.8.0-STAGING-latest + ports: + - "8087:8087" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${CONFIG_DIR_PATH}/override-files/openstack-adapter/onapheat:/app/config + environment: + - APP=openstack-adapter + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + openstack-adapter.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' ################################################################################ sdc-controller: image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/sdc-controller:${TAG} @@ -111,7 +145,7 @@ services: - "8085:8085" volumes: - ${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:/distribution-test-zip - ${CONFIG_DIR_PATH}/override-files/sdc-controller/onapheat:/app/config environment: - APP=sdc-controller @@ -134,7 +168,7 @@ services: max-size: "30m" max-file: "5" user: root - entrypoint: /bin/sh -c 'mkdir -p /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/zipped_sdc_csar.tar.gz -C /distribution-test-zip/unzipped && chmod 777 -R /distribution-test-zip/ && /app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' + entrypoint: /bin/sh -c 'mkdir -p /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/zipped_sdc_csar.tar.gz -C /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/macro_zipped_sdc_csar.tar.gz -C /distribution-test-zip/unzipped && chmod 777 -R /distribution-test-zip/ && /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} @@ -155,6 +189,8 @@ services: - DB_ADMIN_PASSWORD=so_Admin123 hostname: bpmn-infra.so.testlab.onap.org + links: + - "so-etsi-sol003-adapter:so-etsi-sol003-adapter.onap" depends_on: - mariadb - catalog-db-adapter @@ -197,24 +233,24 @@ services: user: root entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' ############################################################################# - so-monitoring: - image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-monitoring:${TAG} + so-admin-cockpit: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-admin-cockpit:${SO_ADMIN_COCKPIT_IMAGE_VERSION} ports: - "30224:30224" volumes: - ${CONFIG_DIR_PATH}/override-files/so-monitoring/onapheat:/app/config environment: - - APP=so-monitoring + - APP=so-admin-cockpit - JVM_ARGS=-Xms64m -Xmx512m hostname: - so-monitoring.so.testlab.onap.org + so-admin-cockpit.so.testlab.onap.org depends_on: - mariadb - catalog-db-adapter - request-db-adapter ################################################################################ - so-vnfm-adapter: - image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/vnfm-adapter:${TAG} + so-etsi-sol003-adapter: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-etsi-sol003-adapter:${SOL_003_ADAPTER_IMAGE_VERSION} ports: - "9092:9092" volumes: @@ -222,10 +258,10 @@ services: - ${CONFIG_DIR_PATH}/certificates/so-vnfm-adapter-certs:/app/so-vnfm-adapter-certs - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt environment: - - APP=so-vnfm-adapter + - APP=so-etsi-sol003-adapter - JVM_ARGS=-Xms64m -Xmx512m hostname: - so-vnfm-adapter + so-etsi-sol003-adapter depends_on: - request-db-adapter logging: @@ -247,7 +283,7 @@ services: sdc-simulator depends_on: - mariadb - - so-vnfm-adapter + - so-etsi-sol003-adapter logging: driver: "json-file" options: @@ -265,7 +301,7 @@ services: aai-simulator depends_on: - mariadb - - so-vnfm-adapter + - so-etsi-sol003-adapter logging: driver: "json-file" options: @@ -284,9 +320,11 @@ services: - JVM_ARGS=-Xms64m -Xmx512m hostname: so-vnfm-simulator + links: + - "so-etsi-sol003-adapter:so-etsi-sol003-adapter.onap" depends_on: - mariadb - - so-vnfm-adapter + - so-etsi-sol003-adapter logging: driver: "json-file" options: @@ -306,7 +344,7 @@ services: - CATALOG_DB=catalogdb depends_on: - mariadb - - so-vnfm-adapter + - so-etsi-sol003-adapter command: - "/config/apply-workarounds.sh" ################################################################################# @@ -321,7 +359,25 @@ services: sdnc-simulator depends_on: - mariadb - - so-vnfm-adapter + - so-etsi-sol003-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################# + multicloud-simulator: + image: simulators/multicloud-simulator:latest + ports: + - "9996:9996" + environment: + - APP=MULTICLOUD-SIMULATOR + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + multicloud-simulator + depends_on: + - mariadb + - so-etsi-sol003-adapter logging: driver: "json-file" options: @@ -345,27 +401,54 @@ services: command: - "/config/populate-aai-simulator.sh" ################################################################################ - ve-vnfm-adapter: - image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/ve-vnfm-adapter:${TAG} + modeling-etsicatalog: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/modeling/etsicatalog:${ETSI_CATALOG_IMAGE_VERSION} ports: - - "9098:9098" + - "8806:8806" volumes: - - ${CONFIG_DIR_PATH}/override-files/ve-vnfm-adapter/onapheat:/app/config - - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt + - /var/lib/mysql + - ${CONFIG_DIR_PATH}/wait-for.sh:/service/wait-for.sh environment: - - APP=ve-vnfm-adapter - - JVM_ARGS=-Xms64m -Xmx512m - - DB_HOST=mariadb + - DB_IP=mariadb + - SDC_ADDR=http://sdc-simulator:9991 hostname: - ve-vnfm-adapter + modeling-etsicatalog + links: + - "so-etsi-sol003-adapter:so-etsi-sol003-adapter.onap" depends_on: - - request-db-adapter - - aai-simulator + - mariadb + - sdc-simulator logging: driver: "json-file" options: max-size: "30m" max-file: "5" + entrypoint: /bin/sh -c '/service/wait-for.sh -t 300 -h mariadb -p 3306 && /service/modeling/etsicatalog/docker/docker-entrypoint.sh' +############################################################################### + so-etsi-nfvo-ns-lcm: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-etsi-nfvo-ns-lcm:${ETSI_NFVO_NS_LCM_IMAGE_VERSION} + ports: + - "9095:9095" + volumes: + - ${CONFIG_DIR_PATH}/override-files/so-etsi-nfvo-ns-lcm/onapheat:/app/config + - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + environment: + - APP=so-etsi-nfvo-ns-lcm + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + etsi.nfvo.ns.lcm + depends_on: + - mariadb + - aai-simulator + - sdc-simulator + - modeling-etsicatalog + - so-etsi-sol003-adapter user: root - entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' -################################################################################ + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" mariadb:3306 -- "/app/start-app.sh"' diff --git a/plans/so/integration-etsi-testing/settings.xml b/plans/so/integration-etsi-testing/settings.xml index 5db52989..e645b41b 100755 --- a/plans/so/integration-etsi-testing/settings.xml +++ b/plans/so/integration-etsi-testing/settings.xml @@ -95,7 +95,7 @@ central - http://repo1.maven.org/maven2/ + https://repo1.maven.org/maven2/ onap-public @@ -112,7 +112,7 @@ central - http://repo1.maven.org/maven2/ + https://repo1.maven.org/maven2/ onap-public diff --git a/plans/so/integration-etsi-testing/setup.sh b/plans/so/integration-etsi-testing/setup.sh index ce6637c1..950571f1 100755 --- a/plans/so/integration-etsi-testing/setup.sh +++ b/plans/so/integration-etsi-testing/setup.sh @@ -33,6 +33,9 @@ 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 +CAMUNDA_SQL_SCRIPT_NAME=mariadb_engine_7.10.0.sql +CAMUNDA_SQL_SCRIPT_DIR=$CONFIG_DIR/camunda-sql +TEST_LAB_SQL_SCRIPTS_DIR=$TEST_LAB_DIR_PATH/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts MAVEN_DIR=$TEMP_DIR_PATH/maven INSTALLED_MAVEN_DIR=$MAVEN_DIR/$MAVEN_VERSION_DIR @@ -49,7 +52,7 @@ echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..." export $(egrep -v '^#' $ENV_FILE | xargs) -MANDATORY_VARIABLES_NAMES=( "NEXUS_DOCKER_REPO_MSO" "DOCKER_ENVIRONMENT" "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", "ETSI_CATALOG_IMAGE_VERSION", "SOL_003_ADAPTER_IMAGE_VERSION", "ETSI_NFVO_NS_LCM_IMAGE_VERSION", "MARIADB_VERSION") for var in "${MANDATORY_VARIABLES_NAMES[@]}" do @@ -136,6 +139,10 @@ fi git clone http://gerrit.onap.org/r/so/docker-config.git $TEST_LAB_DIR_PATH +echo "Replacing $CAMUNDA_SQL_SCRIPT_NAME ..." +rm -rf $TEST_LAB_SQL_SCRIPTS_DIR/$CAMUNDA_SQL_SCRIPT_NAME +cp $CAMUNDA_SQL_SCRIPT_DIR/$CAMUNDA_SQL_SCRIPT_NAME $TEST_LAB_SQL_SCRIPTS_DIR + export TEST_LAB_DIR=$TEST_LAB_DIR_PATH export CONFIG_DIR_PATH=$CONFIG_DIR @@ -153,6 +160,8 @@ fi echo "Sleeping for 3m" sleep 3m +docker ps -a + echo "Will execute $WAIT_FOR_WORKAROUND_SCRIPT script" $WAIT_FOR_WORKAROUND_SCRIPT @@ -173,18 +182,25 @@ if [ $? -ne 0 ]; then exit 1 fi -API_INFRA_CONTAINER_NAME="api-handler-infra" -echo "Will execute $WAIT_FOR_CONTAINER_SCRIPT to wait for $API_INFRA_CONTAINER_NAME container to start up" -$WAIT_FOR_CONTAINER_SCRIPT -c "$API_INFRA_CONTAINER_NAME" -t "300" -n "$DEFAULT_NETWORK_NAME" +PODS_NAMES=( "api-handler-infra" "modeling-etsicatalog" "so-etsi-nfvo-ns-lcm") -if [ $? -ne 0 ]; then - echo "ERROR: $WAIT_FOR_CONTAINER_SCRIPT failed" - echo "Will stop running docker containers . . ." - $TEAR_DOWN_SCRIPT - exit 1 -fi +for pod in "${PODS_NAMES[@]}" + do + echo "Will execute $WAIT_FOR_CONTAINER_SCRIPT to wait for $pod container to start up" + $WAIT_FOR_CONTAINER_SCRIPT -c "$pod" -t "300" -n "$DEFAULT_NETWORK_NAME" + + if [ $? -ne 0 ]; then + echo "ERROR: $WAIT_FOR_CONTAINER_SCRIPT for pod: $pod failed" + echo "Will stop running docker containers . . ." + $TEAR_DOWN_SCRIPT + exit 1 + fi +done REPO_IP='127.0.0.1' ROBOT_VARIABLES="-v REPO_IP:${REPO_IP}" +# install required Robot libraries +pip install robotframework-archivelibrary + echo "Finished executing $SCRIPT_HOME/$SCRIPT_NAME" diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/pom.xml b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/pom.xml index 26815ad0..c51cae12 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/pom.xml +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/pom.xml @@ -8,7 +8,7 @@ aai-simulator - 1.0.0 + 1.8.1 diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/BusinessController.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/BusinessController.java index 4a0ed1b9..1221beae 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/BusinessController.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/BusinessController.java @@ -23,12 +23,12 @@ import static org.onap.so.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSH import static org.onap.so.aaisimulator.utils.Constants.CUSTOMER_TYPE; import static org.onap.so.aaisimulator.utils.Constants.CUSTOMER_URL; import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNF; -import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNF_VNF_ID; import static org.onap.so.aaisimulator.utils.Constants.SERVICE_RESOURCE_TYPE; import static org.onap.so.aaisimulator.utils.Constants.SERVICE_SUBSCRIPTION; import static org.onap.so.aaisimulator.utils.Constants.X_HTTP_METHOD_OVERRIDE; import static org.onap.so.aaisimulator.utils.RequestErrorResponseUtils.getRequestErrorResponseEntity; import static org.onap.so.aaisimulator.utils.RequestErrorResponseUtils.getResourceVersion; +import java.util.List; import java.util.Optional; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.MediaType; @@ -36,7 +36,6 @@ import org.onap.aai.domain.yang.Customer; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.ServiceInstance; import org.onap.aai.domain.yang.ServiceInstances; import org.onap.aai.domain.yang.ServiceSubscription; @@ -263,33 +262,32 @@ public class BusinessController { public ResponseEntity getRelatedToGenericVnf(@PathVariable("global-customer-id") final String globalCustomerId, @PathVariable("service-type") final String serviceType, @PathVariable(name = "service-instance-id") final String serviceInstanceId, - @RequestParam(name = "vnf-name", required = true) final String vnfName, final HttpServletRequest request) { + @RequestParam(name = "vnf-name", required = false) final String vnfName, final HttpServletRequest request) { LOGGER.info( "Will retrieve generic vnf related to information for 'global customer id': {}, 'service type': {} and 'service instance id: '{} with vnfname: {}...", globalCustomerId, serviceType, serviceInstanceId, vnfName); - final Optional optional = - cacheServiceProvider.getRelationship(globalCustomerId, serviceType, serviceInstanceId, vnfName); + final List relatedToVnfIds = + getRelatedToVnfIds(globalCustomerId, serviceType, serviceInstanceId, vnfName); - if (optional.isPresent()) { - - final Relationship relationship = optional.get(); - final Optional relationshipDataOptional = relationship.getRelationshipData().stream() - .filter(existing -> GENERIC_VNF_VNF_ID.equals(existing.getRelationshipKey())).findFirst(); - if (relationshipDataOptional.isPresent()) { - final RelationshipData relationshipData = relationshipDataOptional.get(); - final String vnfId = relationshipData.getRelationshipValue(); + if (!relatedToVnfIds.isEmpty()) { + final GenericVnfs genericVnfs = new GenericVnfs(); + relatedToVnfIds.stream().forEach(vnfId -> { final Optional genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(vnfId); if (genericVnfOptional.isPresent()) { - final GenericVnfs genericVnfs = new GenericVnfs(); - genericVnfs.getGenericVnf().add(genericVnfOptional.get()); - LOGGER.info("found service instance {} in cache", relationship); - return ResponseEntity.ok(genericVnfs); + final GenericVnf genericVnf = genericVnfOptional.get(); + LOGGER.info("found related-to generic-vnf {} in cache", genericVnf); + genericVnfs.getGenericVnf().add(genericVnf); } + }); + if (!genericVnfs.getGenericVnf().isEmpty()) { + LOGGER.info("Found {} related generic-vnfs", genericVnfs.getGenericVnf().size()); + return ResponseEntity.ok(genericVnfs); } } + LOGGER.error( "Couldn't find generic vnf related to information for 'global customer id': {}, 'service type': {} and 'service instance id: '{} with vnfname: {}...", globalCustomerId, serviceType, serviceInstanceId, vnfName); @@ -353,4 +351,12 @@ public class BusinessController { return getRequestErrorResponseEntity(request); } + + private List getRelatedToVnfIds(final String globalCustomerId, final String serviceType, + final String serviceInstanceId, final String vnfName) { + if (vnfName != null) { + return cacheServiceProvider.getRelatedToVnfIds(globalCustomerId, serviceType, serviceInstanceId, vnfName); + } + return cacheServiceProvider.getRelatedToVnfIds(globalCustomerId, serviceType, serviceInstanceId); + } } 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 43fe47da..22209fc8 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 @@ -22,6 +22,7 @@ package org.onap.so.aaisimulator.controller; import static org.onap.so.aaisimulator.utils.Constants.APPLICATION_MERGE_PATCH_JSON; import static org.onap.so.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSHIP_LIST_URL; import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNF; +import static org.onap.so.aaisimulator.utils.Constants.VF_MODULE; import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNFS_URL; import static org.onap.so.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL; import static org.onap.so.aaisimulator.utils.Constants.X_HTTP_METHOD_OVERRIDE; @@ -35,6 +36,8 @@ import javax.ws.rs.core.MediaType; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.GenericVnfs; import org.onap.aai.domain.yang.Relationship; +import org.onap.aai.domain.yang.VfModule; +import org.onap.aai.domain.yang.VfModules; import org.onap.so.aaisimulator.service.providers.GenericVnfCacheServiceProvider; import org.onap.so.aaisimulator.utils.HttpServiceUtils; import org.onap.so.aaisimulator.utils.RequestErrorResponseUtils; @@ -47,6 +50,7 @@ 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.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; @@ -211,5 +215,65 @@ public class GenericVnfsController { return getRequestErrorResponseEntity(request, GENERIC_VNF); } + + + @GetMapping(value = "/generic-vnf/{vnf-id}/vf-modules/vf-module/{vf-module-id}", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity getVfModule(@PathVariable("vnf-id") final String vnfId, @PathVariable("vf-module-id") final String vfModuleId, + @RequestParam(name = "depth", required = false) final Integer depth, + @RequestParam(name = "resultIndex", required = false) final Integer resultIndex, + @RequestParam(name = "resultSize", required = false) final Integer resultSize, + @RequestParam(name = "format", required = false) final String format, final HttpServletRequest request) { + LOGGER.info( + "Will get VfModule for 'vf-module-id': {} with depth: {}, resultIndex: {}, resultSize:{}, format: {} ...", + vnfId, vfModuleId, depth, resultIndex, resultSize, format); + + final Optional optional = cacheServiceProvider.getVfModule(vnfId, vfModuleId); + + if (optional.isPresent()) { + final VfModule vfModule = optional.get(); + LOGGER.info("found VfModule {} in cache", vfModule); + return ResponseEntity.ok(vfModule); + } + + LOGGER.error( + "Unable to find VfModule in cache for 'vf-module-id': {} with depth: {}, resultIndex: {}, resultSize:{}, format:{} ...", + vnfId, vfModuleId, depth, resultIndex, resultSize, format); + return getRequestErrorResponseEntity(request, VF_MODULE); + + } + + + @PutMapping(value = "/generic-vnf/{vnf-id}/vf-modules/vf-module/{vf-module-id}", consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}, + produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity putVfModule(@RequestBody final VfModule vfModule, + @PathVariable("vnf-id") final String vnfId, @PathVariable("vf-module-id") final String vfModuleId, final HttpServletRequest request) { + LOGGER.info("Will add VfModule to cache with 'vf-module-id': {} ...", vfModuleId); + + cacheServiceProvider.putVfModule(vnfId, vfModuleId, vfModule); + return ResponseEntity.accepted().build(); + } + + @PostMapping(value = "/generic-vnf/{vnf-id}/vf-modules/vf-module/{vf-module-id}", + consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, APPLICATION_MERGE_PATCH_JSON}, + produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity patchVfModule(@RequestBody final VfModule vfModule, + @PathVariable("vnf-id") final String vnfId, @PathVariable("vf-module-id") final String vfModuleId, + @RequestHeader(value = X_HTTP_METHOD_OVERRIDE, required = false) final String xHttpHeaderOverride, + final HttpServletRequest request) { + + LOGGER.info("Will post VfModule to cache with 'vf-module-id': {} and '{}': {} ...", vfModuleId, X_HTTP_METHOD_OVERRIDE, + xHttpHeaderOverride); + + if (HttpMethod.PATCH.toString().equalsIgnoreCase(xHttpHeaderOverride)) { + if (cacheServiceProvider.patchVfModule(vnfId, vfModuleId, vfModule)) { + return ResponseEntity.accepted().build(); + } + LOGGER.error("Unable to apply patch to VmModule using 'vf-module-id': {} ... ", vfModule); + return getRequestErrorResponseEntity(request, VF_MODULE); + } + LOGGER.error("{} not supported ... ", xHttpHeaderOverride); + + return getRequestErrorResponseEntity(request, VF_MODULE); + } } diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/CustomerCacheServiceProvider.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/CustomerCacheServiceProvider.java index 7000fb3f..af3595a0 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/CustomerCacheServiceProvider.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/CustomerCacheServiceProvider.java @@ -19,6 +19,7 @@ */ package org.onap.so.aaisimulator.service.providers; +import java.util.List; import java.util.Optional; import org.onap.aai.domain.yang.Customer; import org.onap.aai.domain.yang.Relationship; @@ -53,13 +54,16 @@ public interface CustomerCacheServiceProvider extends Clearable { boolean patchServiceInstance(final String globalCustomerId, final String serviceType, final String serviceInstanceId, final ServiceInstance serviceInstance); - Optional getRelationship(final String globalCustomerId, final String serviceType, - final String serviceInstanceId, final String vnfName); - Optional addRelationShip(final String globalCustomerId, final String serviceType, final String serviceInstanceId, final Relationship relationship, final String requestUri); boolean deleteSericeInstance(final String globalCustomerId, final String serviceType, final String serviceInstanceId, final String resourceVersion); + List getRelatedToVnfIds(final String globalCustomerId, final String serviceType, + final String serviceInstanceId, final String vnfName); + + List getRelatedToVnfIds(final String globalCustomerId, final String serviceType, + final String serviceInstanceId); + } diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/CustomerCacheServiceProviderImpl.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/CustomerCacheServiceProviderImpl.java index 7193ade1..7285faad 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/CustomerCacheServiceProviderImpl.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/service/providers/CustomerCacheServiceProviderImpl.java @@ -22,11 +22,14 @@ package org.onap.so.aaisimulator.service.providers; import static org.onap.so.aaisimulator.utils.CacheName.CUSTOMER_CACHE; import static org.onap.so.aaisimulator.utils.Constants.CUSTOMER_GLOBAL_CUSTOMER_ID; import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNF; +import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNF_VNF_ID; import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNF_VNF_NAME; import static org.onap.so.aaisimulator.utils.Constants.SERVICE_INSTANCE_SERVICE_INSTANCE_ID; import static org.onap.so.aaisimulator.utils.Constants.SERVICE_INSTANCE_SERVICE_INSTANCE_NAME; import static org.onap.so.aaisimulator.utils.Constants.SERVICE_SUBSCRIPTION_SERVICE_TYPE; import static org.onap.so.aaisimulator.utils.HttpServiceUtils.getBiDirectionalRelationShipListRelatedLink; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -279,7 +282,7 @@ public class CustomerCacheServiceProviderImpl extends AbstractCacheServiceProvid } @Override - public Optional getRelationship(final String globalCustomerId, final String serviceType, + public List getRelatedToVnfIds(final String globalCustomerId, final String serviceType, final String serviceInstanceId, final String vnfName) { final Optional optional = getServiceInstance(globalCustomerId, serviceType, serviceInstanceId); @@ -289,20 +292,53 @@ public class CustomerCacheServiceProviderImpl extends AbstractCacheServiceProvid final RelationshipList relationshipList = serviceInstance.getRelationshipList(); if (relationshipList != null) { - final List relationship = relationshipList.getRelationship(); - return relationship.stream().filter( + final List relationships = relationshipList.getRelationship().stream().filter( relationShip -> relationShip.getRelatedToProperty().stream().filter(relatedToProperty -> { final String propertyKey = relatedToProperty.getPropertyKey(); final String propertyValue = relatedToProperty.getPropertyValue(); return GENERIC_VNF_VNF_NAME.equals(propertyKey) && propertyValue != null && propertyValue.equals(vnfName); - }).findFirst().isPresent()).findFirst(); + }).findFirst().isPresent()).collect(Collectors.toList()); + LOGGER.info("Found relationships {} for vnf-name: {}", relationships, vnfName); + return getGenericVnfIdsIfPresent(relationships); } LOGGER.warn("Relationship list is nulll ..."); } - LOGGER.error("Unable to RelationShip with property value: {}... ", vnfName); + LOGGER.error("Unable to find generic-vnf relationships with property value: {}... ", vnfName); + return Collections.emptyList(); + } - return Optional.empty(); + @Override + public List getRelatedToVnfIds(final String globalCustomerId, final String serviceType, + final String serviceInstanceId) { + final Optional optional = getServiceInstance(globalCustomerId, serviceType, serviceInstanceId); + + if (optional.isPresent()) { + LOGGER.info("Found service instance ..."); + final ServiceInstance serviceInstance = optional.get(); + final RelationshipList relationshipList = serviceInstance.getRelationshipList(); + + if (relationshipList != null) { + final List relationships = relationshipList.getRelationship(); + LOGGER.info("Relationships found {}", relationships); + return getGenericVnfIdsIfPresent(relationships); + } + LOGGER.warn("Relationship list is nulll ..."); + } + LOGGER.error("Unable to find generic-vnf relationships ... "); + return Collections.emptyList(); + } + + private List getGenericVnfIdsIfPresent(final List relationships) { + final List vnfIdsFound = new ArrayList<>(); + relationships.stream().forEach(relationship -> { + relationship.getRelationshipData().stream() + .filter(existing -> GENERIC_VNF_VNF_ID.equals(existing.getRelationshipKey())).findFirst() + .ifPresent(consume -> { + vnfIdsFound.add(consume.getRelationshipValue()); + }); + }); + return vnfIdsFound; } @Override 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 901c2594..5570381b 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 @@ -23,6 +23,7 @@ import java.util.List; import java.util.Optional; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; +import org.onap.aai.domain.yang.VfModule; import org.springframework.http.HttpHeaders; /** @@ -49,5 +50,9 @@ public interface GenericVnfCacheServiceProvider extends Clearable { boolean deleteGenericVnf(final String vnfId, final String resourceVersion); + void putVfModule(final String vnfId, final String vfModuleId, final VfModule vfModule); + Optional getVfModule(final String vnfId, final String vfModuleId); + + boolean patchVfModule(final String vnfId, final String vfModuleId, final VfModule vfModule); } 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 e7a42106..24544a6c 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 @@ -37,6 +37,8 @@ import org.onap.aai.domain.yang.RelatedToProperty; import org.onap.aai.domain.yang.Relationship; import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; +import org.onap.aai.domain.yang.VfModule; +import org.onap.aai.domain.yang.VfModules; import org.onap.so.aaisimulator.utils.ShallowBeanCopy; import org.onap.so.simulator.cache.provider.AbstractCacheServiceProvider; import org.slf4j.Logger; @@ -255,4 +257,64 @@ public class GenericVnfCacheServiceProviderImpl extends AbstractCacheServiceProv clearCache(GENERIC_VNF_CACHE.getName()); } -} + @Override + public Optional getVfModule(final String vnfId, final String vfModuleId) { + LOGGER.info("Getting vfModule from cache for vnfId: {} and vfModuleId: {}", + vnfId, vfModuleId); + final Optional genericVnfOptional = getGenericVnf(vnfId); + final GenericVnf value = genericVnfOptional.get(); + final VfModules vfmodules = value.getVfModules(); + if (vfmodules != null) { + for (VfModule vfModule : vfmodules.getVfModule()) { + if (vfModule.getVfModuleId().equalsIgnoreCase(vfModuleId)){ + return Optional.of(vfModule); + } + } + } + return Optional.empty(); + } + + + @Override + public void putVfModule(final String vnfId, final String vfModuleId, final VfModule vfModule) { + LOGGER.info("Adding vfModule for vnfId: {} and vfModuleId: {}", + vnfId, vfModuleId); + final Optional genericVnfOptional = getGenericVnf(vnfId); + final Cache cache = getCache(GENERIC_VNF_CACHE.getName()); + if (genericVnfOptional.isPresent()) { + final GenericVnf genericVnf = genericVnfOptional.get(); + VfModules vfModules = null; + if(genericVnf.getVfModules()==null){ + vfModules = new VfModules(); + genericVnf.setVfModules(vfModules); + } else { + vfModules = genericVnf.getVfModules(); + } + + vfModules.getVfModule().add(vfModule); + cache.put(vfModuleId, vfModule); + } + } + + @Override + public boolean patchVfModule(final String vnfId, final String vfModuleId, final VfModule vfModule) { + final Optional genericVnfOptional = getGenericVnf(vnfId); + LOGGER.info("Create vfModule for vnfId: {} and vfModuleId: {}", + vnfId, vfModuleId); + if (genericVnfOptional.isPresent()) { + final GenericVnf cachedGenericVnf = genericVnfOptional.get(); + final VfModules vfmodules = cachedGenericVnf.getVfModules(); + LOGGER.info("vfModuleId is Matched"); + try { + vfmodules.getVfModule().stream().filter(tempVfModule -> + tempVfModule.getVfModuleId().equalsIgnoreCase(vfModuleId)).forEach(tempVfModule -> + tempVfModule.setOrchestrationStatus(vfModule.getOrchestrationStatus())); + return true; + } catch (final Exception exception) { + LOGGER.error("Unable to update VfModule for vfModuleId: {}", vfModule, exception); + } + } + LOGGER.error("Unable to find VfModule ..."); + return false; + } +} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java index 4099c2a0..4cd5b25a 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java @@ -89,6 +89,8 @@ public class Constants { public static final String COMPOSED_OF = "org.onap.relationships.inventory.ComposedOf"; public static final String GENERIC_VNF = "generic-vnf"; + + public static final String VF_MODULE = "vf-module"; public static final String PLATFORM = "platform"; diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/BusinessControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/BusinessControllerTest.java index c08c51ec..7da37794 100644 --- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/BusinessControllerTest.java +++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/BusinessControllerTest.java @@ -360,6 +360,41 @@ public class BusinessControllerTest extends AbstractSpringBootTest { assertEquals(GENERIC_VNF_NAME, genericVnf.getVnfName()); } + @Test + public void test_putServiceInstanceRelatedTo_ableToRetrieveAllRelatedGenericVnfsFromCache() throws Exception { + + final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); + + invokeCustomerEndPointAndAssertResponse(); + + invokeServiceInstanceEndPointAndAssertResponse(); + + final String relationShipUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL, + BI_DIRECTIONAL_RELATIONSHIP_LIST_URL); + + final ResponseEntity responseEntity2 = testRestTemplateService.invokeHttpPut(relationShipUrl, + TestUtils.getRelationShipJsonObject(), Relationship.class); + + assertEquals(HttpStatus.ACCEPTED, responseEntity2.getStatusCode()); + + final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID); + final ResponseEntity genericVnfResponse = + testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class); + assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode()); + + final ResponseEntity actual = + testRestTemplateService.invokeHttpGet(url + RELATED_TO_URL, GenericVnfs.class); + + assertEquals(HttpStatus.OK, actual.getStatusCode()); + + assertTrue(actual.hasBody()); + final GenericVnfs genericVnfs = actual.getBody(); + assertFalse(genericVnfs.getGenericVnf().isEmpty()); + final GenericVnf genericVnf = genericVnfs.getGenericVnf().get(0); + assertEquals(GENERIC_VNF_NAME, genericVnf.getVnfName()); + } + + @Test public void test_DeleteSericeInstance_ServiceInstanceRemovedFromCache() throws Exception { final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/HELP.md b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/HELP.md new file mode 100644 index 00000000..c8c1987d --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/HELP.md @@ -0,0 +1,9 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.2/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.2/maven-plugin/reference/html/#build-image) + diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/mvnw b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/mvnw new file mode 100755 index 00000000..a16b5431 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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 +# +# https://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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/mvnw.cmd b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/mvnw.cmd new file mode 100644 index 00000000..c8d43372 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/pom.xml b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/pom.xml new file mode 100644 index 00000000..80e21746 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/pom.xml @@ -0,0 +1,86 @@ + + + 4.0.0 + + org.onap.so.simulators + so-simulators + 1.0-SNAPSHOT + + multicloud-simulator + ${project.artifactId} + MultiCloud Simulator + + 11 + 1.1 + 3.2.0 + 3.2.0 + 1.7.1-SNAPSHOT + 2.1.1.RELEASE + + + + ${project.parent.groupId} + common + ${project.version} + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + com.googlecode.json-simple + json-simple + ${json-simple.version} + + + org.onap.so.adapters + mso-adapters-rest-interface + ${mso-adapters.version} + + + org.springframework.security.oauth.boot + spring-security-oauth2-autoconfigure + ${spring-security.version} + + + + + + org.springframework.boot + spring-boot-maven-plugin + + org.onap.so.multicloudsimulator.MultiCloudSimulatorApplication + + + + + repackage + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/MultiCloudSimulatorApplication.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/MultiCloudSimulatorApplication.java new file mode 100644 index 00000000..479c4810 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/MultiCloudSimulatorApplication.java @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author Md Irshad Sheikh (md.irshad.sheikh@huawei.com) + * + */ +@SpringBootApplication(scanBasePackages = { "org.onap" }) +public class MultiCloudSimulatorApplication { + + public static void main(String[] args) { + SpringApplication.run(MultiCloudSimulatorApplication.class, args); + + } + +} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceNameOutput.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceNameOutput.java new file mode 100644 index 00000000..1bf902a2 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceNameOutput.java @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.multicloudsimulator.beans; + +import com.fasterxml.jackson.databind.JsonNode; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.io.ClassPathResource; +import org.springframework.stereotype.Component; +import java.io.IOException; +import java.io.InputStream; + +@Component +@PropertySource(value = "data/InstanceNameOutput.json") +@ConfigurationProperties +public class InstanceNameOutput { + private String template_type; + private String workload_id; + private String workload_status; + public JsonNode workload_status_reason; + + public String getTemplate_type() { + return template_type; + } + + public void setTemplate_type(final String template_type) { + this.template_type = template_type; + } + + public String getWorkload_id() { + return workload_id; + } + + public void setWorkload_id(final String workload_id) { + this.workload_id = workload_id; + } + + public String getWorkload_status() { + return workload_status; + } + + public void setWorkload_status(final String workload_status) { + this.workload_status = workload_status; + } + + public JsonNode getWorkload_status_reason() { + return workload_status_reason; + } + + public void setWorkload_status_reason(final JsonNode workload_status_reason) { + this.workload_status_reason = workload_status_reason; + } + + public final static InputStream getFile(final String file) throws IOException { + return new ClassPathResource(file).getInputStream(); + } + + public final static InputStream getInstanceName() throws Exception, IOException { + return getFile("data/InstanceNameOutput.json"); + } +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceOutput.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceOutput.java new file mode 100644 index 00000000..2cb1fcac --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceOutput.java @@ -0,0 +1,79 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.beans; + +import com.fasterxml.jackson.databind.JsonNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.core.io.ClassPathResource; +import org.springframework.stereotype.Component; +import java.io.IOException; +import java.io.InputStream; + +@Component +@PropertySource(value = "data/InstanceOutput.json") +@ConfigurationProperties +public class InstanceOutput { + private static final Logger LOGGER = LoggerFactory.getLogger(InstanceOutput.class); + private String template_type; + private String workload_id; + private String workload_status; + public JsonNode workload_status_reason; + + public JsonNode getWorkload_status_reason() { + return workload_status_reason; + } + + public void setWorkload_status_reason(final JsonNode workload_status_reason) { + this.workload_status_reason = workload_status_reason; + } + + public String getTemplate_type() { + return template_type; + } + + public void setTemplate_type(final String template_type) { + this.template_type = template_type; + } + + public String getWorkload_id() { + return workload_id; + } + + public void setWorkload_id(final String workload_id) { + this.workload_id = workload_id; + } + + public String getWorkload_status() { + return workload_status; + } + + public void setWorkload_status(final String workload_status) { + this.workload_status = workload_status; + } + + public static InputStream getFile(final String file) throws IOException { + return new ClassPathResource(file).getInputStream(); + } + + public static InputStream getInstance() throws Exception, IOException { + return getFile("data/InstanceOutput.json"); + } +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceResponse.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceResponse.java new file mode 100644 index 00000000..c8a58210 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/InstanceResponse.java @@ -0,0 +1,81 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.beans; + +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "id", "request", "namespace", "resources" }) +@JsonIgnoreProperties(value = "true") +public class InstanceResponse extends Response { + + @JsonProperty("id") + private String id; + @JsonProperty("request") + private MulticloudInstanceRequest request; + @JsonProperty("namespace") + private String namespace; + @JsonProperty("resources") + private List resources = null; + + public InstanceResponse(final String errorMsg) { + super(errorMsg); + } + + public InstanceResponse() { + super(""); + } + + public String getId() { + return id; + } + + public void setId(final String id) { + this.id = id; + } + + public MulticloudInstanceRequest getRequest() { + return request; + } + + public void setRequest(final MulticloudInstanceRequest request) { + this.request = request; + } + + public String getNamespace() { + return namespace; + } + + public void setNamespace(final String namespace) { + this.namespace = namespace; + } + + public List getResources() { + return resources; + } + + public void setResources(final List resources) { + this.resources = resources; + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudCreateResponse.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudCreateResponse.java new file mode 100644 index 00000000..0182fd55 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudCreateResponse.java @@ -0,0 +1,106 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.beans; + +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.JsonNode; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +@JsonPropertyOrder({ "template_type", "workload_id", "template_response", "workload_status_reason", "workload_status" }) +public class MulticloudCreateResponse implements Serializable { + private static final long serialVersionUID = -5215028275577848311L; + + @JsonProperty("template_type") + private String templateType; + @JsonProperty("workload_id") + private String workloadId; + @JsonProperty("template_response") + private JsonNode templateResponse; + @JsonProperty("workload_status_reason") + private JsonNode workloadStatusReason; + @JsonProperty("workload_status") + private String workloadStatus; + + @JsonCreator + public MulticloudCreateResponse(@JsonProperty("template_type") String templateType, + @JsonProperty("workload_id") String workloadId, + @JsonProperty("template_response") JsonNode templateResponse) { + this.templateType = templateType; + this.workloadId = workloadId; + this.templateResponse = templateResponse; + } + + public MulticloudCreateResponse() { + + } + + public String getTemplateType() { + return templateType; + } + + public void setTemplateType(final String templateType) { + this.templateType = templateType; + } + + public String getWorkloadId() { + return workloadId; + } + + public void setWorkloadId(final String workloadId) { + this.workloadId = workloadId; + } + + public void setTemplateResponse(final JsonNode templateResponse) { + this.templateResponse = templateResponse; + } + + public JsonNode getTemplateResponse() { + return templateResponse; + } + + public void setWorkloadStatusReason(final JsonNode workloadStatusReason) { + this.workloadStatusReason = workloadStatusReason; + } + + public JsonNode getWorkloadStatusReason() { + return workloadStatusReason; + } + + public String getWorkloadSstatus() { + return workloadStatus; + } + + public void setWorkloadStatus(final String workloadStatus) { + this.workloadStatus = workloadStatus; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("templateType", templateType).append("workloadId", workloadId) + .append("templateResponse", templateResponse) + .append("workload_status_reason", workloadStatusReason.toString()) + .append("workload_status", workloadStatus).toString(); + } +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudInstanceRequest.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudInstanceRequest.java new file mode 100644 index 00000000..b645b9bf --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudInstanceRequest.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.beans; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +@JsonIgnoreProperties(value = "true") +public class MulticloudInstanceRequest { + + @JsonProperty(value = "cloud-region") + private String cloudRegion; + + @JsonProperty(value = "rb-name") + private String rbName; + + @JsonProperty(value = "rb-version") + private String rbVersion; + + @JsonProperty(value = "profile-name") + private String profileName; + + @JsonProperty(value = "labels") + private Map labels; + + @JsonProperty(value = "override-values") + private Map overrideValues; + + @JsonProperty(value = "release-name") + private String vfModuleUuid; + + public String getCloudRegion() { + return cloudRegion; + } + + public void setCloudRegion(final String cloudRegion) { + this.cloudRegion = cloudRegion; + } + + public String getRbName() { + return rbName; + } + + public void setRbName(final String rbName) { + this.rbName = rbName; + } + + public String getRbVersion() { + return rbVersion; + } + + public void setRbVersion(final String rbVersion) { + this.rbVersion = rbVersion; + } + + public String getProfileName() { + return profileName; + } + + public void setProfileName(final String profileName) { + this.profileName = profileName; + } + + public Map getLabels() { + return labels; + } + + public void setLabels(Map labels) { + this.labels = labels; + } + + public Map getOverrideValues() { + return overrideValues; + } + + public void setOverrideValues(Map overrideValues) { + this.overrideValues = overrideValues; + } + + public String getVfModuleUuid() { + return vfModuleUuid; + } + + public void setVfModuleUuid(final String vfModuleUuid) { + this.vfModuleUuid = vfModuleUuid; + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudRequest.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudRequest.java new file mode 100644 index 00000000..baeebded --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/MulticloudRequest.java @@ -0,0 +1,158 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.multicloudsimulator.beans; + +import java.io.Serializable; +import org.apache.commons.lang3.builder.ToStringBuilder; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.JsonNode; +import com.woorea.openstack.heat.model.CreateStackParam; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "generic-vnf-id", "vf-module-id", "vf-module-model-invariant-id", "vf-module-model-version-id", + "vf-module-model-customization-id", "oof_directives", "sdnc_directives", "user_directives", "template_type", + "template_data" }) +public class MulticloudRequest implements Serializable { + private static final long serialVersionUID = -5215028275577848311L; + + @JsonProperty("generic-vnf-id") + private String genericVnfId; + + @JsonProperty("vf-module-id") + private String vfModuleId; + + @JsonProperty("vf-module-model-invariant-id") + private String vfModuleModelInvariantId; + + @JsonProperty("vf-module-model-version-id") + private String vfModuleModelVersionId; + + @JsonProperty("vf-module-model-customization-id") + private String vfModuleModelCustomizationId; + + @JsonProperty("oof_directives") + private JsonNode oofDirectives; + + @JsonProperty("sdnc_directives") + private JsonNode sdncDirectives; + + @JsonProperty("user_directives") + private JsonNode userDirectives; + + @JsonProperty("template_type") + private String templateType; + + @JsonProperty("template_data") + private CreateStackParam templateData; + + public String getGenericVnfId() { + return genericVnfId; + } + + public void setGenericVnfId(final String genericVnfId) { + this.genericVnfId = genericVnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(final String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleModelInvariantId() { + return vfModuleModelInvariantId; + } + + public void setVfModuleModelInvariantId(final String vfModuleModelInvariantId) { + this.vfModuleModelInvariantId = vfModuleModelInvariantId; + } + + public String getVfModuleModelVersionId() { + return vfModuleModelVersionId; + } + + public void setVfModuleModelVersionId(final String vfModuleModelVersionId) { + this.vfModuleModelVersionId = vfModuleModelVersionId; + } + + public String getVfModuleModelCustomizationId() { + return vfModuleModelCustomizationId; + } + + @JsonProperty("vf-module-model-customization-id") + public void setVfModuleModelCustomizationId(final String vfModuleModelCustomizationId) { + this.vfModuleModelCustomizationId = vfModuleModelCustomizationId; + } + + public JsonNode getOofDirectives() { + return oofDirectives; + } + + public void setOofDirectives(final JsonNode oofDirectives) { + this.oofDirectives = oofDirectives; + } + + public JsonNode getSdncDirectives() { + return sdncDirectives; + } + + public void setSdncDirectives(final JsonNode sdncDirectives) { + this.sdncDirectives = sdncDirectives; + } + + public JsonNode getUserDirectives() { + return userDirectives; + } + + public void setUserDirectives(final JsonNode userDirectives) { + this.userDirectives = userDirectives; + } + + public String getTemplateType() { + return templateType; + } + + public void setTemplateType(final String templateType) { + this.templateType = templateType; + } + + public CreateStackParam getTemplateData() { + return templateData; + } + + public void setTemplateData(CreateStackParam templateData) { + this.templateData = templateData; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("genericVnfId", genericVnfId).append("vfModuleId", vfModuleId) + .append("vfModuleModelInvariantId", vfModuleModelInvariantId) + .append("vfModuleModelVersionId", vfModuleModelVersionId) + .append("vfModuleModelCustomizationId", vfModuleModelCustomizationId) + .append("oofDirectives", oofDirectives).append("sdncDirectives", sdncDirectives) + .append("userDirectives", userDirectives).append("templateType", templateType) + .append("templateData", templateData).toString(); + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/Resource.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/Resource.java new file mode 100644 index 00000000..666cbe03 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/Resource.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.beans; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "resource-type", "resource-link" }) +public class Resource { + + @JsonProperty("resource-type") + private String resourceType; + + @JsonProperty("resource-link") + private String resourceLink; + + @JsonProperty("resource-type") + public String getResourceType() { + return resourceType; + } + + public void setResourceType(final String resourceType) { + this.resourceType = resourceType; + } + + public String getResourceLink() { + return resourceLink; + } + + public void setResourceLink(final String resourceLink) { + this.resourceLink = resourceLink; + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/Response.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/Response.java new file mode 100644 index 00000000..8f0713ea --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/beans/Response.java @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.multicloudsimulator.beans; + +public class Response { + + private String errorMsg; + + public Response(final String errorMsg) { + this.errorMsg = errorMsg; + } + + public Response() { + } + + public String getErrorMsg() { + return errorMsg; + } + + public void setErrorMsg(final String errorMsg) { + this.errorMsg = errorMsg; + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/configuration/ApplicationConfiguration.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/configuration/ApplicationConfiguration.java new file mode 100644 index 00000000..365710e3 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/configuration/ApplicationConfiguration.java @@ -0,0 +1,42 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.configuration; + +import static org.onap.so.multicloudsimulator.utils.Constants.MULTICLOUD_CACHE; +import java.util.Arrays; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.cache.concurrent.ConcurrentMapCache; +import org.springframework.cache.support.SimpleCacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ApplicationConfiguration { + + @Bean + public CacheManager cacheManager() { + final SimpleCacheManager manager = new SimpleCacheManager(); + manager.setCaches(Arrays.asList(getCache(MULTICLOUD_CACHE))); + return manager; + } + + private Cache getCache(final String name) { + return new ConcurrentMapCache(name); + } +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/configuration/WebSecurityConfigImpl.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/configuration/WebSecurityConfigImpl.java new file mode 100644 index 00000000..b1d0984a --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/configuration/WebSecurityConfigImpl.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.configuration; + +import static org.onap.so.multicloudsimulator.utils.Constants.OPERATIONS_URL; +import org.onap.so.simulator.configuration.SimulatorSecurityConfigurer; +import org.onap.so.simulator.model.UserCredentials; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; + +@Configuration +@EnableWebSecurity +public class WebSecurityConfigImpl extends SimulatorSecurityConfigurer { + + @Autowired + public WebSecurityConfigImpl(final UserCredentials userCredentials) { + super(userCredentials.getUsers()); + } + + @Override + protected void configure(final HttpSecurity http) throws Exception { + http.csrf().disable().authorizeRequests().antMatchers(OPERATIONS_URL + "/**/**").authenticated().and() + .httpBasic(); + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/controller/MultiCloudController.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/controller/MultiCloudController.java new file mode 100644 index 00000000..c99e246e --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/controller/MultiCloudController.java @@ -0,0 +1,128 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.controller; + +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.core.MediaType; +import org.apache.commons.io.IOUtils; +import org.onap.so.multicloudsimulator.beans.InstanceOutput; +import org.onap.so.multicloudsimulator.beans.MulticloudCreateResponse; +import org.onap.so.multicloudsimulator.beans.MulticloudInstanceRequest; +import org.onap.so.multicloudsimulator.beans.InstanceResponse; +import org.onap.so.multicloudsimulator.beans.InstanceNameOutput; +import org.onap.so.multicloudsimulator.beans.MulticloudRequest; + +import org.springframework.http.ResponseEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.io.IOException; +import java.io.InputStream; + +import static org.onap.so.multicloudsimulator.utils.Constants.BASE_URL; + +@RestController +@RequestMapping(path = BASE_URL) +public class MultiCloudController { + + public static final String X_HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override"; + private static final Logger LOGGER = LoggerFactory.getLogger(MultiCloudController.class); + + @PostMapping(value = "/v1/instance") + public ResponseEntity createInstance(@RequestBody MulticloudInstanceRequest req) { + System.out.println("MultiCloud createInstance "); + final InstanceResponse InstanceResponse = new InstanceResponse(); + + LOGGER.info("Calling createInstance"); + return ResponseEntity.ok(InstanceResponse); + } + + @GetMapping(value = "/{cloud-owner}/{cloud-region-id}/infra_workload", produces = { MediaType.APPLICATION_JSON }) + public ResponseEntity getInstance(@PathVariable("cloud-owner") String cloudOwner, + @PathVariable("cloud-region-id") String cloudRegionId, + @RequestParam(value = "depth", required = false, defaultValue = "0") Integer depth, + @RequestParam(name = "format", required = false) final String name, final HttpServletRequest request) + throws Exception { + + LOGGER.info("found CloudOwner {}", cloudOwner); + LOGGER.info("found cloudRegionId {}", cloudRegionId); + LOGGER.info("found name {}", name); + final InputStream instanceOutput = InstanceOutput.getInstance(); + final String output = IOUtils.toString(instanceOutput, "utf-8"); + + return ResponseEntity.ok(output); + } + + @PostMapping(value = "/{cloud-owner}/{cloud-region-id}/infra_workload", consumes = { MediaType.APPLICATION_JSON, + MediaType.APPLICATION_XML }, produces = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + public ResponseEntity postCreateInstance(@RequestBody final MulticloudCreateResponse inputRequest, + @PathVariable("cloud-owner") final String cloudOwner, + @PathVariable("cloud-region-id") final String cloudRegionId, + @RequestHeader(value = X_HTTP_METHOD_OVERRIDE, required = false) final String xHttpHeaderOverride, + final HttpServletRequest request) throws IOException { + + LOGGER.info("Calling postCreateInstance"); + inputRequest.setWorkloadStatusReason(null); + + inputRequest.setWorkloadId("sad_sammet"); + inputRequest.setTemplateType("heat"); + inputRequest.setWorkloadStatus("CREATE_COMPLETE"); + + return ResponseEntity.status(201).body(inputRequest); + } + + @GetMapping(value = "/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}", produces = { + MediaType.APPLICATION_JSON }) + public ResponseEntity getInstanceName(@PathVariable("cloud-owner") final String cloudOwner, + @PathVariable("cloud-region-id") final String cloudRegionId, @PathVariable("workload-id") final String workloadId, + @RequestParam(value = "depth", required = false, defaultValue = "0") final Integer depth, + @RequestParam(name = "format", required = false) final String name, final HttpServletRequest request) + throws Exception { + + LOGGER.info("Calling getInstanceName"); + LOGGER.info("found CloudOwner {}", cloudOwner); + LOGGER.info("found cloudRegionId {}", cloudRegionId); + LOGGER.info("found name {}", name); + final InputStream instanceNameOutput = InstanceNameOutput.getInstanceName(); + final String output = IOUtils.toString(instanceNameOutput, "utf-8"); + + return ResponseEntity.ok(output); + } + + @PostMapping(value = "/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}", consumes = { + MediaType.APPLICATION_JSON, + MediaType.APPLICATION_XML }, produces = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) + public ResponseEntity postCreateInstanceName(@RequestBody final MulticloudRequest inputRequest, + @PathVariable("cloud-owner") final String cloudOwner, @PathVariable("workload-id") String workloadId, + @PathVariable("cloud-region-id") final String cloudRegionId, + @RequestHeader(value = X_HTTP_METHOD_OVERRIDE, required = false) final String xHttpHeaderOverride, + final HttpServletRequest request) throws IOException { + + LOGGER.info("Calling postCreateInstanceName"); + + return ResponseEntity.status(405).build(); + } +} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/utils/Constants.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/utils/Constants.java new file mode 100644 index 00000000..e104d235 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/utils/Constants.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator.utils; + +public class Constants { + + public static final String BASE_URL = "/api/multicloud/v1"; + + public static final String OPERATIONS_URL = BASE_URL + "/operations"; + + public static final String MULTICLOUD_CACHE = "multicloud-cache"; + + private Constants() { + } +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/application.properties b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/application.properties new file mode 100644 index 00000000..e507a12f --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/application.properties @@ -0,0 +1 @@ +security.ignored=/** diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/application.yaml b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/application.yaml new file mode 100644 index 00000000..393d1b7b --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/application.yaml @@ -0,0 +1,16 @@ +server: + port: 9996 + tomcat: + max-threads: 4 +ssl-enable: false +spring: + security: + users: + - username: mso + password: $2a$04$f8SB6cW/VI26QvYM6z.GXu7hlEmwnFtePenD8zF18mS3Atu3QNqr2 + role: VID + - username: admin + password: $2a$04$f8SB6cW/VI26QvYM6z.GXu7hlEmwnFtePenD8zF18mS3Atu3QNqr2 + role: VID + main: + allow-bean-definition-overriding: true \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/data/InstanceNameOutput.json b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/data/InstanceNameOutput.json new file mode 100644 index 00000000..8c0e88f4 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/data/InstanceNameOutput.json @@ -0,0 +1,6 @@ +{ + "workload_status_reason": null, + "template_type": "heat", + "workload_id": "sad_sammet", + "workload_status": "CREATE_COMPLETE" +} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/data/InstanceOutput.json b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/data/InstanceOutput.json new file mode 100644 index 00000000..e47ffb43 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/data/InstanceOutput.json @@ -0,0 +1,8 @@ +{ + "workload_status_reason": { + "stacks": "NOTFOUND" + }, + "template_type": "heat", + "workload_id": "", + "workload_status": "GET_COMPLETE" +} diff --git a/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/test/java/org/onap/so/multicloudsimulator/MultiCloudSimulatorApplicationTests.java b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/test/java/org/onap/so/multicloudsimulator/MultiCloudSimulatorApplicationTests.java new file mode 100644 index 00000000..d9b10d45 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/test/java/org/onap/so/multicloudsimulator/MultiCloudSimulatorApplicationTests.java @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.multicloudsimulator; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.so.multicloudsimulator.utils.Constants; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.junit.Assert.assertEquals; + +@RunWith(SpringJUnit4ClassRunner.class) +@ActiveProfiles("test") +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@Configuration +class MultiCloudSimulatorApplicationTests { + @LocalServerPort + private int port; + + @Autowired + private TestRestTemplate restTemplate; + + @Test + public void test_createInstance() { + final String url = "http://localhost:" + port + Constants.BASE_URL + "/operations"; + + final ResponseEntity object = restTemplate.getForEntity(url, String.class); + + assertEquals(Constants.OPERATIONS_URL, object.getBody()); + + } + +} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/package/docker/pom.xml b/plans/so/integration-etsi-testing/so-simulators/package/docker/pom.xml index 9334a095..9173439f 100644 --- a/plans/so/integration-etsi-testing/so-simulators/package/docker/pom.xml +++ b/plans/so/integration-etsi-testing/so-simulators/package/docker/pom.xml @@ -99,6 +99,29 @@ + + simulators/multicloud-simulator + + try + docker-files + Dockerfile.so-simulator-base-image + + ${project.version} + + + + + + + org.onap.so.simulators:multicloud-simulator + + app.jar + + + + + + simulators/vnfm-simulator @@ -170,6 +193,11 @@ sdnc-simulator ${project.version} + + ${project.parent.groupId} + multicloud-simulator + ${project.version} + org.onap.so.simulators.vnfm vnfm-service diff --git a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/Dockerfile.so-simulator-base-image b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/Dockerfile.so-simulator-base-image index efd7833f..f954ea3b 100644 --- a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/Dockerfile.so-simulator-base-image +++ b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/Dockerfile.so-simulator-base-image @@ -1,4 +1,4 @@ -FROM docker.io/openjdk:8-jdk-alpine +FROM adoptopenjdk/openjdk11:jre-11.0.9.1_1-alpine ARG http_proxy ARG https_proxy @@ -8,7 +8,8 @@ ENV http_proxy=$HTTP_PROXY ENV https_proxy=$HTTPS_PROXY # Update the package list and upgrade installed packages -RUN apk update && apk upgrade +USER root +RUN apk update # Install commonly needed tools RUN apk --no-cache add curl netcat-openbsd sudo nss @@ -24,6 +25,8 @@ COPY scripts/start-app.sh /app RUN chown -R so:so /app && chmod 700 /app/*.sh +USER so + # Springboot configuration (required) VOLUME /app/config diff --git a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/Dockerfile.workaround-job-container b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/Dockerfile.workaround-job-container index faf8492c..795a015e 100644 --- a/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/Dockerfile.workaround-job-container +++ b/plans/so/integration-etsi-testing/so-simulators/package/docker/src/main/docker/docker-files/Dockerfile.workaround-job-container @@ -22,6 +22,7 @@ FROM docker.io/alpine # Install packages -RUN apk update && apk upgrade && apk add mysql-client && apk add bash +USER root +RUN apk upgrade && apk add mysql-client -RUN apk --no-cache add curl netcat-openbsd sudo nss +RUN apk --no-cache add bash curl netcat-openbsd sudo nss diff --git a/plans/so/integration-etsi-testing/so-simulators/pom.xml b/plans/so/integration-etsi-testing/so-simulators/pom.xml index 4be20c66..352c18b1 100644 --- a/plans/so/integration-etsi-testing/so-simulators/pom.xml +++ b/plans/so/integration-etsi-testing/so-simulators/pom.xml @@ -10,14 +10,15 @@ 2.1 UTF-8 UTF-8 - 1.8 - 1.8 + 11 + 11 2.3.0 1.1.1 - 1.8 + 11 common + multicloud-simulator sdc-simulator aai-simulator sdnc-simulator diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/pom.xml b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/pom.xml index 27e7c3ea..e694fef1 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/pom.xml +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/pom.xml @@ -9,6 +9,11 @@ sdc-simulator ${project.artifactId} + + ${project.parent.groupId} + common + ${project.version} + org.springframework.boot spring-boot-starter-security diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/configration/WebSecurityConfigImpl.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/configration/WebSecurityConfigImpl.java index b2c51369..a8ede989 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/configration/WebSecurityConfigImpl.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/configration/WebSecurityConfigImpl.java @@ -20,15 +20,12 @@ package org.onap.so.sdcsimulator.configration; import org.onap.so.sdcsimulator.utils.Constants; +import org.onap.so.simulator.configuration.SimulatorSecurityConfigurer; +import org.onap.so.simulator.model.UserCredentials; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; /** * @author waqas.ikram@ericsson.com @@ -36,18 +33,12 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; */ @Configuration @EnableWebSecurity -public class WebSecurityConfigImpl extends WebSecurityConfigurerAdapter { +public class WebSecurityConfigImpl extends SimulatorSecurityConfigurer { - private final String username; - private final String password; - private final String role; - public WebSecurityConfigImpl(@Value("${spring.security.username}") final String username, - @Value("${spring.security.password}") final String password, - @Value("${spring.security.role}") final String role) { - this.username = username; - this.password = password; - this.role = role; + @Autowired + public WebSecurityConfigImpl(final UserCredentials userCredentials) { + super(userCredentials.getUsers()); } @@ -57,15 +48,5 @@ public class WebSecurityConfigImpl extends WebSecurityConfigurerAdapter { .httpBasic(); } - @Bean - public BCryptPasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); - } - - @Autowired - public void configureGlobal(final AuthenticationManagerBuilder auth) throws Exception { - auth.inMemoryAuthentication().passwordEncoder(passwordEncoder()).withUser(username).password(password) - .roles(role); - } } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/controller/CatalogController.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/controller/CatalogController.java index 60c1865d..eebc08c6 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/controller/CatalogController.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/controller/CatalogController.java @@ -22,7 +22,9 @@ package org.onap.so.sdcsimulator.controller; import static org.onap.so.sdcsimulator.utils.Constants.CATALOG_URL; import java.util.Optional; import javax.ws.rs.core.MediaType; -import org.onap.so.sdcsimulator.providers.ResourceProvider; +import org.onap.so.sdcsimulator.models.AssetType; +import org.onap.so.sdcsimulator.models.Metadata; +import org.onap.so.sdcsimulator.providers.AssetProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -42,17 +44,23 @@ import org.springframework.web.bind.annotation.RequestMapping; public class CatalogController { private static final Logger LOGGER = LoggerFactory.getLogger(CatalogController.class); - private ResourceProvider resourceProvider; + private final AssetProvider assetProvider; @Autowired - public CatalogController(final ResourceProvider resourceProvider) { - this.resourceProvider = resourceProvider; + public CatalogController(final AssetProvider assetProvider) { + this.assetProvider = assetProvider; + } + + @GetMapping(value = "/resources", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity getResources() { + LOGGER.info("Running getResources ..."); + return ResponseEntity.ok().body(assetProvider.getAssetInfo(AssetType.RESOURCES)); } @GetMapping(value = "/resources/{csarId}/toscaModel", produces = MediaType.APPLICATION_OCTET_STREAM) - public ResponseEntity getCsar(@PathVariable("csarId") final String csarId) { + public ResponseEntity getResourceCsar(@PathVariable("csarId") final String csarId) { LOGGER.info("Running getCsar for {} ...", csarId); - final Optional resource = resourceProvider.getResource(csarId); + final Optional resource = assetProvider.getAsset(csarId, AssetType.RESOURCES); if (resource.isPresent()) { return new ResponseEntity<>(resource.get(), HttpStatus.OK); } @@ -61,4 +69,51 @@ public class CatalogController { return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } + @GetMapping(value = "/resources/{csarId}/metadata", + produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity getResourceMetadata(@PathVariable("csarId") final String csarId) { + LOGGER.info("Running getResourceMetadata for {} ...", csarId); + final Optional resource = assetProvider.getMetadata(csarId, AssetType.RESOURCES); + if (resource.isPresent()) { + return new ResponseEntity<>(resource.get(), HttpStatus.OK); + } + LOGGER.error("Unable to find metadata for csarId: {}", csarId); + + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + + + @GetMapping(value = "/services", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity getServices() { + LOGGER.info("Running getServices ..."); + return ResponseEntity.ok().body(assetProvider.getAssetInfo(AssetType.SERVICES)); + } + + @GetMapping(value = "/services/{csarId}/toscaModel", produces = MediaType.APPLICATION_OCTET_STREAM) + public ResponseEntity getServiceCsar(@PathVariable("csarId") final String csarId) { + LOGGER.info("Running getServiceCsar for {} ...", csarId); + final Optional resource = assetProvider.getAsset(csarId, AssetType.SERVICES); + if (resource.isPresent()) { + return new ResponseEntity<>(resource.get(), HttpStatus.OK); + } + LOGGER.error("Unable to find csar: {}", csarId); + + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + + + @GetMapping(value = "/services/{csarId}/metadata", + produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity getServiceMetadata(@PathVariable("csarId") final String csarId) { + LOGGER.info("Running getServiceMetadata for {} ...", csarId); + final Optional resource = assetProvider.getMetadata(csarId, AssetType.SERVICES); + if (resource.isPresent()) { + return new ResponseEntity<>(resource.get(), HttpStatus.OK); + } + LOGGER.error("Unable to find metadata for csarId: {}", csarId); + + return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + } + + } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Artifact.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Artifact.java new file mode 100644 index 00000000..51bd18b1 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Artifact.java @@ -0,0 +1,234 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import java.io.Serializable; +import org.springframework.util.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class Artifact implements Serializable { + + private static final long serialVersionUID = 4106531921550274666L; + + @JsonProperty("artifactName") + private String artifactName; + + @JsonProperty("artifactType") + private String artifactType; + + @JsonProperty("artifactURL") + private String artifactUrl; + + @JsonProperty("artifactDescription") + private String artifactDescription; + + @JsonProperty("artifactChecksum") + private String artifactChecksum; + + @JsonProperty("artifactUUID") + private String artifactUuid; + + @JsonProperty("artifactVersion") + private String artifactVersion; + + @JsonProperty("artifactLabel") + private String artifactLabel; + + @JsonProperty("artifactGroupType") + private String artifactGroupType; + + public String getArtifactName() { + return artifactName; + } + + public void setArtifactName(final String artifactName) { + this.artifactName = artifactName; + } + + public Artifact artifactName(final String artifactName) { + this.artifactName = artifactName; + return this; + } + + public String getArtifactType() { + return artifactType; + } + + public void setArtifactType(final String artifactType) { + this.artifactType = artifactType; + } + + public Artifact artifactType(final String artifactType) { + this.artifactType = artifactType; + return this; + } + + public String getArtifactUrl() { + return artifactUrl; + } + + public void setArtifactUrl(final String artifactUrl) { + this.artifactUrl = artifactUrl; + } + + public Artifact artifactUrl(final String artifactURL) { + this.artifactUrl = artifactURL; + return this; + } + + public String getArtifactDescription() { + return artifactDescription; + } + + public void setArtifactDescription(final String artifactDescription) { + this.artifactDescription = artifactDescription; + } + + public Artifact artifactDescription(final String artifactDescription) { + this.artifactDescription = artifactDescription; + return this; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(final String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public Artifact artifactChecksum(final String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + return this; + } + + public String getArtifactUuid() { + return artifactUuid; + } + + public void setArtifactUuid(final String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public Artifact artifactUuid(final String artifactUuid) { + this.artifactUuid = artifactUuid; + return this; + } + + public String getArtifactVersion() { + return artifactVersion; + } + + public void setArtifactVersion(final String artifactVersion) { + this.artifactVersion = artifactVersion; + } + + public Artifact artifactVersion(final String artifactVersion) { + this.artifactVersion = artifactVersion; + return this; + } + + public String getArtifactLabel() { + return artifactLabel; + } + + public void setArtifactLabel(final String artifactLabel) { + this.artifactLabel = artifactLabel; + } + + public Artifact artifactLabel(final String artifactLabel) { + this.artifactLabel = artifactLabel; + return this; + } + + public String getArtifactGroupType() { + return artifactGroupType; + } + + public void setArtifactGroupType(final String artifactGroupType) { + this.artifactGroupType = artifactGroupType; + } + + public Artifact artifactGroupType(final String artifactGroupType) { + this.artifactGroupType = artifactGroupType; + return this; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((artifactChecksum == null) ? 0 : artifactChecksum.hashCode()); + result = prime * result + ((artifactDescription == null) ? 0 : artifactDescription.hashCode()); + result = prime * result + ((artifactGroupType == null) ? 0 : artifactGroupType.hashCode()); + result = prime * result + ((artifactLabel == null) ? 0 : artifactLabel.hashCode()); + result = prime * result + ((artifactName == null) ? 0 : artifactName.hashCode()); + result = prime * result + ((artifactType == null) ? 0 : artifactType.hashCode()); + result = prime * result + ((artifactUrl == null) ? 0 : artifactUrl.hashCode()); + result = prime * result + ((artifactUuid == null) ? 0 : artifactUuid.hashCode()); + result = prime * result + ((artifactVersion == null) ? 0 : artifactVersion.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof AssetInfo) { + final Artifact other = (Artifact) obj; + return ObjectUtils.nullSafeEquals(artifactChecksum, other.artifactChecksum) + && ObjectUtils.nullSafeEquals(artifactDescription, other.artifactDescription) + && ObjectUtils.nullSafeEquals(artifactGroupType, other.artifactGroupType) + && ObjectUtils.nullSafeEquals(artifactLabel, other.artifactLabel) + && ObjectUtils.nullSafeEquals(artifactGroupType, other.artifactGroupType) + && ObjectUtils.nullSafeEquals(artifactName, other.artifactName) + && ObjectUtils.nullSafeEquals(artifactType, other.artifactType) + && ObjectUtils.nullSafeEquals(artifactUrl, other.artifactUrl) + && ObjectUtils.nullSafeEquals(artifactUuid, other.artifactUuid) + && ObjectUtils.nullSafeEquals(artifactVersion, other.artifactVersion); + + + } + return false; + + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Artifact {\n"); + sb.append(" artifactName: ").append(artifactName).append("\n"); + sb.append(" artifactType: ").append(artifactType).append("\n"); + sb.append(" artifactURL: ").append(artifactUrl).append("\n"); + sb.append(" artifactDescription: ").append(artifactDescription).append("\n"); + sb.append(" artifactChecksum: ").append(artifactChecksum).append("\n"); + sb.append(" artifactUUID: ").append(artifactUuid).append("\n"); + sb.append(" artifactVersion: ").append(artifactVersion).append("\n"); + sb.append(" artifactLabel: ").append(artifactLabel).append("\n"); + sb.append(" artifactGroupType: ").append(artifactGroupType).append("\n"); + + sb.append("}"); + return sb.toString(); + + } +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/AssetInfo.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/AssetInfo.java new file mode 100644 index 00000000..17bcdda8 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/AssetInfo.java @@ -0,0 +1,248 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import java.io.Serializable; +import org.springframework.util.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class AssetInfo implements Serializable { + + private static final long serialVersionUID = 3967660000071162759L; + + @JsonProperty("uuid") + private String uuid; + + @JsonProperty("invariantUUID") + private String invariantUuid; + + @JsonProperty("name") + private String name; + + @JsonProperty("version") + private String version; + + @JsonProperty("toscaModelURL") + private String toscaModelUrl; + + @JsonProperty("category") + private String category; + + @JsonProperty("resourceType") + private String resourceType; + + @JsonProperty("lifecycleState") + private String lifecycleState; + + @JsonProperty("lastUpdaterUserId") + private String lastUpdaterUserId; + + @JsonProperty("toscaResourceName") + private String toscaResourceName; + + public String getUuid() { + return uuid; + } + + public void setUuid(final String uuid) { + this.uuid = uuid; + } + + public AssetInfo uuid(final String uuid) { + this.uuid = uuid; + return this; + } + + public String getInvariantUuid() { + return invariantUuid; + } + + public void setInvariantUuid(final String invariantUuid) { + this.invariantUuid = invariantUuid; + } + + public AssetInfo invariantUuid(final String invariantUuid) { + this.invariantUuid = invariantUuid; + return this; + } + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + + public AssetInfo name(final String name) { + this.name = name; + return this; + } + + public String getVersion() { + return version; + } + + public void setVersion(final String version) { + this.version = version; + } + + public AssetInfo version(final String version) { + this.version = version; + return this; + } + + public String getToscaModelUrl() { + return toscaModelUrl; + } + + public void setToscaModelUrl(final String toscaModelUrl) { + this.toscaModelUrl = toscaModelUrl; + } + + public AssetInfo toscaModelUrl(final String toscaModelUrl) { + this.toscaModelUrl = toscaModelUrl; + return this; + } + + public String getCategory() { + return category; + } + + public void setCategory(final String category) { + this.category = category; + } + + public AssetInfo category(final String category) { + this.category = category; + return this; + } + + public String getResourceType() { + return resourceType; + } + + public void setResourceType(final String resourceType) { + this.resourceType = resourceType; + } + + public AssetInfo resourceType(final String resourceType) { + this.resourceType = resourceType; + return this; + } + + public String getLifecycleState() { + return lifecycleState; + } + + public void setLifecycleState(final String lifecycleState) { + this.lifecycleState = lifecycleState; + } + + public AssetInfo lifecycleState(final String lifecycleState) { + this.lifecycleState = lifecycleState; + return this; + } + + public String getLastUpdaterUserId() { + return lastUpdaterUserId; + } + + public void setLastUpdaterUserId(final String lastUpdaterUserId) { + this.lastUpdaterUserId = lastUpdaterUserId; + } + + public AssetInfo lastUpdaterUserId(final String lastUpdaterUserId) { + this.lastUpdaterUserId = lastUpdaterUserId; + return this; + } + + public String getToscaResourceName() { + return toscaResourceName; + } + + public void setToscaResourceName(final String toscaResourceName) { + this.toscaResourceName = toscaResourceName; + } + + public AssetInfo toscaResourceName(final String toscaResourceName) { + this.toscaResourceName = toscaResourceName; + return this; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((category == null) ? 0 : category.hashCode()); + result = prime * result + ((invariantUuid == null) ? 0 : invariantUuid.hashCode()); + result = prime * result + ((lastUpdaterUserId == null) ? 0 : lastUpdaterUserId.hashCode()); + result = prime * result + ((lifecycleState == null) ? 0 : lifecycleState.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode()); + result = prime * result + ((toscaModelUrl == null) ? 0 : toscaModelUrl.hashCode()); + result = prime * result + ((uuid == null) ? 0 : uuid.hashCode()); + result = prime * result + ((version == null) ? 0 : version.hashCode()); + + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof AssetInfo) { + final AssetInfo other = (AssetInfo) obj; + return ObjectUtils.nullSafeEquals(category, other.category) + && ObjectUtils.nullSafeEquals(invariantUuid, other.invariantUuid) + && ObjectUtils.nullSafeEquals(lastUpdaterUserId, other.lastUpdaterUserId) + && ObjectUtils.nullSafeEquals(lifecycleState, other.lifecycleState) + && ObjectUtils.nullSafeEquals(name, other.name) + && ObjectUtils.nullSafeEquals(resourceType, other.resourceType) + && ObjectUtils.nullSafeEquals(toscaModelUrl, other.toscaModelUrl) + && ObjectUtils.nullSafeEquals(uuid, other.uuid) + && ObjectUtils.nullSafeEquals(version, other.version); + + } + return false; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class "); + sb.append(this.getClass().getName()); + sb.append(" {\n"); + sb.append(" uuid: ").append(uuid).append("\n"); + sb.append(" invariantUuid: ").append(invariantUuid).append("\n"); + sb.append(" name: ").append(name).append("\n"); + sb.append(" version: ").append(version).append("\n"); + sb.append(" toscaModelUrl: ").append(toscaModelUrl).append("\n"); + sb.append(" category: ").append(category).append("\n"); + sb.append(" lifecycleState: ").append(lifecycleState).append("\n"); + sb.append(" lastUpdaterUserId: ").append(lastUpdaterUserId).append("\n"); + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/AssetType.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/AssetType.java new file mode 100644 index 00000000..a86e0630 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/AssetType.java @@ -0,0 +1,114 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import static org.onap.so.sdcsimulator.utils.Constants.CATALOG_URL; +import static org.onap.so.sdcsimulator.utils.Constants.FORWARD_SLASH; +import java.io.File; +import java.io.IOException; +import org.springframework.core.io.Resource; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public enum AssetType { + + RESOURCES { + @Override + public AssetInfo getAssetInfo(final Resource resource) throws IOException { + return OBJ_MAPPER.readValue(resource.getInputStream(), ResourceAssetInfo.class); + } + + @Override + public AssetInfo getAssetInfo(final File file) throws IOException { + return OBJ_MAPPER.readValue(file, ResourceAssetInfo.class); + } + + @Override + public Metadata getMetadata(final Resource resource) throws IOException { + return OBJ_MAPPER.readValue(resource.getInputStream(), ResourceMetadata.class); + } + + @Override + public Metadata getMetadata(final File file) throws IOException { + return OBJ_MAPPER.readValue(file, ResourceMetadata.class); + } + + }, + SERVICES { + @Override + public AssetInfo getAssetInfo(final Resource resource) throws IOException { + return OBJ_MAPPER.readValue(resource.getInputStream(), ServiceAssetInfo.class); + } + + @Override + public AssetInfo getAssetInfo(final File file) throws IOException { + return OBJ_MAPPER.readValue(file, ServiceAssetInfo.class); + } + + @Override + public Metadata getMetadata(final Resource resource) throws IOException { + return OBJ_MAPPER.readValue(resource.getInputStream(), ServiceMetadata.class); + } + + @Override + public Metadata getMetadata(final File file) throws IOException { + return OBJ_MAPPER.readValue(file, ServiceMetadata.class); + } + + }; + + private static final ObjectMapper OBJ_MAPPER = + new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + + public abstract AssetInfo getAssetInfo(final Resource resource) throws IOException; + + public abstract AssetInfo getAssetInfo(final File file) throws IOException; + + public abstract Metadata getMetadata(final Resource resource) throws IOException; + + public abstract Metadata getMetadata(final File file) throws IOException; + + public String getToscaModelUrl(final String filename) { + return CATALOG_URL + FORWARD_SLASH + this.toString().toLowerCase() + FORWARD_SLASH + filename + "/toscaModel"; + } + + public AssetInfo getDefaultAssetInfo(final String filename) { + AssetInfo defaultValue = null; + + if (this.equals(RESOURCES)) { + defaultValue = new ResourceAssetInfo().subCategory("Network Service"); + } else if (this.equals(SERVICES)) { + defaultValue = new ServiceAssetInfo().distributionStatus("DISTRIBUTED"); + } else { + defaultValue = new AssetInfo(); + } + + return defaultValue.uuid(filename).invariantUuid(filename).name(filename).version("1.0") + .toscaModelUrl(getToscaModelUrl(filename)).category("Generic").lifecycleState("CERTIFIED") + .lastUpdaterUserId("SDC_SIMULATOR"); + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Metadata.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Metadata.java new file mode 100644 index 00000000..4836fc16 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Metadata.java @@ -0,0 +1,104 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import java.util.HashSet; +import java.util.Set; +import org.springframework.util.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class Metadata extends AssetInfo { + + private static final long serialVersionUID = 2754071491333890698L; + + @JsonProperty("resources") + private Set resources = new HashSet<>(); + + @JsonProperty("artifacts") + private Set artifacts = new HashSet<>(); + + + public Set getResources() { + return resources; + } + + public void setResources(final Set resources) { + this.resources = resources; + } + + public Metadata resources(final Set resources) { + this.resources = resources; + return this; + } + + public Set getArtifacts() { + return artifacts; + } + + public void setArtifacts(final Set artifacts) { + this.artifacts = artifacts; + } + + public Metadata artifacts(Set artifacts) { + this.artifacts = artifacts; + return this; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + super.hashCode(); + result = prime * result + ((resources == null) ? 0 : resources.hashCode()); + result = prime * result + ((artifacts == null) ? 0 : artifacts.hashCode()); + + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof Metadata) { + final Metadata other = (Metadata) obj; + return super.equals(obj) && ObjectUtils.nullSafeEquals(resources, other.resources) + && ObjectUtils.nullSafeEquals(artifacts, other.artifacts); + + } + return false; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.deleteCharAt(sb.length() - 1); + sb.append(" resources: ").append(resources).append("\n"); + sb.append(" artifacts: ").append(artifacts).append("\n"); + + sb.append("}"); + return sb.toString(); + } + + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Resource.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Resource.java new file mode 100644 index 00000000..6eb3734b --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/Resource.java @@ -0,0 +1,198 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; +import org.springframework.util.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class Resource implements Serializable { + + private static final long serialVersionUID = -8014206400770867160L; + + @JsonProperty("resourceInstanceName") + private String resourceInstanceName; + + @JsonProperty("resourceName") + private String resourceName; + + @JsonProperty("resourceInvariantUUID") + private String resourceInvariantUuid; + + @JsonProperty("resourceVersion") + private String resourceVersion; + + @JsonProperty("resoucreType") + private String resourceType; + + @JsonProperty("resourceUUID") + private String resourceUuid; + + @JsonProperty("artifacts") + private Set artifacts = new HashSet<>(); + + public String getResourceInstanceName() { + return resourceInstanceName; + } + + public void setResourceInstanceName(final String resourceInstanceName) { + this.resourceInstanceName = resourceInstanceName; + } + + public Resource resourceInstanceName(final String resourceInstanceName) { + this.resourceInstanceName = resourceInstanceName; + return this; + } + + public String getResourceName() { + return resourceName; + } + + public void setResourceName(final String resourceName) { + this.resourceName = resourceName; + } + + public Resource resourceName(final String resourceName) { + this.resourceName = resourceName; + return this; + } + + public String getResourceInvariantUuid() { + return resourceInvariantUuid; + } + + public void setResourceInvariantUuid(final String resourceInvariantUuid) { + this.resourceInvariantUuid = resourceInvariantUuid; + } + + public Resource resourceInvariantUuid(final String resourceInvariantUuid) { + this.resourceInvariantUuid = resourceInvariantUuid; + return this; + } + + public String getResourceVersion() { + return resourceVersion; + } + + public void setResourceVersion(final String resourceVersion) { + this.resourceVersion = resourceVersion; + } + + public Resource resourceVersion(final String resourceVersion) { + this.resourceVersion = resourceVersion; + return this; + } + + public String getResourceType() { + return resourceType; + } + + public void setResourceType(final String resourceType) { + this.resourceType = resourceType; + } + + public Resource resourceType(final String resourceType) { + this.resourceType = resourceType; + return this; + } + + public String getResourceUuid() { + return resourceUuid; + } + + public void setResourceUuid(final String resourceUuid) { + this.resourceUuid = resourceUuid; + } + + public Resource resourceUUID(final String resourceUuid) { + this.resourceUuid = resourceUuid; + return this; + } + + public Set getArtifacts() { + return artifacts; + } + + public void setArtifacts(final Set artifacts) { + this.artifacts = artifacts; + } + + public Resource artifacts(final Set artifacts) { + this.artifacts = artifacts; + return this; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((artifacts == null) ? 0 : artifacts.hashCode()); + result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode()); + result = prime * result + ((resourceInstanceName == null) ? 0 : resourceInstanceName.hashCode()); + result = prime * result + ((resourceInvariantUuid == null) ? 0 : resourceInvariantUuid.hashCode()); + result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode()); + result = prime * result + ((resourceUuid == null) ? 0 : resourceUuid.hashCode()); + result = prime * result + ((resourceVersion == null) ? 0 : resourceVersion.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof Resource) { + final Resource other = (Resource) obj; + return ObjectUtils.nullSafeEquals(resourceInstanceName, other.resourceInstanceName) + && ObjectUtils.nullSafeEquals(resourceName, other.resourceName) + && ObjectUtils.nullSafeEquals(resourceInvariantUuid, other.resourceInvariantUuid) + && ObjectUtils.nullSafeEquals(resourceVersion, other.resourceVersion) + && ObjectUtils.nullSafeEquals(resourceType, other.resourceType) + && ObjectUtils.nullSafeEquals(resourceUuid, other.resourceUuid) + && ObjectUtils.nullSafeEquals(artifacts, other.artifacts); + } + return false; + + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Resource {\n"); + sb.append(" resourceInstanceName: ").append(resourceInstanceName).append("\n"); + sb.append(" resourceName: ").append(resourceName).append("\n"); + sb.append(" resourceInvariantUuid: ").append(resourceInvariantUuid).append("\n"); + sb.append(" resourceVersion: ").append(resourceVersion).append("\n"); + sb.append(" resourceType: ").append(resourceType).append("\n"); + sb.append(" resourceUuid: ").append(resourceUuid).append("\n"); + sb.append(" artifacts: ").append(artifacts).append("\n"); + + sb.append("}"); + return sb.toString(); + + } + + + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ResourceAssetInfo.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ResourceAssetInfo.java new file mode 100644 index 00000000..352070a7 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ResourceAssetInfo.java @@ -0,0 +1,81 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import org.springframework.util.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class ResourceAssetInfo extends AssetInfo { + + private static final long serialVersionUID = -6812049917047990700L; + + @JsonProperty("subCategory") + private String subCategory; + + public String getSubCategory() { + return subCategory; + } + + public void setSubCategory(final String subCategory) { + this.subCategory = subCategory; + } + + public ResourceAssetInfo subCategory(final String subCategory) { + this.subCategory = subCategory; + return this; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + super.hashCode(); + result = prime * result + ((subCategory == null) ? 0 : subCategory.hashCode()); + + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof ResourceAssetInfo) { + final ResourceAssetInfo other = (ResourceAssetInfo) obj; + return super.equals(obj) && ObjectUtils.nullSafeEquals(subCategory, other.subCategory); + + } + return false; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.deleteCharAt(sb.length() - 1); + sb.append(" subCategory: ").append(subCategory).append("\n"); + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ResourceMetadata.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ResourceMetadata.java new file mode 100644 index 00000000..9ff02c43 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ResourceMetadata.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import java.io.Serializable; +import org.springframework.util.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class ResourceMetadata extends Metadata implements Serializable { + + private static final long serialVersionUID = -6812049917047990700L; + + @JsonProperty("subCategory") + private String subCategory; + + public String getSubCategory() { + return subCategory; + } + + public void setSubCategory(final String subCategory) { + this.subCategory = subCategory; + } + + public ResourceMetadata subCategory(final String subCategory) { + this.subCategory = subCategory; + return this; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + super.hashCode(); + result = prime * result + ((subCategory == null) ? 0 : subCategory.hashCode()); + + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof ResourceMetadata) { + final ResourceMetadata other = (ResourceMetadata) obj; + return super.equals(obj) && ObjectUtils.nullSafeEquals(subCategory, other.subCategory); + + } + return false; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.deleteCharAt(sb.length() - 1); + sb.append(" subCategory: ").append(subCategory).append("\n"); + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ServiceAssetInfo.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ServiceAssetInfo.java new file mode 100644 index 00000000..f1fa2bc9 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ServiceAssetInfo.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import org.springframework.util.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class ServiceAssetInfo extends AssetInfo { + + private static final long serialVersionUID = 1487426510731947767L; + + @JsonProperty("distributionStatus") + private String distributionStatus; + + public String getDistributionStatus() { + return distributionStatus; + } + + public void setDistributionStatus(final String distributionStatus) { + this.distributionStatus = distributionStatus; + } + + public ServiceAssetInfo distributionStatus(final String distributionStatus) { + this.distributionStatus = distributionStatus; + return this; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + super.hashCode(); + result = prime * result + ((distributionStatus == null) ? 0 : distributionStatus.hashCode()); + + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof ServiceAssetInfo) { + final ServiceAssetInfo other = (ServiceAssetInfo) obj; + return super.equals(obj) && ObjectUtils.nullSafeEquals(distributionStatus, other.distributionStatus); + + } + return false; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.deleteCharAt(sb.length() - 1); + sb.append(" distributionStatus: ").append(distributionStatus).append("\n"); + + sb.append("}"); + return sb.toString(); + } + + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ServiceMetadata.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ServiceMetadata.java new file mode 100644 index 00000000..5a2a8ade --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/models/ServiceMetadata.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdcsimulator.models; + +import java.io.Serializable; +import org.springframework.util.ObjectUtils; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * + * @author Waqas Ikram (waqas.ikram@est.tech) + * + */ +public class ServiceMetadata extends Metadata implements Serializable { + + private static final long serialVersionUID = -5677805295913361365L; + @JsonProperty("distributionStatus") + private String distributionStatus; + + public String getDistributionStatus() { + return distributionStatus; + } + + public void setDistributionStatus(final String distributionStatus) { + this.distributionStatus = distributionStatus; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + super.hashCode(); + result = prime * result + ((distributionStatus == null) ? 0 : distributionStatus.hashCode()); + + return result; + } + + @Override + public boolean equals(final Object obj) { + if (obj instanceof ServiceMetadata) { + final ServiceMetadata other = (ServiceMetadata) obj; + return super.equals(obj) && ObjectUtils.nullSafeEquals(distributionStatus, other.distributionStatus); + + } + return false; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.deleteCharAt(sb.length() - 1); + sb.append(" distributionStatus: ").append(distributionStatus).append("\n"); + + sb.append("}"); + return sb.toString(); + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/ResourceProvider.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/AssetProvider.java similarity index 68% rename from plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/ResourceProvider.java rename to plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/AssetProvider.java index 4d5dcdd0..3ea077d4 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/ResourceProvider.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/AssetProvider.java @@ -20,17 +20,23 @@ package org.onap.so.sdcsimulator.providers; -import java.io.IOException; -import java.io.InputStream; import java.util.Optional; +import java.util.Set; +import org.onap.so.sdcsimulator.models.AssetInfo; +import org.onap.so.sdcsimulator.models.AssetType; +import org.onap.so.sdcsimulator.models.Metadata; /** * @author Eoin Hanan (eoin.hanan@est.tech) + * @author Waqas Ikram (waqas.ikram@est.tech) + * */ -public interface ResourceProvider { +public interface AssetProvider { - Optional getResource(final String csarId); + Optional getAsset(final String csarId, final AssetType assetType); - Optional getInputStream(final String csarId) throws IOException; + Set getAssetInfo(final AssetType assetType); + + Optional getMetadata(final String csarId, final AssetType assetType); } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/AssetProviderImpl.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/AssetProviderImpl.java new file mode 100644 index 00000000..8996d249 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/AssetProviderImpl.java @@ -0,0 +1,216 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.sdcsimulator.providers; + +import static org.onap.so.sdcsimulator.utils.Constants.DOT_CSAR; +import static org.onap.so.sdcsimulator.utils.Constants.DOT_JSON; +import static org.onap.so.sdcsimulator.utils.Constants.FORWARD_SLASH; +import static org.onap.so.sdcsimulator.utils.Constants.MAIN_RESOURCE_FOLDER; +import static org.onap.so.sdcsimulator.utils.Constants.WILD_CARD_REGEX; +import static org.springframework.core.io.support.ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.Optional; +import java.util.Set; +import org.onap.so.sdcsimulator.models.AssetInfo; +import org.onap.so.sdcsimulator.models.AssetType; +import org.onap.so.sdcsimulator.models.Metadata; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.ResourcePatternResolver; +import org.springframework.stereotype.Service; +import org.springframework.util.StreamUtils; + +/** + * @author Waqas Ikram (waqas.ikram@est.tech) + */ +@Service +public class AssetProviderImpl implements AssetProvider { + + private static final Logger LOGGER = LoggerFactory.getLogger(AssetProvider.class); + + private final String resourceLocation; + + private final ResourcePatternResolver resourcePatternResolver; + + @Autowired + public AssetProviderImpl(@Value("${sdc.resource.location:/app/csars/}") final String resourceLocation, + final ResourcePatternResolver resourcePatternResolver) { + this.resourceLocation = resourceLocation; + this.resourcePatternResolver = resourcePatternResolver; + } + + @Override + public Optional getAsset(final String csarId, final AssetType assetType) { + try { + final Optional optionalInputStream = getInputStream(csarId, assetType); + if (optionalInputStream.isPresent()) { + return Optional.of(StreamUtils.copyToByteArray(optionalInputStream.get())); + } + } catch (final IOException ioException) { + LOGGER.warn("Unable to create file stream ...", ioException); + } + + return Optional.empty(); + } + + @Override + public Set getAssetInfo(final AssetType assetType) { + final Set result = new HashSet<>(); + + final Path dir = Paths.get(resourceLocation).resolve(assetType.toString()); + if (Files.exists(dir)) { + try (final DirectoryStream stream = Files.newDirectoryStream(dir, WILD_CARD_REGEX + DOT_CSAR)) { + for (final Path entry : stream) { + final String filename = getFilenameWithoutExtension(entry); + result.add(getAssetInfo(assetType, filename, entry)); + } + } catch (final IOException ioException) { + LOGGER.error("Unable to find assetInfo on filesystem", ioException); + } + } + + try { + final String classPathdir = MAIN_RESOURCE_FOLDER + assetType.toString() + FORWARD_SLASH; + final String csarFileLocationPattern = CLASSPATH_ALL_URL_PREFIX + classPathdir + WILD_CARD_REGEX + DOT_CSAR; + final Resource[] resources = resourcePatternResolver.getResources(csarFileLocationPattern); + if (resources != null) { + + for (final Resource resource : resources) { + final String filename = getFilenameWithoutExtension(resource.getFilename()); + result.add(getAssetInfo(assetType, filename, resource)); + } + } + + } catch (final IOException ioException) { + LOGGER.error("Unable to find assetInfo in classpath", ioException); + } + + return result; + } + + @Override + public Optional getMetadata(final String csarId, final AssetType assetType) { + final Path dir = Paths.get(resourceLocation).resolve(assetType.toString()); + final Path metadataFilePath = dir.resolve(csarId + DOT_JSON); + try { + if (Files.exists(metadataFilePath)) { + LOGGER.info("Found metadata file on file system using path: {}", metadataFilePath); + + return Optional.of(assetType.getMetadata(metadataFilePath.toFile())); + + } + } catch (final IOException ioException) { + LOGGER.error("Unable to find metadata file on filesystem", ioException); + } + + + try { + final String path = MAIN_RESOURCE_FOLDER + assetType.toString() + FORWARD_SLASH + csarId + DOT_JSON; + LOGGER.warn("Couldn't find metadata file on file system '{}', will search it in classpath", path); + final ClassPathResource classPathResource = getClassPathResource(path); + if (classPathResource.exists()) { + LOGGER.info("Found metadata file in classpath using path: {}", path); + return Optional.of(assetType.getMetadata(classPathResource)); + } + } catch (final IOException ioException) { + LOGGER.error("Unable to find metadata file in classpath", ioException); + } + LOGGER.error("Couldn't find metadata file in classpath ...."); + return Optional.empty(); + } + + private AssetInfo getAssetInfo(final AssetType assetType, final String filename, final Resource resource) + throws IOException { + final Resource jsonResource = resource.createRelative(filename + DOT_JSON); + + if (jsonResource != null && jsonResource.exists()) { + final AssetInfo assetInfo = assetType.getAssetInfo(jsonResource); + assetInfo.setUuid(filename); + assetInfo.setToscaModelUrl(assetType.getToscaModelUrl(filename)); + LOGGER.info("Found AssetInfo file in classpath: {}", assetInfo); + return assetInfo; + + } + + final AssetInfo assetInfo = assetType.getDefaultAssetInfo(filename); + LOGGER.info("Returning AssetInfo: {}", assetInfo); + return assetInfo; + + } + + private AssetInfo getAssetInfo(final AssetType assetType, final String filename, final Path entry) + throws IOException { + final Path assetJsonFilePath = entry.getParent().resolve(filename + DOT_JSON); + if (Files.exists(assetJsonFilePath)) { + final AssetInfo assetInfo = assetType.getAssetInfo(assetJsonFilePath.toFile()); + assetInfo.setUuid(filename); + assetInfo.setToscaModelUrl(assetType.getToscaModelUrl(filename)); + LOGGER.info("Found AssetInfo file on file system: {}", assetInfo); + return assetInfo; + + } + final AssetInfo assetInfo = assetType.getDefaultAssetInfo(filename); + LOGGER.info("Returning AssetInfo: {}", assetInfo); + return assetInfo; + } + + private String getFilenameWithoutExtension(final String filename) { + return filename.substring(0, filename.lastIndexOf('.')); + } + + private String getFilenameWithoutExtension(final Path file) { + return getFilenameWithoutExtension(file.getFileName().toString()); + } + + private Optional getInputStream(final String csarId, final AssetType assetType) throws IOException { + final Path filePath = Paths.get(resourceLocation, assetType.toString(), csarId + DOT_CSAR); + if (Files.exists(filePath)) { + LOGGER.info("Found csar on file system using path: {}", filePath); + return Optional.of(Files.newInputStream(filePath)); + } + LOGGER.warn("Couldn't find file on file system '{}', will search it in classpath", filePath); + + final String path = MAIN_RESOURCE_FOLDER + assetType.toString() + FORWARD_SLASH + csarId + DOT_CSAR; + final ClassPathResource classPathResource = getClassPathResource(path); + if (classPathResource.exists()) { + LOGGER.info("Found csar in classpath using path: {}", path); + return Optional.of(classPathResource.getInputStream()); + } + + LOGGER.error("Couldn't find csar in classpath ...."); + return Optional.empty(); + } + + private ClassPathResource getClassPathResource(final String path) { + return new ClassPathResource(path, this.getClass()); + } + +} diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/ResourceProviderImpl.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/ResourceProviderImpl.java deleted file mode 100644 index 192ac896..00000000 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/providers/ResourceProviderImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.so.sdcsimulator.providers; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.Optional; -import org.onap.so.sdcsimulator.utils.Constants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.ClassPathResource; -import org.springframework.stereotype.Service; -import org.springframework.util.StreamUtils; - -/** - * @author Eoin Hanan (eoin.hanan@est.tech) - */ -@Service -public class ResourceProviderImpl implements ResourceProvider { - - private static final Logger LOGGER = LoggerFactory.getLogger(ResourceProvider.class); - - private final String resourceLocation; - - public ResourceProviderImpl(@Value("${sdc.resource.location:/app/csars/}") final String resourceLocation) { - this.resourceLocation = resourceLocation; - } - - @Override - public Optional getResource(final String csarId) { - try { - final Optional optionalInputStream = getInputStream(csarId); - if (optionalInputStream.isPresent()) { - return Optional.of(StreamUtils.copyToByteArray(optionalInputStream.get())); - } - } catch (final IOException ioException) { - LOGGER.warn("Unable to create file stream ...", ioException); - } - - return Optional.empty(); - } - - @Override - public Optional getInputStream(final String csarId) throws IOException { - final Path filePath = Paths.get(resourceLocation, csarId + ".csar"); - if (Files.exists(filePath)) { - return Optional.of(Files.newInputStream(filePath)); - } - - LOGGER.info("Couldn't find file on file system '{}', will return default csar", filePath); - final ClassPathResource classPathResource = new ClassPathResource(getDefaultCsarPath(), this.getClass()); - if (classPathResource.exists()) { - return Optional.of(classPathResource.getInputStream()); - } - - LOGGER.error("Couldn't find default csar in classpath ...."); - return Optional.empty(); - } - - /* - * Used in test - */ - String getDefaultCsarPath() { - return Constants.DEFAULT_CSAR_PATH; - } -} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/utils/Constants.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/utils/Constants.java index e8412574..4822b4fc 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/utils/Constants.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/java/org/onap/so/sdcsimulator/utils/Constants.java @@ -25,21 +25,23 @@ package org.onap.so.sdcsimulator.utils; */ public class Constants { + public static final String MAIN_RESOURCE_FOLDER = "/csar/"; + public static final String BASE_URL = "/sdc/v1"; public static final String CATALOG_URL = BASE_URL + "/catalog"; public static final String HEALTHY = "healthy"; - public static final String DEFAULT_CSAR_NAME = "default_csar_file"; - public static final String DOT = "."; + public static final String WILD_CARD_REGEX = "*"; + public static final String DOT_CSAR = DOT + "csar"; - public static final String DEFAULT_CSAR_NAME_WITH_EXT = DEFAULT_CSAR_NAME + DOT_CSAR; + public static final String DOT_JSON = DOT + "json"; - public static final String DEFAULT_CSAR_PATH = "/csar/" + DEFAULT_CSAR_NAME_WITH_EXT; + public static final String FORWARD_SLASH = "/"; private Constants() {} } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/application.yaml b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/application.yaml index 5bb7950a..8ae1e8ac 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/application.yaml +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/application.yaml @@ -5,7 +5,12 @@ server: ssl-enable: false spring: security: - username: mso - #password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U - password: $2a$04$Lcu/DWdyXsl/a3A0iqHTfOX1.zHQ3DlQS/nOPfafT.9pWbeEqlF7W - role: mso \ No newline at end of file + users: + - username: mso + #password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + password: $2a$04$Lcu/DWdyXsl/a3A0iqHTfOX1.zHQ3DlQS/nOPfafT.9pWbeEqlF7W + role: mso + - username: modeling + #password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + password: $2a$04$Lcu/DWdyXsl/a3A0iqHTfOX1.zHQ3DlQS/nOPfafT.9pWbeEqlF7W + role: mso \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/RESOURCES/73522444-e8e9-49c1-be29-d355800aa349.csar b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/RESOURCES/73522444-e8e9-49c1-be29-d355800aa349.csar new file mode 100644 index 00000000..db8f12d8 Binary files /dev/null and b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/RESOURCES/73522444-e8e9-49c1-be29-d355800aa349.csar differ diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/RESOURCES/73522444-e8e9-49c1-be29-d355800aa349.json b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/RESOURCES/73522444-e8e9-49c1-be29-d355800aa349.json new file mode 100644 index 00000000..1ca1e7d4 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/RESOURCES/73522444-e8e9-49c1-be29-d355800aa349.json @@ -0,0 +1,116 @@ +{ + "uuid": "73522444-e8e9-49c1-be29-d355800aa349", + "invariantUUID": "037f7b1b-5c62-44c1-b806-f92fe8970171", + "name": "EtsiVnfCSIT3", + "version": "1.0", + "toscaModelURL": "/sdc/v1/catalog/resources/73522444-e8e9-49c1-be29-d355800aa349/toscaModel", + "category": "Generic", + "subCategory": "Network Service", + "resourceType": "VF", + "lifecycleState": "CERTIFIED", + "lastUpdaterUserId": "cs0008", + "lastUpdaterFullName": "Carlos Santana", + "toscaResourceName": "org.openecomp.resource.vf.Etsivnfcsit3", + "resources": [ + { + "resourceInstanceName": "Cp_vgw_mux_gw_private_net", + "resourceName": "VDU Cp", + "resourceInvariantUUID": "3e4b8692-e6b1-44e9-90b1-6c5f1abf469c", + "resourceVersion": "1.0", + "resoucreType": "CP", + "resourceUUID": "72b9cd47-e8b7-4033-bb1a-fa30e45e3233" + }, + { + "resourceInstanceName": "Cp_vgw_onap_private", + "resourceName": "VDU Cp", + "resourceInvariantUUID": "3e4b8692-e6b1-44e9-90b1-6c5f1abf469c", + "resourceVersion": "1.0", + "resoucreType": "CP", + "resourceUUID": "72b9cd47-e8b7-4033-bb1a-fa30e45e3233" + }, + { + "resourceInstanceName": "LLU_VNF", + "resourceName": "VNF", + "resourceInvariantUUID": "a85aa428-cdb6-4e96-b873-0c20bfd22cac", + "resourceVersion": "1.0", + "resoucreType": "VFC", + "resourceUUID": "bbe67a58-6fd6-4849-abdf-f6a73dbdd594" + }, + { + "resourceInstanceName": "VDU_vgw_0", + "resourceName": "VDU Compute", + "resourceInvariantUUID": "d211a1fd-ae0d-4b33-9076-76defafa7adc", + "resourceVersion": "1.0", + "resoucreType": "VFC", + "resourceUUID": "5dcd4cc9-2db5-49aa-a51a-a0eb4124df4c" + }, + { + "resourceInstanceName": "VL_mux_gw_private_net", + "resourceName": "VnfVirtualLink", + "resourceInvariantUUID": "a9351632-8045-4422-bda6-fdbf4c472b2b", + "resourceVersion": "1.0", + "resoucreType": "VL", + "resourceUUID": "22ba6824-e467-4f6a-87df-ccc8bee01fe4" + }, + { + "resourceInstanceName": "Cp_vgw_cpe_public", + "resourceName": "VDU Cp", + "resourceInvariantUUID": "3e4b8692-e6b1-44e9-90b1-6c5f1abf469c", + "resourceVersion": "1.0", + "resoucreType": "CP", + "resourceUUID": "72b9cd47-e8b7-4033-bb1a-fa30e45e3233" + }, + { + "resourceInstanceName": "Cp_vgw_public", + "resourceName": "VDU Cp", + "resourceInvariantUUID": "3e4b8692-e6b1-44e9-90b1-6c5f1abf469c", + "resourceVersion": "1.0", + "resoucreType": "CP", + "resourceUUID": "72b9cd47-e8b7-4033-bb1a-fa30e45e3233" + }, + { + "resourceInstanceName": "VL_cpe_public", + "resourceName": "VnfVirtualLink", + "resourceInvariantUUID": "a9351632-8045-4422-bda6-fdbf4c472b2b", + "resourceVersion": "1.0", + "resoucreType": "VL", + "resourceUUID": "22ba6824-e467-4f6a-87df-ccc8bee01fe4" + } + ], + "artifacts": [ + { + "artifactName": "vf-license-model.xml", + "artifactType": "VF_LICENSE", + "artifactURL": "/sdc/v1/catalog/resources/73522444-e8e9-49c1-be29-d355800aa349/artifacts/3e964c48-c539-41b6-b504-52905fbe1f93", + "artifactDescription": "VF license file", + "artifactChecksum": "MDAwOTQ0NWYzNzMzYjJmYjBlODc2ODUyY2MzOTIyMjQ=", + "artifactUUID": "3e964c48-c539-41b6-b504-52905fbe1f93", + "artifactVersion": "1", + "artifactLabel": "vflicense", + "artifactGroupType": "DEPLOYMENT" + }, + { + "artifactName": "vgw6.csar", + "artifactType": "ETSI_PACKAGE", + "artifactURL": "/sdc/v1/catalog/resources/73522444-e8e9-49c1-be29-d355800aa349/artifacts/0737049a-204d-4009-932a-57a48119f5eb", + "artifactDescription": "Artifact created from csar", + "artifactChecksum": "ZjAyYjhmYzJkY2ExZjMyYzk1ZjlmNjk0YzkzNDNhY2Y=", + "artifactUUID": "0737049a-204d-4009-932a-57a48119f5eb", + "artifactVersion": "1", + "artifactLabel": "vgw6csar", + "artifactGroupType": "DEPLOYMENT" + }, + { + "artifactName": "vendor-license-model.xml", + "artifactType": "VENDOR_LICENSE", + "artifactURL": "/sdc/v1/catalog/resources/73522444-e8e9-49c1-be29-d355800aa349/artifacts/f17c8eed-cf1f-44cd-a2b3-2caee9c34b17", + "artifactDescription": " Vendor license file", + "artifactChecksum": "NzY2ZGUzODNkNWEwNjM1MjRiMjNiNDY1ZWNkNWQyOTg=", + "artifactUUID": "f17c8eed-cf1f-44cd-a2b3-2caee9c34b17", + "artifactVersion": "1", + "artifactLabel": "vendorlicense", + "artifactGroupType": "DEPLOYMENT" + } + ], + "description": "test" +} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.csar b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.csar new file mode 100644 index 00000000..1610b7fc Binary files /dev/null and b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.csar differ diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.json b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.json new file mode 100644 index 00000000..7c742382 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.json @@ -0,0 +1,62 @@ +{ + "uuid": "9bb8c882-44a1-4b67-a12c-5a998e18d6ba", + "invariantUUID": "388a89d0-3d3d-47f8-8621-32b7b12975d4", + "name": "EtsiNsServiceCSIT1", + "version": "1.0", + "toscaModelURL": "/sdc/v1/catalog/services/9bb8c882-44a1-4b67-a12c-5a998e18d6ba/toscaModel", + "category": "ETSI Network Service", + "lifecycleState": "CERTIFIED", + "lastUpdaterUserId": "cs0008", + "distributionStatus": "DISTRIBUTED", + "lastUpdaterFullName": "Carlos Santana", + "resources": [{ + "resourceInstanceName": "EtsiVnfCSIT3 0", + "resourceName": "EtsiVnfCSIT3", + "resourceInvariantUUID": "037f7b1b-5c62-44c1-b806-f92fe8970171", + "resourceVersion": "1.0", + "resoucreType": "VF", + "resourceUUID": "73522444-e8e9-49c1-be29-d355800aa349", + "artifacts": [{ + "artifactName": "vf-license-model.xml", + "artifactType": "VF_LICENSE", + "artifactURL": "/sdc/v1/catalog/services/9bb8c882-44a1-4b67-a12c-5a998e18d6ba/resourceInstances/etsivnfcsit30/artifacts/3e964c48-c539-41b6-b504-52905fbe1f93", + "artifactDescription": "VF license file", + "artifactChecksum": "MDAwOTQ0NWYzNzMzYjJmYjBlODc2ODUyY2MzOTIyMjQ=", + "artifactUUID": "3e964c48-c539-41b6-b504-52905fbe1f93", + "artifactVersion": "1", + "artifactLabel": "vflicense", + "artifactGroupType": "DEPLOYMENT" + }, { + "artifactName": "vgw6.csar", + "artifactType": "ETSI_PACKAGE", + "artifactURL": "/sdc/v1/catalog/services/9bb8c882-44a1-4b67-a12c-5a998e18d6ba/resourceInstances/etsivnfcsit30/artifacts/0737049a-204d-4009-932a-57a48119f5eb", + "artifactDescription": "Artifact created from csar", + "artifactChecksum": "ZjAyYjhmYzJkY2ExZjMyYzk1ZjlmNjk0YzkzNDNhY2Y=", + "artifactUUID": "0737049a-204d-4009-932a-57a48119f5eb", + "artifactVersion": "1", + "artifactLabel": "vgw6csar", + "artifactGroupType": "DEPLOYMENT" + }, { + "artifactName": "vendor-license-model.xml", + "artifactType": "VENDOR_LICENSE", + "artifactURL": "/sdc/v1/catalog/services/9bb8c882-44a1-4b67-a12c-5a998e18d6ba/resourceInstances/etsivnfcsit30/artifacts/f17c8eed-cf1f-44cd-a2b3-2caee9c34b17", + "artifactDescription": " Vendor license file", + "artifactChecksum": "NzY2ZGUzODNkNWEwNjM1MjRiMjNiNDY1ZWNkNWQyOTg=", + "artifactUUID": "f17c8eed-cf1f-44cd-a2b3-2caee9c34b17", + "artifactVersion": "1", + "artifactLabel": "vendorlicense", + "artifactGroupType": "DEPLOYMENT" + }] + }], + "artifacts": [{ + "artifactName": "ns.csar", + "artifactType": "OTHER", + "artifactURL": "/sdc/v1/catalog/services/9bb8c882-44a1-4b67-a12c-5a998e18d6ba/artifacts/a6b88549-cf1f-4c08-9088-c5e3067db1c9", + "artifactDescription": "ns", + "artifactChecksum": "ODBmYmU0MDRkZWIxNGVkY2NjODkxMGE4MmZlMTNmOGU=", + "artifactUUID": "a6b88549-cf1f-4c08-9088-c5e3067db1c9", + "artifactVersion": "1", + "artifactLabel": "ns", + "artifactGroupType": "DEPLOYMENT" + }] +} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/default_csar_file.csar b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/default_csar_file.csar deleted file mode 100644 index 63b70ec6..00000000 Binary files a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/default_csar_file.csar and /dev/null differ diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/controller/CatalogControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/controller/CatalogControllerTest.java index ca55f495..e5a6e7f7 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/controller/CatalogControllerTest.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/controller/CatalogControllerTest.java @@ -23,20 +23,23 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.Base64; -import java.util.Optional; +import java.util.Set; +import java.util.UUID; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.onap.so.sdcsimulator.controller.CatalogController; -import org.onap.so.sdcsimulator.providers.ResourceProvider; +import org.onap.so.sdcsimulator.models.ResourceAssetInfo; +import org.onap.so.sdcsimulator.models.ResourceMetadata; +import org.onap.so.sdcsimulator.models.ServiceAssetInfo; +import org.onap.so.sdcsimulator.models.ServiceMetadata; import org.onap.so.sdcsimulator.utils.Constants; +import org.onap.so.simulator.model.UserCredentials; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.context.annotation.Configuration; +import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -56,6 +59,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @Configuration public class CatalogControllerTest { + private static final String SUB_CATEGORY = "Network Service"; + + private static final String DISTRIBUTION_STATUS = "DISTRIBUTED"; + + private static final String SERVICE_ID = "9bb8c882-44a1-4b67-a12c-5a998e18d6ba"; + + private static final String RESOURCE_ID = "73522444-e8e9-49c1-be29-d355800aa349"; + private static final String PASSWORD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"; @LocalServerPort @@ -64,42 +75,121 @@ public class CatalogControllerTest { @Autowired private TestRestTemplate restTemplate; - @Value("${spring.security.username}") - private String username; + @Autowired + private UserCredentials userCredentials; + + @Test + public void test_getResourceCsar_validCsarId_matchContent() { + + final String url = getBaseUrl() + "/resources/" + RESOURCE_ID + "/toscaModel"; + + final ResponseEntity response = + restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(getHttpHeaders()), byte[].class); + + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertTrue(response.hasBody()); + assertEquals(117247, response.getBody().length); + + } @Test - public void test_getCsar_validCsarId_matchContent() { + public void test_getServiceCsar_validCsarId_matchContent() { - final String url = getBaseUrl() + "/resources/" + Constants.DEFAULT_CSAR_NAME + "/toscaModel"; + final String url = getBaseUrl() + "/services/" + SERVICE_ID + "/toscaModel"; final ResponseEntity response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(getHttpHeaders()), byte[].class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertTrue(response.hasBody()); - assertEquals(3982, response.getBody().length); + assertEquals(147255, response.getBody().length); + + } + + @Test + public void test_getResources_validResourcesFromClassPath() { + + final ResponseEntity> response = + restTemplate.exchange(getBaseUrl() + "/resources", HttpMethod.GET, new HttpEntity<>(getHttpHeaders()), + new ParameterizedTypeReference>() {}); + + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertTrue(response.hasBody()); + assertEquals(1, response.getBody().size()); + assertEquals(SUB_CATEGORY, response.getBody().iterator().next().getSubCategory()); + + } + + @Test + public void test_getServices_validServicesFromClassPath() { + + final ResponseEntity> response = + restTemplate.exchange(getBaseUrl() + "/services", HttpMethod.GET, new HttpEntity<>(getHttpHeaders()), + new ParameterizedTypeReference>() {}); + + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertTrue(response.hasBody()); + assertEquals(1, response.getBody().size()); + assertEquals(DISTRIBUTION_STATUS, response.getBody().iterator().next().getDistributionStatus()); } @Test - public void test_getCsar_invalidCsar_internalServerError() { - final ResourceProvider mockedResourceProvider = Mockito.mock(ResourceProvider.class); - Mockito.when(mockedResourceProvider.getResource(Mockito.anyString())).thenReturn(Optional.empty()); - final CatalogController objUnderTest = new CatalogController(mockedResourceProvider); + public void test_getResourceCsar_invalidCsar_internalServerError() { + final String url = getBaseUrl() + "/resources/" + UUID.randomUUID().toString() + "/toscaModel"; + + final ResponseEntity response = + restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(getHttpHeaders()), byte[].class); - final ResponseEntity response = objUnderTest.getCsar(Constants.DEFAULT_CSAR_NAME); assertFalse(response.hasBody()); assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, response.getStatusCode()); } + @Test + public void test_getResourceMetadata_validMetadataFileInClasspath_matchContent() { + + final String url = getBaseUrl() + "/resources/" + RESOURCE_ID + "/metadata"; + + final ResponseEntity response = + restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(getHttpHeaders()), ResourceMetadata.class); + + + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertTrue(response.hasBody()); + final ResourceMetadata actual = response.getBody(); + assertEquals(8, actual.getResources().size()); + assertEquals(3, actual.getArtifacts().size()); + assertEquals(SUB_CATEGORY, actual.getSubCategory()); + + } + + @Test + public void test_getServiceMetadata_validMetadataFileInClasspath_matchContent() { + + final String url = getBaseUrl() + "/services/" + SERVICE_ID + "/metadata"; + + final ResponseEntity response = + restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(getHttpHeaders()), ServiceMetadata.class); + + + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertTrue(response.hasBody()); + final ServiceMetadata actual = response.getBody(); + assertEquals(1, actual.getResources().size()); + assertEquals(1, actual.getArtifacts().size()); + assertEquals(DISTRIBUTION_STATUS, actual.getDistributionStatus()); + + } + + private String getBaseUrl() { return "http://localhost:" + port + Constants.CATALOG_URL; } private HttpHeaders getHttpHeaders() { final HttpHeaders requestHeaders = new HttpHeaders(); - requestHeaders.add("Authorization", getBasicAuth(username)); + requestHeaders.add("Authorization", getBasicAuth(userCredentials.getUsers().get(0).getUsername())); requestHeaders.setContentType(MediaType.APPLICATION_JSON); return requestHeaders; } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/providers/ResourceProviderImplTest.java b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/providers/AssetProviderImplTest.java similarity index 56% rename from plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/providers/ResourceProviderImplTest.java rename to plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/providers/AssetProviderImplTest.java index a7cb5dd7..24f5c754 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/providers/ResourceProviderImplTest.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/providers/AssetProviderImplTest.java @@ -22,61 +22,68 @@ package org.onap.so.sdcsimulator.providers; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertFalse; +import static org.onap.so.sdcsimulator.models.AssetType.RESOURCES; +import static org.onap.so.sdcsimulator.utils.Constants.DOT_CSAR; +import static org.onap.so.sdcsimulator.utils.Constants.FORWARD_SLASH; +import static org.onap.so.sdcsimulator.utils.Constants.MAIN_RESOURCE_FOLDER; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.UUID; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; -import org.onap.so.sdcsimulator.utils.Constants; import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.util.StreamUtils; /** * @author Waqas Ikram (waqas.ikram@est.tech) * @author Eoin Hanan (eoin.hanan@est.tech) */ -public class ResourceProviderImplTest { +public class AssetProviderImplTest { + + private static final String VNF_RESOURCE_ID = "73522444-e8e9-49c1-be29-d355800aa349"; @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); - private static final String DUMMY_CONTENT = "Hell world"; + private static final String DUMMY_CONTENT = "Hello world"; + + private final PathMatchingResourcePatternResolver resourcePatternResolver = + new PathMatchingResourcePatternResolver(); @Test public void test_getResource_withValidPath_matchContent() throws IOException { - final File folder = temporaryFolder.newFolder(); - final Path file = Files.createFile(folder.toPath().resolve("empty.csar")); + final File folder = temporaryFolder.newFolder(RESOURCES.toString()); + final String uuid = UUID.randomUUID().toString(); + final Path file = Files.createFile(folder.toPath().resolve(uuid + DOT_CSAR)); Files.write(file, DUMMY_CONTENT.getBytes()); - final ResourceProviderImpl objUnderTest = new ResourceProviderImpl(folder.getPath()); + final AssetProviderImpl objUnderTest = new AssetProviderImpl(folder.getParent(), resourcePatternResolver); - assertArrayEquals(DUMMY_CONTENT.getBytes(), objUnderTest.getResource("empty").get()); + assertArrayEquals(DUMMY_CONTENT.getBytes(), objUnderTest.getAsset(uuid, RESOURCES).get()); } @Test public void test_getResource_withoutValidPath_matchContent() throws IOException { - final ClassPathResource classPathResource = new ClassPathResource(Constants.DEFAULT_CSAR_PATH, this.getClass()); + final String validCsarPath = MAIN_RESOURCE_FOLDER + RESOURCES + FORWARD_SLASH + VNF_RESOURCE_ID + DOT_CSAR; + final ClassPathResource classPathResource = new ClassPathResource(validCsarPath, this.getClass()); final byte[] expectedResult = StreamUtils.copyToByteArray(classPathResource.getInputStream()); - final ResourceProviderImpl objUnderTest = new ResourceProviderImpl(""); + final AssetProviderImpl objUnderTest = new AssetProviderImpl("", resourcePatternResolver); - assertArrayEquals(expectedResult, objUnderTest.getResource(Constants.DEFAULT_CSAR_NAME).get()); + assertArrayEquals(expectedResult, objUnderTest.getAsset(VNF_RESOURCE_ID, RESOURCES).get()); } @Test - public void test_getResource_unbleToreadFileFromClasspath_emptyOptional() throws IOException { - - final ResourceProviderImpl objUnderTest = new ResourceProviderImpl("") { - @Override - String getDefaultCsarPath() { - return "/some/dummy/path"; - } - }; - assertFalse(objUnderTest.getResource(Constants.DEFAULT_CSAR_NAME).isPresent()); + public void test_getResource_unbleToReadFileFromClasspath_emptyOptional() throws IOException { + + final AssetProviderImpl objUnderTest = new AssetProviderImpl("", resourcePatternResolver); + assertFalse(objUnderTest.getAsset(UUID.randomUUID().toString(), RESOURCES).isPresent()); } } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/controller/ConfigController.java b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/controller/ConfigController.java new file mode 100644 index 00000000..7282e051 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/controller/ConfigController.java @@ -0,0 +1,94 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright 2021 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. + * ============LICENSE_END========================================================= + */ +package org.onap.so.sdncsimulator.controller; + +import static org.onap.so.sdncsimulator.utils.Constants.BASE_URL; +import java.util.Optional; +import javax.ws.rs.core.MediaType; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfTopology; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleTopology; + +import org.onap.so.sdncsimulator.providers.ServiceOperationsCacheServiceProvider; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * @author Md Irshad Sheikh (md.irshad.sheikh@huawei.com) + * + */ +@Controller +@RequestMapping(path = BASE_URL) +public class ConfigController { + private static final String HTTP_STATUS_OK = HttpStatus.OK.value() + ""; + + private static final Logger LOGGER = LoggerFactory.getLogger(OperationsController.class); + + private final ServiceOperationsCacheServiceProvider cacheServiceProvider; + + @Autowired + public ConfigController(final ServiceOperationsCacheServiceProvider cacheServiceProvider) { + this.cacheServiceProvider = cacheServiceProvider; + } + + @GetMapping(value = "/config/GENERIC-RESOURCE-API:services/service/{service-id}/service-data/vnfs/vnf/{vnf-id}/vnf-data/vnf-topology/") + public ResponseEntity getVNf(@PathVariable("service-id") String serviceId, + @PathVariable("vnf-id") String vnfId) { + + LOGGER.info("Get vnf-topology with serviceId {} and vnfId {}",serviceId, vnfId); + final Optional optional = + cacheServiceProvider.getGenericResourceApiVnfTopology(vnfId); + if (optional.isPresent()) { + final GenericResourceApiVnfTopology genericVnfTopology = optional.get(); + LOGGER.info("found VnfTopology {} in cache", genericVnfTopology); + return ResponseEntity.ok(genericVnfTopology); + } + + LOGGER.error( + "Unable to find VnfTopology in cache "); + + return ResponseEntity.badRequest().build(); + } + + @GetMapping(value = "/config/GENERIC-RESOURCE-API:services/service/{service-id}/service-data/vnfs/vnf/{vnf-id}/vnf-data/vf-modules/vf-module/{vf-module-id}/vf-module-data/vf-module-topology/", produces = { + MediaType.APPLICATION_JSON }) + public ResponseEntity getVFmodule(@PathVariable("service-id") String serviceId, + @PathVariable("vnf-id") String vnfId, @PathVariable("vf-module-id") String vfModuleId) { + LOGGER.info("Get vfModule-topology with serviceId {}, vnfId {} and vfModuleId {}",serviceId, vnfId,vfModuleId); + + final Optional optional = + cacheServiceProvider.getGenericResourceApiVfModuleTopology(vfModuleId); + + if (optional.isPresent()) { + final GenericResourceApiVfModuleTopology vfModuleTopology = optional.get(); + LOGGER.info("found vfModuleTopology {} in cache", vfModuleTopology); + return ResponseEntity.ok(vfModuleTopology); + } + + LOGGER.error( + "Unable to find VfModuleTopology in cache for "); + + return ResponseEntity.badRequest().build(); + } +} 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 2f24ef69..58f90382 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 @@ -31,6 +31,7 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiSdncrequestheader import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation; import org.onap.sdnc.northbound.client.model.GenericResourceApiSvcActionEnumeration; import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation; import org.onap.so.sdncsimulator.models.InputRequest; import org.onap.so.sdncsimulator.models.Output; import org.onap.so.sdncsimulator.models.OutputRequest; @@ -147,4 +148,36 @@ public class OperationsController { return cacheServiceProvider.putVnfOperationInformation(apiVnfOperationInformation); } + @PostMapping(value = "/GENERIC-RESOURCE-API:vf-module-topology-operation/", + consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}, + produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity postVfModuleOperationInformation( + @RequestBody final InputRequest inputRequest, + final HttpServletRequest request) { + LOGGER.info("Request Received for VfModule : {} ...", inputRequest); + + final GenericResourceApiVfModuleOperationInformation apiVfModuleOperationInformation = inputRequest.getInput(); + if (apiVfModuleOperationInformation == null) { + LOGGER.error("Invalid input request: {}", inputRequest); + return ResponseEntity.badRequest().build(); + } + + final Output output = getOutput(apiVfModuleOperationInformation); + final OutputRequest outputRequest = new OutputRequest(output); + + if (output.getResponseCode().equals(HTTP_STATUS_OK)) { + LOGGER.info("Sucessfully executed request vnf sending response: {}", outputRequest); + return ResponseEntity.ok(outputRequest); + } + + LOGGER.error("Unable to execute input request: {}, will send OutputRequest: {}", inputRequest, outputRequest); + return ResponseEntity.badRequest().body(outputRequest); + + } + + private Output getOutput(final GenericResourceApiVfModuleOperationInformation apiVfModuleOperationInformation) { + + return cacheServiceProvider.putVfModuleOperationInformation(apiVfModuleOperationInformation); + } + } diff --git a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/models/Output.java b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/models/Output.java index d64b0b0c..7cc0bdaf 100644 --- a/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/models/Output.java +++ b/plans/so/integration-etsi-testing/so-simulators/sdnc-simulator/src/main/java/org/onap/so/sdncsimulator/models/Output.java @@ -48,7 +48,10 @@ public class Output implements Serializable { private GenericResourceApiInstanceReference serviceResponseInformation = null; @JsonProperty("vnf-response-information") - private GenericResourceApiInstanceReference vnfResponseInformation = null; + private GenericResourceApiInstanceReference vnfResponseInformation = null; + + @JsonProperty("vf-module-response-information") + private GenericResourceApiInstanceReference vfModuleResponseInformation = null; /** * @return the responseMessage @@ -164,6 +167,11 @@ public class Output implements Serializable { this.vnfResponseInformation = vnfResponseInformation; return this; + } + public Output vfModuleResponseInformation(final GenericResourceApiInstanceReference vfModuleResponseInformation) { + this.vfModuleResponseInformation = vfModuleResponseInformation; + return this; + } @JsonIgnore @@ -177,6 +185,7 @@ public class Output implements Serializable { sb.append(" responseCode: ").append(responseCode).append("\n"); sb.append(" serviceResponseInformation: ").append(serviceResponseInformation).append("\n"); sb.append(" vnfResponseInformation: ").append(vnfResponseInformation).append("\n"); + sb.append(" vfModuleResponseInformation: ").append(vfModuleResponseInformation).append("\n"); sb.append("}"); return sb.toString(); } 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 c3a80ec3..13e1d439 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 @@ -20,9 +20,13 @@ package org.onap.so.sdncsimulator.providers; import java.util.Optional; + import org.onap.sdnc.northbound.client.model.GenericResourceApiServiceOperationInformation; import org.onap.sdnc.northbound.client.model.GenericResourceApiServicemodelinfrastructureService; import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleTopology; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfTopology; import org.onap.so.sdncsimulator.models.Output; /** @@ -44,6 +48,12 @@ public interface ServiceOperationsCacheServiceProvider { Output deleteVnfOperationInformation(final GenericResourceApiVnfOperationInformation apiVnfOperationInformation); + Output putVfModuleOperationInformation(final GenericResourceApiVfModuleOperationInformation apiVfModuleOperationInformation); + + public Optional getGenericResourceApiVfModuleTopology(final String vfModueId); + + public Optional getGenericResourceApiVnfTopology(final String vnfId); + void clearAll(); -} +} \ No newline at end of file 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 88db4c13..4c69a010 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 @@ -60,7 +60,19 @@ import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfinformationVnf import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfrequestinputVnfRequestInput; import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyVnfTopology; import org.onap.sdnc.northbound.client.model.GenericResourceApiVnftopologyidentifierstructureVnfTopologyIdentifierStructure; + +import org.onap.sdnc.northbound.client.model.GenericResourceApiServicedataServicedataVnfsVnfVnfdataVfmodulesVfmoduleVfModuleData; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleTopology; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVnfTopology; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfModuleOperationInformation; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduleinformationVfModuleInformation; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduletopologyVfModuleTopology; +import org.onap.sdnc.northbound.client.model.GenericResourceApiVfmoduletopologyidentifierVfModuleTopologyIdentifier; +import org.onap.sdnc.northbound.client.model.GenericResourceApiParam; +import org.onap.sdnc.northbound.client.model.GenericResourceApiParamParam; + import org.onap.so.sdncsimulator.models.Output; +import org.onap.so.sdncsimulator.utils.Constants; import org.onap.so.simulator.cache.provider.AbstractCacheServiceProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -198,7 +210,7 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ if (ifVnfNotExists(vnfId, svcAction, vnfsList)) { vnfsList.add(getGenericResourceApiServicedataVnf(serviceInstanceId, vnfId, input)); - + setVnfsData(vnfsList); final GenericResourceApiServicestatusServiceStatus serviceStatus = service.getServiceStatus(); return new Output().ackFinalIndicator(serviceStatus.getFinalIndicator()) @@ -507,4 +519,158 @@ public class ServiceOperationsCacheServiceProviderimpl extends AbstractCacheServ } -} + @Override + public Output putVfModuleOperationInformation( + final GenericResourceApiVfModuleOperationInformation input) { + + final GenericResourceApiServiceinformationServiceInformation serviceInformation = input.getServiceInformation(); + final GenericResourceApiVnfinformationVnfInformation vnfInformation = input.getVnfInformation(); + final GenericResourceApiVfmoduleinformationVfModuleInformation vfModuleInformation = input.getVfModuleInformation(); + // Call getVfModule to make a vfList for get the vf-module-information while GET reqest + getVfModule(input); + + final GenericResourceApiSdncrequestheaderSdncRequestHeader requestHeader = input.getSdncRequestHeader(); + final String svcRequestId = getSvcRequestId(requestHeader); + + if (serviceInformation != null && isValid(serviceInformation.getServiceInstanceId()) && vnfInformation != null + && isValid(vnfInformation.getVnfId()) && vfModuleInformation !=null && isValid(vfModuleInformation.getVfModuleId())) { + + + final String serviceInstanceId = serviceInformation.getServiceInstanceId(); + final String vnfId = vnfInformation.getVnfId(); + final String vfModuleId = vfModuleInformation.getVfModuleId(); + + final Optional optional = + getGenericResourceApiServicemodelinfrastructureService(serviceInstanceId); + if (optional.isPresent()) { + final GenericResourceApiServicemodelinfrastructureService service = optional.get(); + final GenericResourceApiServicedataServiceData serviceData = service.getServiceData(); + if (serviceData != null) { + + final GenericResourceApiServicestatusServiceStatus serviceStatus = service.getServiceStatus(); + + return new Output().ackFinalIndicator(serviceStatus.getFinalIndicator()) + .responseCode(serviceStatus.getResponseCode()) + .responseMessage(serviceStatus.getResponseMessage()).svcRequestId(svcRequestId) + .serviceResponseInformation(new GenericResourceApiInstanceReference() + .instanceId(serviceInstanceId).objectPath(getObjectPath(serviceInstanceId))) + .vnfResponseInformation(new GenericResourceApiInstanceReference().instanceId(vnfId) + .objectPath(getObjectPath(serviceInstanceId, vnfId))) + .vfModuleResponseInformation(new GenericResourceApiInstanceReference().instanceId(vfModuleId) + .objectPath(getObjectPath(vnfId, vfModuleId))); + } + } + LOGGER.error( + "Unable to find existing GenericResourceApiServiceModelInfrastructure in cache using service instance id: {}", + serviceInstanceId); + } + LOGGER.error( + "Unable to add GenericResourceApiServiceOperationInformation in cache due to invalid input: {}... ", + input); + return new Output().ackFinalIndicator(YES).responseCode(HTTP_STATUS_BAD_REQUEST) + .responseMessage("Unable to add vfModule").svcRequestId(svcRequestId); + } + + private void getVfModule + (final GenericResourceApiVfModuleOperationInformation input) { + + final GenericResourceApiVfmoduletopologyVfModuleTopology apiVfModuletopologyVfModuleTopology = + new GenericResourceApiVfmoduletopologyVfModuleTopology(); + + final GenericResourceApiServicedataServicedataVnfsVnfVnfdataVfmodulesVfmoduleVfModuleData vfModuleData = + new GenericResourceApiServicedataServicedataVnfsVnfVnfdataVfmodulesVfmoduleVfModuleData(); + + final String vfModuleId = input.getVfModuleInformation().getVfModuleId(); + + vfModuleData.setVfModuleInformation(input.getVfModuleInformation()); + vfModuleData.setVfModuleRequestInput(input.getVfModuleRequestInput()); + + final GenericResourceApiVfmoduletopologyVfModuleTopology vfModuleTopology = + new GenericResourceApiVfmoduletopologyVfModuleTopology(); + + vfModuleTopology.setSdncGeneratedCloudResources(true); + final GenericResourceApiParam vfModuleParametersData = new GenericResourceApiParam(); + final List params = new ArrayList(); + final GenericResourceApiParamParam param = new GenericResourceApiParamParam(); + param.setName("k8s-rb-profile-name"); + param.setValue("k8s-rb-profile-value"); + + params.add(param); + vfModuleParametersData.setParam(params); + vfModuleTopology.setVfModuleParameters(vfModuleParametersData); + + vfModuleTopology.setOnapModelInformation(vfModuleData.getVfModuleInformation().getOnapModelInformation()); + vfModuleTopology.setVfModuleParameters(vfModuleData.getVfModuleRequestInput().getVfModuleInputParameters()); + vfModuleTopology.setAicClli(vfModuleData.getVfModuleRequestInput().getAicClli()); + vfModuleTopology.setAicCloudRegion(vfModuleData.getVfModuleRequestInput().getAicCloudRegion()); + vfModuleTopology.setCloudOwner(vfModuleData.getVfModuleRequestInput().getCloudOwner()); + + apiVfModuletopologyVfModuleTopology.vfModuleTopologyIdentifier(getVfModuleTopologyIdentifierStructure(input)); + + vfModuleTopology.setVfModuleTopologyIdentifier(apiVfModuletopologyVfModuleTopology.getVfModuleTopologyIdentifier()); + vfModuleTopology.setTenant(vfModuleData.getVfModuleRequestInput().getTenant()); + + final GenericResourceApiVfModuleTopology genericResourceApiVfModuleTopology = new GenericResourceApiVfModuleTopology(); + genericResourceApiVfModuleTopology.setVfModuleTopology(vfModuleTopology); + + final Cache cache = getCache(Constants.SERVICE_TOPOLOGY_OPERATION_CACHE); + cache.put(vfModuleId, genericResourceApiVfModuleTopology); + } + + @Override + public Optional getGenericResourceApiVfModuleTopology(final String vfModueId) { + LOGGER.info("getting GenericResourceApiVfModuleTopology from cache using key: {}", vfModueId); + final Cache cache = getCache(Constants.SERVICE_TOPOLOGY_OPERATION_CACHE); + final GenericResourceApiVfModuleTopology value = + cache.get(vfModueId, GenericResourceApiVfModuleTopology.class); + if (value != null) { + return Optional.of(value); + } + LOGGER.error("Unable to find GenericResourceApiVfModuleTopology ..."); + return Optional.empty(); + } + + private GenericResourceApiVfmoduletopologyidentifierVfModuleTopologyIdentifier getVfModuleTopologyIdentifierStructure( + @Valid final GenericResourceApiVfModuleOperationInformation input) { + + final GenericResourceApiVfmoduleinformationVfModuleInformation vfModuleInformation = input.getVfModuleInformation(); + return new GenericResourceApiVfmoduletopologyidentifierVfModuleTopologyIdentifier() + .vfModuleId(vfModuleInformation.getVfModuleId()).vfModuleType(vfModuleInformation.getVfModuleType()).vfModuleName(input.getVfModuleRequestInput().getVfModuleName()); + } + + + public void setVnfsData(List vnfsList) { + + final GenericResourceApiVnftopologyVnfTopology vnfTopology = new GenericResourceApiVnftopologyVnfTopology(); + LOGGER.info(String.valueOf(vnfsList)); + final String vnfId = vnfsList.get(0).getVnfId(); + vnfTopology.setOnapModelInformation(vnfsList.get(0).getVnfData().getVnfInformation().getOnapModelInformation()); + vnfTopology.setAicClli(String.valueOf(vnfsList.get(0).getVnfData().getVnfRequestInput().getAicClli())); + vnfTopology.setAicCloudRegion(String.valueOf(vnfsList.get(0).getVnfData().getVnfRequestInput().getAicCloudRegion())); + vnfTopology.setCloudOwner(String.valueOf(vnfsList.get(0).getVnfData().getVnfRequestInput().getCloudOwner())); + vnfTopology.setTenant(String.valueOf(vnfsList.get(0).getVnfData().getVnfRequestInput().getTenant())); + vnfTopology.setVnfResourceAssignments(vnfsList.get(0).getVnfData().getVnfTopology().getVnfResourceAssignments()); + vnfTopology.setVnfTopologyIdentifierStructure(vnfsList.get(0).getVnfData().getVnfTopology().getVnfTopologyIdentifierStructure()); + vnfTopology.setVnfParametersData(vnfsList.get(0).getVnfData().getVnfTopology().getVnfParametersData()); + vnfTopology.setSdncGeneratedCloudResources(vnfsList.get(0).getVnfData().getVnfTopology().getSdncGeneratedCloudResources()); + + final GenericResourceApiVnfTopology genericResourceApiVnfTopology = new GenericResourceApiVnfTopology(); + genericResourceApiVnfTopology.setVnfTopology(vnfTopology); + + final Cache cache = getCache(Constants.SERVICE_TOPOLOGY_OPERATION_CACHE); + cache.put(vnfId, genericResourceApiVnfTopology); + } + + @Override + public Optional getGenericResourceApiVnfTopology(final String vnfId) { + LOGGER.info("getting GenericResourceApiVnfTopology from cache using key: {}", vnfId); + final Cache cache = getCache(Constants.SERVICE_TOPOLOGY_OPERATION_CACHE); + final GenericResourceApiVnfTopology value = + cache.get(vnfId, GenericResourceApiVnfTopology.class); + if (value != null) { + return Optional.of(value); + } + LOGGER.error("Unable to find GenericResourceApiVnfTopology ..."); + return Optional.empty(); + } +} \ No newline at end of file diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/pom.xml b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/pom.xml index 00fd81f1..bd507ca3 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/pom.xml +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/pom.xml @@ -136,6 +136,11 @@ httpclient 4.5.8 + + org.onap.so.simulators + common + ${project.version} + diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/config/ApplicationConfig.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/config/ApplicationConfig.java index b4657922..2e11714d 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/config/ApplicationConfig.java +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/config/ApplicationConfig.java @@ -1,7 +1,10 @@ package org.onap.so.svnfm.simulator.config; -import java.util.Arrays; +import java.util.ArrayList; +import java.util.List; import org.onap.so.svnfm.simulator.constants.Constant; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; @@ -16,6 +19,7 @@ import org.springframework.stereotype.Component; @Component public class ApplicationConfig implements ApplicationRunner { + private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationConfig.class); private static final String PORT = "local.server.port"; @@ -45,9 +49,18 @@ public class ApplicationConfig implements ApplicationRunner { @Bean public CacheManager cacheManager() { - final Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE); + final Cache inlineResponse201 = getCache(Constant.IN_LINE_RESPONSE_201_CACHE); + final Cache vnfPkgOnboardingNotificationCache = getCache(Constant.VNF_PKG_ONBOARDING_NOTIFICATION_CACHE); + final List caches = new ArrayList<>(); + caches.add(inlineResponse201); + caches.add(vnfPkgOnboardingNotificationCache); final SimpleCacheManager manager = new SimpleCacheManager(); - manager.setCaches(Arrays.asList(inlineResponse201)); + manager.setCaches(caches); return manager; } + + private Cache getCache(final String name) { + LOGGER.info("Creating cache with name: {}", name); + return new ConcurrentMapCache(name); + } } diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/constants/Constant.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/constants/Constant.java index ceb5be5a..c35be6d1 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/constants/Constant.java +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/constants/Constant.java @@ -37,9 +37,11 @@ public class Constant { public static final String VNF_CONFIG_PROPERTIES = "{\"isAutoScaleEnabled\": \"true\",\"isAutoHealingEnabled\": \"true\"}"; public static final String IN_LINE_RESPONSE_201_CACHE = "inlineResponse201"; + public static final String VNF_PKG_ONBOARDING_NOTIFICATION_CACHE = "vnfPackageOnboardingNotificationCache"; public static final String PACKAGE_MANAGEMENT_BASE_URL = "/vnfpkgm/v1"; public static final String SUBSCRIPTION_ENDPOINT = "/subscribe"; public static final String NOTIFICATION_ENDPOINT = "/notification"; - public static final String VNFM_ADAPTER_ENDPOINT = "https://so-vnfm-adapter.onap:9092/so/vnfm-adapter/v1/"; + public static final String NOTIFICATION_CACHE_TEST_ENDPOINT = "/notification-cache-test/{vnfPkgId}"; + public static final String VNFM_ADAPTER_ENDPOINT = "/so/vnfm-adapter/v1/"; public static final String VNFM_ADAPTER_SUBSCRIPTION_ENDPOINT = VNFM_ADAPTER_ENDPOINT + "vnfpkgm/v1/subscriptions"; } diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/controller/SubscriptionNotificationController.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/controller/SubscriptionNotificationController.java index 2c6b8f24..1db20faf 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/controller/SubscriptionNotificationController.java +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/controller/SubscriptionNotificationController.java @@ -21,23 +21,39 @@ package org.onap.so.svnfm.simulator.controller; import javax.ws.rs.core.MediaType; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.InlineResponse201; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.PkgmSubscriptionRequest; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthentication.AuthTypeEnum; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsAuthenticationParamsBasic; +import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageChangeNotification; +import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; import org.onap.so.svnfm.simulator.constants.Constant; import org.onap.so.svnfm.simulator.services.SubscriptionManager; +import org.onap.so.svnfm.simulator.services.providers.VnfPkgOnboardingNotificationCacheServiceProviderImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.io.IOException; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Optional; /** * @author Eoin Hanan (eoin.hanan@est.tech) @@ -47,10 +63,18 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping(path = Constant.PACKAGE_MANAGEMENT_BASE_URL, produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) public class SubscriptionNotificationController { + + private static final Logger logger = LoggerFactory.getLogger(SubscriptionNotificationController.class); + private final Gson gson; @Autowired private SubscriptionManager subscriptionManager; + @Autowired + private VnfPkgOnboardingNotificationCacheServiceProviderImpl vnfPkgOnboardingNotificationCacheServiceProvider; - private static final Logger logger = LoggerFactory.getLogger(SubscriptionNotificationController.class); + @Autowired + public SubscriptionNotificationController() { + this.gson = new GsonBuilder().registerTypeAdapter(LocalDateTime.class, new LocalDateTimeTypeAdapter()).create(); + } @Value("${spring.security.usercredentials[0].username}") private String username; @@ -99,9 +123,94 @@ public class SubscriptionNotificationController { * @return */ @PostMapping(value = Constant.NOTIFICATION_ENDPOINT, produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity postVnfPackageNotification(@RequestBody Object notification){ + public ResponseEntity postVnfPackageNotification(@RequestBody final Object notification){ logger.info("Vnf Notification received:\n{}", notification); + final String notificationString = gson.toJson(notification); + addNotificationObjectToCache(notificationString); return ResponseEntity.noContent().build(); } + /** + * Testing endpoint for checking that notifications have been received + * + * @param vnfPkgId + * @return + */ + @GetMapping(value = Constant.NOTIFICATION_CACHE_TEST_ENDPOINT) + public ResponseEntity getVnfPackageNotification(@PathVariable("vnfPkgId") final String vnfPkgId) { + logger.info("Getting notification with vnfPkgId: {}", vnfPkgId); + final Optional optionalVnfPackageOnboardingNotification = + vnfPkgOnboardingNotificationCacheServiceProvider.getVnfPkgOnboardingNotification(vnfPkgId); + if(optionalVnfPackageOnboardingNotification.isPresent()) { + VnfPackageOnboardingNotification vnfPackageOnboardingNotification = + optionalVnfPackageOnboardingNotification.get(); + logger.info("Return notification with vnfPkgId: {} and body {}", vnfPkgId, vnfPackageOnboardingNotification); + return ResponseEntity.ok().body(vnfPackageOnboardingNotification); + } + final String errorMessage = "No notification found with vnfPkgId: " + vnfPkgId; + logger.error(errorMessage); + return ResponseEntity.status(HttpStatus.NOT_FOUND).body(errorMessage); + } + + private void addNotificationObjectToCache(final String notification) { + logger.info("addNotificationObjectToCache(): {}", notification); + final String notificationType = getNotificationType(notification); + if (VnfPackageOnboardingNotification.NotificationTypeEnum.VNFPACKAGEONBOARDINGNOTIFICATION.getValue() + .equals(notificationType)) { + final VnfPackageOnboardingNotification pkgOnboardingNotification = + gson.fromJson(notification, VnfPackageOnboardingNotification.class); + logger.info("Onboarding notification received:\n{}", pkgOnboardingNotification); + final String vnfPkgId = pkgOnboardingNotification.getVnfPkgId(); + vnfPkgOnboardingNotificationCacheServiceProvider.addVnfPkgOnboardingNotification(vnfPkgId, pkgOnboardingNotification); + } else if (VnfPackageChangeNotification.NotificationTypeEnum.VNFPACKAGECHANGENOTIFICATION.getValue() + .equals(notificationType)) { + final VnfPackageChangeNotification pkgChangeNotification = + gson.fromJson(notification, VnfPackageChangeNotification.class); + logger.info("Change notification received:\n{}", pkgChangeNotification); + } else { + final String errorMessage = "An error occurred. Notification type not supported for: " + notificationType; + logger.error(errorMessage); + throw new RuntimeException(errorMessage); + } + } + + private String getNotificationType(final String notification) { + try { + logger.info("getNotificationType() notification: {}", notification); + final JsonParser parser = new JsonParser(); + final JsonObject element = (JsonObject) parser.parse(notification); + return element.get("notificationType").getAsString(); + } catch (final Exception e) { + logger.error("An error occurred processing notificiation: {}", e.getMessage()); + } + throw new RuntimeException( + "Unable to parse notification type in object \n" + notification); + } + + public static class LocalDateTimeTypeAdapter extends TypeAdapter { + + private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + @Override + public void write(final JsonWriter out, final LocalDateTime localDateTime) throws IOException { + if (localDateTime == null) { + out.nullValue(); + } else { + out.value(FORMATTER.format(localDateTime)); + } + } + + @Override + public LocalDateTime read(final JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + final String dateTime = in.nextString(); + return LocalDateTime.parse(dateTime, FORMATTER); + } + } + } + } diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/model/Vnfds.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/model/Vnfds.java index cf550067..6fe696ee 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/model/Vnfds.java +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/model/Vnfds.java @@ -31,6 +31,17 @@ public class Vnfds { public void setVnfcList(final List vnfclist) { this.vnfclist = vnfclist; } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Vnfd {\n"); + sb.append(" vnfdId: ").append(vnfdId).append("\n"); + sb.append(" vnfclist: ").append(vnfclist).append("\n"); + sb.append("}"); + return sb.toString(); + } + } @@ -82,8 +93,20 @@ public class Vnfds { this.grantResourceId = grantResourceId; } - } + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Vnfc {\n"); + sb.append(" vnfcId: ").append(vnfcId).append("\n"); + sb.append(" type: ").append(type).append("\n"); + sb.append(" vduId: ").append(vduId).append("\n"); + sb.append(" resourceTemplateId: ").append(resourceTemplateId).append("\n"); + sb.append(" grantResourceId: ").append(grantResourceId).append("\n"); + sb.append("}"); + return sb.toString(); + } + } public List getVnfdList() { return vnfdList; @@ -94,4 +117,15 @@ public class Vnfds { this.vnfdList = vnfdList; } + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class Vnfds {\n"); + sb.append(" vnfdList: ").append(vnfdList).append("\n"); + sb.append("}"); + return sb.toString(); + } + + + } diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/InstantiateOperationProgressor.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/InstantiateOperationProgressor.java index 0a5444b9..6b483548 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/InstantiateOperationProgressor.java +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/InstantiateOperationProgressor.java @@ -40,9 +40,10 @@ public class InstantiateOperationProgressor extends OperationProgressor { @Override protected List getAddResources(final String vnfdId) { final List resources = new ArrayList<>(); - + LOGGER.info("Will find GrantsAddResources for vnfdId: {}", vnfdId); for (final Vnfd vnfd : vnfds.getVnfdList()) { if (vnfd.getVnfdId().equals(vnfdId)) { + LOGGER.info("Found vnfd: {}", vnfd); for (final Vnfc vnfc : vnfd.getVnfcList()) { final GrantsAddResources addResource = new GrantsAddResources(); vnfc.setGrantResourceId(UUID.randomUUID().toString()); @@ -80,9 +81,12 @@ public class InstantiateOperationProgressor extends OperationProgressor { addResource.getVimConnectionId()); } LOGGER.info("VIM connections in grant response: {}", mapOfGrantResourceIdToVimConnectionId); + final String vnfInstanceId = operation.getVnfInstanceId(); + + LOGGER.info("vnfds: {}", vnfds); for (final Vnfd vnfd : vnfds.getVnfdList()) { - if (vnfd.getVnfdId().equals(svnfmService.getVnf(operation.getVnfInstanceId()).getVnfdId())) { + if (vnfd.getVnfdId().equals(svnfmService.getVnf(vnfInstanceId).getVnfdId())) { for (final Vnfc vnfc : vnfd.getVnfcList()) { final InlineResponse201InstantiatedVnfInfoVnfcResourceInfo vnfcResourceInfoItem = new InlineResponse201InstantiatedVnfInfoVnfcResourceInfo(); diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/SubscriptionManager.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/SubscriptionManager.java index 2050ab0d..ddda7b64 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/SubscriptionManager.java +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/SubscriptionManager.java @@ -37,6 +37,9 @@ public class SubscriptionManager { @Value("${vnfm-adapter.auth.password}") private String password; + @Value("${vnfm-adapter.base.endpoint:http://so-etsi-sol003-adapter.onap:9092}") + private String baseEndpoint; + @Autowired public SubscriptionManager( @Qualifier(SSL_BASED_CONFIGURABLE_REST_TEMPLATE) final RestTemplate restTemplate) { @@ -52,7 +55,7 @@ public class SubscriptionManager { public InlineResponse201 createSubscription(final PkgmSubscriptionRequest pkgmSubscriptionRequest) { final byte[] encodedAuth = getBasicAuth(username, password); final String authHeader = "Basic " + new String(encodedAuth); - final String uri = Constant.VNFM_ADAPTER_SUBSCRIPTION_ENDPOINT; + final String uri = baseEndpoint + Constant.VNFM_ADAPTER_SUBSCRIPTION_ENDPOINT; final HttpHeaders headers = new HttpHeaders(); headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); headers.add(HttpHeaders.AUTHORIZATION, authHeader); diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/TerminateOperationProgressor.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/TerminateOperationProgressor.java index bd729f3a..9257e49f 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/TerminateOperationProgressor.java +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/TerminateOperationProgressor.java @@ -12,12 +12,15 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.lcn.model.LcnVnfLcmOpera import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201.InstantiationStateEnum; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfoResourceHandle; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201InstantiatedVnfInfoVnfcResourceInfo; -import org.onap.so.svnfm.simulator.model.Vnfds; -import org.onap.so.svnfm.simulator.repository.VnfOperationRepository; import org.onap.so.svnfm.simulator.config.ApplicationConfig; import org.onap.so.svnfm.simulator.model.VnfOperation; +import org.onap.so.svnfm.simulator.model.Vnfds; +import org.onap.so.svnfm.simulator.repository.VnfOperationRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TerminateOperationProgressor extends OperationProgressor { + private static final Logger LOGGER = LoggerFactory.getLogger(TerminateOperationProgressor.class); public TerminateOperationProgressor(final VnfOperation operation, final SvnfmService svnfmService, final VnfOperationRepository vnfOperationRepository, final ApplicationConfig applicationConfig, @@ -33,9 +36,12 @@ public class TerminateOperationProgressor extends OperationProgressor { @Override protected List getRemoveResources(final String vnfdId) { final List resources = new ArrayList<>(); + LOGGER.info("Will find RemoveResources for vnfdId: {}", vnfdId); + final String vnfInstanceId = operation.getVnfInstanceId(); final org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201 vnf = - svnfmService.getVnf(operation.getVnfInstanceId()); + svnfmService.getVnf(vnfInstanceId); + LOGGER.info("Found InlineResponse201: {} for vnfInstanceId: {}", vnf, vnfInstanceId); for (final InlineResponse201InstantiatedVnfInfoVnfcResourceInfo vnfc : vnf.getInstantiatedVnfInfo() .getVnfcResourceInfo()) { final GrantsAddResources addResource = new GrantsAddResources(); diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/providers/VnfPkgOnboardingNotificationCacheServiceProvider.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/providers/VnfPkgOnboardingNotificationCacheServiceProvider.java new file mode 100644 index 00000000..b62fb862 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/providers/VnfPkgOnboardingNotificationCacheServiceProvider.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.svnfm.simulator.services.providers; + +import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; +import java.util.Optional; + +/** + * @author Andrew Lamb (andrew.a.lamb@est.tech) + */ +public interface VnfPkgOnboardingNotificationCacheServiceProvider { + + /** + * Add a VnfPkgOnboardingNotification to the cache + * @param vnfPkgId + * @param vnfPackageOnboardingNotification + */ + void addVnfPkgOnboardingNotification(final String vnfPkgId, final VnfPackageOnboardingNotification vnfPackageOnboardingNotification); + + /** + * Get a VnfPkgOnboardingNotification from the cache + * @param vnfPkgId + * @return + */ + Optional getVnfPkgOnboardingNotification(final String vnfPkgId); +} diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/providers/VnfPkgOnboardingNotificationCacheServiceProviderImpl.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/providers/VnfPkgOnboardingNotificationCacheServiceProviderImpl.java new file mode 100644 index 00000000..3f522138 --- /dev/null +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/java/org/onap/so/svnfm/simulator/services/providers/VnfPkgOnboardingNotificationCacheServiceProviderImpl.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.so.svnfm.simulator.services.providers; + +import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; +import org.onap.so.simulator.cache.provider.AbstractCacheServiceProvider; +import org.onap.so.svnfm.simulator.constants.Constant; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.stereotype.Service; +import java.util.Optional; + +/** + * @author Andrew Lamb (andrew.a.lamb@est.tech) + */ +@Service +public class VnfPkgOnboardingNotificationCacheServiceProviderImpl extends AbstractCacheServiceProvider + implements VnfPkgOnboardingNotificationCacheServiceProvider { + + private static final Logger LOGGER = LoggerFactory.getLogger(VnfPkgOnboardingNotificationCacheServiceProviderImpl.class); + + @Autowired + public VnfPkgOnboardingNotificationCacheServiceProviderImpl(final CacheManager cacheManager) { + super(cacheManager); + } + + @Override public void addVnfPkgOnboardingNotification(final String vnfPkgId, + final VnfPackageOnboardingNotification vnfPackageOnboardingNotification) { + LOGGER.debug("Adding {} to cache with vnfPkgId: {}", vnfPackageOnboardingNotification, vnfPkgId); + getCache(Constant.VNF_PKG_ONBOARDING_NOTIFICATION_CACHE).put(vnfPkgId, vnfPackageOnboardingNotification); + } + + @Override public Optional getVnfPkgOnboardingNotification(final String vnfPkgId) { + LOGGER.debug("Getting vnfPkgOnboardingNotification from cache using vnfPkgId: {}", vnfPkgId); + final Cache cache = getCache(Constant.VNF_PKG_ONBOARDING_NOTIFICATION_CACHE); + final VnfPackageOnboardingNotification vnfPackageOnboardingNotification = cache.get(vnfPkgId, VnfPackageOnboardingNotification.class); + if (vnfPackageOnboardingNotification != null) { + return Optional.of(vnfPackageOnboardingNotification); + } + LOGGER.error("Unable to find vnfPkgOnboardingNotification in cache using vnfPkgId: {}", vnfPkgId); + return Optional.empty(); + } +} diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/resources/application.yaml b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/resources/application.yaml index db2a6d4c..5d655b82 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/resources/application.yaml +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/main/resources/application.yaml @@ -47,6 +47,8 @@ vnfm-adapter: auth: name: vnfm password: password1$ + base: + endpoint: http://so-etsi-sol003-adapter.onap:9092 vnfds: vnfdlist: - vnfdid: 1 @@ -88,4 +90,4 @@ vnfds: - vnfcid: VNFC8 resourceTemplateId: vnfd4_vnfc6 vduId: vnfd4_vduForVnfc6 - type: COMPUTE \ No newline at end of file + type: COMPUTE diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/java/org/onap/so/svnfm/simulator/controllers/TestSubscriptionNotificationController.java b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/java/org/onap/so/svnfm/simulator/controllers/TestSubscriptionNotificationController.java index 743e2c04..c35bbaf7 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/java/org/onap/so/svnfm/simulator/controllers/TestSubscriptionNotificationController.java +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/java/org/onap/so/svnfm/simulator/controllers/TestSubscriptionNotificationController.java @@ -31,17 +31,20 @@ import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model. import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.model.SubscriptionsFilter1; import org.onap.so.adapters.vnfmadapter.extclients.vnfm.packagemanagement.notification.model.VnfPackageOnboardingNotification; import org.onap.so.svnfm.simulator.config.SvnfmApplication; +import org.onap.so.svnfm.simulator.controller.SubscriptionNotificationController; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; +import org.springframework.http.converter.json.GsonHttpMessageConverter; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.client.MockRestServiceServer; @@ -77,6 +80,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat public class TestSubscriptionNotificationController { private static final Logger LOGGER = getLogger(TestSubscriptionNotificationController.class); + private static final String SOL003_SUBSCRIPTION_URL = "http://so-etsi-sol003-adapter.onap:9092" + VNFM_ADAPTER_SUBSCRIPTION_ENDPOINT; @LocalServerPort private int port; @@ -85,7 +89,6 @@ public class TestSubscriptionNotificationController { private RestTemplate restTemplate; private MockRestServiceServer mockRestServiceServer; - @Autowired private TestRestTemplate testRestTemplate; private Gson gson; @@ -94,8 +97,11 @@ public class TestSubscriptionNotificationController { @Before public void setup() { mockRestServiceServer = MockRestServiceServer.bindTo(restTemplate).build(); - gson = new GsonBuilder().create(); + gson = new GsonBuilder().registerTypeAdapter(LocalDateTime.class, + new SubscriptionNotificationController.LocalDateTimeTypeAdapter()).create(); vnfmSimulatorCallbackUrl = getBaseUrl(port) + PACKAGE_MANAGEMENT_BASE_URL + NOTIFICATION_ENDPOINT; + testRestTemplate = new TestRestTemplate( + new RestTemplateBuilder().additionalMessageConverters(new GsonHttpMessageConverter(gson))); } @After @@ -118,7 +124,7 @@ public class TestSubscriptionNotificationController { new InlineResponse201().id("subscriptionId").filter(new SubscriptionsFilter1()) .callbackUri("callbackUri"); - mockRestServiceServer.expect(requestTo(VNFM_ADAPTER_SUBSCRIPTION_ENDPOINT)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(SOL003_SUBSCRIPTION_URL)).andExpect(method(HttpMethod.POST)) .andExpect(content().json(gson.toJson(pkgmSubscriptionRequest))) .andRespond(withSuccess(gson.toJson(inlineResponse), APPLICATION_JSON)); @@ -137,7 +143,7 @@ public class TestSubscriptionNotificationController { new InlineResponse201().id("subscriptionId").filter(new SubscriptionsFilter1()) .callbackUri("callbackUri"); - mockRestServiceServer.expect(requestTo(VNFM_ADAPTER_SUBSCRIPTION_ENDPOINT)).andExpect(method(HttpMethod.POST)) + mockRestServiceServer.expect(requestTo(SOL003_SUBSCRIPTION_URL)).andExpect(method(HttpMethod.POST)) .andExpect(content().json(gson.toJson(pkgmSubscriptionRequest))) .andRespond(withSuccess(gson.toJson(inlineResponse), APPLICATION_JSON)); @@ -152,8 +158,6 @@ public class TestSubscriptionNotificationController { final VnfPackageOnboardingNotification vnfPackageOnboardingNotification = gson.fromJson(getNotification(VNFPACKAGEONBOARDINGNOTIFICATION), VnfPackageOnboardingNotification.class); - final LocalDateTime timestamp = LocalDateTime.of(2020, 1, 1, 1, 1, 1, 1); - vnfPackageOnboardingNotification.setTimeStamp(timestamp); final ResponseEntity responseEntity = postNotification(vnfPackageOnboardingNotification); assertEquals(HttpStatus.NO_CONTENT, responseEntity.getStatusCode()); } diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/resources/application.yaml b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/resources/application.yaml index 3a2268cb..5e5aba8b 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/resources/application.yaml +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/resources/application.yaml @@ -40,6 +40,8 @@ vnfm-adapter: auth: name: vnfm password: password1$ + base: + endpoint: http://so-etsi-sol003-adapter.onap:9092 vnfds: vnfdlist: - vnfdid: 1 diff --git a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/resources/test-data/vnf-package-onboarding-notification.json b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/resources/test-data/vnf-package-onboarding-notification.json index 40b565be..bcc36592 100644 --- a/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/resources/test-data/vnf-package-onboarding-notification.json +++ b/plans/so/integration-etsi-testing/so-simulators/vnfm-simulator/vnfm-service/src/test/resources/test-data/vnf-package-onboarding-notification.json @@ -1,6 +1,7 @@ { "id": "string", "notificationType": "VnfPackageOnboardingNotification", + "timeStamp":"2020-01-01 01:01:01", "subscriptionId": "string", "vnfPkgId": "string", "vnfdId": "string", diff --git a/plans/so/integration-etsi-testing/testplan.txt b/plans/so/integration-etsi-testing/testplan.txt index c68e4fb1..963abb93 100644 --- a/plans/so/integration-etsi-testing/testplan.txt +++ b/plans/so/integration-etsi-testing/testplan.txt @@ -1,3 +1,8 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -so/etsi/etsi_tests.robot +so/etsi/etsi_vnf_subscription_tests.robot +so/etsi/etsi_package_onboarding_tests.robot +so/etsi/etsi_vnf_lcm_tests.robot +so/etsi/etsi_vnf_package_management_tests.robot +so/etsi/etsi_vnf_notification_tests.robot +so/etsi/etsi_nfvo_ns_lcm_tests.robot diff --git a/plans/so/macroflow/config/distribution-test-zip/macro_zipped_sdc_csar.tar.gz b/plans/so/macroflow/config/distribution-test-zip/macro_zipped_sdc_csar.tar.gz new file mode 100755 index 00000000..f826c2eb Binary files /dev/null and b/plans/so/macroflow/config/distribution-test-zip/macro_zipped_sdc_csar.tar.gz differ diff --git a/plans/so/macroflow/config/env b/plans/so/macroflow/config/env new file mode 100644 index 00000000..f5453e95 --- /dev/null +++ b/plans/so/macroflow/config/env @@ -0,0 +1,7 @@ +NEXUS_DOCKER_REPO_MSO=nexus3.onap.org:10001 +DOCKER_ENVIRONMENT=remote +TAG=1.8.0-STAGING-latest +TIME_OUT_DEFAULT_VALUE_SEC=1200 +PROJECT_NAME=macroflowintegrationtesting +DEFAULT_NETWORK_NAME=macroflowintegrationtesting_default +MARIADB_VERSION=10.5.8 diff --git a/plans/so/macroflow/config/mariadb_engine_7.10.0.sql b/plans/so/macroflow/config/mariadb_engine_7.10.0.sql new file mode 100644 index 00000000..b8062107 --- /dev/null +++ b/plans/so/macroflow/config/mariadb_engine_7.10.0.sql @@ -0,0 +1,1361 @@ +-- +-- Copyright © 2012 - 2018 camunda services GmbH and various authors (info@camunda.com) +-- +-- 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. +-- + +USE `camundabpmn`; + + +create table ACT_GE_PROPERTY ( + NAME_ varchar(64), + VALUE_ varchar(300), + REV_ integer, + primary key (NAME_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +insert into ACT_GE_PROPERTY +values ('schema.version', 'fox', 1); + +insert into ACT_GE_PROPERTY +values ('schema.history', 'create(fox)', 1); + +insert into ACT_GE_PROPERTY +values ('next.dbid', '1', 1); + +insert into ACT_GE_PROPERTY +values ('deployment.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('history.cleanup.job.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('startup.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('telemetry.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('installationId.lock', '0', 1); + +create table ACT_GE_BYTEARRAY ( + ID_ varchar(64), + REV_ integer, + NAME_ varchar(255), + DEPLOYMENT_ID_ varchar(64), + BYTES_ LONGBLOB, + GENERATED_ TINYINT, + TENANT_ID_ varchar(64), + TYPE_ integer, + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_GE_SCHEMA_LOG ( + ID_ varchar(64), + TIMESTAMP_ datetime(3), + VERSION_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +insert into ACT_GE_SCHEMA_LOG +values ('0', CURRENT_TIMESTAMP, '7.14.0'); + +create table ACT_RE_DEPLOYMENT ( + ID_ varchar(64), + NAME_ varchar(255), + DEPLOY_TIME_ datetime(3), + SOURCE_ varchar(255), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EXECUTION ( + ID_ varchar(64), + REV_ integer, + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + BUSINESS_KEY_ varchar(255), + PARENT_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SUPER_EXEC_ varchar(64), + SUPER_CASE_EXEC_ varchar(64), + CASE_INST_ID_ varchar(64), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + IS_ACTIVE_ TINYINT, + IS_CONCURRENT_ TINYINT, + IS_SCOPE_ TINYINT, + IS_EVENT_SCOPE_ TINYINT, + SUSPENSION_STATE_ integer, + CACHED_ENT_STATE_ integer, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ datetime(3) NULL, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROCESS_DEF_ID_ varchar(64), + PROCESS_DEF_KEY_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + FAILED_ACT_ID_ varchar(255), + DUEDATE_ datetime(3) NULL, + REPEAT_ varchar(255), + REPEAT_OFFSET_ bigint DEFAULT 0, + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + DEPLOYMENT_ID_ varchar(64), + SUSPENSION_STATE_ integer NOT NULL DEFAULT 1, + JOB_DEF_ID_ varchar(64), + PRIORITY_ bigint NOT NULL DEFAULT 0, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_JOBDEF ( + ID_ varchar(64) NOT NULL, + REV_ integer, + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ACT_ID_ varchar(255), + JOB_TYPE_ varchar(255) NOT NULL, + JOB_CONFIGURATION_ varchar(255), + SUSPENSION_STATE_ integer, + JOB_PRIORITY_ bigint, + TENANT_ID_ varchar(64), + DEPLOYMENT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RE_PROCDEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + HAS_START_FORM_KEY_ TINYINT, + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(64), + VERSION_TAG_ varchar(64), + HISTORY_TTL_ integer, + STARTABLE_ boolean NOT NULL default TRUE, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_TASK ( + ID_ varchar(64), + REV_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + TASK_DEF_KEY_ varchar(255), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + DELEGATION_ varchar(64), + PRIORITY_ integer, + CREATE_TIME_ datetime(3), + DUE_DATE_ datetime(3), + FOLLOW_UP_DATE_ datetime(3), + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_IDENTITYLINK ( + ID_ varchar(64), + REV_ integer, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_VARIABLE ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + TASK_ID_ varchar(64), + BATCH_ID_ varchar(64), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + VAR_SCOPE_ varchar(64) not null, + SEQUENCE_COUNTER_ bigint, + IS_CONCURRENT_LOCAL_ TINYINT, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EVENT_SUBSCR ( + ID_ varchar(64) not null, + REV_ integer, + EVENT_TYPE_ varchar(255) not null, + EVENT_NAME_ varchar(255), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTIVITY_ID_ varchar(255), + CONFIGURATION_ varchar(255), + CREATED_ datetime(3) not null, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_INCIDENT ( + ID_ varchar(64) not null, + REV_ integer not null, + INCIDENT_TIMESTAMP_ datetime(3) not null, + INCIDENT_MSG_ varchar(4000), + INCIDENT_TYPE_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + ACTIVITY_ID_ varchar(255), + FAILED_ACTIVITY_ID_ varchar(255), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CAUSE_INCIDENT_ID_ varchar(64), + ROOT_CAUSE_INCIDENT_ID_ varchar(64), + CONFIGURATION_ varchar(255), + TENANT_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_AUTHORIZATION ( + ID_ varchar(64) not null, + REV_ integer not null, + TYPE_ integer not null, + GROUP_ID_ varchar(255), + USER_ID_ varchar(255), + RESOURCE_TYPE_ integer not null, + RESOURCE_ID_ varchar(255), + PERMS_ integer, + REMOVAL_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_FILTER ( + ID_ varchar(64) not null, + REV_ integer not null, + RESOURCE_TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + OWNER_ varchar(255), + QUERY_ LONGTEXT not null, + PROPERTIES_ LONGTEXT, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_METER_LOG ( + ID_ varchar(64) not null, + NAME_ varchar(64) not null, + REPORTER_ varchar(255), + VALUE_ bigint, + TIMESTAMP_ datetime(3), + MILLISECONDS_ bigint DEFAULT 0, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EXT_TASK ( + ID_ varchar(64) not null, + REV_ integer not null, + WORKER_ID_ varchar(255), + TOPIC_NAME_ varchar(255), + RETRIES_ integer, + ERROR_MSG_ varchar(4000), + ERROR_DETAILS_ID_ varchar(64), + LOCK_EXP_TIME_ datetime(3) NULL, + SUSPENSION_STATE_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + TENANT_ID_ varchar(64), + PRIORITY_ bigint NOT NULL DEFAULT 0, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer not null, + TYPE_ varchar(255), + TOTAL_JOBS_ integer, + JOBS_CREATED_ integer, + JOBS_PER_SEED_ integer, + INVOCATIONS_PER_JOB_ integer, + SEED_JOB_DEF_ID_ varchar(64), + BATCH_JOB_DEF_ID_ varchar(64), + MONITOR_JOB_DEF_ID_ varchar(64), + SUSPENSION_STATE_ integer, + CONFIGURATION_ varchar(255), + TENANT_ID_ varchar(64), + CREATE_USER_ID_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_EXEC_ROOT_PI on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_); +create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_); +create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_); +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_); +create index ACT_IDX_TASK_OWNER on ACT_RU_TASK(OWNER_); +create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_); +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR_TENANT_ID on ACT_RU_EVENT_SUBSCR(TENANT_ID_); + +create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_); +create index ACT_IDX_VARIABLE_TENANT_ID on ACT_RU_VARIABLE(TENANT_ID_); +create index ACT_IDX_VARIABLE_TASK_NAME_TYPE on ACT_RU_VARIABLE(TASK_ID_, NAME_, TYPE_); + +create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_); +create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_); +create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_); +-- CAM-5914 +create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_); +-- this index needs to be limited in mariadb see CAM-6938 +create index ACT_IDX_JOB_HANDLER on ACT_RU_JOB(HANDLER_TYPE_(100),HANDLER_CFG_(155)); +create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_); +create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_); +create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_); + +-- new metric milliseconds column +CREATE INDEX ACT_IDX_METER_LOG_MS ON ACT_RU_METER_LOG(MILLISECONDS_); +CREATE INDEX ACT_IDX_METER_LOG_NAME_MS ON ACT_RU_METER_LOG(NAME_, MILLISECONDS_); +CREATE INDEX ACT_IDX_METER_LOG_REPORT ON ACT_RU_METER_LOG(NAME_, REPORTER_, MILLISECONDS_); + +-- old metric timestamp column +CREATE INDEX ACT_IDX_METER_LOG_TIME ON ACT_RU_METER_LOG(TIMESTAMP_); +CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_); + +create index ACT_IDX_EXT_TASK_TOPIC on ACT_RU_EXT_TASK(TOPIC_NAME_); +create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_); +create index ACT_IDX_EXT_TASK_PRIORITY ON ACT_RU_EXT_TASK(PRIORITY_); +create index ACT_IDX_EXT_TASK_ERR_DETAILS ON ACT_RU_EXT_TASK(ERROR_DETAILS_ID_); +create index ACT_IDX_AUTH_GROUP_ID ON ACT_RU_AUTHORIZATION(GROUP_ID_); +create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_); + +alter table ACT_GE_BYTEARRAY + add constraint ACT_FK_BYTEARR_DEPL + foreign key (DEPLOYMENT_ID_) + references ACT_RE_DEPLOYMENT (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade; + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PARENT + foreign key (PARENT_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_SUPER + foreign key (SUPER_EXEC_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_IDENTITYLINK + add constraint ACT_FK_TSKASS_TASK + foreign key (TASK_ID_) + references ACT_RU_TASK (ID_); + +alter table ACT_RU_IDENTITYLINK + add constraint ACT_FK_ATHRZ_PROCEDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF(ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION(ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EVENT_SUBSCR + add constraint ACT_FK_EVENT_EXEC + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION(ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_CAUSE + foreign key (CAUSE_INCIDENT_ID_) + references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade; + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_RCAUSE + foreign key (ROOT_CAUSE_INCIDENT_ID_) + references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade; + +alter table ACT_RU_EXT_TASK + add constraint ACT_FK_EXT_TASK_ERROR_DETAILS + foreign key (ERROR_DETAILS_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_INC_JOB_DEF on ACT_RU_INCIDENT(JOB_DEF_ID_); +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_JOB_DEF + foreign key (JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +alter table ACT_RU_AUTHORIZATION + add constraint ACT_UNIQ_AUTH_USER + unique (USER_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_); + +alter table ACT_RU_AUTHORIZATION + add constraint ACT_UNIQ_AUTH_GROUP + unique (GROUP_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_UNIQ_VARIABLE + unique (VAR_SCOPE_, NAME_); + +alter table ACT_RU_EXT_TASK + add constraint ACT_FK_EXT_TASK_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +create index ACT_IDX_BATCH_SEED_JOB_DEF ON ACT_RU_BATCH(SEED_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_SEED_JOB_DEF + foreign key (SEED_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_MONITOR_JOB_DEF ON ACT_RU_BATCH(MONITOR_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_MONITOR_JOB_DEF + foreign key (MONITOR_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_JOB_DEF ON ACT_RU_BATCH(BATCH_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_JOB_DEF + foreign key (BATCH_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_ID ON ACT_RU_VARIABLE(BATCH_ID_); +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BATCH + foreign key (BATCH_ID_) + references ACT_RU_BATCH (ID_); + +-- indexes for deadlock problems - https://app.camunda.com/jira/browse/CAM-2567 -- +create index ACT_IDX_INC_CAUSEINCID on ACT_RU_INCIDENT(CAUSE_INCIDENT_ID_); +create index ACT_IDX_INC_EXID on ACT_RU_INCIDENT(EXECUTION_ID_); +create index ACT_IDX_INC_PROCDEFID on ACT_RU_INCIDENT(PROC_DEF_ID_); +create index ACT_IDX_INC_PROCINSTID on ACT_RU_INCIDENT(PROC_INST_ID_); +create index ACT_IDX_INC_ROOTCAUSEINCID on ACT_RU_INCIDENT(ROOT_CAUSE_INCIDENT_ID_); +-- index for deadlock problem - https://app.camunda.com/jira/browse/CAM-4440 -- +create index ACT_IDX_AUTH_RESOURCE_ID on ACT_RU_AUTHORIZATION(RESOURCE_ID_); +-- index to prevent deadlock on fk constraint - https://app.camunda.com/jira/browse/CAM-5440 -- +create index ACT_IDX_EXT_TASK_EXEC on ACT_RU_EXT_TASK(EXECUTION_ID_); + +-- indexes to improve deployment +create index ACT_IDX_BYTEARRAY_ROOT_PI on ACT_GE_BYTEARRAY(ROOT_PROC_INST_ID_); +create index ACT_IDX_BYTEARRAY_RM_TIME on ACT_GE_BYTEARRAY(REMOVAL_TIME_); +create index ACT_IDX_BYTEARRAY_NAME on ACT_GE_BYTEARRAY(NAME_); +create index ACT_IDX_DEPLOYMENT_NAME on ACT_RE_DEPLOYMENT(NAME_); +create index ACT_IDX_DEPLOYMENT_TENANT_ID on ACT_RE_DEPLOYMENT(TENANT_ID_); +create index ACT_IDX_JOBDEF_PROC_DEF_ID ON ACT_RU_JOBDEF(PROC_DEF_ID_); +create index ACT_IDX_JOB_HANDLER_TYPE ON ACT_RU_JOB(HANDLER_TYPE_); +create index ACT_IDX_EVENT_SUBSCR_EVT_NAME ON ACT_RU_EVENT_SUBSCR(EVENT_NAME_); +create index ACT_IDX_PROCDEF_DEPLOYMENT_ID ON ACT_RE_PROCDEF(DEPLOYMENT_ID_); +create index ACT_IDX_PROCDEF_TENANT_ID ON ACT_RE_PROCDEF(TENANT_ID_); +create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); + +-- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 +create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +-- create case definition table -- +create table ACT_RE_CASE_DEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + TENANT_ID_ varchar(64), + HISTORY_TTL_ integer, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create case execution table -- +create table ACT_RU_CASE_EXECUTION ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CASE_INST_ID_ varchar(64), + SUPER_CASE_EXEC_ varchar(64), + SUPER_EXEC_ varchar(64), + BUSINESS_KEY_ varchar(255), + PARENT_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + ACT_ID_ varchar(255), + PREV_STATE_ integer, + CURRENT_STATE_ integer, + REQUIRED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create case sentry part table -- + +create table ACT_RU_CASE_SENTRY_PART ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CASE_INST_ID_ varchar(64), + CASE_EXEC_ID_ varchar(64), + SENTRY_ID_ varchar(255), + TYPE_ varchar(255), + SOURCE_CASE_EXEC_ID_ varchar(64), + STANDARD_EVENT_ varchar(255), + SOURCE_ varchar(255), + VARIABLE_EVENT_ varchar(255), + VARIABLE_NAME_ varchar(255), + SATISFIED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create index on business key -- +create index ACT_IDX_CASE_EXEC_BUSKEY on ACT_RU_CASE_EXECUTION(BUSINESS_KEY_); + +-- https://app.camunda.com/jira/browse/CAM-9165 +create index ACT_IDX_CASE_EXE_CASE_INST on ACT_RU_CASE_EXECUTION(CASE_INST_ID_); + +-- create foreign key constraints on ACT_RU_CASE_EXECUTION -- +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_) on delete cascade on update cascade; + +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_PARENT + foreign key (PARENT_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_CASE_DEF + foreign key (CASE_DEF_ID_) + references ACT_RE_CASE_DEF(ID_); + +-- create foreign key constraints on ACT_RU_VARIABLE -- +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_CASE_EXE + foreign key (CASE_EXECUTION_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +-- create foreign key constraints on ACT_RU_TASK -- +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_CASE_EXE + foreign key (CASE_EXECUTION_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_CASE_DEF + foreign key (CASE_DEF_ID_) + references ACT_RE_CASE_DEF(ID_); + +-- create foreign key constraints on ACT_RU_CASE_SENTRY_PART -- +alter table ACT_RU_CASE_SENTRY_PART + add constraint ACT_FK_CASE_SENTRY_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_CASE_SENTRY_PART + add constraint ACT_FK_CASE_SENTRY_CASE_EXEC + foreign key (CASE_EXEC_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +create index ACT_IDX_CASE_DEF_TENANT_ID on ACT_RE_CASE_DEF(TENANT_ID_); +create index ACT_IDX_CASE_EXEC_TENANT_ID on ACT_RU_CASE_EXECUTION(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +-- create decision definition table -- +create table ACT_RE_DECISION_DEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + DEC_REQ_ID_ varchar(64), + DEC_REQ_KEY_ varchar(255), + TENANT_ID_ varchar(64), + HISTORY_TTL_ integer, + VERSION_TAG_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create decision requirements definition table -- +create table ACT_RE_DECISION_REQ_DEF ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) NOT NULL, + VERSION_ integer NOT NULL, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +alter table ACT_RE_DECISION_DEF + add constraint ACT_FK_DEC_REQ + foreign key (DEC_REQ_ID_) + references ACT_RE_DECISION_REQ_DEF(ID_); + +create index ACT_IDX_DEC_DEF_TENANT_ID on ACT_RE_DECISION_DEF(TENANT_ID_); +create index ACT_IDX_DEC_DEF_REQ_ID on ACT_RE_DECISION_DEF(DEC_REQ_ID_); +create index ACT_IDX_DEC_REQ_DEF_TENANT_ID on ACT_RE_DECISION_REQ_DEF(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +create table ACT_HI_PROCINST ( + ID_ varchar(64) not null, + PROC_INST_ID_ varchar(64) not null, + BUSINESS_KEY_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64) not null, + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + DURATION_ bigint, + START_USER_ID_ varchar(255), + START_ACT_ID_ varchar(255), + END_ACT_ID_ varchar(255), + SUPER_PROCESS_INSTANCE_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + SUPER_CASE_INSTANCE_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + DELETE_REASON_ varchar(4000), + TENANT_ID_ varchar(64), + STATE_ varchar(255), + primary key (ID_), + unique (PROC_INST_ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_ACTINST ( + ID_ varchar(64) not null, + PARENT_ACT_INST_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64) not null, + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64) not null, + EXECUTION_ID_ varchar(64) not null, + ACT_ID_ varchar(255) not null, + TASK_ID_ varchar(64), + CALL_PROC_INST_ID_ varchar(64), + CALL_CASE_INST_ID_ varchar(64), + ACT_NAME_ varchar(255), + ACT_TYPE_ varchar(255) not null, + ASSIGNEE_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + ACT_INST_STATE_ integer, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_TASKINST ( + ID_ varchar(64) not null, + TASK_DEF_KEY_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + DELETE_REASON_ varchar(4000), + PRIORITY_ integer, + DUE_DATE_ datetime(3), + FOLLOW_UP_DATE_ datetime(3), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_VARINST ( + ID_ varchar(64) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(100), + CREATE_TIME_ datetime(3), + REV_ integer, + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + STATE_ varchar(20), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_DETAIL ( + ID_ varchar(64) not null, + TYPE_ varchar(255) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + VAR_INST_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(255), + REV_ integer, + TIME_ datetime(3) not null, + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + OPERATION_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + INITIAL_ boolean, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_IDENTITYLINK ( + ID_ varchar(64) not null, + TIMESTAMP_ timestamp(3) not null, + TYPE_ varchar(255), + USER_ID_ varchar(255), + GROUP_ID_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + OPERATION_TYPE_ varchar(64), + ASSIGNER_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_COMMENT ( + ID_ varchar(64) not null, + TYPE_ varchar(255), + TIME_ datetime(3) not null, + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTION_ varchar(255), + MESSAGE_ varchar(4000), + FULL_MSG_ LONGBLOB, + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_ATTACHMENT ( + ID_ varchar(64) not null, + REV_ integer, + USER_ID_ varchar(255), + NAME_ varchar(255), + DESCRIPTION_ varchar(4000), + TYPE_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + URL_ varchar(4000), + CONTENT_ID_ varchar(64), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_OP_LOG ( + ID_ varchar(64) not null, + DEPLOYMENT_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + JOB_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + BATCH_ID_ varchar(64), + USER_ID_ varchar(255), + TIMESTAMP_ timestamp(3) not null, + OPERATION_TYPE_ varchar(64), + OPERATION_ID_ varchar(64), + ENTITY_TYPE_ varchar(30), + PROPERTY_ varchar(64), + ORG_VALUE_ varchar(4000), + NEW_VALUE_ varchar(4000), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + CATEGORY_ varchar(64), + EXTERNAL_TASK_ID_ varchar(64), + ANNOTATION_ varchar(4000), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_INCIDENT ( + ID_ varchar(64) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CREATE_TIME_ timestamp(3) not null, + END_TIME_ timestamp(3) null, + INCIDENT_MSG_ varchar(4000), + INCIDENT_TYPE_ varchar(255) not null, + ACTIVITY_ID_ varchar(255), + FAILED_ACTIVITY_ID_ varchar(255), + CAUSE_INCIDENT_ID_ varchar(64), + ROOT_CAUSE_INCIDENT_ID_ varchar(64), + CONFIGURATION_ varchar(255), + HISTORY_CONFIGURATION_ varchar(255), + INCIDENT_STATE_ integer, + TENANT_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_JOB_LOG ( + ID_ varchar(64) not null, + TIMESTAMP_ datetime(3) not null, + JOB_ID_ varchar(64) not null, + JOB_DUEDATE_ datetime(3) NULL, + JOB_RETRIES_ integer, + JOB_PRIORITY_ bigint NOT NULL DEFAULT 0, + JOB_EXCEPTION_MSG_ varchar(4000), + JOB_EXCEPTION_STACK_ID_ varchar(64), + JOB_STATE_ integer, + JOB_DEF_ID_ varchar(64), + JOB_DEF_TYPE_ varchar(255), + JOB_DEF_CONFIGURATION_ varchar(255), + ACT_ID_ varchar(255), + FAILED_ACT_ID_ varchar(255), + ROOT_PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROCESS_DEF_ID_ varchar(64), + PROCESS_DEF_KEY_ varchar(255), + DEPLOYMENT_ID_ varchar(64), + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + HOSTNAME_ varchar(255), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_BATCH ( + ID_ varchar(64) not null, + TYPE_ varchar(255), + TOTAL_JOBS_ integer, + JOBS_PER_SEED_ integer, + INVOCATIONS_PER_JOB_ integer, + SEED_JOB_DEF_ID_ varchar(64), + MONITOR_JOB_DEF_ID_ varchar(64), + BATCH_JOB_DEF_ID_ varchar(64), + TENANT_ID_ varchar(64), + CREATE_USER_ID_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_EXT_TASK_LOG ( + ID_ varchar(64) not null, + TIMESTAMP_ timestamp(3) not null, + EXT_TASK_ID_ varchar(64) not null, + RETRIES_ integer, + TOPIC_NAME_ varchar(255), + WORKER_ID_ varchar(255), + PRIORITY_ bigint NOT NULL DEFAULT 0, + ERROR_MSG_ varchar(4000), + ERROR_DETAILS_ID_ varchar(64), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + TENANT_ID_ varchar(64), + STATE_ integer, + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_); +create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_); +create index ACT_IDX_HI_PRO_INST_TENANT_ID on ACT_HI_PROCINST(TENANT_ID_); +create index ACT_IDX_HI_PRO_INST_PROC_DEF_KEY on ACT_HI_PROCINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_PRO_INST_PROC_TIME on ACT_HI_PROCINST(START_TIME_, END_TIME_); +create index ACT_IDX_HI_PI_PDEFID_END_TIME on ACT_HI_PROCINST(PROC_DEF_ID_, END_TIME_); +create index ACT_IDX_HI_PRO_INST_ROOT_PI on ACT_HI_PROCINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_PRO_INST_RM_TIME on ACT_HI_PROCINST(REMOVAL_TIME_); + +create index ACT_IDX_HI_ACTINST_ROOT_PI on ACT_HI_ACTINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_ACT_INST_START_END on ACT_HI_ACTINST(START_TIME_, END_TIME_); +create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_); +create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_); +create index ACT_IDX_HI_ACT_INST_COMP on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_, END_TIME_, ID_); +create index ACT_IDX_HI_ACT_INST_STATS on ACT_HI_ACTINST(PROC_DEF_ID_, PROC_INST_ID_, ACT_ID_, END_TIME_, ACT_INST_STATE_); +create index ACT_IDX_HI_ACT_INST_TENANT_ID on ACT_HI_ACTINST(TENANT_ID_); +create index ACT_IDX_HI_ACT_INST_PROC_DEF_KEY on ACT_HI_ACTINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_AI_PDEFID_END_TIME on ACT_HI_ACTINST(PROC_DEF_ID_, END_TIME_); +create index ACT_IDX_HI_ACT_INST_RM_TIME on ACT_HI_ACTINST(REMOVAL_TIME_); + +create index ACT_IDX_HI_TASKINST_ROOT_PI on ACT_HI_TASKINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_TASK_INST_TENANT_ID on ACT_HI_TASKINST(TENANT_ID_); +create index ACT_IDX_HI_TASK_INST_PROC_DEF_KEY on ACT_HI_TASKINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_TASKINST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_); +create index ACT_IDX_HI_TASKINSTID_PROCINST on ACT_HI_TASKINST(ID_,PROC_INST_ID_); +create index ACT_IDX_HI_TASK_INST_RM_TIME on ACT_HI_TASKINST(REMOVAL_TIME_); +create index ACT_IDX_HI_TASK_INST_START on ACT_HI_TASKINST(START_TIME_); +create index ACT_IDX_HI_TASK_INST_END on ACT_HI_TASKINST(END_TIME_); + +create index ACT_IDX_HI_DETAIL_ROOT_PI on ACT_HI_DETAIL(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_); +create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_); +create index ACT_IDX_HI_DETAIL_CASE_INST on ACT_HI_DETAIL(CASE_INST_ID_); +create index ACT_IDX_HI_DETAIL_CASE_EXEC on ACT_HI_DETAIL(CASE_EXECUTION_ID_); +create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_); +create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_); +create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_); +create index ACT_IDX_HI_DETAIL_TENANT_ID on ACT_HI_DETAIL(TENANT_ID_); +create index ACT_IDX_HI_DETAIL_PROC_DEF_KEY on ACT_HI_DETAIL(PROC_DEF_KEY_); +create index ACT_IDX_HI_DETAIL_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_); +create index ACT_IDX_HI_DETAIL_RM_TIME on ACT_HI_DETAIL(REMOVAL_TIME_); +create index ACT_IDX_HI_DETAIL_TASK_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_, TASK_ID_); +create index ACT_IDX_HI_DETAIL_VAR_INST_ID on ACT_HI_DETAIL(VAR_INST_ID_); + +create index ACT_IDX_HI_IDENT_LNK_ROOT_PI on ACT_HI_IDENTITYLINK(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_GROUP on ACT_HI_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_HI_IDENT_LNK_TENANT_ID on ACT_HI_IDENTITYLINK(TENANT_ID_); +create index ACT_IDX_HI_IDENT_LNK_PROC_DEF_KEY on ACT_HI_IDENTITYLINK(PROC_DEF_KEY_); +create index ACT_IDX_HI_IDENT_LINK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_); +create index ACT_IDX_HI_IDENT_LINK_RM_TIME on ACT_HI_IDENTITYLINK(REMOVAL_TIME_); +create index ACT_IDX_HI_IDENT_LNK_TIMESTAMP on ACT_HI_IDENTITYLINK(TIMESTAMP_); + +create index ACT_IDX_HI_VARINST_ROOT_PI on ACT_HI_VARINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_); +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_CASEVAR_CASE_INST on ACT_HI_VARINST(CASE_INST_ID_); +create index ACT_IDX_HI_VAR_INST_TENANT_ID on ACT_HI_VARINST(TENANT_ID_); +create index ACT_IDX_HI_VAR_INST_PROC_DEF_KEY on ACT_HI_VARINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_VARINST_BYTEAR on ACT_HI_VARINST(BYTEARRAY_ID_); +create index ACT_IDX_HI_VARINST_RM_TIME on ACT_HI_VARINST(REMOVAL_TIME_); +create index ACT_IDX_HI_VAR_PI_NAME_TYPE on ACT_HI_VARINST(PROC_INST_ID_, NAME_, VAR_TYPE_); + +create index ACT_IDX_HI_INCIDENT_TENANT_ID on ACT_HI_INCIDENT(TENANT_ID_); +create index ACT_IDX_HI_INCIDENT_PROC_DEF_KEY on ACT_HI_INCIDENT(PROC_DEF_KEY_); +create index ACT_IDX_HI_INCIDENT_ROOT_PI on ACT_HI_INCIDENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_INCIDENT_PROCINST on ACT_HI_INCIDENT(PROC_INST_ID_); +create index ACT_IDX_HI_INCIDENT_RM_TIME on ACT_HI_INCIDENT(REMOVAL_TIME_); +create index ACT_IDX_HI_INCIDENT_CREATE_TIME on ACT_HI_INCIDENT(CREATE_TIME_); +create index ACT_IDX_HI_INCIDENT_END_TIME on ACT_HI_INCIDENT(END_TIME_); + +create index ACT_IDX_HI_JOB_LOG_ROOT_PI on ACT_HI_JOB_LOG(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_JOB_LOG_PROCINST on ACT_HI_JOB_LOG(PROCESS_INSTANCE_ID_); +create index ACT_IDX_HI_JOB_LOG_PROCDEF on ACT_HI_JOB_LOG(PROCESS_DEF_ID_); +create index ACT_IDX_HI_JOB_LOG_TENANT_ID on ACT_HI_JOB_LOG(TENANT_ID_); +create index ACT_IDX_HI_JOB_LOG_JOB_DEF_ID on ACT_HI_JOB_LOG(JOB_DEF_ID_); +create index ACT_IDX_HI_JOB_LOG_PROC_DEF_KEY on ACT_HI_JOB_LOG(PROCESS_DEF_KEY_); +create index ACT_IDX_HI_JOB_LOG_EX_STACK on ACT_HI_JOB_LOG(JOB_EXCEPTION_STACK_ID_); +create index ACT_IDX_HI_JOB_LOG_RM_TIME on ACT_HI_JOB_LOG(REMOVAL_TIME_); +create index ACT_IDX_HI_JOB_LOG_JOB_CONF on ACT_HI_JOB_LOG(JOB_DEF_CONFIGURATION_); + +create index ACT_HI_BAT_RM_TIME on ACT_HI_BATCH(REMOVAL_TIME_); + +create index ACT_HI_EXT_TASK_LOG_ROOT_PI on ACT_HI_EXT_TASK_LOG(ROOT_PROC_INST_ID_); +create index ACT_HI_EXT_TASK_LOG_PROCINST on ACT_HI_EXT_TASK_LOG(PROC_INST_ID_); +create index ACT_HI_EXT_TASK_LOG_PROCDEF on ACT_HI_EXT_TASK_LOG(PROC_DEF_ID_); +create index ACT_HI_EXT_TASK_LOG_PROC_DEF_KEY on ACT_HI_EXT_TASK_LOG(PROC_DEF_KEY_); +create index ACT_HI_EXT_TASK_LOG_TENANT_ID on ACT_HI_EXT_TASK_LOG(TENANT_ID_); +create index ACT_IDX_HI_EXTTASKLOG_ERRORDET on ACT_HI_EXT_TASK_LOG(ERROR_DETAILS_ID_); +create index ACT_HI_EXT_TASK_LOG_RM_TIME on ACT_HI_EXT_TASK_LOG(REMOVAL_TIME_); + +create index ACT_IDX_HI_OP_LOG_ROOT_PI on ACT_HI_OP_LOG(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_OP_LOG_PROCINST on ACT_HI_OP_LOG(PROC_INST_ID_); +create index ACT_IDX_HI_OP_LOG_PROCDEF on ACT_HI_OP_LOG(PROC_DEF_ID_); +create index ACT_IDX_HI_OP_LOG_TASK on ACT_HI_OP_LOG(TASK_ID_); +create index ACT_IDX_HI_OP_LOG_RM_TIME on ACT_HI_OP_LOG(REMOVAL_TIME_); +create index ACT_IDX_HI_OP_LOG_TIMESTAMP on ACT_HI_OP_LOG(TIMESTAMP_); +create index ACT_IDX_HI_OP_LOG_USER_ID on ACT_HI_OP_LOG(USER_ID_); +create index ACT_IDX_HI_OP_LOG_OP_TYPE on ACT_HI_OP_LOG(OPERATION_TYPE_); +create index ACT_IDX_HI_OP_LOG_ENTITY_TYPE on ACT_HI_OP_LOG(ENTITY_TYPE_); + +create index ACT_IDX_HI_COMMENT_TASK on ACT_HI_COMMENT(TASK_ID_); +create index ACT_IDX_HI_COMMENT_ROOT_PI on ACT_HI_COMMENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_COMMENT_PROCINST on ACT_HI_COMMENT(PROC_INST_ID_); +create index ACT_IDX_HI_COMMENT_RM_TIME on ACT_HI_COMMENT(REMOVAL_TIME_); + +create index ACT_IDX_HI_ATTACHMENT_CONTENT on ACT_HI_ATTACHMENT(CONTENT_ID_); +create index ACT_IDX_HI_ATTACHMENT_ROOT_PI on ACT_HI_ATTACHMENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_ATTACHMENT_PROCINST on ACT_HI_ATTACHMENT(PROC_INST_ID_); +create index ACT_IDX_HI_ATTACHMENT_TASK on ACT_HI_ATTACHMENT(TASK_ID_); +create index ACT_IDX_HI_ATTACHMENT_RM_TIME on ACT_HI_ATTACHMENT(REMOVAL_TIME_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +create table ACT_HI_CASEINST ( + ID_ varchar(64) not null, + CASE_INST_ID_ varchar(64) not null, + BUSINESS_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64) not null, + CREATE_TIME_ datetime(3) not null, + CLOSE_TIME_ datetime(3), + DURATION_ bigint, + STATE_ integer, + CREATE_USER_ID_ varchar(255), + SUPER_CASE_INSTANCE_ID_ varchar(64), + SUPER_PROCESS_INSTANCE_ID_ varchar(64), + TENANT_ID_ varchar(64), + primary key (ID_), + unique (CASE_INST_ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_CASEACTINST ( + ID_ varchar(64) not null, + PARENT_ACT_INST_ID_ varchar(64), + CASE_DEF_ID_ varchar(64) not null, + CASE_INST_ID_ varchar(64) not null, + CASE_ACT_ID_ varchar(255) not null, + TASK_ID_ varchar(64), + CALL_PROC_INST_ID_ varchar(64), + CALL_CASE_INST_ID_ varchar(64), + CASE_ACT_NAME_ varchar(255), + CASE_ACT_TYPE_ varchar(255), + CREATE_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + STATE_ integer, + REQUIRED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_CAS_I_CLOSE on ACT_HI_CASEINST(CLOSE_TIME_); +create index ACT_IDX_HI_CAS_I_BUSKEY on ACT_HI_CASEINST(BUSINESS_KEY_); +create index ACT_IDX_HI_CAS_I_TENANT_ID on ACT_HI_CASEINST(TENANT_ID_); +create index ACT_IDX_HI_CAS_A_I_CREATE on ACT_HI_CASEACTINST(CREATE_TIME_); +create index ACT_IDX_HI_CAS_A_I_END on ACT_HI_CASEACTINST(END_TIME_); +create index ACT_IDX_HI_CAS_A_I_COMP on ACT_HI_CASEACTINST(CASE_ACT_ID_, END_TIME_, ID_); +create index ACT_IDX_HI_CAS_A_I_CASEINST on ACT_HI_CASEACTINST(CASE_INST_ID_, CASE_ACT_ID_); +create index ACT_IDX_HI_CAS_A_I_TENANT_ID on ACT_HI_CASEACTINST(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; 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. +-- + +-- create history decision instance table -- +create table ACT_HI_DECINST ( + ID_ varchar(64) NOT NULL, + DEC_DEF_ID_ varchar(64) NOT NULL, + DEC_DEF_KEY_ varchar(255) NOT NULL, + DEC_DEF_NAME_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + ACT_ID_ varchar(255), + EVAL_TIME_ datetime(3) not null, + REMOVAL_TIME_ datetime(3), + COLLECT_VALUE_ double, + USER_ID_ varchar(255), + ROOT_DEC_INST_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + DEC_REQ_ID_ varchar(64), + DEC_REQ_KEY_ varchar(255), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create history decision input table -- +create table ACT_HI_DEC_IN ( + ID_ varchar(64) NOT NULL, + DEC_INST_ID_ varchar(64) NOT NULL, + CLAUSE_ID_ varchar(64), + CLAUSE_NAME_ varchar(255), + VAR_TYPE_ varchar(100), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create history decision output table -- +create table ACT_HI_DEC_OUT ( + ID_ varchar(64) NOT NULL, + DEC_INST_ID_ varchar(64) NOT NULL, + CLAUSE_ID_ varchar(64), + CLAUSE_NAME_ varchar(255), + RULE_ID_ varchar(64), + RULE_ORDER_ integer, + VAR_NAME_ varchar(255), + VAR_TYPE_ varchar(100), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(10000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + + +create index ACT_IDX_HI_DEC_INST_ID on ACT_HI_DECINST(DEC_DEF_ID_); +create index ACT_IDX_HI_DEC_INST_KEY on ACT_HI_DECINST(DEC_DEF_KEY_); +create index ACT_IDX_HI_DEC_INST_PI on ACT_HI_DECINST(PROC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_CI on ACT_HI_DECINST(CASE_INST_ID_); +create index ACT_IDX_HI_DEC_INST_ACT on ACT_HI_DECINST(ACT_ID_); +create index ACT_IDX_HI_DEC_INST_ACT_INST on ACT_HI_DECINST(ACT_INST_ID_); +create index ACT_IDX_HI_DEC_INST_TIME on ACT_HI_DECINST(EVAL_TIME_); +create index ACT_IDX_HI_DEC_INST_TENANT_ID on ACT_HI_DECINST(TENANT_ID_); +create index ACT_IDX_HI_DEC_INST_ROOT_ID on ACT_HI_DECINST(ROOT_DEC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_REQ_ID on ACT_HI_DECINST(DEC_REQ_ID_); +create index ACT_IDX_HI_DEC_INST_REQ_KEY on ACT_HI_DECINST(DEC_REQ_KEY_); +create index ACT_IDX_HI_DEC_INST_ROOT_PI on ACT_HI_DECINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_RM_TIME on ACT_HI_DECINST(REMOVAL_TIME_); + + +create index ACT_IDX_HI_DEC_IN_INST on ACT_HI_DEC_IN(DEC_INST_ID_); +create index ACT_IDX_HI_DEC_IN_CLAUSE on ACT_HI_DEC_IN(DEC_INST_ID_, CLAUSE_ID_); +create index ACT_IDX_HI_DEC_IN_ROOT_PI on ACT_HI_DEC_IN(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_IN_RM_TIME on ACT_HI_DEC_IN(REMOVAL_TIME_); + +create index ACT_IDX_HI_DEC_OUT_INST on ACT_HI_DEC_OUT(DEC_INST_ID_); +create index ACT_IDX_HI_DEC_OUT_RULE on ACT_HI_DEC_OUT(RULE_ORDER_, CLAUSE_ID_); +create index ACT_IDX_HI_DEC_OUT_ROOT_PI on ACT_HI_DEC_OUT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_OUT_RM_TIME on ACT_HI_DEC_OUT(REMOVAL_TIME_); + diff --git a/plans/so/macroflow/config/override-files/api-handler-infra/onapheat/override.yaml b/plans/so/macroflow/config/override-files/api-handler-infra/onapheat/override.yaml new file mode 100644 index 00000000..bdf5c4de --- /dev/null +++ b/plans/so/macroflow/config/override-files/api-handler-infra/onapheat/override.yaml @@ -0,0 +1,133 @@ +server: + port: 8080 + tomcat: + max-threads: 50 +ssl-enable: false + +mso: + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + logPath: logs + site-name: onapheat + adapters: + requestDb: + endpoint: http://request-db-adapter:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + config: + path: /src/main/resources/ + infra: + default: + alacarte: + orchestrationUri: /mso/async/services/ALaCarteOrchestrator + recipeTimeout: 180 + testApi: VNF_API + service: + macro: + default: + testApi: GR_API + camundaURL: http://bpmn-infra:8081 + camundaAuth: AE2E9BE6EF9249085AF98689C4EE087736A5500629A72F35068FFB88813A023581DD6E765071F1C04075B36EA4213A + async: + core-pool-size: 50 + max-pool-size: 50 + queue-capacity: 500 + sdc: + client: + auth: F3473596C526938329DF877495B494DC374D1C4198ED3AD305EA3ADCBBDA1862 + activate: + instanceid: test + userid: cs0008 + endpoint: http://c1.vm1.mso.simpledemo.onap.org:28090 + tenant: + isolation: + retry: + count: 3 + aai: + endpoint: https://aai-simulator:9993 + auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885 + extApi: + endpoint: http://nbi.onap:8080/nbi/api/v3 + so: + operational-environment: + dmaap: + username: testuser + password: VjR5NDcxSzA= + host: http://c1.vm1.mso.simpledemo.onap.org:28090 + auth: 51EA5414022D7BE536E7516C4D1A6361416921849B72C0D6FC1C7F262FD9F2BBC2AD124190A332D9845A188AD80955567A4F975C84C221EEA8243BFD92FFE6896CDD1EA16ADD34E1E3D47D4A + publisher: + topic: com.att.ecomp.mso.operationalEnvironmentEvent + health: + auth: Basic bXNvX2FkbWlufHBhc3N3b3JkMSQ= + endpoints: + - subsystem: apih + uri: http://bpmn-infra:8081 + - subsystem: catalogdb + uri: http://catalog-db-adapter:8082 + +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: true + jpa: + show-sql: true + hibernate: + dialect: org.hibernate.dialect.MySQL5Dialect + ddl-auto: validate + naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy + enable-lazy-load-no-trans: true + jersey: + type: filter + + security: + usercredentials: + - + username: sitecontrol + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SiteControl-Client + - + username: gui + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: GUI-Client + - + username: infraportal + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: InfraPortal-Client + - + username: InfraPortalClient + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: InfraPortal-Client + - + username: bpel + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR + +request: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/requestdb + username: requestuser + password: request123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: reqdb-pool + registerMbeans: true +org: + onap: + so: + cloud-owner: CloudOwner + adapters: + network: + encryptionKey: 07a7159d3bf51a0e53be7a8f89699be7 diff --git a/plans/so/macroflow/config/override-files/bpmn-infra/onapheat/override.yaml b/plans/so/macroflow/config/override-files/bpmn-infra/onapheat/override.yaml new file mode 100644 index 00000000..3ca554df --- /dev/null +++ b/plans/so/macroflow/config/override-files/bpmn-infra/onapheat/override.yaml @@ -0,0 +1,366 @@ +aai: + auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885 + dme2: + timeout: '30000' + endpoint: https://aai-simulator:9993 + workflowAaiDistributionDelay: PT30S + pnfEntryNotificationTimeout: P14D +cds: + endpoint: blueprints-processor + port: 9111 + auth: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== + timeout: 60 +camunda: + bpm: + admin-user: + id: admin + password: so_Admin123 + history-level: full + job-execution: + max-pool-size: 30 + core-pool-size: 3 +entitymanager: + packagesToScan: com +pnf: + dmaap: + host: message-router + port: 3904 + protocol: http + uriPathPrefix: events + topicName: unauthenticated.PNF_READY + consumerGroup: consumerGroup + consumerId: consumerId + topicListenerDelayInSeconds: 5 +bpelURL: http://bpmn-infra:8081 +msb-ip: msb-iag +msb-port: 80 +mso: + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + config: + path: /var/csar/ + correlation: + timeout: 60 + logPath: logs + async: + core-pool-size: 50 + max-pool-size: 50 + queue-capacity: 500 + aai: + endpoint: https://aai-simulator:9993 + adapters: + completemsoprocess: + endpoint: http://bpmn-infra:8081/CompleteMsoProcess + requestDb: + endpoint: http://request-db-adapter:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + db: + auth: 33293332AEC4930F655D8E2E8BB08937 + password: wLg4sjrAFUS8rfVfdvTXeQ== + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8083/services/RequestsDbAdapter + spring: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8083 + network: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/NetworkAdapter + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/rest/v1/networks + openecomp: + db: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8083/services/RequestsDbAdapter + po: + auth: 33293332AEC4930F655D8E2E8BB08937 + password: B8EBDE0311F0AF355CF3F2FD505A8CAD + sdnc: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8086/adapters/SDNCAdapter + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8086/adapters/rest/v1/sdnc + timeout: PT60M + tenant: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/TenantAdapter + vnf: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/VnfAdapter + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/rest/v1/vnfs + volume-groups: + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/rest/v1/volume-groups + vnf-async: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8087/services/VnfAdapterAsync + vfc: + rest: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8084/services/v1/vfcadapter + workflow: + message: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8081/mso/WorkflowMessage + bpmn: + process: + historyTimeToLive: '30' + callbackRetryAttempts: '5' + catalog: + db: + endpoint: http://catalog-db-adapter:8082/ecomp/mso/catalog + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + default: + adapter: + namespace: http://org.onap.mso + healthcheck: + log: + debug: 'false' + infra: + customer: + id: testCustIdInfra + po: + timeout: PT60M + request: + db: + endpoint: http://c1.vm1.mso.simpledemo.onap.org:8083/ + rollback: 'true' + sdnc: + password: 3141634BF7E070AA289CF2892C986C0B + service: + agnostic: + sniro: + endpoint: /sniro/api/v2/placement + host: http://c1.vm1.mso.simpledemo.onap.org:30253 + site-name: CamundaEngine + sniro: + auth: test:testpwd + callback: http://c1.vm1.mso.simpledemo.onap.org:8086/adapters/rest/SDNCNotify + endpoint: http://replaceme:28090/optimizationInstance/V1/create + timeout: PT30M + oof: + auth: test:testpwd + callbackEndpoint: http://bpmn-infra:8081/mso/WorkflowMessage + endpoint: http://oof.api.simpledemo.openecomp.org:8698/api/oof/v1/placement + timeout: PT30M + workflow: + CreateGenericVNFV1: + aai: + volume-group: + uri: /aai/v6/cloud-infrastructure/volume-groups/volume-group + default: + aai: + version: '14' + cloud-region: + version: '14' + generic-vnf: + version: '14' + v14: + customer: + uri: /aai/v14/business/customers/customer + generic-query: + uri: /aai/v14/search/generic-query + generic-vnf: + uri: /aai/v14/network/generic-vnfs/generic-vnf + l3-network: + uri: /aai/v14/network/l3-networks/l3-network + network-policy: + uri: /aai/v14/network/network-policies/network-policy + nodes-query: + uri: /aai/v14/search/nodes-query + route-table-reference: + uri: /aai/v14/network/route-table-references/route-table-reference + tenant: + uri: /aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant + vce: + uri: /aai/v14/network/vces/vce + vpn-binding: + uri: /aai/v14/network/vpn-bindings/vpn-binding + sp-partner: + uri: /aai/v14/business/sp-partners/sp-partner + device: + uri: /aai/v14/network/devices/device + v11: + customer: + uri: /aai/v11/business/customers/customer + generic-query: + uri: /aai/v11/search/generic-query + generic-vnf: + uri: /aai/v11/network/generic-vnfs/generic-vnf + l3-network: + uri: /aai/v11/network/l3-networks/l3-network + network-policy: + uri: /aai/v11/network/network-policies/network-policy + nodes-query: + uri: /aai/v11/search/nodes-query + route-table-reference: + uri: /aai/v11/network/route-table-references/route-table-reference + tenant: + uri: /aai/v11/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant + vce: + uri: /aai/v11/network/vces/vce + vpn-binding: + uri: /aai/v11/network/vpn-bindings/vpn-binding + v8: + configuration: + uri: /aai/v11/network/configurations/configuration + customer: + uri: /aai/v8/business/customers/customer + generic-query: + uri: /aai/v8/search/generic-query + l3-network: + uri: /aai/v8/network/l3-networks/l3-network + network-policy: + uri: /aai/v8/network/network-policies/network-policy + nodes-query: + uri: /aai/v8/search/nodes-query + route-table-reference: + uri: /aai/v8/network/route-table-references/route-table-reference + tenant: + uri: /aai/v8/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/RegionOne/tenants/tenant + vce: + uri: /aai/v8/network/vces/vce + vpn-binding: + uri: /aai/v8/network/vpn-bindings/vpn-binding + v9: + cloud-region: + uri: /aai/v9/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner + generic-vnf: + uri: /aai/v9/network/generic-vnfs/generic-vnf + retry: + attempts: '1' + deleteCinderVolumeV1: + aai: + volume-group: + uri: /aai/v6/cloud-infrastructure/volume-groups/volume-group + global: + default: + aai: + namespace: http://org.onap.aai.inventory/ + version: 14 + message: + endpoint: http://bpmn-infra:8081/mso/WorkflowMessage + notification: + name: GenericNotificationServiceATT + sdnc: + replication: + delay: PT60S + sdncadapter: + callback: http://bpmn-infra:8081/mso/SDNCAdapterCallbackService + vnfadapter: + create: + callback: http://c1.vm1.mso.simpledemo.onap.org:8087/mso/vnfAdapterNotify + delete: + callback: http://c1.vm1.mso.simpledemo.onap.org:8087/mso/vnfAdapterNotify + query: + callback: http://c1.vm1.mso.simpledemo.onap.org:8087/mso/vnfAdapterNotify + rollback: + callback: http://c1.vm1.mso.simpledemo.onap.org:8087/mso/vnfAdapterNotify + use: + qualified: + host: false + global: + dmaap: + username: testuser + password: alRyMzJ3NUNeakxl + host: http://10.42.111.36:904 + publisher: + topic: replaceme + naming: + endpoint: http://naming.demo.onap.com:8081/web/service/v1/genNetworkElementName + auth: Basic bTA0NzY4QG5vbi1wcm9kLm1zby5lY29tcC5hdHQuY29tOkF0dG0wNDc2OExpZmUhQA== +policy: + auth: Basic dGVzdHBkcDphbHBoYTEyMw== + default: + disposition: Skip + client: + auth: Basic bTAzNzQzOnBvbGljeVIwY2sk + endpoint: https://localhost:8081/pdp/api/ + environment: TEST +sdnc: + auth: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== + host: http://sdnc-simulator:9994 + path: /restconf/operations/GENERIC-RESOURCE-API + si: + svc: + types: PORT-MIRROR,PPROBE + dmaap: + host: ueb1.simpledemo.onap.org:3904 + timeout: 30000 + lcm: + path: '/restconf/operations/LCM:' + actionTimeout: 300000 + dmapp: + readTopic: SDNC-LCM-WRITE + writeTopic: SDNC-LCM-READ +appc: + client: + topic: + read: + name: APPC-LCM-WRITE + timeout: 360000 + write: APPC-LCM-READ + sdnc: + read: SDNC-LCM-WRITE + write: SDNC-LCM-READ + response: + timeout: 360000 + key: VIlbtVl6YLhNUrtU + secret: 64AG2hF4pYeG2pq7CT6XwUOT + service: ueb + poolMembers: ueb1.simpledemo.onap.org:3904,ueb2.simpledemo.onap.org:3904 +sniro: + conductor: + enabled: true + host: http://sniro-emulator:80 + uri: /v1/release-orders + headers.auth: Basic dGVzdDp0ZXN0cHdk + manager: + timeout: PT30M + host: http://sniro-emulator:80 + uri.v1: /sniro/api/v2/placement + uri.v2: /sniro/api/placement/v2 + headers.auth: Basic dGVzdDp0ZXN0cHdk + headers.patchVersion: 1 + headers.minorVersion: 1 + headers.latestVersion: 2 +server: + port: 8081 + tomcat: + max-threads: 50 +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/camundabpmn + username: camundauser + password: camunda123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: bpmn-pool + registerMbeans: true + security: + usercredentials: + - + username: apihBpmn + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPMN-Client + - + username: sdncaBpmn + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPMN-Client + - + username: poBpmn + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPMN-Client + - + username: wmaBpmn + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPMN-Client + - + username: sniro + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SNIRO-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR +so: + vnfm: + adapter: + url: http://so-vnfm-adapter:9092/so/vnfm-adapter/v1/ + auth: Basic dm5mbTpwYXNzd29yZDEk +org: + onap: + so: + cloud-owner: CloudOwner diff --git a/plans/so/macroflow/config/override-files/catalog-db-adapter/onapheat/override.yaml b/plans/so/macroflow/config/override-files/catalog-db-adapter/onapheat/override.yaml new file mode 100644 index 00000000..934e8fbd --- /dev/null +++ b/plans/so/macroflow/config/override-files/catalog-db-adapter/onapheat/override.yaml @@ -0,0 +1,103 @@ +server: + port: 8082 + tomcat: + max-threads: 50 +ssl-enable: false +mso: + logPath: logs + site-name: onapheat + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: true + flyway: + baseline-on-migrate: false + url: jdbc:mariadb://mariadb:3306/catalogdb + user: cataloguser + password: catalog123 + outOfOrder: true + validateOnMigrate: false + jpa: + generate-ddl: false + show-sql: false + hibernate: + ddl-auto: validate + naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy + enable-lazy-load-no-trans: true + database-platform: org.hibernate.dialect.MySQL5InnoDBDialect + security: + usercredentials: + - + username: bpel + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR +#Actuator +management: + context-path: /manage +cloud_config: + identity_services: + RAX_KEYSTONE: + identity_url: "https://identity.api.rackspacecloud.com/v2.0" + mso_id: "RACKSPACE_ACCOUNT_ID" + mso_pass: "RACKSPACE_ACCOUNT_APIKEY" + admin_tenant: "dummy" + member_role: "admin" + tenant_metadata: true + identity_server_type: "KEYSTONE" + identity_authentication_type: "RACKSPACE_APIKEY" + project_domain_name: "PROJECT_DOMAIN_NAME" + user_domain_name: "USER_DOMAIN_NAME" + DEFAULT_KEYSTONE: + identity_url: "dummy" + mso_id: "dummy" + mso_pass: "dummy" + admin_tenant: "dummy" + member_role: "admin" + tenant_metadata: true + identity_server_type: "KEYSTONE" + identity_authentication_type: "USERNAME_PASSWORD" + project_domain_name: "dummy" + user_domain_name: "dummy" + cloud_sites: + Dallas: + region_id: "DFW" + clli: "DFW" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + Northern Virginia: + region_id: "IAD" + clli: "IAD" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + Chicago: + region_id: "ORD" + clli: "ORD" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + RegionOne: + region_id: "RegionOne" + clli: "RegionOne" + aic_version: "2.5" + identity_service_id: "DEFAULT_KEYSTONE" + DEFAULT: + region_id: "dummyRegionId" + clli: "dummyClli" + aic_version: "2.5" + identity_service_id: "DEFAULT_KEYSTONE" + + diff --git a/plans/so/macroflow/config/override-files/openstack-adapter/onapheat/override.yaml b/plans/so/macroflow/config/override-files/openstack-adapter/onapheat/override.yaml new file mode 100644 index 00000000..7e2afa85 --- /dev/null +++ b/plans/so/macroflow/config/override-files/openstack-adapter/onapheat/override.yaml @@ -0,0 +1,147 @@ +server: + port: 8087 + +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: false + + security: + usercredentials: + - + username: sdnc + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SDNC-Client + - + username: sitecontrol + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SiteControl-Client + - + username: bpel + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - + username: sniro + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: SNIRO-Client + - + username: apih + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: MSO-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR + + +org: + onap: + so: + adapters: + default_keystone_url_version: /v2.0 + default_keystone_reg_ex: "/[vV][0-9]" + vnf: + bpelauth: D1A67FA93B6A6419132D0F83CC771AF774FD3C60853C50C22C8C6FC5088CC79E9E81EDE9EA39F22B2F66A0068E + checkRequiredParameters: true + addGetFilesOnVolumeReq: false + sockettimeout: 30 + connecttimeout: 30 + retrycount: 5 + retryinterval: -15 + retrylist: 408,429,500,502,503,504,900 + valet_enabled: false + fail_requests_on_valet_failure: false + network: + bpelauth: D1A67FA93B6A6419132D0F83CC771AF774FD3C60853C50C22C8C6FC5088CC79E9E81EDE9EA39F22B2F66A0068E + sockettimeout: 5 + connecttimeout: 5 + retrycount: 5 + retryinterval: -15 + retrylist: 408,429,500,502,503,504,900 + encryptionKey: 07a7159d3bf51a0e53be7a8f89699be7 + tenant: + default_keystone_url_version: /v2.0 + default_keystone_reg_ex: "/[vV][0-9]" + default_tenant_description: Tenant + default_region_type: single + default_user_role: admin + default_success_status_string: Success + default_no_regions_status_string: no regions + default_quota_value: 10 + set_default_quota: false + +ecomp: + mso: + adapters: + po: + retryCodes: 504 + retryDelay: 5 + retryCount: 3 + pollTimeout: 7500 + pollInterval: 15 + +mso: + adapters: + requestDb: + endpoint: http://so-request-db-adapter.onap:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + auth: BEA8637716A7EB617DF472BA6552D22F68C1CB17B0D094D77DDA562F4ADAAC4457CAB848E1A4 + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + logPath: ./logs/openstack + msb-ip: multicloud-simulator + msb-port: 9996 + msb-scheme: http + workflow: + endpoint: http://bpmn-infra:8081/sobpmnengine + config: + cadi: + aafId: poBpmn + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + site-name: localDevEnv + async: + core-pool-size: 50 + max-pool-size: 50 + queue-capacity: 500 + +cloud_config: + identity_services: + RAX_KEYSTONE: + identity_url: "https://identity.api.rackspacecloud.com/v2.0" + mso_id: "RACKSPACE_ACCOUNT_ID" + mso_pass: "RACKSPACE_ACCOUNT_APIKEY" + admin_tenant: "service" + member_role: "admin" + tenant_metadata: true + identity_server_type: "KEYSTONE" + identity_authentication_type: "RACKSPACE_APIKEY" + cloud_sites: + Dallas: + region_id: "DFW" + clli: "DFW" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + Northern Virginia: + region_id: "IAD" + clli: "IAD" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + Chicago: + region_id: "ORD" + clli: "ORD" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" + DEFAULT: + region_id: "DFW" + clli: "DFW" + aic_version: "2.5" + identity_service_id: "RAX_KEYSTONE" diff --git a/plans/so/macroflow/config/override-files/sdc-controller/onapheat/override.yaml b/plans/so/macroflow/config/override-files/sdc-controller/onapheat/override.yaml new file mode 100644 index 00000000..ed8bd43f --- /dev/null +++ b/plans/so/macroflow/config/override-files/sdc-controller/onapheat/override.yaml @@ -0,0 +1,81 @@ +aai: + auth: 2A11B07DB6214A839394AA1EC5844695F5114FC407FF5422625FB00175A3DCB8A1FF745F22867EFA72D5369D599BBD88DA8BED4233CF5586 +server: + port: 8085 + +spring: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/catalogdb + username: cataloguser + password: catalog123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: catdb-pool + registerMbeans: false + + security: + usercredentials: + - + username: asdc + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: Asdc-Client + - + username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR + +request: + datasource: + hikari: + jdbcUrl: jdbc:mariadb://mariadb:3306/requestdb + username: requestuser + password: request123 + driver-class-name: org.mariadb.jdbc.Driver + pool-name: reqdb-pool + registerMbeans: false + +mso: + msoKey: 07a7159d3bf51a0e53be7a8f89699be7 + logPath: ./logs/asdc + catalog: + db: + spring: + endpoint: http://catalog-db-adapter:8082 + db: + auth: Basic YnBlbDpwYXNzd29yZDEk + site-name: onapheat + camundaURL: http://bpmn-infra:8081/ + adapters: + requestDb: + endpoint: http://request-db-adapter:8083 + auth: Basic YnBlbDpwYXNzd29yZDEk + aai: + endpoint: https://aai.api.simpledemo.onap.org:8443 + asdc-connections: + asdc-controller1: + user: mso + consumerGroup: SO-OpenSource-Env11 + consumerId: SO-COpenSource-Env11 + environmentName: AUTO + asdcAddress: c2.vm1.sdc.simpledemo.onap.org:8443 + password: 76966BDD3C7414A03F7037264FF2E6C8EEC6C28F2B67F2840A1ED857C0260FEE731D73F47F828E5527125D29FD25D3E0DE39EE44C058906BF1657DE77BF897EECA93BDC07FA64F + pollingInterval: 60 + pollingTimeout: 60 + relevantArtifactTypes: HEAT,HEAT_ENV,HEAT_VOL + useHttpsWithDmaap: false + activateServerTLSAuth: false + keyStorePassword: + keyStorePath: + watchDogTimeout: 100 + isFitlerInEmptyResources: true + messageBusAddress: vm1.mr.simpledemo.onap.org,vm1.mr.simpledemo.onap.org + asdc: + config: + activity: + endpoint: http://sdc-wfd-be:8080 + key: 566B754875657232314F5548556D3665 + components: + count: 0, + componentNames: + scheduling: + enabled: false diff --git a/plans/so/macroflow/config/override-files/so-monitoring/onapheat/override.yaml b/plans/so/macroflow/config/override-files/so-monitoring/onapheat/override.yaml new file mode 100644 index 00000000..7e61c7d0 --- /dev/null +++ b/plans/so/macroflow/config/override-files/so-monitoring/onapheat/override.yaml @@ -0,0 +1,24 @@ +server: + port: 30224 + tomcat: + max-threads: 4 +ssl-enable: false +camunda: + rest: + api: + url: http://bpmn-infra:8081/sobpmnengine/engine/ + engine: default + auth: Basic YXBpaEJwbW46cGFzc3dvcmQxJA== +mso: + database: + rest: + api: + url: http://request-db-adapter:8083/infraActiveRequests/ + auth: Basic YnBlbDpwYXNzd29yZDEk +spring: + security: + usercredentials: + - + username: gui + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: GUI-Client diff --git a/plans/so/macroflow/config/override-files/so-vnfm-adapter/onapheat/override.yaml b/plans/so/macroflow/config/override-files/so-vnfm-adapter/onapheat/override.yaml new file mode 100644 index 00000000..b029bd7e --- /dev/null +++ b/plans/so/macroflow/config/override-files/so-vnfm-adapter/onapheat/override.yaml @@ -0,0 +1,33 @@ +server: + port: 9092 + tomcat: + max-threads: 4 +aai: + auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885 + version: v15 + endpoint: https://aai-simulator:9993 +spring: + security: + usercredentials: + - username: vnfm + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + - username: mso_admin + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: ACTUATOR +mso: + key: 07a7159d3bf51a0e53be7a8f89699be7 + site-name: localSite + logPath: ./logs/vnfm-adapter +sdc: + username: mso + password: 76966BDD3C7414A03F7037264FF2E6C8EEC6C28F2B67F2840A1ED857C0260FEE731D73F47F828E5527125D29FD25D3E0DE39EE44C058906BF1657DE77BF897EECA93BDC07FA64F + key: 566B754875657232314F5548556D3665 + endpoint: http://sdc-simulator:9991/ + toscametapath: Artifacts/Deployment/OTHER/TOSCA.meta +vnfmadapter: + endpoint: http://so-vnfm-adapter:9092 +etsi-catalog-manager: + vnfpkgm: + endpoint: http://modeling-etsicatalog:8806/api/vnfpkgm/v1 + diff --git a/plans/so/macroflow/config/override-files/vnfm-simulator/onapheat/override.yaml b/plans/so/macroflow/config/override-files/vnfm-simulator/onapheat/override.yaml new file mode 100644 index 00000000..05cb1e56 --- /dev/null +++ b/plans/so/macroflow/config/override-files/vnfm-simulator/onapheat/override.yaml @@ -0,0 +1,56 @@ +spring: + h2: + console: + enabled: true + path: console + datasource: + url: jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE + username: admin + password: admin + http: + converters: + preferred-json-mapper: gson + security: + usercredentials: + - username: vnfm + password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke' + role: BPEL-Client + +server: + port: 9093 + tomcat: + max-threads: 50 + ssl: + client-auth: need + key-alias: so@so.onap.org + key--store-password: '7Em3&j4.19xYiMelhD5?xbQ.' + key-store: classpath:so-vnfm-simulator.p12 + key-store-type: PKCS12 + request: + grant: + auth: twowaytls + dns: + name: so-vnfm-simulator + +vnfds: + vnfdlist: + - vnfdid: sgsn-mme_12df452s04131 + vnfclist: + - vnfcid: VNFC1 + resourceTemplateId: vnfd1_vnfc1 + vduId: vnfd1_vduForVnfc1 + type: COMPUTE + - vnfcid: VNFC2 + resourceTemplateId: vnfd1_vnfc2 + vduId: vnfd1_vduForVnfc2 + type: COMPUTE + - vnfdid: 2 + vnfclist: + - vnfcid: VNFC3 + resourceTemplateId: vnfd2_vnfc3 + vduId: vnfd2_vduForVnfc3 + type: COMPUTE + - vnfcid: VNFC4 + resourceTemplateId: vnfd2_vnfc4 + vduId: vnfd2_vduForVnfc4 + type: COMPUTE diff --git a/plans/so/macroflow/docker-compose.local.yml b/plans/so/macroflow/docker-compose.local.yml new file mode 100644 index 00000000..281a5162 --- /dev/null +++ b/plans/so/macroflow/docker-compose.local.yml @@ -0,0 +1,30 @@ +version: '3' +services: +################################################################################ + mariadb: + image: mariadb:${MARIADB_VERSION} +################################################################################ + 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} +################################################################################ + openstack-adapter: + image: onap/so/openstack-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} +################################################################################ diff --git a/plans/so/macroflow/docker-compose.yml b/plans/so/macroflow/docker-compose.yml new file mode 100644 index 00000000..8cc1c7b6 --- /dev/null +++ b/plans/so/macroflow/docker-compose.yml @@ -0,0 +1,346 @@ +version: '3' +services: +################################################################################ + mariadb: + image: ${NEXUS_DOCKER_REPO_MSO}/mariadb:${MARIADB_VERSION} + ports: + - "3306:3306" + volumes: + - ${TEST_LAB_DIR}/volumes/mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + - ${TEST_LAB_DIR}/volumes/mariadb/conf.d:/etc/mysql/conf.d + environment: + - MYSQL_ROOT_PASSWORD=password + hostname: + mariadb.so.testlab.onap.org + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################ + catalog-db-adapter: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/catalog-db-adapter:${TAG} + ports: + - "8082:8082" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${CONFIG_DIR_PATH_MACRO}/override-files/catalog-db-adapter/onapheat:/app/config + environment: + - APP=catalog-db-adapter + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + catalog-db-adapter.so.testlab.onap.org + depends_on: + - mariadb + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" mariadb:3306 -- "/app/start-app.sh"' +################################################################################ + request-db-adapter: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/request-db-adapter:${TAG} + ports: + - "8083:8083" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${TEST_LAB_DIR}/volumes/so/config/request-db-adapter/onapheat:/app/config + environment: + - APP=request-db-adapter + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + request-db-adapter.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" catalog-db-adapter:8082 -- "/app/start-app.sh"' +################################################################################ + sdnc-adapter: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/sdnc-adapter:${TAG} + ports: + - "8086:8086" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${TEST_LAB_DIR}/volumes/so/config/sdnc-adapter/onapheat:/app/config + environment: + - APP=sdnc-adapter + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + sdnc-adapter.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' +################################################################################ + openstack-adapter: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/openstack-adapter:${TAG} + ports: + - "8087:8087" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${CONFIG_DIR_PATH_MACRO}/override-files/openstack-adapter/onapheat:/app/config + environment: + - APP=openstack-adapter + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + openstack-adapter.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' +################################################################################ + sdc-controller: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/sdc-controller:${TAG} + ports: + - "8085:8085" + volumes: + - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates + - ${CONFIG_DIR_PATH_MACRO}/distribution-test-zip:/distribution-test-zip + - ${CONFIG_DIR_PATH_MACRO}/override-files/sdc-controller/onapheat:/app/config + environment: + - APP=sdc-controller + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + sdc-controller.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c 'mkdir -p /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/macro_zipped_sdc_csar.tar.gz -C /distribution-test-zip/unzipped && chmod 777 -R /distribution-test-zip/ && /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} + ports: + - "8081:8081" + volumes: + - ${CONFIG_DIR_PATH_MACRO}/override-files/bpmn-infra/onapheat:/app/config + - ${CONFIG_DIR_PATH}/certificates/bpmn-infra-certs:/app/bpmn-infra-certs + - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt + environment: + - APP=bpmn-infra + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + bpmn-infra.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' +################################################################################ + api-handler-infra: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/api-handler-infra:${TAG} + ports: + - "8080:8080" + volumes: + - ${CONFIG_DIR_PATH_MACRO}/override-files/api-handler-infra/onapheat:/app/config + - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt + environment: + - APP=api-handler-infra + - JVM_ARGS=-Xms64m -Xmx512m + - DB_HOST=mariadb + - DB_PORT=3306 + - DB_USERNAME=so_user + - DB_PASSWORD=so_User123 + - DB_ADMIN_USERNAME=so_admin + - DB_ADMIN_PASSWORD=so_Admin123 + hostname: + api-handler-infra.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + user: root + entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"' +############################################################################# + so-monitoring: + image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-monitoring:${TAG} + ports: + - "30224:30224" + volumes: + - ${CONFIG_DIR_PATH_MACRO}/override-files/so-monitoring/onapheat:/app/config + environment: + - APP=so-monitoring + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + so-monitoring.so.testlab.onap.org + depends_on: + - mariadb + - catalog-db-adapter + - request-db-adapter +################################################################################ + sdc-simulator: + image: simulators/sdc-simulator:latest + ports: + - "9991:9991" + environment: + - APP=SDC-SIMULATOR + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + sdc-simulator + depends_on: + - mariadb + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################ + aai-simulator: + image: simulators/aai-simulator:latest + ports: + - "9993:9993" + environment: + - APP=AAI-SIMULATOR + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + aai-simulator + depends_on: + - mariadb + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################ + workaround-config: + image: jobs/workaround-job-container:latest + ports: + - "9990:9990" + volumes: + - ${CONFIG_DIR_PATH}/apply-workarounds.sh:/config/apply-workarounds.sh + environment: + - MYSQL_ROOT_PASSWORD=password + - DB_HOST=mariadb + - DB_PORT=3306 + - CATALOG_DB=catalogdb + depends_on: + - mariadb + command: + - "/config/apply-workarounds.sh" +################################################################################# + sdnc-simulator: + image: simulators/sdnc-simulator:latest + ports: + - "9994:9994" + environment: + - APP=SDNC-SIMULATOR + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + sdnc-simulator + depends_on: + - mariadb + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################# + multicloud-simulator: + image: simulators/multicloud-simulator:latest + ports: + - "9996:9996" + environment: + - APP=MULTICLOUD-SIMULATOR + - JVM_ARGS=-Xms64m -Xmx512m + hostname: + multicloud-simulator + depends_on: + - mariadb + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" +################################################################################ + populate-aai-config: + image: jobs/workaround-job-container:latest + ports: + - "9995:9995" + volumes: + - ${CONFIG_DIR_PATH}/populate-aai-simulator.sh:/config/populate-aai-simulator.sh + - ${CONFIG_DIR_PATH}/wait-for.sh:/config/wait-for.sh + - ${CONFIG_DIR_PATH}/aai-simulator-populate-data:/config/aai-simulator-populate-data/ + environment: + - AAI_SIMULATOR_HOST=aai-simulator + - AAI_SIMULATOR_PORT=9993 + - TIMEOUT_IN_SECONDS=300 #5 mins + depends_on: + - aai-simulator + command: + - "/config/populate-aai-simulator.sh" +################################################################################ diff --git a/plans/so/macroflow/setup.sh b/plans/so/macroflow/setup.sh new file mode 100644 index 00000000..932eea0d --- /dev/null +++ b/plans/so/macroflow/setup.sh @@ -0,0 +1,207 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# Copyright 2021 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +MAVEN_VERSION_DIR="apache-maven-3.3.9" +MAVEN_TAR_FILE="$MAVEN_VERSION_DIR-bin.tar.gz" +MAVEN_TAR_LOCATION="https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/$MAVEN_TAR_FILE" + +# Macroflow +SCRIPT_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_NAME=$(basename $0) +CONFIG_DIR_MACRO=$SCRIPT_HOME/config +ENV_FILE=$CONFIG_DIR_MACRO/env +SQL_PATH=$SCRIPT_HOME/cloud_owner_sql +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 +TEMP_DIR_PATH=$SCRIPT_HOME/temp +TEST_LAB_DIR_PATH=$TEMP_DIR_PATH/test_lab + +#CAMUNDA SQL SCRIPTS +TEST_LAB_SQL_SCRIPTS_DIR=$TEST_LAB_DIR_PATH/volumes/mariadb/docker-entrypoint-initdb.d/db-sql-scripts +CAMUNDA_SQL_SCRIPT_NAME=mariadb_engine_7.10.0.sql + +# INTEGRATION_ETSI +INTEGRATION_ETSI_TESTING_DIR=$WORKSPACE/plans/so/integration-etsi-testing +INTEGRATION_ETSI_TESTING_CONFIG_DIR=$INTEGRATION_ETSI_TESTING_DIR/config + +MAVEN_DIR=$TEMP_DIR_PATH/maven +INSTALLED_MAVEN_DIR=$MAVEN_DIR/$MAVEN_VERSION_DIR +MVN=$INSTALLED_MAVEN_DIR/bin/mvn +MVN_VERSION="$MVN -v" +MVN_SETTINGS_XML="$INTEGRATION_ETSI_TESTING_DIR/settings.xml" +MVN_CLEAN_INSTALL="$MVN clean install" +SIMULATOR_MAVEN_PROJECT_POM="$INTEGRATION_ETSI_TESTING_DIR/so-simulators/pom.xml" +WAIT_FOR_WORKAROUND_SCRIPT=$INTEGRATION_ETSI_TESTING_CONFIG_DIR/"wait-for-workaround-job.sh" +WAIT_FOR_POPULATE_AAI_SCRIPT=$INTEGRATION_ETSI_TESTING_CONFIG_DIR/"wait-for-aai-config-job.sh" +WAIT_FOR_CONTAINER_SCRIPT=$INTEGRATION_ETSI_TESTING_CONFIG_DIR/"wait-for-container.sh" + +echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..." + +export $(egrep -v '^#' $ENV_FILE | xargs) + +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 + if [ -z "${!var}" ]; then + echo "Missing mandatory attribute $var in $ENV_FILE" + exit 1 + fi +done + +if [[ ! "$TEMP_DIR_PATH" || ! -d "$TEMP_DIR_PATH" ]]; then + echo "Creating temporary directory $TEMP_DIR_PATH" + mkdir $TEMP_DIR_PATH + + if [ $? -ne 0 ]; then + echo "Could not create $TEMP_DIR_PATH" + exit 1 + fi + +fi +echo "Will use ${TEMP_DIR_PATH} directory" + +if [[ ! "$MAVEN_DIR" || ! -d "$MAVEN_DIR" ]]; then + echo "Creating temporary maven directory $MAVEN_DIR" + mkdir $MAVEN_DIR + + if [ $? -ne 0 ]; then + echo "Could not create $MAVEN_DIR" + exit 1 + fi +fi +echo "Will use ${MAVEN_DIR} directory for maven install" + +if [[ ! "$INSTALLED_MAVEN_DIR" || ! -d "$INSTALLED_MAVEN_DIR" ]]; then + echo "Installing maven ..." + cd $MAVEN_DIR + + CURL=`which curl` + if [[ ! "$CURL" ]]; then + echo "curl command is not installed" + echo "Unable to execute test plan" + exit 1 + fi + curl -O $MAVEN_TAR_LOCATION + + TAR=`which tar` + if [[ ! "$TAR" ]]; then + echo "tar command is not installed" + echo "Unable to execute test plan" + exit 1 + fi + + tar -xzvf $MAVEN_TAR_FILE + + echo "Finished installing maven ..." +fi + +echo "Maven installed under directory $INSTALLED_MAVEN_DIR" + +$MVN_VERSION + +if [ $? -ne 0 ]; then + echo "Unable to run mvn -v command" + exit 1 +fi + +cd $SCRIPT_HOME + +echo "Will build simulator project using $MVN_CLEAN_INSTALL -f $SIMULATOR_MAVEN_PROJECT_POM --settings $MVN_SETTINGS_XML" +$MVN_CLEAN_INSTALL -f $SIMULATOR_MAVEN_PROJECT_POM --settings $MVN_SETTINGS_XML + +if [ $? -ne 0 ]; then + echo "Maven build failed" + exit 1 +fi + +echo "Will clone docker-config project ... " + + +if [[ -d "$TEST_LAB_DIR_PATH" ]]; then + echo "$TEST_LAB_DIR_PATH already exists" + echo "Removing $TEST_LAB_DIR_PATH directory ..." + rm -rf $TEST_LAB_DIR_PATH +fi + +git clone http://gerrit.onap.org/r/so/docker-config.git $TEST_LAB_DIR_PATH + +echo "Replacing $CAMUNDA_SQL_SCRIPT_NAME ..." +rm -rf $TEST_LAB_SQL_SCRIPTS_DIR/$CAMUNDA_SQL_SCRIPT_NAME +cp $CONFIG_DIR_MACRO/$CAMUNDA_SQL_SCRIPT_NAME $TEST_LAB_SQL_SCRIPTS_DIR + +export TEST_LAB_DIR=$TEST_LAB_DIR_PATH +export CONFIG_DIR_PATH=$INTEGRATION_ETSI_TESTING_CONFIG_DIR +export CONFIG_DIR_PATH_MACRO=$CONFIG_DIR_MACRO + +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 + +echo "Will execute $WAIT_FOR_WORKAROUND_SCRIPT script" +$WAIT_FOR_WORKAROUND_SCRIPT + +if [ $? -ne 0 ]; then + echo "ERROR: $WAIT_FOR_WORKAROUND_SCRIPT failed" + echo "Will stop running docker containers . . ." + $TEAR_DOWN_SCRIPT + exit 1 +fi + +echo "Will execute $WAIT_FOR_POPULATE_AAI_SCRIPT script" +$WAIT_FOR_POPULATE_AAI_SCRIPT + +if [ $? -ne 0 ]; then + echo "ERROR: $WAIT_FOR_POPULATE_AAI_SCRIPT failed" + echo "Will stop running docker containers . . ." + $TEAR_DOWN_SCRIPT + exit 1 +fi + +PODS_NAMES=( "api-handler-infra" "bpmn-infra") + +for pod in "${PODS_NAMES[@]}" + do + echo "Will execute $WAIT_FOR_CONTAINER_SCRIPT to wait for $pod container to start up" + $WAIT_FOR_CONTAINER_SCRIPT -c "$pod" -t "300" -n "$DEFAULT_NETWORK_NAME" + + if [ $? -ne 0 ]; then + echo "ERROR: $WAIT_FOR_CONTAINER_SCRIPT for pod: $pod failed" + echo "Will stop running docker containers . . ." + $TEAR_DOWN_SCRIPT + exit 1 + fi +done + +REPO_IP='127.0.0.1' +ROBOT_VARIABLES="-v REPO_IP:${REPO_IP}" + +echo "Finished executing $SCRIPT_HOME/$SCRIPT_NAME" diff --git a/plans/so/macroflow/teardown.sh b/plans/so/macroflow/teardown.sh new file mode 100644 index 00000000..248ecff4 --- /dev/null +++ b/plans/so/macroflow/teardown.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# Copyright 2021 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +INTEGRATION_ETSI_TESTING_DIR=$WORKSPACE/plans/so/integration-etsi-testing +INTEGRATION_ETSI_TESTING_CONFIG_DIR=$INTEGRATION_ETSI_TESTING_DIR/config + +# Macroflow Path +SCRIPT_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_NAME=$(basename $0) +CONFIG_DIR_MACRO=$SCRIPT_HOME/config +ENV_FILE=$CONFIG_DIR_MACRO/env +DOCKER_COMPOSE_FILE_PATH=$SCRIPT_HOME/docker-compose.yml +DOCKER_COMPOSE_LOCAL_OVERRIDE_FILE=$SCRIPT_HOME/docker-compose.local.yml + +TEMP_DIR_PATH=$MACRO_HOME/temp +TEST_LAB_DIR_PATH=$TEMP_DIR_PATH/test_lab + +echo "Running $SCRIPT_HOME/$SCRIPT_NAME ..." +export $(egrep -v '^#' $ENV_FILE | xargs) +export TEST_LAB_DIR=$TEST_LAB_DIR_PATH +export CONFIG_DIR_PATH=$INTEGRATION_ETSI_TESTING_CONFIG_DIR +export CONFIG_DIR_PATH_MACRO=$CONFIG_DIR_MACRO + + +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/ccsdk/healthcheck/testplan.txt b/plans/so/macroflow/testplan.txt similarity index 76% rename from plans/ccsdk/healthcheck/testplan.txt rename to plans/so/macroflow/testplan.txt index 2cd8cdaf..00a8d8b7 100644 --- a/plans/ccsdk/healthcheck/testplan.txt +++ b/plans/so/macroflow/testplan.txt @@ -1,4 +1,3 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -ccsdk/healthcheck - +so/sanity-check/macroflow.robot diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/A20181002.0000-1000-0015-1000_5G.xml.gz b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/A20181002.0000-1000-0015-1000_5G.xml.gz deleted file mode 100644 index 32865fc1..00000000 Binary files a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/A20181002.0000-1000-0015-1000_5G.xml.gz and /dev/null differ diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json deleted file mode 100644 index 25816a50..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs-initializer.json +++ /dev/null @@ -1,95 +0,0 @@ -[{ - "httpRequest":{ - "method":"GET", - "path":"/service_component/pmmapper", - "headers":{ - "!X-ONAP-RequestID":[ - "!12345" - ], - "!X-ONAP-InvocationID":[ - "!12345" - ], - "X-ONAP-PartnerName":[ - "pm-mapper" - ], - "User-Agent":[ - "Java/11.0.7" - ], - "Host":[ - "!some-random-host:10000" - ], - "Accept":[ - "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" - ], - "Connection":[ - "keep-alive" - ], - "content-length":[ - "0" - ] - }, - "keepAlive":true, - "secure":false - }, - "httpResponse":{ - "statusCode":200, - "headers":{ - "content-type":[ - "application/json" - ] - }, - "body":{ - "type":"JSON", - "json":{ - "pm-mapper-filter":"{\"filters\": []}", - "key_store_path":"/opt/app/pm-mapper/etc/cert.jks", - "key_store_pass_path":"/opt/app/pm-mapper/etc/jks.pass", - "trust_store_path":"/opt/app/pm-mapper/etc/trust.jks", - "trust_store_pass_path":"/opt/app/pm-mapper/etc/trust.pass", - "dmaap_dr_delete_endpoint":"https://dmaap-dr-node:8443/delete", - "dmaap_dr_feed_name":"1", - "aaf_identity":"aaf_admin@people.osaaf.org", - "aaf_password":"demo123456!", - "enable_http":true, - "streams_publishes":{ - "dmaap_publisher":{ - "type":"message_router", - "dmaap_info":{ - "topic_url":"http://dmaap-message-router:3904/events/org.onap.dmaap.mr.VES_PM", - "client_role":"org.onap.dcae.pmPublisher", - "location":"csit-pmmapper", - "client_id":"1562763644939" - } - } - }, - "streams_subscribes":{ - "dmaap_subscriber":{ - "type":"data_router", - "dmaap_info":{ - "username":"username", - "password":"password", - "location":"csit-pmmapper", - "delivery_url":"http://dcae-pm-mapper:8081/delivery", - "subscriber_id":1 - } - } - } - } - } - } -}, - { - "httpRequest": { - "path": "/health" - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": "{}" - } - } -] diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs_mockserver.properties b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs_mockserver.properties deleted file mode 100644 index 8c29348a..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/cbs_mockserver.properties +++ /dev/null @@ -1,26 +0,0 @@ -####################################### -# MockServer & Proxy Example Settings # -####################################### - -# Socket & Port Settings - -# socket timeout in milliseconds (default 120000) -mockserver.maxSocketTimeout=120000 - -# Certificate Generation - -# delete KeyStore file on JVM shutdown (default true) -mockserver.deleteGeneratedKeyStoreOnExit=true -# certificate domain name (default "localhost") -mockserver.sslCertificateDomainName=localhost -# comma separated list of domain names for Subject Alternative Name domain names (default empty list) -mockserver.sslSubjectAlternativeNameDomains=cbs-sim,config-binding-service,config-binding-service.onap -# comma separated list of ip addresses for Subject Alternative Name ips (default empty list) -mockserver.sslSubjectAlternativeNameIps=127.0.0.1 - -# CORS - -# enable CORS for MockServer REST API -mockserver.enableCORSForAPI=true -# enable CORS for all responses -mockserver.enableCORSForAllResponses=true diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/application.yaml b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/application.yaml deleted file mode 100644 index 086babc4..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/application.yaml +++ /dev/null @@ -1,26 +0,0 @@ -spring: - profiles: - active: prod -management: - endpoints: - web: - exposure: - include: "loggers,logfile,health,info,metrics" -server: - port: 8433 - ssl: - key-store-type: PKCS12 - key-store-password: ericssondfc - key-store: classpath:keystore.jks - key-password: ericssondfc - keyAlias: tomcat-localhost -logging: - level: - ROOT: ERROR - org.springframework: ERROR - org.springframework.data: ERROR - org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR - org.onap.dcaegen2.collectors.datafile: TRACE - file: /var/log/ONAP/application.log -app: - filepath: /opt/app/datafile/config/datafile_endpoints.json diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json deleted file mode 100644 index 8aaca058..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/datafile_endpoints.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "config": { - "//description": "This file is only used for testing purposes", - "dmaap.ftpesConfig.keyCert": "/opt/app/datafile/etc/cert/cert.jks", - "dmaap.ftpesConfig.keyPasswordPath": "/opt/app/datafile/etc/cert/jks.pass", - "dmaap.ftpesConfig.trustedCa": "/opt/app/datafile/etc/cert/trust.jks", - "dmaap.ftpesConfig.trustedCaPasswordPath": "/opt/app/datafile/etc/cert/trust.pass", - "dmaap.security.trustStorePath": "/opt/app/datafile/etc/cert/trust.jks", - "dmaap.security.trustStorePasswordPath": "/opt/app/datafile/etc/cert/trust.pass", - "dmaap.security.keyStorePath": "/opt/app/datafile/etc/cert/cert.jks", - "dmaap.security.keyStorePasswordPath": "/opt/app/datafile/etc/cert/jks.pass", - "dmaap.security.enableDmaapCertAuth": "false", - "dmaap.dmaapConsumerConfiguration.consumerGroup": "OpenDcae-c12", - "dmaap.dmaapConsumerConfiguration.consumerId": "C12", - "dmaap.dmaapConsumerConfiguration.timeoutMs": -1, - "sftp.security.strictHostKeyChecking": "true", - "streams_publishes": { - "PM_MEAS_FILES": { - "type": "data_router", - "dmaap_info": { - "username": "dradmin", - "location": "san-francisco", - "log_url": "https://dmaap-dr-prov:8443/feedlog/1", - "publisher_id": "972.360gm", - "password": "dradmin", - "publish_url": "https://dmaap-dr-prov:8443/publish/1" - } - } - }, - "streams_subscribes": { - "dmaap_subscriber": { - "dmaap_info": { - "topic_url":"http://dmaap-message-router:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT" - }, - "type": "message_router" - } - } - } -} diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addDefaultSubscriber.json b/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addDefaultSubscriber.json deleted file mode 100644 index 6a8da842..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addDefaultSubscriber.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "delivery":{ - "url":"http://datarouter-subscriber:7070", - "user":"LOGIN", - "password":"PASSWORD", - "use100":true - }, - "follow_redirect":false, - "metadataOnly":false, - "suspend":false, - "groupid":0, - "links":{ - "self": "https://dmaap-dr-prov/subscribe/1", - "log": "https://dmaap-dr-prov/feedlog/1", - "feed": "https://dmaap-dr-prov/feed/1" - }, - "subscriber":"admin", - "decompress":true - } \ No newline at end of file diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml b/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml deleted file mode 100644 index 46fab55c..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml +++ /dev/null @@ -1,155 +0,0 @@ -version: '2.1' -services: - datarouter-prov: - image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov:latest - container_name: dmaap-datarouter-prov - hostname: dmaap-dr-prov - ports: - - "443:8443" - - "8443:8443" - - "8080:8080" - volumes: - - ../prov_data/provserver.properties:/opt/app/datartr/etc/provserver.properties - - ../prov_data/addSubscriber.txt:/opt/app/datartr/addSubscriber.txt - - ../prov_data/addFeed3.txt:/opt/app/datartr/addFeed3.txt - depends_on: - mariadb_container: - condition: service_healthy - healthcheck: - test: ["CMD", "curl", "-f", "http://dmaap-dr-prov:8080/internal/prov"] - interval: 10s - timeout: 10s - retries: 5 - networks: - tmp_bulk-pm-network: - aliases: - - datarouter-prov - - dmaap-dr-prov - - datarouter-node: - image: nexus3.onap.org:10001/onap/dmaap/datarouter-node:latest - container_name: dmaap-datarouter-node - hostname: dmaap-dr-node - ports: - - "9443:8443" - - "9090:8080" - volumes: - - ../node_data/node.properties:/opt/app/datartr/etc/node.properties - depends_on: - datarouter-prov: - condition: service_healthy - networks: - tmp_bulk-pm-network: - aliases: - - datarouter-node - - dmaap-dr-node - - datarouter-subscriber: - image: nexus3.onap.org:10001/onap/dmaap/datarouter-subscriber:latest - container_name: fileconsumer-node - hostname: subscriber.com - ports: - - "7070:7070" - volumes: - - ../subscriber_data/subscriber.properties:/opt/app/subscriber/etc/subscriber.properties - networks: - tmp_bulk-pm-network: - aliases: - - datarouter-subscriber - - mariadb_container: - image: mariadb:10.2.14 - container_name: dmaap-dr-prov-mariadb - ports: - - "3306:3306" - environment: - MYSQL_ROOT_PASSWORD: datarouter - MYSQL_DATABASE: datarouter - MYSQL_USER: datarouter - MYSQL_PASSWORD: datarouter - healthcheck: - test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "--silent"] - interval: 10s - timeout: 30s - retries: 5 - networks: - tmp_bulk-pm-network: - aliases: - - datarouter-mariadb - - sftp: - container_name: sftp - image: atmoz/sftp - ports: - - "2222:22" - command: admin:admin:1001 - networks: - tmp_bulk-pm-network: - aliases: - - sftp - - ves: - container_name: dcaegen2-vescollector - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.4.4 - environment: - DMAAPHOST: dmaap-message-router - networks: - tmp_bulk-pm-network: - aliases: - - dcaegen2-ves-collector - - dfc: - container_name: dcaegen2-datafile-collector - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:latest - ports: - - "8433:8433" - volumes: - - ./dfc/application.yaml:/opt/app/datafile/config/application.yaml - - ./dfc/datafile_endpoints.json:/opt/app/datafile/config/datafile_endpoints.json - networks: - tmp_bulk-pm-network: - aliases: - - dcaegen2-datafile-collector - environment: - KNOWN_HOSTS_FILE_PATH: "/home/datafile/.ssh/known_hosts" - CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000 - - cbs-sim: - container_name: config-binding-service-sim - image: mockserver/mockserver:mockserver-5.10.0 - environment: - MOCKSERVER_PROPERTY_FILE: /config/mockserver.properties - MOCKSERVER_INITIALIZATION_JSON_PATH: /config/cbs-initializer.json - LOG_LEVEL: "DEBUG" - SERVER_PORT: 10000 - volumes: - - ./cbs_sim/cbs_mockserver.properties:/config/mockserver.properties - - ./cbs_sim/cbs-initializer.json:/config/cbs-initializer.json - networks: - tmp_bulk-pm-network: - aliases: - - config-binding-service - - pmmapper: - container_name: dcaegen2-pm-mapper - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:latest - ports: - - "8081:8081" - volumes: - - ./pm_mapper_certs/cert.jks:/opt/app/pm-mapper/etc/cert.jks:ro - - ./pm_mapper_certs/jks.pass:/opt/app/pm-mapper/etc/jks.pass:ro - - ./pm_mapper_certs/trust.jks:/opt/app/pm-mapper/etc/trust.jks:ro - - ./pm_mapper_certs/trust.pass:/opt/app/pm-mapper/etc/trust.pass:ro - environment: - CONFIG_BINDING_SERVICE_SERVICE_HOST: config-binding-service - CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000 - HOSTNAME: pmmapper - networks: - tmp_bulk-pm-network: - aliases: - - dcae-pm-mapper - -networks: - tmp_bulk-pm-network: - external: true - diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-mr.yml b/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-mr.yml deleted file mode 100644 index ba30f280..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-mr.yml +++ /dev/null @@ -1,77 +0,0 @@ -version: '2.1' -services: - zookeeper: - container_name: dmaap-message-router-zookeeper - image: nexus3.onap.org:10001/onap/dmaap/zookeeper:6.0.3 - ports: - - "2181:2181" - environment: - ZOOKEEPER_REPLICAS: 1 - ZOOKEEPER_TICK_TIME: 2000 - ZOOKEEPER_SYNC_LIMIT: 5 - ZOOKEEPER_INIT_LIMIT: 10 - ZOOKEEPER_MAX_CLIENT_CNXNS: 200 - ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3 - ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24 - ZOOKEEPER_CLIENT_PORT: 2181 - KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl - ZOOKEEPER_SERVER_ID: 1 - volumes: - - ../zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf - networks: - bulk-pm-network: - aliases: - - zookeeper - - kafka: - container_name: dmaap-message-router-kafka - image: nexus3.onap.org:10001/onap/dmaap/kafka111:1.0.4 - ports: - - "9092:9092" - environment: - enableCadi: 'false' - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000 - KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT - KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092 - KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092 - KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT - KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false' - KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf - KAFKA_ZOOKEEPER_SET_ACL: 'true' - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment - KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1 - volumes: - - ../kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf - networks: - bulk-pm-network: - aliases: - - kafka - depends_on: - - zookeeper - - dmaap-message-router: - container_name: dmaap-message-router-server - image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.1.18 - ports: - - "3904:3904" - - "3905:3905" - environment: - enableCadi: 'false' - volumes: - - ../mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties - - ../mr/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml - - ../mr/cadi.properties:/appl/dmaapMR1/etc/cadi.properties - networks: - bulk-pm-network: - aliases: - - dmaap-message-router - depends_on: - - zookeeper - - kafka - -networks: - bulk-pm-network: - driver: bridge diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh b/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh deleted file mode 100644 index 8cb3d9f8..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/setup.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -# Place the scripts in run order: -source ${SCRIPTS}/common_functions.sh - -# Clone DMaaP Message Router repo -mkdir -p $WORKSPACE/archives/dmaapmr -cd $WORKSPACE/archives/dmaapmr -git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master -mkdir $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/tmp/ -# Copy custom docker-compose file -cp $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-mr.yml \ -$WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/tmp/docker-compose-mr.yml - -# Login to onap docker -docker login -u docker -p docker nexus3.onap.org:10001 -# Start DMaaP MR containers with docker compose and configuration from docker-compose-mr.yml -docker-compose -f $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/tmp/docker-compose-mr.yml up -d -sleep 5 - -# Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper -for i in 1 2 3 4 5 6 7 8 9 10; do - if [[ $(docker inspect --format '{{ .State.Running }}' dmaap-message-router-kafka) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dmaap-message-router-zookeeper) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dmaap-message-router-server) ]] - then - echo "Message Router service running" - break - else - echo sleep ${i} - sleep ${i} - fi -done - -# Clone DMaaP Data Router repo -mkdir -p $WORKSPACE/archives/dmaapdr -cd $WORKSPACE/archives/dmaapdr -git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master -mkdir $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose - -# Copy e2e docker compose assets to tmp dir -cp $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/composefile/docker-compose-e2e.yml \ -$WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose-e2e.yml -cp -rf $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/cbs_sim/ \ -$WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/ -cp -rf $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dfc/ \ -$WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/ -cp -rf $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/pm_mapper_certs/ \ -$WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/ - -# Start cbs-sim for pmmapper stability -docker-compose -f $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose-e2e.yml up -d cbs-sim -echo "Starting cbs-sim" -sleep 10 - -# Start the rest of the e2e containers -docker-compose -f $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose-e2e.yml up -d - -# Wait for initialization of the following containers -for i in 1 2 3 4 5 6 7 8 9 10; do - if [[ $(docker inspect --format '{{ .State.Running }}' dmaap-datarouter-node) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dmaap-datarouter-prov) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dmaap-dr-prov-mariadb) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dcaegen2-pm-mapper) ]] && \ - [[ $(docker inspect --format '{{ .State.Running }}' dcaegen2-datafile-collector) ]] - then - echo "Data Router service running" - break - else - echo sleep ${i} - sleep ${i} - fi -done - -# Get IP address of docker-host, dmaap-dr-prov, dmaap-dr-gateway, dmaap-mr and ves collector. -#HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $7}') -DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap-datarouter-prov) -DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' dmaap-datarouter-prov) -DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap-message-router-server) -VESC_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dcaegen2-vescollector) - -#Add SFTP server pubilc key to known hosts of datafile collector -HOST_NAMES=$(docker inspect -f '{{ range .NetworkSettings.Networks}}{{join .Aliases ","}}{{end}}' sftp) -KEY_ENTRY=$(echo $HOST_NAMES "$(docker exec sftp cat /etc/ssh/ssh_host_rsa_key.pub)" | sed -e 's/\w*@\w*$//') -docker exec -i -u root dcaegen2-datafile-collector sh -c "echo $KEY_ENTRY >> /home/datafile/.ssh/known_hosts" - -# Add gateway IP to DR Prov -docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" -docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" - -#Increase DFC Logging -#docker exec dfc /bin/sh -c " sed -i 's/org.onap.dcaegen2.collectors.datafile: WARN/org.onap.dcaegen2.collectors.datafile: TRACE/g' /opt/app/datafile/config/application.yaml" - -# Copy sample PM file to sftp server -docker cp $WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/A20181002.0000-1000-0015-1000_5G.xml.gz sftp:/home/admin/ - -# Data Router Configuration: -# Create default feed on DMaaP data router -curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:dradmin" \ ---data-ascii @$WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/createFeed.json --post301 \ ---location-trusted -k https://${DR_PROV_IP}:8443 -sleep 2 -# Create file consumer subscriber on DMaaP data router -curl -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:dradmin" \ ---data-ascii @$WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addDefaultSubscriber.json --post301 \ ---location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1 -sleep 2 -# Add PM Mapper subscriber on data router feed -curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" \ ---data-ascii @$WORKSPACE/plans/usecases-5G-bulkpm/5G-bulkpm/assets/dmaap_dr/addPmMapperSubscriber.json \ ---post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1 - -# Check DMaaP DR provisioning -curl -k https://${DR_PROV_IP}:8443/internal/prov - -# Add necessary python libs -pip install jsonschema uuid simplejson - -# Export necessary vars -export VESC_IP=${VESC_IP} -export VESC_PORT=8080 -export DMAAP_MR_IP=${DMAAP_MR_IP} - -#Pass any variables required by Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v VESC_PORT:${VESC_PORT}" diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/teardown.sh b/plans/usecases-5G-bulkpm/5G-bulkpm/teardown.sh deleted file mode 100644 index 04391bbf..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/teardown.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -echo "Starting teardown script" -kill-instance.sh dmaap-message-router-server -kill-instance.sh dmaap-message-router-kafka -kill-instance.sh dmaap-message-router-zookeeper -kill-instance.sh dmaap-datarouter-node -kill-instance.sh dmaap-datarouter-prov -kill-instance.sh dmaap-dr-prov-mariadb -kill-instance.sh fileconsumer-node -kill-instance.sh dcaegen2-vescollector -kill-instance.sh dcaegen2-datafile-collector -kill-instance.sh dcaegen2-pm-mapper -kill-instance.sh sftp -kill-instance.sh config-binding-service-sim -yes | docker network prune diff --git a/plans/usecases-5G-bulkpm/5G-bulkpm/testplan.txt b/plans/usecases-5G-bulkpm/5G-bulkpm/testplan.txt deleted file mode 100644 index b72ba90d..00000000 --- a/plans/usecases-5G-bulkpm/5G-bulkpm/testplan.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Test suites are relative paths under [integration/csit.git]/tests/. -# Place the suites in run order. -usecases-5G-bulkpm/5G-bulkpm diff --git a/plans/usecases-config-over-netconf/config-over-netconf/cds/cds_setup.sh b/plans/usecases-config-over-netconf/config-over-netconf/cds/cds_setup.sh deleted file mode 100755 index b595e6b1..00000000 --- a/plans/usecases-config-over-netconf/config-over-netconf/cds/cds_setup.sh +++ /dev/null @@ -1,55 +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========================================================= - -# @author Rahul Tyagi (rahul.tyagi@est.tech) - -CDS_DATA_PATH=$WORKSPACE/plans/$PARENT/$SUB_PARENT/cds - -cd $CDS_DATA_PATH -export LOCAL_IP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+') -unset http_proxy https_proxy - -#cd $WORKSPACE/archives/cds/ms/blueprintsprocessor/distribution/src/main/dc/ - -############# update ip of sdnc in docker-compose########### -SDNC_CONTAINER=$(docker ps -a -q --filter="name=sdnc_controller_container") -SDNC_CONTAINER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $SDNC_CONTAINER) -echo " " >> docker-compose.yaml -echo " extra_hosts:" >> docker-compose.yaml -echo " - 'sdnc:$LOCAL_IP'" >> docker-compose.yaml -############################################################# - -docker-compose up -d -sleep 10 -################# Check state of BP #################### -BP_CONTAINER=$(docker ps -a -q --filter="name=bp-rest") -CCSDK_MARIADB=$(docker ps -a -q --filter="name=ccsdk-mariadb") -for i in {1..10}; do -if [ $(docker inspect --format='{{ .State.Running }}' $BP_CONTAINER) ] && \ -[ $(docker inspect --format='{{ .State.Running }}' $CCSDK_MARIADB) ] -then - echo "Blueprint proc Service Running" - break -else - echo sleep $i - sleep $i -fi -done - diff --git a/plans/usecases-config-over-netconf/config-over-netconf/cds/docker-compose.yaml b/plans/usecases-config-over-netconf/config-over-netconf/cds/docker-compose.yaml index 4834f912..f914e48c 100755 --- a/plans/usecases-config-over-netconf/config-over-netconf/cds/docker-compose.yaml +++ b/plans/usecases-config-over-netconf/config-over-netconf/cds/docker-compose.yaml @@ -23,9 +23,17 @@ services: - "8000:8080" restart: always environment: - APPLICATIONNAME: BlueprintsProcessor - BUNDLEVERSION: 1.0.0 - APP_CONFIG_HOME: /opt/app/onap/config - STICKYSELECTORKEY: - ENVCONTEXT: dev + - APPLICATIONNAME=BlueprintsProcessor + - BUNDLEVERSION=1.0.0 + - APP_CONFIG_HOME=/opt/app/onap/config + - ENVCONTEXT=dev + volumes: + - /etc/localtime:/etc/localtime:ro + - ${WORKSPACE}/plans/usecases-config-over-netconf/config-over-netconf/cds/resources:/opt/app/onap/res + entrypoint: + - /bin/sh + - -c + - "/opt/app/onap/res/importCerAndStartService.sh" + extra_hosts: + - sdnc:${LOCAL_IP} diff --git a/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/application.properties b/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/application.properties new file mode 100755 index 00000000..34d572e5 --- /dev/null +++ b/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/application.properties @@ -0,0 +1,97 @@ +# Web Server Configurations +# START -Controller Blueprints Properties & Load Resource Source Mappings +resourceSourceMappings=processor-db=source-db,input=source-input,default=source-default,sdnc=source-rest,aai-data=source-rest,capability=source-capability,rest=source-rest,vault-data=source-rest,script=source-capability + +# Controller Blueprints Core Configuration +blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy +blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive +blueprintsprocessor.blueprintWorkingPath=/opt/app/onap/blueprints/working + +# Controller Blueprint Load Configurations +blueprintsprocessor.loadBluePrintPaths=/opt/app/onap/model-catalog/blueprint-model +blueprintsprocessor.loadModeTypePaths=/opt/app/onap/model-catalog/definition-type +blueprintsprocessor.loadResourceDictionaryPaths=/opt/app/onap/model-catalog/resource-dictionary + +# CBA file extension +controllerblueprints.loadCbaExtension=zip + +### END -Controller Blueprints Properties + +blueprintsprocessor.grpcEnable=true +blueprintsprocessor.httpPort=8080 +blueprintsprocessor.grpcPort=9111 + +# DB +blueprintsprocessor.db.url=jdbc:mysql://db:3306/sdnctl +blueprintsprocessor.db.username=sdnctl +blueprintsprocessor.db.password=sdnctl +blueprintsprocessor.db.driverClassName=org.mariadb.jdbc.Driver +blueprintsprocessor.db.hibernateHbm2ddlAuto=update +blueprintsprocessor.db.hibernateDDLAuto=update +blueprintsprocessor.db.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect + +# Processor-DB Endpoint +blueprintsprocessor.db.processor-db.type=maria-db +blueprintsprocessor.db.processor-db.url=jdbc:mysql://mariadb-galera:3306/sdnctl +blueprintsprocessor.db.processor-db.username=root +blueprintsprocessor.db.processor-db.password=secretpassword + +# Python Executor +blueprints.processor.functions.python.executor.executionPath=/opt/app/onap/scripts/jython/ccsdk_blueprints +blueprints.processor.functions.python.executor.modulePaths=/opt/app/onap/scripts/jython/ccsdk_blueprints,/opt/app/onap/scripts/jython/ccsdk_netconf,/opt/app/onap/scripts/jython/ccsdk_restconf + +security.user.password: {bcrypt}$2a$10$duaUzVUVW0YPQCSIbGEkQOXwafZGwQ/b32/Ys4R1iwSSawFgz7QNu +security.user.name: ccsdkapps + +# Used in Health Check +#endpoints.user.name=ccsdkapps +#endpoints.user.password=ccsdkapps + +# Executor Options +blueprintsprocessor.resourceResolution.enabled=true +blueprintsprocessor.netconfExecutor.enabled=true +blueprintsprocessor.restConfExecutor.enabled=true +blueprintsprocessor.cliExecutor.enabled=true +blueprintsprocessor.remoteScriptCommand.enabled=true + +# Command Executor +blueprintsprocessor.grpcclient.remote-python.type=token-auth +blueprintsprocessor.grpcclient.remote-python.host=localhost +blueprintsprocessor.grpcclient.remote-python.port=50051 +blueprintsprocessor.grpcclient.remote-python.token=Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== + +# Python Executor +blueprintsprocessor.grpcclient.py-executor.type=tls-auth +blueprintsprocessor.grpcclient.py-executor.host=py-executor-default:50052 +blueprintsprocessor.grpcclient.py-executor.trustCertCollection=/opt/app/onap/config/certs/py-executor/py-executor-chain.pem + +# Config Data REST client settings +blueprintsprocessor.restconfEnabled=true +blueprintsprocessor.restclient.sdnc.type=basic-auth +blueprintsprocessor.restclient.sdnc.url=http://sdnc:8282 +blueprintsprocessor.restclient.sdnc.username=admin +blueprintsprocessor.restclient.sdnc.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +blueprintprocessor.remoteScriptCommand.enabled=true + +# Encrypted username and password for health check service +endpoints.user.name=eHbVUbJAj4AG2522cSbrOQ== +endpoints.user.password=eHbVUbJAj4AG2522cSbrOQ== + +# BaseUrls for health check blueprint processor services +blueprintprocessor.healthcheck.baseUrl=http://localhost:8080/ +blueprintprocessor.healthcheck.mapping-service-name-with-service-link=[Execution service,/api/v1/execution-service/health-check],[Resources service,/api/v1/resources/health-check],[Template service,/api/v1/template/health-check] + +# BaseUrls for health check Cds Listener services +cdslistener.healthcheck.baseUrl=http://cds-sdc-listener:8080/ +cdslistener.healthcheck.mapping-service-name-with-service-link=[SDC Listener service,/api/v1/sdclistener/healthcheck] + +# Actuator Properties +management.endpoints.web.exposure.include=* +management.endpoint.health.show-details=always +management.info.git.mode=full + +# Error Managements +error.catalog.applicationId=cds +error.catalog.type=properties +error.catalog.errorDefinitionDir=/opt/app/onap/config/ \ No newline at end of file diff --git a/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/error-messages_en.properties b/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/error-messages_en.properties new file mode 100755 index 00000000..3b731c70 --- /dev/null +++ b/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/error-messages_en.properties @@ -0,0 +1,77 @@ +# Error Messages Configurations + +org.onap.ccsdk.cds.blueprintsprocessor.generic_failure=cause=Internal error in Blueprint Processor run time.,action=Contact CDS administrator team. +org.onap.ccsdk.cds.blueprintsprocessor.resource_path_missing=cause=Resource path missing or wrong.,action=Please reload your artifact in run time. +org.onap.ccsdk.cds.blueprintsprocessor.resource_writing_fail=cause=Fail to write resources files.,action=Please reload your files and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.io_file_interrupt=cause=IO file system interruption.,action=Please reload your file and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.invalid_request_format=cause=bad request provided.,action=Verify the request payload. +org.onap.ccsdk.cds.blueprintsprocessor.unauthorized_request=cause=The request requires user authentication.,action=Please provide the right credentials. +org.onap.ccsdk.cds.blueprintsprocessor.request_not_found=cause=Request mapping doesn't exist.,action=Please verify your request. +org.onap.ccsdk.cds.blueprintsprocessor.conflict_adding_resource=cause=Duplicated entry while saving resource.,action=Please make the saving model doesn't exist. +org.onap.ccsdk.cds.blueprintsprocessor.duplicate_data=cause=Duplicated data - was expecting one result, got more than one.,action=Please provide single resource at a time. +org.onap.ccsdk.cds.blueprintsprocessor.resource_not_found=cause=No response was found for this request in the server.,action=Provide the ID to find the resource. +org.onap.ccsdk.cds.blueprintsprocessor.unsupported_media_type=cause=An invalid media was provided.,action=Please make sure your media or artifact is in the proper structure or format. + +# Self Service API +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.generic_failure=cause=Internal error in Self Service API.,action=Verify the request and try again. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.generic_process_failure=cause=Internal error while processing REST call to the Self Service API.,action=Verify the request and try again. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.invalid_file_extension=cause=Failed trying to upload a non ZIP file format.,action=Please reload your file and make sure it is in ZIP format. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.resource_path_missing=cause=Resource path missing or wrong.,action=Please reload your artifact in run time. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.resource_writing_fail=cause=Fail to write resources files.,action=Please reload your files and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.io_file_interrupt=cause=IO file system interruption.,action=Please reload your file and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.invalid_request_format=cause=bad request provided.,action=Verify the request payload. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.unauthorized_request=cause=The request requires user authentication.,action=Please provide the right credentials. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.request_not_found=cause=Request mapping doesn't exist.,action=Please verify your request. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.conflict_adding_resource=cause=Duplicated entry while saving resource.,action=Please make the saving model doesn't exist. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.duplicate_data=cause=Duplicated data - was expecting one result, got more than one.,action=Please provide single resource at a time. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.resource_not_found=cause=No response was found for this request in the server.,action=Provide the ID to find the resource. +org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.unsupported_media_type=cause=An invalid media was provided.,action=Please make sure your media or artifact is in the proper structure or format. + +# Designer API +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.generic_failure=cause=Internal error while processing REST call to the Designer API.,action=Verify the request and try again. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.invalid_file_extension=cause=Failed trying to upload a non ZIP file format.,action=Please reload your file and make sure it is in ZIP format. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.resource_path_missing=cause=Resource path missing or wrong.,action=Please reload your artifact in run time. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.resource_writing_fail=cause=Fail to write resources files.,action=Please reload your files and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.io_file_interrupt=cause=IO file system interruption.,action=Please reload your file and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.invalid_request_format=cause=bad request provided.,action=Verify the request payload. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.unauthorized_request=cause=The request requires user authentication.,action=Please provide the right credentials. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.request_not_found=cause=Request mapping doesn't exist.,action=Please verify your request. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.conflict_adding_resource=cause=Duplicated entry while saving resource.,action=Please make the saving model doesn't exist. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.duplicate_data=cause=Duplicated data - was expecting one result, got more than one.,action=Please provide single resource at a time. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.resource_not_found=cause=No response was found for this request in the server.,action=Provide the ID to find the resource. +org.onap.ccsdk.cds.blueprintsprocessor.designer.api.unsupported_media_type=cause=An invalid media was provided.,action=Please make sure your media or artifact is in the proper structure or format. + +# Resource API +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.generic_failure=cause=Internal error while processing REST call to the Resource API.,action=Verify the request and try again. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.invalid_file_extension=cause=Failed trying to upload a non ZIP file format.,action=Please reload your file and make sure it is in ZIP format. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.resource_path_missing=cause=Resource path missing or wrong.,action=Please reload your artifact in run time. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.resource_writing_fail=cause=Fail to write resources files.,action=Please reload your files and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.io_file_interrupt=cause=IO file system interruption.,action=Please reload your file and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.invalid_request_format=cause=bad request provided.,action=Verify the request payload. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.unauthorized_request=cause=The request requires user authentication.,action=Please provide the right credentials. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.request_not_found=cause=Request mapping doesn't exist.,action=Please verify your request. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.conflict_adding_resource=cause=Duplicated entry while saving resource.,action=Please make the saving model doesn't exist. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.duplicate_data=cause=Duplicated data - was expecting one result, got more than one.,action=Please provide single resource at a time. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.resource_not_found=cause=No response was found for this request in the server.,action=Provide the ID to find the resource. +org.onap.ccsdk.cds.blueprintsprocessor.resource.api.unsupported_media_type=cause=An invalid media was provided.,action=Please make sure your media or artifact is in the proper structure or format. + +# Configs API +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.generic_failure=cause=Internal error while processing REST call to the Configs API.,action=Verify the request and try again. +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.resource_path_missing=cause=Resource path missing or wrong.,action=Please reload your artifact in run time. +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.io_file_interrupt=cause=IO file system interruption.,action=Please reload your file and make sure it is in the right format. +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.invalid_request_format=cause=bad request provided.,action=Verify the request payload. +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.unauthorized_request=cause=The request requires user authentication.,action=Please provide the right credentials. +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.request_not_found=cause=Request mapping doesn't exist.,action=Please verify your request. +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.conflict_adding_resource=cause=Duplicated entry while saving resource.,action=Please make the saving model doesn't exist. +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.duplicate_data=cause=Duplicated data - was expecting one result, got more than one.,action=Please provide single resource at a time. +org.onap.ccsdk.cds.blueprintsprocessor.configs.api.resource_not_found=cause=No response was found for this request in the server.,action=Provide the ID to find the resource. + +# Python Executor +org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor.generic_failure=cause=Internal error in Blueprint Processor run time.,action=Contact CDS administrator team. + +# Resource resolution +org.onap.ccsdk.cds.blueprintsprocessor.resource.resolution.invalid_request_format=cause=bad request provided.,action=Verify the request payload. +org.onap.ccsdk.cds.blueprintsprocessor.resource.resolution.resource_not_found=cause=No response was found for this resolution in CDS.,action=Verify definition of the resource in CBA. +org.onap.ccsdk.cds.blueprintsprocessor.resource.resolution.internal_error=cause=Internal error while processing Resource Resolution.,action=Verify the payload. + +org.onap.ccsdk.cds.sdclistener.generic_failure=cause=Internal error in SDC Listener.,action=Contact CDS administrator team. \ No newline at end of file diff --git a/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/importCerAndStartService.sh b/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/importCerAndStartService.sh new file mode 100755 index 00000000..b5816068 --- /dev/null +++ b/plans/usecases-config-over-netconf/config-over-netconf/cds/resources/importCerAndStartService.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +chmod -R 775 /opt/app/onap/res +cp -f /opt/app/onap/res/application.properties /opt/app/onap/config +cp -f /opt/app/onap/res/error-messages_en.properties /opt/app/onap/config + +echo "Starting Service..." +source /startService.sh \ No newline at end of file diff --git a/scripts/sdnc/netconf-pnp-simulator/docker-compose.yml b/plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/docker-compose.yml similarity index 100% rename from scripts/sdnc/netconf-pnp-simulator/docker-compose.yml rename to plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/docker-compose.yml diff --git a/scripts/sdnc/netconf-pnp-simulator/netconf-config/data.json b/plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/netconf-config/data.json similarity index 100% rename from scripts/sdnc/netconf-pnp-simulator/netconf-config/data.json rename to plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/netconf-config/data.json diff --git a/scripts/sdnc/netconf-pnp-simulator/netconf-config/model.yang b/plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/netconf-config/model.yang similarity index 100% rename from scripts/sdnc/netconf-pnp-simulator/netconf-config/model.yang rename to plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/netconf-config/model.yang diff --git a/scripts/sdnc/netconf-pnp-simulator/netconf-config/subscriber.py b/plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/netconf-config/subscriber.py similarity index 100% rename from scripts/sdnc/netconf-pnp-simulator/netconf-config/subscriber.py rename to plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/netconf-config/subscriber.py diff --git a/plans/usecases-config-over-netconf/config-over-netconf/setup.sh b/plans/usecases-config-over-netconf/config-over-netconf/setup.sh index fcedbecf..2e61da0a 100644 --- a/plans/usecases-config-over-netconf/config-over-netconf/setup.sh +++ b/plans/usecases-config-over-netconf/config-over-netconf/setup.sh @@ -20,101 +20,102 @@ # @author Rahul Tyagi (rahul.tyagi@est.tech) - -SCRIPTS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -export PARENT=usecases-config-over-netconf -export SUB_PARENT=config-over-netconf -source ${WORKSPACE}/plans/$PARENT/$SUB_PARENT/test.properties +SCRIPTS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "${WORKSPACE}"/plans/usecases-config-over-netconf/config-over-netconf/test.properties export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) if [ "$MTU" == "" ]; then - export MTU="1450" + export MTU="1450" fi -# clone integration branch for pnf-simulator -mkdir -m 755 -p $WORKSPACE/temp/integration -cd $WORKSPACE/temp -git clone -b dublin --single-branch --depth=1 http://gerrit.onap.org/r/integration.git integration - -HOST_IP_ADDR=localhost +export CONFIG_OVER_NETCONF=${CONFIG_OVER_NETCONF} -# setup sdnc +# Prepare enviroment +echo "Uninstall docker-py and reinstall docker." +pip uninstall -y docker-py +pip uninstall -y docker +pip install -U docker==2.7.0 -cd $SDNC_DOCKER_PATH +# Disable Proxy - for local run unset http_proxy https_proxy -docker pull $NETOPEER_DOCKER_REPO:$NETOPEER_IMAGE_TAG -docker tag $NETOPEER_DOCKER_REPO:$NETOPEER_IMAGE_TAG $NETOPEER_DOCKER_REPO:latest -#sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="AUTO"/g" diocker-compose.yml -docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO +# Export default Networking bridge created on the host machine +export LOCAL_IP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+') -docker pull $NEXUS_DOCKER_REPO/onap/sdnc-image:$SDNC_IMAGE_TAG -docker tag $NEXUS_DOCKER_REPO/onap/sdnc-image:$SDNC_IMAGE_TAG onap/sdnc-image:latest +###################### Netconf-PNP-Simulator Setup ###################### -docker pull $NEXUS_DOCKER_REPO/onap/sdnc-ansible-server-image:$ANSIBLE_IMAGE_TAG -docker tag $NEXUS_DOCKER_REPO/onap/sdnc-ansible-server-image:$ANSIBLE_IMAGE_TAG onap/sdnc-ansible-server-image:latest +# Export Netconf-Pnp Simulator conf path +export NETCONF_CONFIG_PATH -docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-blueprintsprocessor:$BP_IMAGE_TAG -docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-blueprintsprocessor:$BP_IMAGE_TAG onap/ccsdk-blueprintsprocessor:latest +# Start N etconf-Pnp-Simulator Container with docker-compose and configuration from docker-compose.yml +docker-compose -f "${CONFIG_OVER_NETCONF}"/netconf-pnp-simulator/docker-compose.yml up -d -export SDNC_CERT_PATH=${CERT_SUBPATH} -#sed -i 's/sdnc_controller_container/sdnc_controller_container\n volumes: \n - $SDNC_CERT_PATH:\/opt\/opendaylight\/current\/certs/' docker-compose.yaml -# start SDNC containers with docker compose and configuration from docker-compose.yml -docker-compose up -d +# Update default Networking bridge IP in mount.json file +sed -i "s/pnfaddr/${LOCAL_IP}/g" "${REQUEST_DATA_PATH}"/mount.xml -# start pnf simulator +############################## SDNC Setup ############################## -cd $INT_DOCKER_PATH +export SDNC_CERT_PATH="${CERT_SUBPATH}" -./simulator.sh start& +docker pull "${NEXUS_DOCKER_REPO}"/onap/sdnc-image:"${SDNC_IMAGE_TAG}" +docker tag "${NEXUS_DOCKER_REPO}"/onap/sdnc-image:"${SDNC_IMAGE_TAG}" onap/sdnc-image:latest -# WAIT 10 minutes maximum and test every 5 seconds if SDNC is up using HealthCheck API -TIME_OUT=1000 -INTERVAL=30 -TIME=0 -while [ "$TIME" -lt "$TIME_OUT" ]; do - 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-sdnc" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8282/restconf/operations/SLI-API:healthcheck ); - echo $response +docker pull "${NEXUS_DOCKER_REPO}"/onap/sdnc-ansible-server-image:"${ANSIBLE_IMAGE_TAG}" +docker tag "${NEXUS_DOCKER_REPO}"/onap/sdnc-ansible-server-image:"${ANSIBLE_IMAGE_TAG}" onap/sdnc-ansible-server-image:latest - if [ "$response" == "200" ]; then - echo SDNC started in $TIME seconds - break; - fi +docker-compose -f "${CONFIG_OVER_NETCONF}"/sdn/docker-compose.yaml up -d - echo Sleep: $INTERVAL seconds before testing if SDNC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds - sleep $INTERVAL - TIME=$(($TIME+$INTERVAL)) +# Check if SDNC Service is healthy and ready +for i in {1..10}; do + SDNC_IP=$(get-instance-ip.sh sdnc_controller_container) + RESP_CODE=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-sdnc" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8282/restconf/operations/SLI-API:healthcheck) + if [[ "${RESP_CODE}" == '200' ]]; then + echo "SDNC Service is Ready." + break + fi + echo "Waiting for SDNC Service to Start Up..." + sleep 2m done -export LOCAL_IP=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+') -sed -i "s/pnfaddr/$LOCAL_IP/g" $REQUEST_DATA_PATH/mount.xml +if [[ "${SDNC_IP}" == 'none' || "${SDNC_IP}" == '' || "${RESP_CODE}" != '200' ]]; then + echo "SDNC Service not started Could cause problems for testing activities...!" +fi +############################## CDS Setup ############################## -if [ "$TIME" -ge "$TIME_OUT" ]; then - echo TIME OUT: karaf session not started in $TIME_OUT seconds... Could cause problems for testing activities... -fi +docker pull "${NEXUS_DOCKER_REPO}"/onap/ccsdk-blueprintsprocessor:"${BP_IMAGE_TAG}" +docker tag "${NEXUS_DOCKER_REPO}"/onap/ccsdk-blueprintsprocessor:"${BP_IMAGE_TAG}" onap/ccsdk-blueprintsprocessor:latest -########################################## blueprintsprocessor setup ########################################################## -source $CDS_DOCKER_PATH/cds_setup.sh +docker-compose -f "${CONFIG_OVER_NETCONF}"/cds/docker-compose.yaml up -d -########## update pnf simulator ip in config deploy request ######## +echo "Sleeping 1 minute" +sleep 1m -NETOPEER_CONTAINER=$(docker ps -a -q --filter="name=netopeer") -NETOPEER_CONTAINER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $SDNC_CONTAINER) -RES_KEY=$(uuidgen -r) -sed -i "s/pnfaddr/$LOCAL_IP/g" $REQUEST_DATA_PATH/config-deploy.json -sed -i "s/pnfaddr/$LOCAL_IP/g" $REQUEST_DATA_PATH/config-assign.json +BP_CONTAINER=$(docker ps -a -q --filter="name=bp-rest") +CCSDK_MARIADB=$(docker ps -a -q --filter="name=ccsdk-mariadb") -sed -i "s/reskey/$RES_KEY/g" $REQUEST_DATA_PATH/config-deploy.json -sed -i "s/reskey/$RES_KEY/g" $REQUEST_DATA_PATH/config-assign.json +for i in {1..10}; do + if [ $(docker inspect --format='{{ .State.Running }}' "${BP_CONTAINER}") ] && + [ $(docker inspect --format='{{ .State.Running }}' "${CCSDK_MARIADB}") ]; then + echo "Blueprint Proc Service Running" + break + else + echo sleep "${i}" + sleep "${i}" + fi +done -#########################check if server is up gracefully ###################################### +############################ Update Setup ############################ -# Sleep additional 3 minutes (180 secs) to give application time to finish +RES_KEY=$(uuidgen -r) +sed -i "s/pnfaddr/$LOCAL_IP/g" "${REQUEST_DATA_PATH}"/config-deploy.json +sed -i "s/pnfaddr/$LOCAL_IP/g" "${REQUEST_DATA_PATH}"/config-assign.json -sleep 150 +sed -i "s/reskey/$RES_KEY/g" "${REQUEST_DATA_PATH}"/config-deploy.json +sed -i "s/reskey/$RES_KEY/g" "${REQUEST_DATA_PATH}"/config-assign.json # Pass any variables required by Robot test suites in ROBOT_VARIABLES - -ROBOT_VARIABLES="-v SCRIPTS:${SCRIPTS}" +REPO_IP='127.0.0.1' +ROBOT_VARIABLES+=" -v REPO_IP:${REPO_IP} " +ROBOT_VARIABLES+=" -v SCRIPTS:${SCRIPTS} " \ No newline at end of file diff --git a/plans/usecases-config-over-netconf/config-over-netconf/teardown.sh b/plans/usecases-config-over-netconf/config-over-netconf/teardown.sh index 9613e3ee..7257b366 100755 --- a/plans/usecases-config-over-netconf/config-over-netconf/teardown.sh +++ b/plans/usecases-config-over-netconf/config-over-netconf/teardown.sh @@ -1,18 +1,10 @@ #!/bin/bash -SDNC_DOCKER_COMPOSE_PATH=$SDNC_DOCKER_PATH/docker-compose.yaml -PNFSIM_DOCKER_COMPOSE_PATH=$INT_DOCKER_PATH/docker-compose.yml -CDS_DOCKER_COMPOSE_PATH=$CDS_DOCKER_PATH/docker-compose.yaml +echo 'Stop, Removing all running containers...' +docker stop $(docker ps -aq) && docker rm $(docker ps -aq) -echo "==========================blueprint-processor logs ==================================" -docker logs bp-rest +echo 'Removing Volumes...' +echo y | docker volume prune -echo "==========================sdnc-controller logs ======================================" -docker logs sdnc_controller_container - - -docker-compose -f $SDNC_DOCKER_COMPOSE_PATH down -docker-compose -f $PNFSIM_DOCKER_COMPOSE_PATH down -docker-compose -f $CDS_DOCKER_COMPOSE_PATH down - -rm -rf $WORKSPACE/temp +echo 'Removing Networks...' +echo y | docker network prune \ No newline at end of file diff --git a/plans/usecases-config-over-netconf/config-over-netconf/test.properties b/plans/usecases-config-over-netconf/config-over-netconf/test.properties index ee002461..4e4c99b4 100644 --- a/plans/usecases-config-over-netconf/config-over-netconf/test.properties +++ b/plans/usecases-config-over-netconf/config-over-netconf/test.properties @@ -1,14 +1,10 @@ NEXUS_DOCKER_REPO=nexus3.onap.org:10001 NEXUS_USERNAME=docker NEXUS_PASSWD=docker +BP_IMAGE_TAG=0.7.1 SDNC_IMAGE_TAG=1.7.6 ANSIBLE_IMAGE_TAG=1.7.6 -BP_IMAGE_TAG=0.6.4 -REQUEST_DATA_PATH=$WORKSPACE/tests/$PARENT/$SUB_PARENT/data -TC_PLANS_PATH=$WORKSPACE/plans/$PARENT/$SUB_PARENT -CDS_DOCKER_PATH=$TC_PLANS_PATH/cds -SDNC_DOCKER_PATH=$TC_PLANS_PATH/sdn -INT_DOCKER_PATH=$WORKSPACE/temp/integration/test/mocks/pnfsimulator -CERT_SUBPATH=$TC_PLANS_PATH/certs -NETOPEER_DOCKER_REPO=sysrepo/sysrepo-netopeer2 -NETOPEER_IMAGE_TAG=v0.7.7 +CERT_SUBPATH=${WORKSPACE}/plans/usecases-config-over-netconf/config-over-netconf/certs +CONFIG_OVER_NETCONF=${WORKSPACE}/plans/usecases-config-over-netconf/config-over-netconf +REQUEST_DATA_PATH=${WORKSPACE}/tests/usecases-config-over-netconf/config-over-netconf/data +NETCONF_CONFIG_PATH=${WORKSPACE}/plans/usecases-config-over-netconf/config-over-netconf/netconf-pnp-simulator/netconf-config \ No newline at end of file diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/cds_setup.sh b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/cds_setup.sh index b6b46109..6eed7955 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/cds_setup.sh +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/cds_setup.sh @@ -26,9 +26,6 @@ cd $CDS_DATA_PATH export CDS_DOCKER_PATH=$CDS_DOCKER_PATH export APP_CONFIG_HOME=$APP_CONFIG_HOME -docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-blueprintsprocessor:$BP_IMAGE_TAG -docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-blueprintsprocessor:$BP_IMAGE_TAG onap/ccsdk-blueprintsprocessor:latest - docker-compose -f $CDS_DATA_PATH/docker-compose.yml -p $PROJECT_NAME up -d sleep 10 ################# Check state of BP #################### diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/docker-compose.yml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/docker-compose.yml index f48a2039..03899897 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/docker-compose.yml +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/docker-compose.yml @@ -14,7 +14,7 @@ services: MYSQL_USER: sdnctl MYSQL_PASSWORD: sdnctl blueprints-processor: - image: onap/ccsdk-blueprintsprocessor:latest + image: nexus3.onap.org:10001/onap/ccsdk-blueprintsprocessor:1.0.3 depends_on: - db ports: diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/application.properties b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/application.properties index d11bab62..2aae3936 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/application.properties +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/application.properties @@ -1,3 +1,18 @@ +# +# Copyright (c) 2017-2019 AT&T, IBM, Bell Canada, 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. +# # Web server config ### START -Controller Blueprints Properties # Load Resource Source Mappings @@ -9,7 +24,7 @@ blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive blueprintsprocessor.blueprintWorkingPath=/opt/app/onap/blueprints/working # Controller Blueprint Load Configurations -blueprintsprocessor.loadBluePrintPaths=/opt/app/onap/model-catalog/blueprint-model +blueprintsprocessor.loadBlueprintPaths=/opt/app/onap/model-catalog/blueprint-model blueprintsprocessor.loadModeTypePaths=/opt/app/onap/model-catalog/definition-type blueprintsprocessor.loadResourceDictionaryPaths=/opt/app/onap/model-catalog/resource-dictionary @@ -45,6 +60,11 @@ blueprints.processor.functions.python.executor.modulePaths=/opt/app/onap/scripts security.user.password: {bcrypt}$2a$10$duaUzVUVW0YPQCSIbGEkQOXwafZGwQ/b32/Ys4R1iwSSawFgz7QNu security.user.name: ccsdkapps +# Error Managements +error.catalog.applicationId=cds +error.catalog.type=properties +error.catalog.errorDefinitionDir=/opt/app/onap/config/ + # Used in Health Check #endpoints.user.name=ccsdkapps #endpoints.user.password=ccsdkapps @@ -74,6 +94,18 @@ blueprintsprocessor.restclient.sdnc.url=http://sdnc:8282 blueprintsprocessor.restclient.sdnc.username=admin blueprintsprocessor.restclient.sdnc.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +# Naming MS REST client settings +blueprintsprocessor.restclient.naming-ms.type=basic-auth +blueprintsprocessor.restclient.naming-ms.url=http://naming-ms:8282 +blueprintsprocessor.restclient.naming-ms.username=admin +blueprintsprocessor.restclient.naming-ms.password=demo123456! + +# IPAssign MS REST client settings +blueprintsprocessor.restclient.ipassign-ms.type=basic-auth +blueprintsprocessor.restclient.ipassign-ms.url=http://naming-ms:8282 +blueprintsprocessor.restclient.ipassign-ms.username=admin +blueprintsprocessor.restclient.ipassign-ms.password=demo123456! + # Primary AAI Data REST Client settings blueprintsprocessor.restclient.aai-data.type=basic-auth blueprintsprocessor.restclient.aai-data.url=https://aai-simulator:9993 @@ -83,20 +115,35 @@ blueprintsprocessor.restclient.aai-data.additionalHeaders.X-TransactionId=cds-tr blueprintsprocessor.restclient.aai-data.additionalHeaders.X-FromAppId=cds-app-id blueprintsprocessor.restclient.aai-data.additionalHeaders.Accept=application/json -# Kafka-message-lib Configuration -blueprintsprocessor.messageconsumer.self-service-api.kafkaEnable=false -blueprintsprocessor.messageconsumer.self-service-api.type=kafka-basic-auth -blueprintsprocessor.messageconsumer.self-service-api.bootstrapServers=127.0.0.1:9092 -blueprintsprocessor.messageconsumer.self-service-api.topic=receiver.t -blueprintsprocessor.messageconsumer.self-service-api.groupId=receiver-id -blueprintsprocessor.messageconsumer.self-service-api.clientId=default-client-id -blueprintsprocessor.messageconsumer.self-service-api.pollMillSec=1000 - -blueprintsprocessor.messageproducer.self-service-api.type=kafka-basic-auth -blueprintsprocessor.messageproducer.self-service-api.bootstrapServers=127.0.0.1:9092 -blueprintsprocessor.messageproducer.self-service-api.clientId=default-client-id -blueprintsprocessor.messageproducer.self-service-api.topic=producer.t - +# Kafka audit service Configurations +## Audit request +blueprintsprocessor.messageproducer.self-service-api.audit.kafkaEnable=false +blueprintsprocessor.messageproducer.self-service-api.audit.request.type=kafka-basic-auth +blueprintsprocessor.messageproducer.self-service-api.audit.request.bootstrapServers=127.0.0.1:9092 +blueprintsprocessor.messageproducer.self-service-api.audit.request.clientId=audit-request-producer-client-id +blueprintsprocessor.messageproducer.self-service-api.audit.request.topic=audit-request-producer.t +#### Security settings +#### SSL +#blueprintsprocessor.messageproducer.self-service-api.audit.request.truststore=/path/to/truststore.jks +#blueprintsprocessor.messageproducer.self-service-api.audit.request.truststorePassword=truststorePassword +#blueprintsprocessor.messageproducer.self-service-api.audit.request.keystore=/path/to/keystore.jks +#blueprintsprocessor.messageproducer.self-service-api.audit.request.keystorePassword=keystorePassword +#### SCRAM +#blueprintsprocessor.messageproducer.self-service-api.audit.request.scramUsername=test-user +#blueprintsprocessor.messageproducer.self-service-api.audit.request.scramPassword=testUserPassword + +## Audit response +blueprintsprocessor.messageproducer.self-service-api.audit.response.type=kafka-basic-auth +blueprintsprocessor.messageproducer.self-service-api.audit.response.bootstrapServers=127.0.0.1:9092 +blueprintsprocessor.messageproducer.self-service-api.audit.response.clientId=audit-response-producer-client-id +blueprintsprocessor.messageproducer.self-service-api.audit.response.topic=audit-response-producer.t + +# Message prioritization kakfa properties, Enable if Prioritization service is needed +# Deploy message-prioritization function along with blueprintsprocessor application. +#blueprintsprocessor.messageconsumer.prioritize-input.type=kafka-streams-basic-auth +#blueprintsprocessor.messageconsumer.prioritize-input.bootstrapServers=127.0.0.1:9092 +#blueprintsprocessor.messageconsumer.prioritize-input.applicationId=cds-controller +#blueprintsprocessor.messageconsumer.prioritize-input.topic=prioritize-input-topic blueprintprocessor.remoteScriptCommand.enabled=true @@ -117,7 +164,7 @@ management.endpoints.web.exposure.include=* management.endpoint.health.show-details=always management.info.git.mode=full -# Error Managements -error.catalog.applicationId=cds -error.catalog.type=properties -error.catalog.errorDefinitionDir=/opt/app/onap/config/ +#K8s Plugin properties +blueprintprocessor.k8s.plugin.username=test +blueprintprocessor.k8s.plugin.password=pass +blueprintprocessor.k8s.plugin.url=http://multicloud-k8s:9015/ diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/importCerAndStartService.sh b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/importCerAndStartService.sh index c5501d40..4e71e375 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/importCerAndStartService.sh +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/importCerAndStartService.sh @@ -5,7 +5,7 @@ cp -f /opt/app/onap/res/application.properties /opt/app/onap/config cp -f /opt/app/onap/res/error-messages_en.properties /opt/app/onap/config echo "importing aai cert." -keytool -import -noprompt -trustcacerts -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -alias aai -import -file /opt/app/onap/res/aai.cert +keytool -import -noprompt -trustcacerts -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit -alias aai-cacert -file /opt/app/onap/res/aai.cert echo "starting service." -source /startService.sh \ No newline at end of file +source /opt/app/onap/blueprints-processor/startService.sh \ 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 b7d7e648..6dbe58c1 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/setup.sh +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/setup.sh @@ -34,6 +34,12 @@ if [ "$MTU" == "" ]; then fi unset http_proxy https_proxy +# Prepare Environment +echo "Uninstall docker-py and reinstall docker." +pip uninstall -y docker-py +pip uninstall -y docker +pip install -U docker==2.7.0 + HOST_IP_ADDR=localhost ###################### setup so ############################## @@ -51,6 +57,7 @@ docker-compose -f $PNF_SIM_DOCKER_PATH/docker-compose.yml -p $PROJECT_NAME up -d ##### 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 7b1d5a8f..c6657e27 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 @@ -8,5 +8,15 @@ services: ports: - "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 00000000..fc42fa55 --- /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 ab39d8c7..331b249d 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 00000000..07732f21 --- /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 new file mode 100644 index 00000000..53dc39d2 --- /dev/null +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/aai-simulator-populate-data/service-instance-aai.json @@ -0,0 +1,45 @@ +{ + "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": "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/", + "orchestration-status": "Assigned", + "relationship-list": { + "relationship": [ + { + "related-to": "owning-entity", + "related-link": "/aai/v11/business/owning-entities/owning-entity/67f2e84c-734d-4e90-a1e4-d2ffa2e75849", + "relationship-data": [ + { + "relationship-key": "owning-entity.owning-entity-id", + "relationship-value": "67f2e84c-734d-4e90-a1e4-d2ffa2e75849" + } + ] + }, + { + "related-to": "pnf", + "related-link": "/aai/v11/network/pnfs/pnf/PNFDemo", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "PNFDemo" + } + ] + }, + { + "related-to": "pnf", + "related-link": "/aai/v11/network/pnfs/pnf/PNFDemo1", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "PNFDemo1" + } + ] + } + ] + } +} \ No newline at end of file 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 cb61ca34..72e84347 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 @@ apply_workaround() 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 00000000..357260ef Binary files /dev/null and b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/distribution-test-zip/zipped_sdc_csar_2.0.tar.gz 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 95469f90..d5ce982f 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.5 +TAG=1.8.0 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 6852e3f9..bbc5b9f3 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,8 @@ populate_aai_simulator() 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" echo "$SCRIPT_NAME $(current_timestamp): checking health of AAI Simulator" @@ -76,14 +78,6 @@ populate_aai_simulator() echo "$SCRIPT_NAME $(current_timestamp): Populating AAI Simulator" - echo "$SCRIPT_NAME $(current_timestamp): Adding Cloud-Customer Data" - 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/DemoCustomer -X PUT -d @"$CUSTOMER_JSON_FILE") - - if [[ "$status_code" -ne "$STATUS_CODE_ACCEPTED" ]] ; then - echo "$SCRIPT_NAME $(current_timestamp) ERROR: Unable to put customer data in AAI Simulator. Status code received: $status_code" - exit 1 - fi - echo "$SCRIPT_NAME $(current_timestamp): Adding Project" 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/projects/project/PnfSwUCsitProject -X PUT -d @"$PROJECT_JSON_FILE") @@ -164,6 +158,22 @@ populate_aai_simulator() 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/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" + exit 1 + fi + echo "$SCRIPT_NAME $(current_timestamp): AAI Simulator Populated Successfully" } 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 0886d9d5..4699be33 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 @@ services: - /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 @@ services: 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 @@ services: 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 30d25215..99768146 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 @@ javax.activation activation + + com.google.code.gson + gson + 2.8.5 + diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/controller/BusinessController.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/controller/BusinessController.java index 8559e8aa..f6ee7e64 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/controller/BusinessController.java +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/controller/BusinessController.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,38 +19,22 @@ */ package org.onap.aaisimulator.controller; -import static org.onap.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSHIP_LIST_URL; -import static org.onap.aaisimulator.utils.Constants.CUSTOMER_TYPE; import static org.onap.aaisimulator.utils.Constants.CUSTOMER_URL; -import static org.onap.aaisimulator.utils.Constants.GENERIC_VNF; -import static org.onap.aaisimulator.utils.Constants.GENERIC_VNF_VNF_ID; import static org.onap.aaisimulator.utils.Constants.SERVICE_RESOURCE_TYPE; -import static org.onap.aaisimulator.utils.Constants.SERVICE_SUBSCRIPTION; import static org.onap.aaisimulator.utils.Constants.X_HTTP_METHOD_OVERRIDE; import static org.onap.aaisimulator.utils.RequestErrorResponseUtils.getRequestErrorResponseEntity; -import static org.onap.aaisimulator.utils.RequestErrorResponseUtils.getResourceVersion; + import java.util.Optional; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.MediaType; -import org.onap.aai.domain.yang.Customer; -import org.onap.aai.domain.yang.GenericVnf; -import org.onap.aai.domain.yang.GenericVnfs; -import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.ServiceInstance; -import org.onap.aai.domain.yang.ServiceInstances; -import org.onap.aai.domain.yang.ServiceSubscription; -import org.onap.aaisimulator.models.NodeServiceInstance; -import org.onap.aaisimulator.service.providers.CustomerCacheServiceProvider; -import org.onap.aaisimulator.service.providers.GenericVnfCacheServiceProvider; -import org.onap.aaisimulator.service.providers.NodesCacheServiceProvider; +import org.onap.aaisimulator.service.providers.ServiceInstanceCacheProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; 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; @@ -60,297 +44,87 @@ import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -/** - * @author waqas.ikram@ericsson.com - * - */ @Controller @RequestMapping(path = CUSTOMER_URL) public class BusinessController { private static final Logger LOGGER = LoggerFactory.getLogger(BusinessController.class); - private final CustomerCacheServiceProvider cacheServiceProvider; - private final NodesCacheServiceProvider nodesCacheServiceProvider; - private final GenericVnfCacheServiceProvider genericVnfCacheServiceProvider; - - @Autowired - public BusinessController(final CustomerCacheServiceProvider cacheServiceProvider, - final NodesCacheServiceProvider nodesCacheServiceProvider, - final GenericVnfCacheServiceProvider genericVnfCacheServiceProvider) { - this.cacheServiceProvider = cacheServiceProvider; - this.nodesCacheServiceProvider = nodesCacheServiceProvider; - this.genericVnfCacheServiceProvider = genericVnfCacheServiceProvider; - } - - @GetMapping(value = "{global-customer-id}", produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity getCustomer(@PathVariable("global-customer-id") final String globalCustomerId, - final HttpServletRequest request) { - LOGGER.info("Will retrieve customer for 'global customer id': {} ...", globalCustomerId); - - final Optional optional = cacheServiceProvider.getCustomer(globalCustomerId); - if (optional.isPresent()) { - final Customer customer = optional.get(); - LOGGER.info("found customer {} in cache", customer); - return ResponseEntity.ok(customer); - } - LOGGER.error("Couldn't find {} in cache", globalCustomerId); - return getRequestErrorResponseEntity(request, CUSTOMER_TYPE); - } - - @PutMapping(value = "/{global-customer-id}", consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}, - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity putCustomer(@RequestBody final Customer customer, - @PathVariable("global-customer-id") final String globalCustomerId, final HttpServletRequest request) { - LOGGER.info("Will put customer for 'global customer id': {} ...", globalCustomerId); - - if (customer.getResourceVersion() == null || customer.getResourceVersion().isEmpty()) { - customer.setResourceVersion(getResourceVersion()); - - } - cacheServiceProvider.putCustomer(globalCustomerId, customer); - return ResponseEntity.accepted().build(); + private final ServiceInstanceCacheProvider svcInstanceCacheSvcProvider; + @Autowired + public BusinessController(final ServiceInstanceCacheProvider serviceInstanceCacheProvider) { + this.svcInstanceCacheSvcProvider = serviceInstanceCacheProvider; } - @GetMapping(value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}", - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity getCustomer(@PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, final HttpServletRequest request) { - LOGGER.info("Will retrieve service subscription for 'global customer id': {} and 'service type': {} ...", - globalCustomerId, serviceType); - - final Optional optional = - cacheServiceProvider.getServiceSubscription(globalCustomerId, serviceType); - if (optional.isPresent()) { - final ServiceSubscription serviceSubscription = optional.get(); - LOGGER.info("found service subscription {} in cache", serviceSubscription); - return ResponseEntity.ok(serviceSubscription); - } - - LOGGER.error("Couldn't find 'global customer id': {} and 'service type': {} in cache", globalCustomerId, - serviceType); - return getRequestErrorResponseEntity(request, SERVICE_SUBSCRIPTION); - } + @PutMapping(value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}", + produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity putServiceInstance(@PathVariable("global-customer-id") final String globalCustomerId, + @PathVariable("service-type") final String serviceType, + @PathVariable(name = "service-instance-id") final String serviceInstanceId, + @RequestBody final ServiceInstance serviceInstance, final HttpServletRequest request) { - @PutMapping(value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}", - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity putServiceSubscription(@PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, - @RequestBody final ServiceSubscription serviceSubscription, final HttpServletRequest request) { - LOGGER.info("Will add service subscription for 'global customer id': {} and 'service type': {} ...", - globalCustomerId, serviceType); + LOGGER.info("Add service instance to cache for 'global customer id': {}, 'service type': {} and " + + "'service instance id: '{}..", globalCustomerId, serviceType, serviceInstanceId); - if (cacheServiceProvider.putServiceSubscription(globalCustomerId, serviceType, serviceSubscription)) { - LOGGER.info("Successfully add service subscription in cache ..."); + if (svcInstanceCacheSvcProvider.putServiceInstance(globalCustomerId, serviceInstance)) { + LOGGER.info("Successfully added service instance to cache ..."); return ResponseEntity.accepted().build(); } - LOGGER.error("Couldn't add service subscription using 'global customer id': {} and 'service type': {}", - globalCustomerId, serviceType); - return getRequestErrorResponseEntity(request, SERVICE_SUBSCRIPTION); - } - - @GetMapping( - value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances", - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity getSericeInstances(@PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, - @RequestParam(name = "service-instance-name") final String serviceInstanceName, - @RequestParam(name = "depth", required = false) final Integer depth, final HttpServletRequest request) { - - LOGGER.info( - "Will retrieve service instances for 'global customer id': {}, 'service type': {} and 'service instance name: '{} with depth: {}...", - globalCustomerId, serviceType, serviceInstanceName, depth); - - final Optional optional = - cacheServiceProvider.getServiceInstances(globalCustomerId, serviceType, serviceInstanceName); - if (optional.isPresent()) { - final ServiceInstances serviceInstances = optional.get(); - LOGGER.info("found service instance {} in cache", serviceInstances); - return ResponseEntity.ok(serviceInstances); - } - LOGGER.error( - "Couldn't find 'global customer id': {}, 'service type': {} and 'service instance name': {} with depth: {} in cache", - globalCustomerId, serviceType, serviceInstanceName, depth); - return getRequestErrorResponseEntity(request); - } - - @GetMapping( - value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}", - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity getSericeInstance(@PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, - @PathVariable(name = "service-instance-id") final String serviceInstanceId, - @RequestParam(name = "depth", required = false) final Integer depth, - @RequestParam(name = "resultIndex", required = false) final Integer resultIndex, - @RequestParam(name = "resultSize", required = false) final Integer resultSize, - @RequestParam(name = "format", required = false) final String format, final HttpServletRequest request) { - - LOGGER.info( - "Will retrieve service instances for 'global customer id': {}, 'service type': {} and 'service instance id: '{} with depth: {}, resultIndex:{}, resultSize: {} and format: {}...", - globalCustomerId, serviceType, serviceInstanceId, depth, resultIndex, resultSize, format); - - final Optional optional = - cacheServiceProvider.getServiceInstance(globalCustomerId, serviceType, serviceInstanceId); - if (optional.isPresent()) { - final ServiceInstance serviceInstance = optional.get(); - LOGGER.info("found service instance {} in cache", serviceInstance); - return ResponseEntity.ok(serviceInstance); - } LOGGER.error( - "Couldn't find 'global customer id': {}, 'service type': {} and 'service instance id': {} with depth: {}, resultIndex:{}, resultSize: {} and format: {} in cache", - globalCustomerId, serviceType, serviceInstanceId, depth, resultIndex, resultSize, format); - return getRequestErrorResponseEntity(request); + "Couldn't add service instance for 'global customer id': {},'service type': {} and 'service instance id: '{} ...", + globalCustomerId, serviceType, serviceInstanceId); + return getRequestErrorResponseEntity(request, SERVICE_RESOURCE_TYPE); } - @PutMapping( - value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}", - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity putSericeInstance(@PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, - @PathVariable(name = "service-instance-id") final String serviceInstanceId, - @RequestHeader(value = X_HTTP_METHOD_OVERRIDE, required = false) final String invocationId, - @RequestBody final ServiceInstance serviceInstance, final HttpServletRequest request) { + @GetMapping(value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}", + produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity getServiceInstance(@PathVariable("global-customer-id") final String globalCustomerId, + @PathVariable("service-type") final String serviceType, + @PathVariable(name = "service-instance-id") final String serviceInstanceId, + @RequestParam(name = "depth", required = false) final Integer depth, + @RequestParam(name = "resultIndex", required = false) final Integer resultIndex, + @RequestParam(name = "resultSize", required = false) final Integer resultSize, + @RequestParam(name = "format", required = false) final String format, final HttpServletRequest request) { LOGGER.info( - "Will add service instance for 'global customer id': {}, 'service type': {} and 'service instance id: '{} ...", - globalCustomerId, serviceType, serviceInstanceId); + "Retrieve service instances for 'global customer id': {}, 'service type': {} and 'service instance id: '{} with depth: {}, resultIndex:{}, resultSize: {} and format: {}...", + globalCustomerId, serviceType, serviceInstanceId, depth, resultIndex, resultSize, format); - if (serviceInstance.getResourceVersion() == null || serviceInstance.getResourceVersion().isEmpty()) { - serviceInstance.setResourceVersion(getResourceVersion()); - } + final Optional svcInstance = + svcInstanceCacheSvcProvider.getServiceInstance(globalCustomerId); - if (cacheServiceProvider.putServiceInstance(globalCustomerId, serviceType, serviceInstanceId, - serviceInstance)) { - nodesCacheServiceProvider.putNodeServiceInstance(serviceInstanceId, new NodeServiceInstance( - globalCustomerId, serviceType, serviceInstanceId, SERVICE_RESOURCE_TYPE, request.getRequestURI())); - return ResponseEntity.accepted().build(); + if (svcInstance.isPresent()) { + final ServiceInstance serviceInstance = svcInstance.get(); + LOGGER.info("Found service instance {} in cache", serviceInstance); + return ResponseEntity.ok(serviceInstance); } - LOGGER.error("Couldn't add 'global customer id': {}, 'service type': {} and 'service instance id': {} to cache", - globalCustomerId, serviceType, serviceInstanceId); + LOGGER.error( + "Couldn't find 'global customer id': {}, 'service type': {} and 'service instance id': {} with depth: {}, resultIndex:{}, resultSize: {} and format: {} in cache", + globalCustomerId, serviceType, serviceInstanceId, depth, resultIndex, resultSize, format); return getRequestErrorResponseEntity(request); } - @PostMapping( - value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}", - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity patchSericeInstance(@PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, - @PathVariable(name = "service-instance-id") final String serviceInstanceId, - @RequestHeader(value = X_HTTP_METHOD_OVERRIDE, required = false) final String xHttpHeaderOverride, - @RequestBody final ServiceInstance serviceInstance, final HttpServletRequest request) { + @PostMapping(value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}", + produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) + public ResponseEntity patchServiceInstance(@PathVariable("global-customer-id") final String globalCustomerId, + @PathVariable("service-type") final String serviceType, + @PathVariable(name = "service-instance-id") final String serviceInstanceId, + @RequestHeader(value = X_HTTP_METHOD_OVERRIDE, required = false) final String xHttpHeaderOverride, + @RequestBody final ServiceInstance serviceInstance, final HttpServletRequest request) { LOGGER.info( - "Will post service instance for 'global customer id': {}, 'service type': {}, 'service instance id: '{} and '{}': {}...", - globalCustomerId, serviceType, serviceInstanceId, X_HTTP_METHOD_OVERRIDE, xHttpHeaderOverride); + "Post service instance for 'global customer id': {}, 'service type': {}, 'service instance id: '{} and '{}': {}...", + globalCustomerId, serviceType, serviceInstanceId, X_HTTP_METHOD_OVERRIDE, xHttpHeaderOverride); if (HttpMethod.PATCH.toString().equalsIgnoreCase(xHttpHeaderOverride)) { - cacheServiceProvider.patchServiceInstance(globalCustomerId, serviceType, serviceInstanceId, - serviceInstance); + svcInstanceCacheSvcProvider.patchServiceInstance(globalCustomerId, serviceInstance); return ResponseEntity.accepted().build(); } LOGGER.error("{} not supported ... ", xHttpHeaderOverride); return getRequestErrorResponseEntity(request); } - - - @GetMapping( - value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}/related-to/generic-vnfs", - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity getRelatedToGenericVnf(@PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, - @PathVariable(name = "service-instance-id") final String serviceInstanceId, - @RequestParam(name = "vnf-name", required = true) final String vnfName, final HttpServletRequest request) { - - LOGGER.info( - "Will retrieve generic vnf related to information for 'global customer id': {}, 'service type': {} and 'service instance id: '{} with vnfname: {}...", - globalCustomerId, serviceType, serviceInstanceId, vnfName); - - final Optional optional = - cacheServiceProvider.getRelationship(globalCustomerId, serviceType, serviceInstanceId, vnfName); - - if (optional.isPresent()) { - - final Relationship relationship = optional.get(); - final Optional relationshipDataOptional = relationship.getRelationshipData().stream() - .filter(existing -> GENERIC_VNF_VNF_ID.equals(existing.getRelationshipKey())).findFirst(); - - if (relationshipDataOptional.isPresent()) { - final RelationshipData relationshipData = relationshipDataOptional.get(); - final String vnfId = relationshipData.getRelationshipValue(); - final Optional genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(vnfId); - if (genericVnfOptional.isPresent()) { - final GenericVnfs genericVnfs = new GenericVnfs(); - genericVnfs.getGenericVnf().add(genericVnfOptional.get()); - LOGGER.info("found service instance {} in cache", relationship); - return ResponseEntity.ok(genericVnfs); - } - } - } - LOGGER.error( - "Couldn't find generic vnf related to information for 'global customer id': {}, 'service type': {} and 'service instance id: '{} with vnfname: {}...", - globalCustomerId, serviceType, serviceInstanceId, vnfName); - return getRequestErrorResponseEntity(request, GENERIC_VNF); - } - - @PutMapping( - value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}" - + BI_DIRECTIONAL_RELATIONSHIP_LIST_URL, - consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}, - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity putSericeInstanceRelationShip( - @PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, - @PathVariable(name = "service-instance-id") final String serviceInstanceId, - @RequestBody final Relationship relationship, final HttpServletRequest request) { - - LOGGER.info( - "Will add {} relationship for 'global customer id': {}, 'service type': {} and 'service instance id: '{} ...", - relationship.getRelatedTo(), globalCustomerId, serviceType, serviceInstanceId); - final Optional optional = cacheServiceProvider.addRelationShip(globalCustomerId, serviceType, - serviceInstanceId, relationship, request.getRequestURI()); - - if (optional.isPresent()) { - final Relationship resultantRelationship = optional.get(); - LOGGER.info("Relationship add, sending resultant relationship: {} in response ...", resultantRelationship); - return ResponseEntity.accepted().body(resultantRelationship); - } - - LOGGER.error( - "Couldn't add {} relationship for 'global customer id': {}, 'service type': {} and 'service instance id: '{} ...", - relationship.getRelatedTo(), globalCustomerId, serviceType, serviceInstanceId); - - return getRequestErrorResponseEntity(request); - } - - @DeleteMapping( - value = "/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}", - produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public ResponseEntity deleteSericeInstance(@PathVariable("global-customer-id") final String globalCustomerId, - @PathVariable("service-type") final String serviceType, - @PathVariable(name = "service-instance-id") final String serviceInstanceId, - @RequestParam(name = "resource-version") final String resourceVersion, final HttpServletRequest request) { - - LOGGER.info( - "Will delete SericeInstance for 'global-customer-id': {}, 'service-type': {}, 'service-instance-id': {} and 'resource-version': {}", - globalCustomerId, serviceType, serviceInstanceId, resourceVersion); - - if (cacheServiceProvider.deleteSericeInstance(globalCustomerId, serviceType, serviceInstanceId, - resourceVersion)) { - LOGGER.info( - "Successfully deleted SericeInstance from cache for 'global-customer-id': {}, 'service-type': {}, 'service-instance-id': {} and 'resource-version': {}", - globalCustomerId, serviceType, serviceInstanceId, resourceVersion); - return ResponseEntity.noContent().build(); - } - - LOGGER.error( - "Unable to delete SericeInstance from cache for 'global-customer-id': {}, 'service-type': {}, 'service-instance-id': {} and 'resource-version': {}", - globalCustomerId, serviceType, serviceInstanceId, resourceVersion); - - return getRequestErrorResponseEntity(request); - - } -} +} \ 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/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 ddc2b624..13753871 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 @@ public class ServiceDesignAndCreationController { @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 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 00000000..d6825089 --- /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 00000000..7d74ec36 --- /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 modelVer = null; + + public List getModelVer() { + return modelVer; + } + + public void setModelVer(List 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 00000000..d0a879c4 --- /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/main/java/org/onap/aaisimulator/service/providers/ServiceInstanceCacheProvider.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/service/providers/ServiceInstanceCacheProvider.java new file mode 100644 index 00000000..fc21eb69 --- /dev/null +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/service/providers/ServiceInstanceCacheProvider.java @@ -0,0 +1,32 @@ +/*- + * ============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.service.providers; + +import java.util.Optional; +import org.onap.aai.domain.yang.ServiceInstance; + +public interface ServiceInstanceCacheProvider { + + boolean patchServiceInstance(final String globalCustomerId, final ServiceInstance serviceInstance); + + Optional getServiceInstance(final String globalCustomerId); + + boolean putServiceInstance(final String serviceInstanceId, final ServiceInstance serviceInstance); +} \ 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/service/providers/ServiceInstanceCacheProviderImpl.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/service/providers/ServiceInstanceCacheProviderImpl.java new file mode 100644 index 00000000..57450ed6 --- /dev/null +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/service/providers/ServiceInstanceCacheProviderImpl.java @@ -0,0 +1,78 @@ +/*- + * ============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.service.providers; + +import static org.onap.aaisimulator.utils.CacheName.SERVICE_INSTANCE_CACHE; + +import java.util.Optional; +import org.onap.aai.domain.yang.ServiceInstance; +import org.onap.aaisimulator.cache.provider.AbstractCacheServiceProvider; +import org.onap.aaisimulator.utils.ShallowBeanCopy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.stereotype.Service; + +@Service +public class ServiceInstanceCacheProviderImpl extends AbstractCacheServiceProvider implements + ServiceInstanceCacheProvider { + + private static final Logger LOGGER = LoggerFactory.getLogger(ServiceInstanceCacheProviderImpl.class); + + private final Cache cache; + + @Autowired + public ServiceInstanceCacheProviderImpl(final CacheManager cacheManager) { + super(cacheManager); + cache = getCache(SERVICE_INSTANCE_CACHE.getName()); + } + + @Override + public boolean patchServiceInstance(String globalCustomerId, ServiceInstance serviceInstance) { + final Optional svcInstance = getServiceInstance(globalCustomerId); + if (svcInstance.isPresent()) { + final ServiceInstance cachedSvcInstance = svcInstance.get(); + try { + ShallowBeanCopy.copy(serviceInstance, cachedSvcInstance); + return true; + } catch (final Exception exception) { + LOGGER.error("Unable to update ServiceInstance for globalCustomerId: {}", globalCustomerId, exception); + } + } + LOGGER.error("Unable to find ServiceInstance for globalCustomerId : {}", globalCustomerId); + return false; + } + + @Override + public Optional getServiceInstance(final String globalCustomerId) { + LOGGER.info("Getting Service Instance with key: {} in cache ...", globalCustomerId); + final ServiceInstance svcInstance = cache.get(globalCustomerId, ServiceInstance.class); + return Optional.ofNullable(svcInstance); + } + + @Override + public boolean putServiceInstance(String globalCustomerId, ServiceInstance serviceInstance) { + LOGGER.info("Adding ServiceInstance: {} with key: {} in cache ...", serviceInstance, globalCustomerId); + cache.put(globalCustomerId, serviceInstance); + return true; + } +} \ 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/utils/CacheName.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/utils/CacheName.java index 63e7e261..53d2dff2 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/utils/CacheName.java +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/java/org/onap/aaisimulator/utils/CacheName.java @@ -26,6 +26,7 @@ package org.onap.aaisimulator.utils; public enum CacheName { CUSTOMER_CACHE("customer-cache"), + SERVICE_INSTANCE_CACHE("service-instance-cache"), PROJECT_CACHE("project-cache"), NODES_CACHE("nodes-cache"), GENERIC_VNF_CACHE("generic-vnf-cache"), diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AaiSimulatorControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/AaiSimulatorControllerTest.java similarity index 100% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AaiSimulatorControllerTest.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/AaiSimulatorControllerTest.java diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AbstractSpringBootTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/AbstractSpringBootTest.java similarity index 100% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/AbstractSpringBootTest.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/AbstractSpringBootTest.java diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/BusinessControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/BusinessControllerTest.java new file mode 100755 index 00000000..9bab789d --- /dev/null +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/BusinessControllerTest.java @@ -0,0 +1,109 @@ +/*- + * ============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.controller; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.onap.aaisimulator.utils.Constants.X_HTTP_METHOD_OVERRIDE; +import static org.onap.aaisimulator.utils.TestConstants.CUSTOMER_BASE_URL; +import static org.onap.aaisimulator.utils.TestConstants.SVC_INSTANCE_CUSTOMER_ID; +import static org.onap.aaisimulator.utils.TestConstants.SVC_INSTANCE_CUSTOMER_NAME; +import static org.onap.aaisimulator.utils.TestConstants.SVC_INSTANCE_URL; +import static org.onap.aaisimulator.utils.TestConstants.SVC_SUBSCRIPTIONS_URL; +import static org.onap.aaisimulator.utils.TestUtils.getSvcInstance; + +import java.io.IOException; +import org.junit.After; +import org.junit.Test; +import org.onap.aai.domain.yang.ServiceInstance; +import org.onap.aaisimulator.service.providers.CustomerCacheServiceProvider; +import org.onap.aaisimulator.utils.Constants; +import org.onap.aaisimulator.utils.TestUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +public class BusinessControllerTest extends AbstractSpringBootTest { + + @Autowired + private CustomerCacheServiceProvider cacheServiceProvider; + + @After + public void after() { + cacheServiceProvider.clearAll(); + } + + @Test + public void test_getSvcInstance_usingServiceInstanceId_fromCache() throws Exception { + final String url = getUrl(CUSTOMER_BASE_URL, SVC_SUBSCRIPTIONS_URL, SVC_INSTANCE_URL); + + final ResponseEntity responseEntity = testRestTemplateService + .invokeHttpPut(url, getSvcInstance(), Void.class); + + assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); + + final ResponseEntity actual = testRestTemplateService + .invokeHttpGet(url, ServiceInstance.class); + + assertEquals(HttpStatus.OK, actual.getStatusCode()); + assertTrue(actual.hasBody()); + + final ServiceInstance actualServiceInstance = actual.getBody(); + + assertEquals(SVC_INSTANCE_CUSTOMER_NAME, actualServiceInstance.getServiceInstanceName()); + assertEquals(SVC_INSTANCE_CUSTOMER_ID, actualServiceInstance.getServiceInstanceId()); + } + + @Test + public void test_postForServiceInstanceId_fromCache() throws Exception { + addServiceInstnceToCache(); + final HttpHeaders httpHeaders = testRestTemplateService.getHttpHeaders(); + httpHeaders.add(X_HTTP_METHOD_OVERRIDE, HttpMethod.PATCH.toString()); + httpHeaders.remove(HttpHeaders.CONTENT_TYPE); + httpHeaders.add(HttpHeaders.CONTENT_TYPE, Constants.APPLICATION_MERGE_PATCH_JSON); + + final String svcInstanceUrl = getUrl(CUSTOMER_BASE_URL, SVC_SUBSCRIPTIONS_URL, SVC_INSTANCE_URL); + final ResponseEntity postServiceInstanceResponse = testRestTemplateService + .invokeHttpPost(httpHeaders, svcInstanceUrl, TestUtils.getSvcInstance(), Void.class); + + assertEquals(HttpStatus.ACCEPTED, postServiceInstanceResponse.getStatusCode()); + + final ResponseEntity response = + testRestTemplateService.invokeHttpGet(svcInstanceUrl, ServiceInstance.class); + assertEquals(HttpStatus.OK, response.getStatusCode()); + + assertTrue(response.hasBody()); + + final ServiceInstance actualServiceInstance = response.getBody(); + + assertEquals(SVC_INSTANCE_CUSTOMER_NAME, actualServiceInstance.getServiceInstanceName()); + assertEquals(SVC_INSTANCE_CUSTOMER_ID, actualServiceInstance.getServiceInstanceId()); + + } + + private void addServiceInstnceToCache() throws Exception, IOException { + final ResponseEntity serviceInstanceResponse = + testRestTemplateService.invokeHttpPut(getUrl(CUSTOMER_BASE_URL, SVC_SUBSCRIPTIONS_URL, SVC_INSTANCE_URL), + TestUtils.getSvcInstance(), Void.class); + assertEquals(HttpStatus.ACCEPTED, serviceInstanceResponse.getStatusCode()); + } +} \ No newline at end of file diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/LinesOfBusinessControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/LinesOfBusinessControllerTest.java similarity index 100% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/LinesOfBusinessControllerTest.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/LinesOfBusinessControllerTest.java diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PlatformControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/PlatformControllerTest.java similarity index 100% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PlatformControllerTest.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/PlatformControllerTest.java diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PnfsControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/PnfsControllerTest.java similarity index 100% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/PnfsControllerTest.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/PnfsControllerTest.java diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/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 similarity index 60% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ServiceDesignAndCreationControllerTest.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/ServiceDesignAndCreationControllerTest.java index d0e652bd..8bda17e4 100644 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/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 @@ public class ServiceDesignAndCreationControllerTest extends AbstractSpringBootTe @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 actual = testRestTemplateService.invokeHttpGet(url, String.class); - String expectedXml = "\n" + - "\n" + - " \n" + - " c0818142-324d-4a8c-8065-45a61df247a5\n" + - " EricService\n" + - " 1.0\n" + - " blah\n" + - " 1594657102313\n" + - " \n" + - " \n" + - " 4442dfc1-0d2d-46b4-b0bc-a2ac10448269\n" + - " EricService\n" + - " 2.0\n" + - " blahhhh\n" + - " 1594707742646\n" + - " \n" + - ""; + 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/java/org/onap/so/aaisimulator/controller/configuration/TestRestTemplateConfigration.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/configuration/TestRestTemplateConfigration.java similarity index 100% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/configuration/TestRestTemplateConfigration.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/controller/configuration/TestRestTemplateConfigration.java diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/utils/TestConstants.java similarity index 86% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/utils/TestConstants.java index 942e8701..bccb2f02 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestConstants.java +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/utils/TestConstants.java @@ -33,18 +33,32 @@ public class TestConstants { public static final String SERVICE_INSTANCE_ID = "ccece8fe-13da-456a-baf6-41b3a4a2bc2b"; + public static final String SVC_INSTANCE_NAME = "ETE_Customer_807c7a02-249c-4db8-9fa9-bee973fe08ce"; + public static final String SERVICE_INSTANCE_URL = SERVICE_INSTANCES_URL + "/service-instance/" + SERVICE_INSTANCE_ID; + public static final String SVC_INSTANCE_URL = SERVICE_INSTANCES_URL + "/service-instance/" + SVC_INSTANCE_NAME; + public static final String SERVICE_TYPE = "vCPE"; + public static final String SVC_TYPE = "pNF"; + public static final String SERVICE_SUBSCRIPTIONS_URL = "/service-subscriptions/service-subscription/" + SERVICE_TYPE; + public static final String SVC_SUBSCRIPTIONS_URL = "/service-subscriptions/service-subscription/"+ SVC_TYPE; + public static final String GLOBAL_CUSTOMER_ID = "DemoCustomer"; + public static final String SVC_INSTANCE_CUSTOMER_ID = "5df8b6de-2083-11e7-93ae-92361f002676"; + + public static final String SVC_INSTANCE_CUSTOMER_NAME = "Service_Ete_Name123452c4-3d7f-42ce-8188-818fab951269"; + public static final String CUSTOMERS_URL = BASE_URL_V17 + "/business/customers/customer/" + GLOBAL_CUSTOMER_ID; + public static final String CUSTOMER_BASE_URL = BASE_URL_V17 + "/business/customers/customer/" + SVC_INSTANCE_CUSTOMER_ID; + public static final String VNF_ID = "dfd02fb5-d7fb-4aac-b3c4-cd6b60058701"; public static final String GENERIC_VNF_NAME = "EsyVnfInstantiationTest2"; diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestRestTemplateService.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/utils/TestRestTemplateService.java similarity index 100% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestRestTemplateService.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/utils/TestRestTemplateService.java diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestUtils.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/utils/TestUtils.java similarity index 97% rename from plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestUtils.java rename to plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/utils/TestUtils.java index e8dc9df2..77675745 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/utils/TestUtils.java +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/aaisimulator/utils/TestUtils.java @@ -80,6 +80,10 @@ public class TestUtils { return getJsonString("test-data/service-instance.json"); } + public static String getSvcInstance() throws IOException { + return getJsonString("test-data/service-instance-aai.json"); + } + public static String getGenericVnf() throws IOException { return getJsonString("test-data/generic-vnf.json"); } diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/BusinessControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/BusinessControllerTest.java deleted file mode 100755 index 70f5d21b..00000000 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/BusinessControllerTest.java +++ /dev/null @@ -1,397 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -package org.onap.aaisimulator.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.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSHIP_LIST_URL; -import static org.onap.aaisimulator.utils.Constants.X_HTTP_METHOD_OVERRIDE; -import static org.onap.aaisimulator.utils.TestConstants.CUSTOMERS_URL; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_NAME; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_URL; -import static org.onap.aaisimulator.utils.TestConstants.GLOBAL_CUSTOMER_ID; -import static org.onap.aaisimulator.utils.TestConstants.RELATED_TO_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCES_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_ID; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_NAME; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_SUBSCRIPTIONS_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_TYPE; -import static org.onap.aaisimulator.utils.TestConstants.VNF_ID; -import static org.onap.aaisimulator.utils.TestUtils.getCustomer; -import static org.onap.aaisimulator.utils.TestUtils.getServiceInstance; -import java.io.IOException; -import java.util.Optional; -import java.util.UUID; -import org.junit.After; -import org.junit.Test; -import org.onap.aai.domain.yang.Customer; -import org.onap.aai.domain.yang.GenericVnf; -import org.onap.aai.domain.yang.GenericVnfs; -import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.ServiceInstance; -import org.onap.aai.domain.yang.ServiceInstances; -import org.onap.aai.domain.yang.ServiceSubscription; -import org.onap.aaisimulator.service.providers.CustomerCacheServiceProvider; -import org.onap.aaisimulator.utils.RequestError; -import org.onap.aaisimulator.utils.RequestErrorResponseUtils; -import org.onap.aaisimulator.utils.ServiceException; -import org.onap.aaisimulator.utils.TestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -/** - * @author waqas.ikram@ericsson.com - * - */ -public class BusinessControllerTest extends AbstractSpringBootTest { - - private static final String FIREWALL_SERVICE_TYPE = "Firewall"; - - private static final String ORCHESTRATION_STATUS = "Active"; - - @Autowired - private CustomerCacheServiceProvider cacheServiceProvider; - - @After - public void after() { - cacheServiceProvider.clearAll(); - } - - @Test - public void test_putCustomer_successfullyAddedToCache() throws Exception { - invokeCustomerEndPointAndAssertResponse(); - assertTrue(cacheServiceProvider.getCustomer(GLOBAL_CUSTOMER_ID).isPresent()); - } - - @Test - public void test_getCustomer_ableToRetrieveCustomer() throws Exception { - final String url = getUrl(CUSTOMERS_URL); - - final ResponseEntity response = testRestTemplateService.invokeHttpPut(url, getCustomer(), Void.class); - assertEquals(HttpStatus.ACCEPTED, response.getStatusCode()); - - final ResponseEntity actual = testRestTemplateService.invokeHttpGet(url, Customer.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final Customer actualCustomer = actual.getBody(); - assertEquals(GLOBAL_CUSTOMER_ID, actualCustomer.getGlobalCustomerId()); - assertNotNull(actualCustomer.getResourceVersion()); - assertFalse(actualCustomer.getResourceVersion().isEmpty()); - } - - @Test - public void test_getCustomer_returnRequestError_ifCustomerNotInCache() throws Exception { - final String url = getUrl(CUSTOMERS_URL); - - final ResponseEntity actual = testRestTemplateService.invokeHttpGet(url, RequestError.class); - - assertEquals(HttpStatus.NOT_FOUND, actual.getStatusCode()); - - final RequestError actualError = actual.getBody(); - final ServiceException serviceException = actualError.getServiceException(); - - assertNotNull(serviceException); - assertEquals(RequestErrorResponseUtils.ERROR_MESSAGE_ID, serviceException.getMessageId()); - assertEquals(RequestErrorResponseUtils.ERROR_MESSAGE, serviceException.getText()); - assertTrue(serviceException.getVariables().contains(HttpMethod.GET.toString())); - - } - - @Test - public void test_getServiceSubscription_ableToRetrieveServiceSubscriptionFromCache() throws Exception { - final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL); - - invokeCustomerEndPointAndAssertResponse(); - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(url, ServiceSubscription.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final ServiceSubscription actualServiceSubscription = actual.getBody(); - assertEquals(SERVICE_TYPE, actualServiceSubscription.getServiceType()); - assertNotNull(actualServiceSubscription.getRelationshipList()); - assertFalse(actualServiceSubscription.getRelationshipList().getRelationship().isEmpty()); - } - - @Test - public void test_putSericeInstance_ableToRetrieveServiceInstanceFromCache() throws Exception { - - invokeCustomerEndPointAndAssertResponse(); - invokeServiceInstanceEndPointAndAssertResponse(); - - - final Optional actual = - cacheServiceProvider.getServiceInstance(GLOBAL_CUSTOMER_ID, SERVICE_TYPE, SERVICE_INSTANCE_ID); - - assertTrue(actual.isPresent()); - final ServiceInstance actualServiceInstance = actual.get(); - - assertEquals(SERVICE_INSTANCE_ID, actualServiceInstance.getServiceInstanceId()); - assertEquals(SERVICE_NAME, actualServiceInstance.getServiceInstanceName()); - - } - - @Test - public void test_getSericeInstance_usingServiceInstanceName_ableToRetrieveServiceInstanceFromCache() - throws Exception { - - invokeCustomerEndPointAndAssertResponse(); - invokeServiceInstanceEndPointAndAssertResponse(); - - - final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCES_URL) - + "?depth=2&service-instance-name=" + SERVICE_NAME; - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(serviceInstanceUrl, ServiceInstances.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final ServiceInstances actualServiceInstances = actual.getBody(); - assertFalse(actualServiceInstances.getServiceInstance().isEmpty()); - - assertEquals(SERVICE_NAME, actualServiceInstances.getServiceInstance().get(0).getServiceInstanceName()); - - } - - @Test - public void test_getSericeInstance_usingServiceInstanceName_returnRequestErrorIfnoServiceInstanceFound() - throws Exception { - - invokeCustomerEndPointAndAssertResponse(); - - final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCES_URL) - + "?depth=2&service-instance-name=" + SERVICE_NAME; - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(serviceInstanceUrl, RequestError.class); - - assertEquals(HttpStatus.NOT_FOUND, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - assertNotNull(actual.getBody().getServiceException()); - - } - - @Test - public void test_getSericeInstance_usingServiceInstanceId_ableToRetrieveServiceInstanceFromCache() - throws Exception { - - final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - - invokeCustomerEndPointAndAssertResponse(); - invokeServiceInstanceEndPointAndAssertResponse(); - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(url, ServiceInstance.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final ServiceInstance actualServiceInstance = actual.getBody(); - - assertEquals(SERVICE_NAME, actualServiceInstance.getServiceInstanceName()); - assertEquals(SERVICE_INSTANCE_ID, actualServiceInstance.getServiceInstanceId()); - - } - - @Test - public void test_getSericeInstance_usinginvalidServiceInstanceId_shouldReturnError() throws Exception { - - invokeCustomerEndPointAndAssertResponse(); - - invokeServiceInstanceEndPointAndAssertResponse(); - - - final String invalidServiceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, - SERVICE_INSTANCES_URL + "/service-instance/" + UUID.randomUUID()); - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(invalidServiceInstanceUrl, RequestError.class); - - assertEquals(HttpStatus.NOT_FOUND, actual.getStatusCode()); - - final RequestError actualError = actual.getBody(); - final ServiceException serviceException = actualError.getServiceException(); - - assertNotNull(serviceException); - assertEquals(RequestErrorResponseUtils.ERROR_MESSAGE_ID, serviceException.getMessageId()); - assertEquals(RequestErrorResponseUtils.ERROR_MESSAGE, serviceException.getText()); - assertTrue(serviceException.getVariables().contains(HttpMethod.GET.toString())); - - } - - @Test - public void test_getSericeInstance_usingInvalidServiceInstanceName_shouldReturnError() throws Exception { - - invokeCustomerEndPointAndAssertResponse(); - invokeServiceInstanceEndPointAndAssertResponse(); - - - final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCES_URL) - + "?service-instance-name=Dummy&depth=2"; - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(serviceInstanceUrl, RequestError.class); - - assertEquals(HttpStatus.NOT_FOUND, actual.getStatusCode()); - - final RequestError actualError = actual.getBody(); - final ServiceException serviceException = actualError.getServiceException(); - - assertNotNull(serviceException); - assertEquals(RequestErrorResponseUtils.ERROR_MESSAGE_ID, serviceException.getMessageId()); - assertEquals(RequestErrorResponseUtils.ERROR_MESSAGE, serviceException.getText()); - assertTrue(serviceException.getVariables().contains(HttpMethod.GET.toString())); - - } - - @Test - public void test_PathSericeInstance_usingServiceInstanceId_OrchStatusChangedInCache() throws Exception { - - final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - - invokeCustomerEndPointAndAssertResponse(); - invokeServiceInstanceEndPointAndAssertResponse(); - - final HttpHeaders httpHeaders = testRestTemplateService.getHttpHeaders(); - httpHeaders.add(X_HTTP_METHOD_OVERRIDE, HttpMethod.PATCH.toString()); - - final ResponseEntity orchStatuUpdateServiceInstanceResponse = testRestTemplateService - .invokeHttpPost(httpHeaders, url, TestUtils.getOrchStatuUpdateServiceInstance(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, orchStatuUpdateServiceInstanceResponse.getStatusCode()); - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(url, ServiceInstance.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final ServiceInstance actualServiceInstance = actual.getBody(); - - assertEquals(SERVICE_NAME, actualServiceInstance.getServiceInstanceName()); - assertEquals(SERVICE_INSTANCE_ID, actualServiceInstance.getServiceInstanceId()); - assertEquals(ORCHESTRATION_STATUS, actualServiceInstance.getOrchestrationStatus()); - - } - - @Test - public void test_putServiceSubscription_successfullyAddedToCache() throws Exception { - final String serviceSubscriptionurl = - getUrl(CUSTOMERS_URL, "/service-subscriptions/service-subscription/", FIREWALL_SERVICE_TYPE); - - invokeCustomerEndPointAndAssertResponse(); - - final ResponseEntity responseEntity = testRestTemplateService.invokeHttpPut(serviceSubscriptionurl, - TestUtils.getServiceSubscription(), Void.class); - assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(serviceSubscriptionurl, ServiceSubscription.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final ServiceSubscription actualServiceSubscription = actual.getBody(); - assertEquals(FIREWALL_SERVICE_TYPE, actualServiceSubscription.getServiceType()); - - } - - @Test - public void test_putSericeInstanceRelatedTo_ableToRetrieveServiceInstanceFromCache() throws Exception { - - final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - - invokeCustomerEndPointAndAssertResponse(); - - invokeServiceInstanceEndPointAndAssertResponse(); - - final String relationShipUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL, - BI_DIRECTIONAL_RELATIONSHIP_LIST_URL); - - final ResponseEntity responseEntity2 = testRestTemplateService.invokeHttpPut(relationShipUrl, - TestUtils.getRelationShipJsonObject(), Relationship.class); - - assertEquals(HttpStatus.ACCEPTED, responseEntity2.getStatusCode()); - - final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID); - final ResponseEntity genericVnfResponse = - testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class); - assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode()); - - final ResponseEntity actual = testRestTemplateService - .invokeHttpGet(url + RELATED_TO_URL + "?vnf-name=" + GENERIC_VNF_NAME, GenericVnfs.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - - assertTrue(actual.hasBody()); - final GenericVnfs genericVnfs = actual.getBody(); - assertFalse(genericVnfs.getGenericVnf().isEmpty()); - final GenericVnf genericVnf = genericVnfs.getGenericVnf().get(0); - assertEquals(GENERIC_VNF_NAME, genericVnf.getVnfName()); - } - - @Test - public void test_DeleteSericeInstance_ServiceInstanceRemovedFromCache() throws Exception { - final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - - invokeCustomerEndPointAndAssertResponse(); - - invokeServiceInstanceEndPointAndAssertResponse(); - - final Optional optional = - cacheServiceProvider.getServiceInstance(GLOBAL_CUSTOMER_ID, SERVICE_TYPE, SERVICE_INSTANCE_ID); - assertTrue(optional.isPresent()); - final ServiceInstance serviceInstance = optional.get(); - - final ResponseEntity responseEntity = testRestTemplateService - .invokeHttpDelete(url + "?resource-version=" + serviceInstance.getResourceVersion(), Void.class); - assertEquals(HttpStatus.NO_CONTENT, responseEntity.getStatusCode()); - assertFalse(cacheServiceProvider.getServiceInstance(GLOBAL_CUSTOMER_ID, SERVICE_TYPE, SERVICE_INSTANCE_ID) - .isPresent()); - } - - private void invokeServiceInstanceEndPointAndAssertResponse() throws IOException { - final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - final ResponseEntity responseEntity = - testRestTemplateService.invokeHttpPut(url, getServiceInstance(), Void.class); - assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); - } - - private void invokeCustomerEndPointAndAssertResponse() throws Exception, IOException { - final ResponseEntity response = - testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), getCustomer(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, response.getStatusCode()); - } - -} diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java deleted file mode 100755 index 29d03ce0..00000000 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/CloudRegionsControllerTest.java +++ /dev/null @@ -1,420 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -package org.onap.aaisimulator.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.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSHIP_LIST_URL; -import static org.onap.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL; -import static org.onap.aaisimulator.utils.Constants.VSERVER; -import static org.onap.aaisimulator.utils.TestConstants.CLOUD_OWNER_NAME; -import static org.onap.aaisimulator.utils.TestConstants.CLOUD_REGION_NAME; -import static org.onap.aaisimulator.utils.TestConstants.CUSTOMERS_URL; -import static org.onap.aaisimulator.utils.TestConstants.ESR_PASSWORD; -import static org.onap.aaisimulator.utils.TestConstants.ESR_SERVICE_URL; -import static org.onap.aaisimulator.utils.TestConstants.ESR_SYSTEM_INFO_ID; -import static org.onap.aaisimulator.utils.TestConstants.ESR_SYSTEM_INFO_LIST_URL; -import static org.onap.aaisimulator.utils.TestConstants.ESR_SYSTEM_TYPE; -import static org.onap.aaisimulator.utils.TestConstants.ESR_TYEP; -import static org.onap.aaisimulator.utils.TestConstants.ESR_USERNAME; -import static org.onap.aaisimulator.utils.TestConstants.ESR_VENDOR; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_NAME; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_SUBSCRIPTIONS_URL; -import static org.onap.aaisimulator.utils.TestConstants.SYSTEM_NAME; -import static org.onap.aaisimulator.utils.TestConstants.TENANTS_TENANT; -import static org.onap.aaisimulator.utils.TestConstants.TENANT_ID; -import static org.onap.aaisimulator.utils.TestConstants.VNF_ID; -import static org.onap.aaisimulator.utils.TestConstants.VSERVER_ID; -import static org.onap.aaisimulator.utils.TestConstants.VSERVER_NAME; -import static org.onap.aaisimulator.utils.TestConstants.VSERVER_URL; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import org.junit.After; -import org.junit.Test; -import org.onap.aai.domain.yang.CloudRegion; -import org.onap.aai.domain.yang.EsrSystemInfo; -import org.onap.aai.domain.yang.EsrSystemInfoList; -import org.onap.aai.domain.yang.GenericVnf; -import org.onap.aai.domain.yang.RelatedToProperty; -import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.RelationshipData; -import org.onap.aai.domain.yang.RelationshipList; -import org.onap.aai.domain.yang.Tenant; -import org.onap.aai.domain.yang.Vserver; -import org.onap.aaisimulator.models.CloudRegionKey; -import org.onap.aaisimulator.service.providers.CloudRegionCacheServiceProvider; -import org.onap.aaisimulator.service.providers.CustomerCacheServiceProvider; -import org.onap.aaisimulator.service.providers.GenericVnfCacheServiceProvider; -import org.onap.aaisimulator.utils.Constants; -import org.onap.aaisimulator.utils.TestConstants; -import org.onap.aaisimulator.utils.TestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -/** - * @author Waqas Ikram (waqas.ikram@est.tech) - * - */ -public class CloudRegionsControllerTest extends AbstractSpringBootTest { - - private static final CloudRegionKey CLOUD_REGION_KEY = new CloudRegionKey(CLOUD_OWNER_NAME, CLOUD_REGION_NAME); - - @Autowired - private CloudRegionCacheServiceProvider cloudRegionCacheServiceProvider; - - @Autowired - private CustomerCacheServiceProvider customerCacheServiceProvider; - - @Autowired - private GenericVnfCacheServiceProvider genericVnfCacheServiceProvider; - - @After - public void after() { - cloudRegionCacheServiceProvider.clearAll(); - customerCacheServiceProvider.clearAll(); - genericVnfCacheServiceProvider.clearAll(); - } - - @Test - public void test_putCloudRegion_successfullyAddedToCache() throws Exception { - final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - - invokeCloudRegionHttpPutEndPointAndAssertResponse(url); - - final ResponseEntity response = testRestTemplateService.invokeHttpGet(url, CloudRegion.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - - final CloudRegion cloudRegion = response.getBody(); - assertEquals(CLOUD_OWNER_NAME, cloudRegion.getCloudOwner()); - assertEquals(CLOUD_REGION_NAME, cloudRegion.getCloudRegionId()); - - assertNotNull("ResourceVersion should not be null", cloudRegion.getResourceVersion()); - - } - - @Test - public void test_getCloudRegionWithDepthValue_shouldReturnMatchedCloudRegion() throws Exception { - final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - - invokeCloudRegionHttpPutEndPointAndAssertResponse(url); - - final ResponseEntity response = - testRestTemplateService.invokeHttpGet(url + "?depth=2", CloudRegion.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - - final CloudRegion cloudRegion = response.getBody(); - assertEquals(CLOUD_OWNER_NAME, cloudRegion.getCloudOwner()); - assertEquals(CLOUD_REGION_NAME, cloudRegion.getCloudRegionId()); - - assertNotNull("ResourceVersion should not be null", cloudRegion.getResourceVersion()); - - } - - @Test - public void test_putGenericVnfRelationShipToPlatform_successfullyAddedToCache() throws Exception { - - final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - - invokeCloudRegionHttpPutEndPointAndAssertResponse(url); - - final String relationShipUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME, - BI_DIRECTIONAL_RELATIONSHIP_LIST_URL); - - final ResponseEntity responseEntity = testRestTemplateService.invokeHttpPut(relationShipUrl, - TestUtils.getGenericVnfRelationShip(), Relationship.class); - assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); - - final Optional optional = cloudRegionCacheServiceProvider.getCloudRegion(CLOUD_REGION_KEY); - assertTrue(optional.isPresent()); - - final CloudRegion actual = optional.get(); - - assertNotNull(actual.getRelationshipList()); - final List relationshipList = actual.getRelationshipList().getRelationship(); - assertFalse("Relationship list should not be empty", relationshipList.isEmpty()); - final Relationship relationship = relationshipList.get(0); - - assertEquals(GENERIC_VNF_URL + VNF_ID, relationship.getRelatedLink()); - - assertFalse("RelationshipData list should not be empty", relationship.getRelationshipData().isEmpty()); - assertFalse("RelatedToProperty list should not be empty", relationship.getRelatedToProperty().isEmpty()); - - final RelationshipData relationshipData = relationship.getRelationshipData().get(0); - assertEquals(Constants.GENERIC_VNF_VNF_ID, relationshipData.getRelationshipKey()); - assertEquals(TestConstants.VNF_ID, relationshipData.getRelationshipValue()); - - final RelatedToProperty relatedToProperty = relationship.getRelatedToProperty().get(0); - assertEquals(Constants.GENERIC_VNF_VNF_NAME, relatedToProperty.getPropertyKey()); - assertEquals(TestConstants.GENERIC_VNF_NAME, relatedToProperty.getPropertyValue()); - - } - - @Test - public void test_putTenant_successfullyAddedToCache() throws Exception { - final String cloudRegionUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - - invokeCloudRegionHttpPutEndPointAndAssertResponse(cloudRegionUrl); - - final String tenantUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, - "/" + CLOUD_REGION_NAME + TENANTS_TENANT + TENANT_ID); - addTenantAndAssertResponse(tenantUrl); - - final ResponseEntity response = testRestTemplateService.invokeHttpGet(tenantUrl, Tenant.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - - final Tenant tenant = response.getBody(); - assertEquals(TENANT_ID, tenant.getTenantId()); - assertEquals("admin", tenant.getTenantName()); - - assertNotNull("ResourceVersion should not be null", tenant.getResourceVersion()); - - } - - @Test - public void test_putTenantRelationToGenericVnf_successfullyAddedToCache() throws Exception { - - addCustomerServiceAndGenericVnf(); - - final String cloudRegionUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - invokeCloudRegionHttpPutEndPointAndAssertResponse(cloudRegionUrl); - - final String tenantUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME, - TENANTS_TENANT + TENANT_ID); - addTenantAndAssertResponse(tenantUrl); - - final String tenantRelationShipUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, - "/" + CLOUD_REGION_NAME, TENANTS_TENANT + TENANT_ID, RELATIONSHIP_LIST_RELATIONSHIP_URL); - - final ResponseEntity tenantRelationShipResponse = testRestTemplateService - .invokeHttpPut(tenantRelationShipUrl, TestUtils.getGenericVnfRelatedLink(), Void.class); - assertEquals(HttpStatus.ACCEPTED, tenantRelationShipResponse.getStatusCode()); - - final Optional optional = cloudRegionCacheServiceProvider.getTenant(CLOUD_REGION_KEY, TENANT_ID); - - assertTrue(optional.isPresent()); - final Tenant actualTenant = optional.get(); - final RelationshipList relationshipList = actualTenant.getRelationshipList(); - assertNotNull(relationshipList); - assertFalse(relationshipList.getRelationship().isEmpty()); - - final Relationship relationship = relationshipList.getRelationship().get(0); - - assertEquals(Constants.BELONGS_TO, relationship.getRelationshipLabel()); - assertFalse(relationship.getRelationshipData().isEmpty()); - assertEquals(1, relationship.getRelationshipData().size()); - - final List relationshipDataList = relationship.getRelationshipData(); - - final RelationshipData relationshipData = - getRelationshipData(relationshipDataList, Constants.GENERIC_VNF_VNF_ID); - assertNotNull(relationshipData); - assertEquals(VNF_ID, relationshipData.getRelationshipValue()); - - final List relatedToPropertyList = relationship.getRelatedToProperty(); - - final RelatedToProperty property = getRelatedToProperty(relatedToPropertyList, Constants.GENERIC_VNF_VNF_NAME); - assertNotNull(property); - assertEquals(GENERIC_VNF_NAME, property.getPropertyValue()); - - final Optional genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); - assertTrue(genericVnfOptional.isPresent()); - final GenericVnf actualGenericVnf = genericVnfOptional.get(); - final RelationshipList relationshipListGenericVnf = actualGenericVnf.getRelationshipList(); - assertNotNull(relationshipListGenericVnf); - assertFalse(relationshipListGenericVnf.getRelationship().isEmpty()); - - final Relationship relationshipGenericVnf = relationshipListGenericVnf.getRelationship().get(0); - - assertEquals(Constants.BELONGS_TO, relationshipGenericVnf.getRelationshipLabel()); - assertFalse(relationshipGenericVnf.getRelationshipData().isEmpty()); - assertEquals(3, relationshipGenericVnf.getRelationshipData().size()); - - } - - @Test - public void test_putEsrSystemInfo_successfullyAddedToCache() throws Exception { - final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - - invokeCloudRegionHttpPutEndPointAndAssertResponse(url); - - final String esrSystemInfoListUrl = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, - "/" + CLOUD_REGION_NAME, ESR_SYSTEM_INFO_LIST_URL); - - final String esrSystemInfoUrl = esrSystemInfoListUrl + "/esr-system-info/" + ESR_SYSTEM_INFO_ID; - final ResponseEntity esrSystemInfoResponse = - testRestTemplateService.invokeHttpPut(esrSystemInfoUrl, TestUtils.getEsrSystemInfo(), Void.class); - assertEquals(HttpStatus.ACCEPTED, esrSystemInfoResponse.getStatusCode()); - - final ResponseEntity response = - testRestTemplateService.invokeHttpGet(esrSystemInfoListUrl, EsrSystemInfoList.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - final EsrSystemInfoList actualEsrSystemInfoList = response.getBody(); - - final List esrSystemInfoList = actualEsrSystemInfoList.getEsrSystemInfo(); - assertNotNull(esrSystemInfoList); - assertEquals(1, esrSystemInfoList.size()); - - final EsrSystemInfo esrSystemInfo = esrSystemInfoList.get(0); - assertEquals(ESR_SYSTEM_INFO_ID, esrSystemInfo.getEsrSystemInfoId()); - assertEquals(SYSTEM_NAME, esrSystemInfo.getSystemName()); - assertEquals(ESR_TYEP, esrSystemInfo.getType()); - assertEquals(ESR_VENDOR, esrSystemInfo.getVendor()); - assertEquals(ESR_SERVICE_URL, esrSystemInfo.getServiceUrl()); - assertEquals(ESR_USERNAME, esrSystemInfo.getUserName()); - assertEquals(ESR_PASSWORD, esrSystemInfo.getPassword()); - assertEquals(ESR_SYSTEM_TYPE, esrSystemInfo.getSystemType()); - } - - @Test - public void test_putVServer_successfullyAddedToCache() throws Exception { - final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - - invokeCloudRegionHttpPutEndPointAndAssertResponse(url); - addCustomerServiceAndGenericVnf(); - - final String tenantUrl = url + TENANTS_TENANT + TENANT_ID; - addTenantAndAssertResponse(tenantUrl); - - final String vServerUrl = tenantUrl + VSERVER_URL + VSERVER_ID; - - final ResponseEntity vServerResponse = - testRestTemplateService.invokeHttpPut(vServerUrl, TestUtils.getVserver(), Void.class); - assertEquals(HttpStatus.ACCEPTED, vServerResponse.getStatusCode()); - - final ResponseEntity response = testRestTemplateService.invokeHttpGet(vServerUrl, Vserver.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - final Vserver actualVserver = response.getBody(); - assertEquals(VSERVER_NAME, actualVserver.getVserverName()); - assertEquals(VSERVER_ID, actualVserver.getVserverId()); - assertEquals("active", actualVserver.getProvStatus()); - assertNotNull(actualVserver.getRelationshipList()); - assertFalse(actualVserver.getRelationshipList().getRelationship().isEmpty()); - - final Optional optional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); - assertTrue(optional.isPresent()); - final GenericVnf genericVnf = optional.get(); - assertNotNull(genericVnf.getRelationshipList()); - assertFalse(genericVnf.getRelationshipList().getRelationship().isEmpty()); - - final Relationship expectedRelationShip = genericVnf.getRelationshipList().getRelationship().get(0); - assertEquals(VSERVER, expectedRelationShip.getRelatedTo()); - assertNotNull(expectedRelationShip.getRelationshipData()); - assertEquals(4, expectedRelationShip.getRelationshipData().size()); - - final List relationshipDataList = expectedRelationShip.getRelationshipData(); - final RelationshipData vServerrelationshipData = - getRelationshipData(relationshipDataList, Constants.VSERVER_VSERVER_ID); - assertNotNull(vServerrelationshipData); - assertEquals(VSERVER_ID, vServerrelationshipData.getRelationshipValue()); - - final RelationshipData cloudOwnerRelationshipData = - getRelationshipData(relationshipDataList, Constants.CLOUD_REGION_CLOUD_OWNER); - assertNotNull(cloudOwnerRelationshipData); - assertEquals(CLOUD_OWNER_NAME, cloudOwnerRelationshipData.getRelationshipValue()); - - final RelationshipData cloudRegionIdRelationshipData = - getRelationshipData(relationshipDataList, Constants.CLOUD_REGION_CLOUD_REGION_ID); - assertNotNull(cloudRegionIdRelationshipData); - assertEquals(CLOUD_REGION_NAME, cloudRegionIdRelationshipData.getRelationshipValue()); - - final RelationshipData tenantRelationshipData = - getRelationshipData(relationshipDataList, Constants.TENANT_TENANT_ID); - assertNotNull(tenantRelationshipData); - assertEquals(TENANT_ID, tenantRelationshipData.getRelationshipValue()); - - } - - @Test - public void test_deleteVServer_successfullyRemoveFromCache() throws Exception { - final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - - invokeCloudRegionHttpPutEndPointAndAssertResponse(url); - addCustomerServiceAndGenericVnf(); - - final String tenantUrl = url + TENANTS_TENANT + TENANT_ID; - addTenantAndAssertResponse(tenantUrl); - - final String vServerAddUrl = tenantUrl + VSERVER_URL + VSERVER_ID; - - final ResponseEntity vServerAddResponse = - testRestTemplateService.invokeHttpPut(vServerAddUrl, TestUtils.getVserver(), Void.class); - assertEquals(HttpStatus.ACCEPTED, vServerAddResponse.getStatusCode()); - - final Optional optional = - cloudRegionCacheServiceProvider.getVserver(CLOUD_REGION_KEY, TENANT_ID, VSERVER_ID); - assertTrue(optional.isPresent()); - final Vserver vserver = optional.get(); - - final String vServerRemoveUrl = vServerAddUrl + "?resource-version=" + vserver.getResourceVersion(); - - final ResponseEntity responseEntity = - testRestTemplateService.invokeHttpDelete(vServerRemoveUrl, Void.class); - assertEquals(HttpStatus.NO_CONTENT, responseEntity.getStatusCode()); - assertFalse(cloudRegionCacheServiceProvider.getVserver(CLOUD_REGION_KEY, TENANT_ID, VSERVER_ID).isPresent()); - - - } - - private void addTenantAndAssertResponse(final String tenantUrl) throws IOException { - final ResponseEntity responseEntity = - testRestTemplateService.invokeHttpPut(tenantUrl, TestUtils.getTenant(), Void.class); - assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); - } - - private void addCustomerServiceAndGenericVnf() throws Exception, IOException { - final ResponseEntity customerResponse = - testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), TestUtils.getCustomer(), Void.class); - assertEquals(HttpStatus.ACCEPTED, customerResponse.getStatusCode()); - - final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - final ResponseEntity serviceInstanceResponse = - testRestTemplateService.invokeHttpPut(serviceInstanceUrl, TestUtils.getServiceInstance(), Void.class); - assertEquals(HttpStatus.ACCEPTED, serviceInstanceResponse.getStatusCode()); - - final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID); - final ResponseEntity genericVnfResponse = - testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class); - assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode()); - - } - - private void invokeCloudRegionHttpPutEndPointAndAssertResponse(final String url) throws IOException { - final ResponseEntity responseEntity = - testRestTemplateService.invokeHttpPut(url, TestUtils.getCloudRegion(), Void.class); - assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); - } - -} diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrControllerTest.java deleted file mode 100755 index fb406ab4..00000000 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ExternalSystemEsrControllerTest.java +++ /dev/null @@ -1,233 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -package org.onap.aaisimulator.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.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL; -import static org.onap.aaisimulator.utils.TestConstants.CUSTOMERS_URL; -import static org.onap.aaisimulator.utils.TestConstants.ESR_PASSWORD; -import static org.onap.aaisimulator.utils.TestConstants.ESR_SERVICE_URL; -import static org.onap.aaisimulator.utils.TestConstants.ESR_SYSTEM_INFO_ID; -import static org.onap.aaisimulator.utils.TestConstants.ESR_SYSTEM_INFO_LIST_URL; -import static org.onap.aaisimulator.utils.TestConstants.ESR_SYSTEM_TYPE; -import static org.onap.aaisimulator.utils.TestConstants.ESR_TYEP; -import static org.onap.aaisimulator.utils.TestConstants.ESR_USERNAME; -import static org.onap.aaisimulator.utils.TestConstants.ESR_VENDOR; -import static org.onap.aaisimulator.utils.TestConstants.ESR_VIM_ID; -import static org.onap.aaisimulator.utils.TestConstants.ESR_VNFM_ID; -import static org.onap.aaisimulator.utils.TestConstants.ESR_VNFM_URL; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_SUBSCRIPTIONS_URL; -import static org.onap.aaisimulator.utils.TestConstants.SYSTEM_NAME; -import static org.onap.aaisimulator.utils.TestConstants.VNF_ID; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import org.junit.After; -import org.junit.Test; -import org.onap.aai.domain.yang.EsrSystemInfo; -import org.onap.aai.domain.yang.EsrSystemInfoList; -import org.onap.aai.domain.yang.EsrVnfm; -import org.onap.aai.domain.yang.EsrVnfmList; -import org.onap.aai.domain.yang.GenericVnf; -import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.RelationshipData; -import org.onap.aai.domain.yang.RelationshipList; -import org.onap.aaisimulator.service.providers.ExternalSystemCacheServiceProvider; -import org.onap.aaisimulator.service.providers.GenericVnfCacheServiceProvider; -import org.onap.aaisimulator.utils.Constants; -import org.onap.aaisimulator.utils.TestConstants; -import org.onap.aaisimulator.utils.TestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -/** - * @author Waqas Ikram (waqas.ikram@est.tech) - * - */ -public class ExternalSystemEsrControllerTest extends AbstractSpringBootTest { - - @Autowired - private ExternalSystemCacheServiceProvider externalSystemCacheServiceProvider; - - - @Autowired - private GenericVnfCacheServiceProvider genericVnfCacheServiceProvider; - - @After - public void after() { - externalSystemCacheServiceProvider.clearAll(); - genericVnfCacheServiceProvider.clearAll(); - } - - @Test - public void test_putEsrVnfm_successfullyAddedToCache() throws Exception { - final String esrVnfmUrl = getUrl(ESR_VNFM_URL, ESR_VNFM_ID); - addEsrVnfmAndAssertResponse(esrVnfmUrl); - - final ResponseEntity response = testRestTemplateService.invokeHttpGet(esrVnfmUrl, EsrVnfm.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - - final EsrVnfm actualEsrVnfm = response.getBody(); - assertEquals(ESR_VNFM_ID, actualEsrVnfm.getVnfmId()); - assertEquals(ESR_VIM_ID, actualEsrVnfm.getVimId()); - - } - - @Test - public void test_getEsrVnfmList_getAllEsrVnfmsFromCache() throws Exception { - final String esrVnfmUrl = getUrl(ESR_VNFM_URL, ESR_VNFM_ID); - addEsrVnfmAndAssertResponse(esrVnfmUrl); - - final String esrVnfmListUrl = getUrl(TestConstants.EXTERNAL_SYSTEM_ESR_VNFM_LIST_URL); - final ResponseEntity response = - testRestTemplateService.invokeHttpGet(esrVnfmListUrl, EsrVnfmList.class); - - assertTrue(response.hasBody()); - - final EsrVnfmList actualEsrVnfmList = response.getBody(); - - final List esrVnfmList = actualEsrVnfmList.getEsrVnfm(); - assertNotNull(esrVnfmList); - assertEquals(1, esrVnfmList.size()); - final EsrVnfm actualEsrVnfm = esrVnfmList.get(0); - assertEquals(ESR_VNFM_ID, actualEsrVnfm.getVnfmId()); - assertEquals(ESR_VIM_ID, actualEsrVnfm.getVimId()); - - } - - @Test - public void test_putEsrSystemInfo_successfullyAddedToCache() throws Exception { - final String esrVnfmUrl = getUrl(ESR_VNFM_URL, ESR_VNFM_ID); - addEsrVnfmAndAssertResponse(esrVnfmUrl); - final String esrSystemInfoListUrl = getUrl(ESR_VNFM_URL, ESR_VNFM_ID, ESR_SYSTEM_INFO_LIST_URL); - - final String esrSystemInfoUrl = esrSystemInfoListUrl + "/esr-system-info/" + ESR_SYSTEM_INFO_ID; - final ResponseEntity esrSystemInfoResponse = - testRestTemplateService.invokeHttpPut(esrSystemInfoUrl, TestUtils.getEsrSystemInfo(), Void.class); - assertEquals(HttpStatus.ACCEPTED, esrSystemInfoResponse.getStatusCode()); - - final ResponseEntity response = - testRestTemplateService.invokeHttpGet(esrSystemInfoListUrl, EsrSystemInfoList.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - final EsrSystemInfoList actualEsrSystemInfoList = response.getBody(); - - final List esrSystemInfoList = actualEsrSystemInfoList.getEsrSystemInfo(); - assertNotNull(esrSystemInfoList); - assertEquals(1, esrSystemInfoList.size()); - - final EsrSystemInfo esrSystemInfo = esrSystemInfoList.get(0); - assertEquals(ESR_SYSTEM_INFO_ID, esrSystemInfo.getEsrSystemInfoId()); - assertEquals(SYSTEM_NAME, esrSystemInfo.getSystemName()); - assertEquals(ESR_TYEP, esrSystemInfo.getType()); - assertEquals(ESR_VENDOR, esrSystemInfo.getVendor()); - assertEquals(ESR_SERVICE_URL, esrSystemInfo.getServiceUrl()); - assertEquals(ESR_USERNAME, esrSystemInfo.getUserName()); - assertEquals(ESR_PASSWORD, esrSystemInfo.getPassword()); - assertEquals(ESR_SYSTEM_TYPE, esrSystemInfo.getSystemType()); - - - } - - @Test - public void test_putEsrRelationToGenericVnfm_successfullyAddedToCache() throws Exception { - final String esrVnfmUrl = getUrl(ESR_VNFM_URL, ESR_VNFM_ID); - - addEsrVnfmAndAssertResponse(esrVnfmUrl); - addCustomerServiceAndGenericVnf(); - - final String relationShipUrl = esrVnfmUrl + RELATIONSHIP_LIST_RELATIONSHIP_URL; - - final ResponseEntity response = testRestTemplateService.invokeHttpPut(relationShipUrl, - TestUtils.getGenericVnfRelatedLink(), Void.class); - assertEquals(HttpStatus.ACCEPTED, response.getStatusCode()); - - final Optional optional = externalSystemCacheServiceProvider.getEsrVnfm(ESR_VNFM_ID); - assertTrue(optional.isPresent()); - - final EsrVnfm actualEsrVnfm = optional.get(); - final RelationshipList relationshipList = actualEsrVnfm.getRelationshipList(); - assertNotNull(relationshipList); - assertFalse(relationshipList.getRelationship().isEmpty()); - - final Relationship relationship = relationshipList.getRelationship().get(0); - - assertEquals(Constants.DEPENDS_ON, relationship.getRelationshipLabel()); - assertFalse(relationship.getRelationshipData().isEmpty()); - assertEquals(1, relationship.getRelationshipData().size()); - - final RelationshipData relationshipData = - getRelationshipData(relationship.getRelationshipData(), Constants.GENERIC_VNF_VNF_ID); - assertNotNull(relationshipData); - assertEquals(VNF_ID, relationshipData.getRelationshipValue()); - - final Optional genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); - assertTrue(genericVnfOptional.isPresent()); - final GenericVnf actualGenericVnf = genericVnfOptional.get(); - final RelationshipList relationshipListGenericVnf = actualGenericVnf.getRelationshipList(); - assertNotNull(relationshipListGenericVnf); - assertFalse(relationshipListGenericVnf.getRelationship().isEmpty()); - - final Relationship relationshipGenericVnf = relationshipListGenericVnf.getRelationship().get(0); - - assertEquals(Constants.DEPENDS_ON, relationshipGenericVnf.getRelationshipLabel()); - assertFalse(relationshipGenericVnf.getRelationshipData().isEmpty()); - assertEquals(1, relationshipGenericVnf.getRelationshipData().size()); - - final RelationshipData esrRelationshipData = - getRelationshipData(relationshipGenericVnf.getRelationshipData(), Constants.ESR_VNFM_VNFM_ID); - assertNotNull(esrRelationshipData); - assertEquals(ESR_VNFM_ID, esrRelationshipData.getRelationshipValue()); - - - } - - private void addEsrVnfmAndAssertResponse(final String esrVnfmUrl) throws IOException { - final ResponseEntity esrVnfmResponse = - testRestTemplateService.invokeHttpPut(esrVnfmUrl, TestUtils.getEsrVnfm(), Void.class); - assertEquals(HttpStatus.ACCEPTED, esrVnfmResponse.getStatusCode()); - } - - private void addCustomerServiceAndGenericVnf() throws Exception, IOException { - final ResponseEntity customerResponse = - testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), TestUtils.getCustomer(), Void.class); - assertEquals(HttpStatus.ACCEPTED, customerResponse.getStatusCode()); - - final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - final ResponseEntity serviceInstanceResponse = - testRestTemplateService.invokeHttpPut(serviceInstanceUrl, TestUtils.getServiceInstance(), Void.class); - assertEquals(HttpStatus.ACCEPTED, serviceInstanceResponse.getStatusCode()); - - final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID); - final ResponseEntity genericVnfResponse = - testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class); - assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode()); - - } -} diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java deleted file mode 100755 index 8ec26065..00000000 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java +++ /dev/null @@ -1,430 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -package org.onap.aaisimulator.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.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSHIP_LIST_URL; -import static org.onap.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL; -import static org.onap.aaisimulator.utils.Constants.X_HTTP_METHOD_OVERRIDE; -import static org.onap.aaisimulator.utils.TestConstants.CLOUD_OWNER_NAME; -import static org.onap.aaisimulator.utils.TestConstants.CLOUD_REGION_NAME; -import static org.onap.aaisimulator.utils.TestConstants.CUSTOMERS_URL; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_NAME; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_URL; -import static org.onap.aaisimulator.utils.TestConstants.GLOBAL_CUSTOMER_ID; -import static org.onap.aaisimulator.utils.TestConstants.LINE_OF_BUSINESS_NAME; -import static org.onap.aaisimulator.utils.TestConstants.PLATFORM_NAME; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_ID; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_NAME; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_SUBSCRIPTIONS_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_TYPE; -import static org.onap.aaisimulator.utils.TestConstants.VNF_ID; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import org.junit.After; -import org.junit.Test; -import org.onap.aai.domain.yang.GenericVnf; -import org.onap.aai.domain.yang.GenericVnfs; -import org.onap.aai.domain.yang.RelatedToProperty; -import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.RelationshipData; -import org.onap.aai.domain.yang.RelationshipList; -import org.onap.aai.domain.yang.ServiceInstance; -import org.onap.aaisimulator.service.providers.CustomerCacheServiceProvider; -import org.onap.aaisimulator.service.providers.GenericVnfCacheServiceProvider; -import org.onap.aaisimulator.service.providers.LinesOfBusinessCacheServiceProvider; -import org.onap.aaisimulator.service.providers.PlatformCacheServiceProvider; -import org.onap.aaisimulator.utils.Constants; -import org.onap.aaisimulator.utils.TestConstants; -import org.onap.aaisimulator.utils.TestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -/** - * @author Waqas Ikram (waqas.ikram@est.tech) - * - */ -public class GenericVnfsControllerTest extends AbstractSpringBootTest { - - @Autowired - private CustomerCacheServiceProvider customerCacheServiceProvider; - - @Autowired - private GenericVnfCacheServiceProvider genericVnfCacheServiceProvider; - - @Autowired - private LinesOfBusinessCacheServiceProvider linesOfBusinessCacheServiceProvider; - - @Autowired - private PlatformCacheServiceProvider platformVnfCacheServiceProvider; - - @After - public void after() { - customerCacheServiceProvider.clearAll(); - genericVnfCacheServiceProvider.clearAll(); - platformVnfCacheServiceProvider.clearAll(); - linesOfBusinessCacheServiceProvider.clearAll(); - } - - @Test - public void test_putGenericVnf_successfullyAddedToCache() throws Exception { - - final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID); - final ResponseEntity genericVnfResponse = - testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class); - assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode()); - - final ResponseEntity response = - testRestTemplateService.invokeHttpGet(genericVnfUrl, GenericVnf.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - - final GenericVnf actualGenericVnf = response.getBody(); - assertEquals(GENERIC_VNF_NAME, actualGenericVnf.getVnfName()); - assertEquals(VNF_ID, actualGenericVnf.getVnfId()); - - } - - @Test - public void test_putGenericVnfRelation_successfullyAddedToCache() throws Exception { - - addCustomerServiceAndGenericVnf(); - - final String genericVnfRelationShipUrl = getUrl(GENERIC_VNF_URL, VNF_ID, RELATIONSHIP_LIST_RELATIONSHIP_URL); - final ResponseEntity genericVnfRelationShipResponse = testRestTemplateService - .invokeHttpPut(genericVnfRelationShipUrl, TestUtils.getRelationShip(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, genericVnfRelationShipResponse.getStatusCode()); - - - final Optional optional = - customerCacheServiceProvider.getServiceInstance(GLOBAL_CUSTOMER_ID, SERVICE_TYPE, SERVICE_INSTANCE_ID); - - assertTrue(optional.isPresent()); - - final ServiceInstance actualServiceInstance = optional.get(); - final RelationshipList actualRelationshipList = actualServiceInstance.getRelationshipList(); - assertNotNull(actualRelationshipList); - assertFalse(actualRelationshipList.getRelationship().isEmpty()); - final Relationship actualRelationShip = actualRelationshipList.getRelationship().get(0); - - assertEquals(Constants.COMPOSED_OF, actualRelationShip.getRelationshipLabel()); - assertEquals(GENERIC_VNF_URL + VNF_ID, actualRelationShip.getRelatedLink()); - - - assertFalse(actualRelationShip.getRelatedToProperty().isEmpty()); - assertFalse(actualRelationShip.getRelationshipData().isEmpty()); - final RelatedToProperty actualRelatedToProperty = actualRelationShip.getRelatedToProperty().get(0); - final RelationshipData actualRelationshipData = actualRelationShip.getRelationshipData().get(0); - - assertEquals(Constants.GENERIC_VNF_VNF_NAME, actualRelatedToProperty.getPropertyKey()); - assertEquals(GENERIC_VNF_NAME, actualRelatedToProperty.getPropertyValue()); - assertEquals(Constants.GENERIC_VNF_VNF_ID, actualRelationshipData.getRelationshipKey()); - assertEquals(VNF_ID, actualRelationshipData.getRelationshipValue()); - - final Optional genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); - assertTrue(genericVnfOptional.isPresent()); - final GenericVnf actualGenericVnf = genericVnfOptional.get(); - final RelationshipList relationshipList = actualGenericVnf.getRelationshipList(); - assertNotNull(relationshipList); - assertFalse(relationshipList.getRelationship().isEmpty()); - - final Relationship relationship = relationshipList.getRelationship().get(0); - assertFalse(relationship.getRelatedToProperty().isEmpty()); - assertEquals(3, relationship.getRelationshipData().size()); - assertEquals(CUSTOMERS_URL + SERVICE_SUBSCRIPTIONS_URL + SERVICE_INSTANCE_URL, relationship.getRelatedLink()); - - - final List relatedToProperty = relationship.getRelatedToProperty(); - final RelatedToProperty firstRelatedToProperty = relatedToProperty.get(0); - assertEquals(Constants.SERVICE_INSTANCE_SERVICE_INSTANCE_NAME, firstRelatedToProperty.getPropertyKey()); - assertEquals(SERVICE_NAME, firstRelatedToProperty.getPropertyValue()); - - final List relationshipData = relationship.getRelationshipData(); - - final RelationshipData globalRelationshipData = - getRelationshipData(relationshipData, Constants.CUSTOMER_GLOBAL_CUSTOMER_ID); - assertNotNull(globalRelationshipData); - assertEquals(GLOBAL_CUSTOMER_ID, globalRelationshipData.getRelationshipValue()); - - final RelationshipData serviceSubscriptionRelationshipData = - getRelationshipData(relationshipData, Constants.SERVICE_SUBSCRIPTION_SERVICE_TYPE); - assertNotNull(serviceSubscriptionRelationshipData); - assertEquals(SERVICE_TYPE, serviceSubscriptionRelationshipData.getRelationshipValue()); - - final RelationshipData serviceInstanceRelationshipData = - getRelationshipData(relationshipData, Constants.SERVICE_INSTANCE_SERVICE_INSTANCE_ID); - assertNotNull(serviceInstanceRelationshipData); - assertEquals(SERVICE_INSTANCE_ID, serviceInstanceRelationshipData.getRelationshipValue()); - - } - - @Test - public void test_putGenericVnfRelationToPlatform_successfullyAddedToCache() throws Exception { - addCustomerServiceAndGenericVnf(); - - final String platformUrl = getUrl(TestConstants.PLATFORMS_URL, PLATFORM_NAME); - final ResponseEntity platformResponse = - testRestTemplateService.invokeHttpPut(platformUrl, TestUtils.getPlatform(), Void.class); - assertEquals(HttpStatus.ACCEPTED, platformResponse.getStatusCode()); - - final String genericVnfRelationShipUrl = getUrl(GENERIC_VNF_URL, VNF_ID, RELATIONSHIP_LIST_RELATIONSHIP_URL); - final ResponseEntity genericVnfRelationShipResponse = testRestTemplateService - .invokeHttpPut(genericVnfRelationShipUrl, TestUtils.getPlatformRelatedLink(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, genericVnfRelationShipResponse.getStatusCode()); - - final Optional genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); - assertTrue(genericVnfOptional.isPresent()); - final GenericVnf actualGenericVnf = genericVnfOptional.get(); - final RelationshipList relationshipList = actualGenericVnf.getRelationshipList(); - assertNotNull(relationshipList); - assertFalse(relationshipList.getRelationship().isEmpty()); - - final Relationship relationship = relationshipList.getRelationship().get(0); - - assertEquals(Constants.USES, relationship.getRelationshipLabel()); - assertFalse(relationship.getRelationshipData().isEmpty()); - assertEquals(1, relationship.getRelationshipData().size()); - assertEquals(TestConstants.PLATFORMS_URL + PLATFORM_NAME, relationship.getRelatedLink()); - - - final List relationshipData = relationship.getRelationshipData(); - - final RelationshipData platformRelationshipData = - getRelationshipData(relationshipData, Constants.PLATFORM_PLATFORM_NAME); - assertNotNull(platformRelationshipData); - assertEquals(PLATFORM_NAME, platformRelationshipData.getRelationshipValue()); - - } - - @Test - public void test_putGenericVnfRelationToLineOfBusiness_successfullyAddedToCache() throws Exception { - addCustomerServiceAndGenericVnf(); - - final String url = getUrl(TestConstants.LINES_OF_BUSINESS_URL, LINE_OF_BUSINESS_NAME); - final ResponseEntity responseEntity = - testRestTemplateService.invokeHttpPut(url, TestUtils.getLineOfBusiness(), Void.class); - assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); - - final String genericVnfRelationShipUrl = getUrl(GENERIC_VNF_URL, VNF_ID, RELATIONSHIP_LIST_RELATIONSHIP_URL); - final ResponseEntity genericVnfRelationShipResponse = testRestTemplateService - .invokeHttpPut(genericVnfRelationShipUrl, TestUtils.getLineOfBusinessRelatedLink(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, genericVnfRelationShipResponse.getStatusCode()); - - final Optional genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); - assertTrue(genericVnfOptional.isPresent()); - final GenericVnf actualGenericVnf = genericVnfOptional.get(); - final RelationshipList relationshipList = actualGenericVnf.getRelationshipList(); - assertNotNull(relationshipList); - assertFalse(relationshipList.getRelationship().isEmpty()); - - final Relationship relationship = relationshipList.getRelationship().get(0); - - assertEquals(Constants.USES, relationship.getRelationshipLabel()); - assertEquals(TestConstants.LINES_OF_BUSINESS_URL + LINE_OF_BUSINESS_NAME, relationship.getRelatedLink()); - - assertFalse(relationship.getRelationshipData().isEmpty()); - assertEquals(1, relationship.getRelationshipData().size()); - - final List relationshipData = relationship.getRelationshipData(); - - final RelationshipData lineOfBusinessRelationshipData = - getRelationshipData(relationshipData, Constants.LINE_OF_BUSINESS_LINE_OF_BUSINESS_NAME); - assertNotNull(lineOfBusinessRelationshipData); - assertEquals(LINE_OF_BUSINESS_NAME, lineOfBusinessRelationshipData.getRelationshipValue()); - - } - - @Test - public void test_putGenericVnfRelationToCloudRegion_successfullyAddedToCache() throws Exception { - addCustomerServiceAndGenericVnf(); - - final String url = getUrl(TestConstants.CLOUD_REGIONS, CLOUD_OWNER_NAME, "/" + CLOUD_REGION_NAME); - - final ResponseEntity responseEntity = - testRestTemplateService.invokeHttpPut(url, TestUtils.getCloudRegion(), Void.class); - assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); - - final String genericVnfRelationShipUrl = getUrl(GENERIC_VNF_URL, VNF_ID, RELATIONSHIP_LIST_RELATIONSHIP_URL); - final ResponseEntity genericVnfRelationShipResponse = testRestTemplateService - .invokeHttpPut(genericVnfRelationShipUrl, TestUtils.getCloudRegionRelatedLink(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, genericVnfRelationShipResponse.getStatusCode()); - - final Optional genericVnfOptional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); - assertTrue(genericVnfOptional.isPresent()); - final GenericVnf actualGenericVnf = genericVnfOptional.get(); - final RelationshipList relationshipList = actualGenericVnf.getRelationshipList(); - assertNotNull(relationshipList); - assertFalse(relationshipList.getRelationship().isEmpty()); - - final Relationship relationship = relationshipList.getRelationship().get(0); - - assertEquals(Constants.LOCATED_IN, relationship.getRelationshipLabel()); - assertEquals(TestConstants.CLOUD_REGIONS + CLOUD_OWNER_NAME + "/" + CLOUD_REGION_NAME, - relationship.getRelatedLink()); - - assertFalse(relationship.getRelationshipData().isEmpty()); - assertEquals(2, relationship.getRelationshipData().size()); - - final List relationshipDataList = relationship.getRelationshipData(); - - final RelationshipData cloudOwnerRelationshipData = - getRelationshipData(relationshipDataList, Constants.CLOUD_REGION_CLOUD_OWNER); - assertNotNull(cloudOwnerRelationshipData); - assertEquals(CLOUD_OWNER_NAME, cloudOwnerRelationshipData.getRelationshipValue()); - - final RelationshipData cloudRegionIdRelationshipData = - getRelationshipData(relationshipDataList, Constants.CLOUD_REGION_CLOUD_REGION_ID); - assertNotNull(cloudRegionIdRelationshipData); - assertEquals(CLOUD_REGION_NAME, cloudRegionIdRelationshipData.getRelationshipValue()); - - final List relatedToPropertyList = relationship.getRelatedToProperty(); - - final RelatedToProperty cloudRegionOwnerDefinedTypeProperty = - getRelatedToProperty(relatedToPropertyList, Constants.CLOUD_REGION_OWNER_DEFINED_TYPE); - assertNotNull(cloudRegionOwnerDefinedTypeProperty); - assertEquals("OwnerType", cloudRegionOwnerDefinedTypeProperty.getPropertyValue()); - - } - - @Test - public void test_putBiDirectionalRelationShip_successfullyAddedToCache() throws Exception { - addCustomerServiceAndGenericVnf(); - - final String relationShipUrl = getUrl(GENERIC_VNF_URL, VNF_ID, BI_DIRECTIONAL_RELATIONSHIP_LIST_URL); - - final ResponseEntity responseEntity = testRestTemplateService.invokeHttpPut(relationShipUrl, - TestUtils.getTenantRelationShip(), Relationship.class); - assertEquals(HttpStatus.ACCEPTED, responseEntity.getStatusCode()); - - final Optional optional = genericVnfCacheServiceProvider.getGenericVnf(VNF_ID); - assertTrue(optional.isPresent()); - - final GenericVnf actual = optional.get(); - - assertNotNull(actual.getRelationshipList()); - final List relationshipList = actual.getRelationshipList().getRelationship(); - assertFalse("Relationship list should not be empty", relationshipList.isEmpty()); - final Relationship relationship = relationshipList.get(0); - - assertFalse("RelationshipData list should not be empty", relationship.getRelationshipData().isEmpty()); - assertFalse("RelatedToProperty list should not be empty", relationship.getRelatedToProperty().isEmpty()); - } - - @Test - public void test_patchGenericVnf_usingVnfId_OrchStatusChangedInCache() throws Exception { - addCustomerServiceAndGenericVnf(); - - final HttpHeaders httpHeaders = testRestTemplateService.getHttpHeaders(); - httpHeaders.add(X_HTTP_METHOD_OVERRIDE, HttpMethod.PATCH.toString()); - httpHeaders.remove(HttpHeaders.CONTENT_TYPE); - httpHeaders.add(HttpHeaders.CONTENT_TYPE, Constants.APPLICATION_MERGE_PATCH_JSON); - - final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID); - final ResponseEntity orchStatuUpdateServiceInstanceResponse = testRestTemplateService - .invokeHttpPost(httpHeaders, genericVnfUrl, TestUtils.getGenericVnfOrchStatuUpdate(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, orchStatuUpdateServiceInstanceResponse.getStatusCode()); - - final ResponseEntity response = - testRestTemplateService.invokeHttpGet(genericVnfUrl, GenericVnf.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - - final GenericVnf actualGenericVnf = response.getBody(); - assertEquals(GENERIC_VNF_NAME, actualGenericVnf.getVnfName()); - assertEquals(VNF_ID, actualGenericVnf.getVnfId()); - assertEquals("Assigned", actualGenericVnf.getOrchestrationStatus()); - - } - - @Test - public void test_getGenericVnfs_usingSelfLink_getAllGenericVnfsInCache() throws Exception { - - addCustomerServiceAndGenericVnf(); - - final String selfLink = "http://localhost:9921/generic-vnf/" + VNF_ID; - final String url = getUrl(TestConstants.GENERIC_VNFS_URL_1) + "?selflink=" + selfLink; - final ResponseEntity response = testRestTemplateService.invokeHttpGet(url, GenericVnfs.class); - assertEquals(HttpStatus.OK, response.getStatusCode()); - - assertTrue(response.hasBody()); - - final GenericVnfs actualGenericVnfs = response.getBody(); - final List genericVnfList = actualGenericVnfs.getGenericVnf(); - assertNotNull(genericVnfList); - assertEquals(1, genericVnfList.size()); - final GenericVnf actualGenericVnf = genericVnfList.get(0); - assertEquals(selfLink, actualGenericVnf.getSelflink()); - assertEquals(GENERIC_VNF_NAME, actualGenericVnf.getVnfName()); - assertEquals(VNF_ID, actualGenericVnf.getVnfId()); - } - - @Test - public void test_deleteGenericVnf_usingVnfIdAndResourceVersion_removedFromCache() throws Exception { - - addCustomerServiceAndGenericVnf(); - - final Optional 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 responseEntity = - testRestTemplateService.invokeHttpDelete(genericVnfDeleteUrl, Void.class); - assertEquals(HttpStatus.NO_CONTENT, responseEntity.getStatusCode()); - assertFalse(genericVnfCacheServiceProvider.getGenericVnf(VNF_ID).isPresent()); - - } - - private void addCustomerServiceAndGenericVnf() throws Exception, IOException { - final ResponseEntity customerResponse = - testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), TestUtils.getCustomer(), Void.class); - assertEquals(HttpStatus.ACCEPTED, customerResponse.getStatusCode()); - - final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - final ResponseEntity serviceInstanceResponse = - testRestTemplateService.invokeHttpPut(serviceInstanceUrl, TestUtils.getServiceInstance(), Void.class); - assertEquals(HttpStatus.ACCEPTED, serviceInstanceResponse.getStatusCode()); - - final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID); - final ResponseEntity genericVnfResponse = - testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class); - assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode()); - - } - - -} diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/NodesControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/NodesControllerTest.java deleted file mode 100755 index 12412872..00000000 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/NodesControllerTest.java +++ /dev/null @@ -1,156 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -package org.onap.aaisimulator.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.aaisimulator.utils.Constants.RESOURCE_LINK; -import static org.onap.aaisimulator.utils.Constants.RESOURCE_TYPE; -import static org.onap.aaisimulator.utils.Constants.SERVICE_RESOURCE_TYPE; -import static org.onap.aaisimulator.utils.TestConstants.CUSTOMERS_URL; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNFS_URL; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_NAME; -import static org.onap.aaisimulator.utils.TestConstants.GENERIC_VNF_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_ID; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_NAME; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_SUBSCRIPTIONS_URL; -import static org.onap.aaisimulator.utils.TestConstants.VNF_ID; -import java.io.IOException; -import java.util.Map; -import org.junit.After; -import org.junit.Test; -import org.onap.aai.domain.yang.GenericVnf; -import org.onap.aai.domain.yang.GenericVnfs; -import org.onap.aai.domain.yang.ServiceInstance; -import org.onap.aaisimulator.models.Format; -import org.onap.aaisimulator.models.Results; -import org.onap.aaisimulator.service.providers.CustomerCacheServiceProvider; -import org.onap.aaisimulator.service.providers.NodesCacheServiceProvider; -import org.onap.aaisimulator.utils.TestConstants; -import org.onap.aaisimulator.utils.TestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -/** - * @author waqas.ikram@ericsson.com - * - */ -public class NodesControllerTest extends AbstractSpringBootTest { - - @Autowired - private NodesCacheServiceProvider nodesCacheServiceProvider; - - @Autowired - private CustomerCacheServiceProvider customerCacheServiceProvider; - - @After - public void after() { - nodesCacheServiceProvider.clearAll(); - customerCacheServiceProvider.clearAll(); - } - - @Test - public void test_getNodesSericeInstance_usingServiceInstanceId_ableToRetrieveServiceInstanceFromCache() - throws Exception { - - invokeCustomerandServiceInstanceUrls(); - - final ResponseEntity actual = testRestTemplateService - .invokeHttpGet(getUrl(TestConstants.NODES_URL, SERVICE_INSTANCE_URL), ServiceInstance.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final ServiceInstance actualServiceInstance = actual.getBody(); - - assertEquals(SERVICE_NAME, actualServiceInstance.getServiceInstanceName()); - assertEquals(SERVICE_INSTANCE_ID, actualServiceInstance.getServiceInstanceId()); - - } - - @Test - public void test_getNodesSericeInstance_usingServiceInstanceIdAndFormatPathed_ableToRetrieveServiceInstanceFromCache() - throws Exception { - - invokeCustomerandServiceInstanceUrls(); - - final ResponseEntity actual = testRestTemplateService.invokeHttpGet( - getUrl(TestConstants.NODES_URL, SERVICE_INSTANCE_URL) + "?format=" + Format.PATHED.getValue(), - Results.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final Results result = actual.getBody(); - - assertNotNull(result.getValues()); - assertFalse(result.getValues().isEmpty()); - final Map actualMap = result.getValues().get(0); - - assertEquals(CUSTOMERS_URL + SERVICE_SUBSCRIPTIONS_URL + SERVICE_INSTANCE_URL, actualMap.get(RESOURCE_LINK)); - assertEquals(SERVICE_RESOURCE_TYPE, actualMap.get(RESOURCE_TYPE)); - - } - - @Test - public void test_getNodesGenericVnfs_usingVnfName_ableToRetrieveItFromCache() throws Exception { - invokeCustomerandServiceInstanceUrls(); - - final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID); - final ResponseEntity genericVnfResponse = - testRestTemplateService.invokeHttpPut(genericVnfUrl, TestUtils.getGenericVnf(), Void.class); - assertEquals(HttpStatus.ACCEPTED, genericVnfResponse.getStatusCode()); - - final String nodeGenericVnfsUrl = - getUrl(TestConstants.NODES_URL, GENERIC_VNFS_URL) + "?vnf-name=" + GENERIC_VNF_NAME; - - final ResponseEntity actual = - testRestTemplateService.invokeHttpGet(nodeGenericVnfsUrl, GenericVnfs.class); - - assertEquals(HttpStatus.OK, actual.getStatusCode()); - assertTrue(actual.hasBody()); - - final GenericVnfs genericVnfs = actual.getBody(); - assertEquals(1, genericVnfs.getGenericVnf().size()); - - final GenericVnf genericVnf = genericVnfs.getGenericVnf().get(0); - assertEquals(GENERIC_VNF_NAME, genericVnf.getVnfName()); - assertEquals(VNF_ID, genericVnf.getVnfId()); - - } - - private void invokeCustomerandServiceInstanceUrls() throws Exception, IOException { - final String url = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - - final ResponseEntity response = - testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), TestUtils.getCustomer(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, response.getStatusCode()); - - final ResponseEntity response2 = - testRestTemplateService.invokeHttpPut(url, TestUtils.getServiceInstance(), Void.class); - assertEquals(HttpStatus.ACCEPTED, response2.getStatusCode()); - } - -} diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/OwningEntityControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/OwningEntityControllerTest.java deleted file mode 100755 index c5baad47..00000000 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/OwningEntityControllerTest.java +++ /dev/null @@ -1,199 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -package org.onap.aaisimulator.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.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL; -import static org.onap.aaisimulator.utils.TestConstants.CUSTOMERS_URL; -import static org.onap.aaisimulator.utils.TestConstants.GLOBAL_CUSTOMER_ID; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_ID; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_SUBSCRIPTIONS_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_TYPE; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import org.junit.After; -import org.junit.Test; -import org.onap.aai.domain.yang.OwningEntity; -import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.RelationshipData; -import org.onap.aai.domain.yang.ServiceInstance; -import org.onap.aaisimulator.models.Format; -import org.onap.aaisimulator.models.Results; -import org.onap.aaisimulator.service.providers.CustomerCacheServiceProvider; -import org.onap.aaisimulator.service.providers.OwnEntityCacheServiceProvider; -import org.onap.aaisimulator.utils.Constants; -import org.onap.aaisimulator.utils.TestConstants; -import org.onap.aaisimulator.utils.TestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -/** - * @author waqas.ikram@ericsson.com - * - */ -public class OwningEntityControllerTest extends AbstractSpringBootTest { - - private static final String OWN_ENTITY_ID_VALUE = "oe_1"; - private static final String OWN_ENTITY_NAME_VALUE = "oe_2"; - - @Autowired - private OwnEntityCacheServiceProvider cacheServiceProvider; - - @Autowired - private CustomerCacheServiceProvider customerCacheServiceProvider; - - @After - public void after() { - cacheServiceProvider.clearAll(); - customerCacheServiceProvider.clearAll(); - } - - @Test - public void test_putOwningEntity_successfullyAddedToCache() throws Exception { - final String url = getUrl(TestConstants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE); - final ResponseEntity actual = - testRestTemplateService.invokeHttpPut(url, TestUtils.getOwningEntity(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, actual.getStatusCode()); - - final ResponseEntity actualResponse = - testRestTemplateService.invokeHttpGet(url, OwningEntity.class); - - assertEquals(HttpStatus.OK, actualResponse.getStatusCode()); - assertTrue(actualResponse.hasBody()); - final OwningEntity actualOwningEntity = actualResponse.getBody(); - assertEquals(OWN_ENTITY_ID_VALUE, actualOwningEntity.getOwningEntityId()); - assertEquals(OWN_ENTITY_NAME_VALUE, actualOwningEntity.getOwningEntityName()); - assertNotNull(actualOwningEntity.getResourceVersion()); - - } - - @Test - public void test_getOwningEntityCount_correctResult() throws Exception { - final String url = getUrl(TestConstants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE); - final ResponseEntity actual = - testRestTemplateService.invokeHttpPut(url, TestUtils.getOwningEntity(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, actual.getStatusCode()); - - final ResponseEntity actualResponse = testRestTemplateService - .invokeHttpGet(url + "?resultIndex=0&resultSize=1&format=" + Format.COUNT.getValue(), Results.class); - - assertEquals(HttpStatus.OK, actualResponse.getStatusCode()); - assertTrue(actualResponse.hasBody()); - final Results result = actualResponse.getBody(); - assertNotNull(result.getValues()); - assertFalse(result.getValues().isEmpty()); - assertEquals(1, result.getValues().get(0).get(Constants.OWNING_ENTITY)); - } - - @Test - public void test_putOwningEntityRelationShip_successfullyAddedToCache() throws Exception { - addCustomerAndServiceInstance(); - - final String url = getUrl(TestConstants.OWNING_ENTITY_URL, OWN_ENTITY_ID_VALUE); - final ResponseEntity actual = - testRestTemplateService.invokeHttpPut(url, TestUtils.getOwningEntity(), Void.class); - assertEquals(HttpStatus.ACCEPTED, actual.getStatusCode()); - - final String owningEntityRelationshipUrl = url + RELATIONSHIP_LIST_RELATIONSHIP_URL; - - final ResponseEntity putResponse = testRestTemplateService.invokeHttpPut(owningEntityRelationshipUrl, - TestUtils.getOwningEntityRelationship(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, putResponse.getStatusCode()); - - final ResponseEntity actualResponse = - testRestTemplateService.invokeHttpGet(url, OwningEntity.class); - - assertEquals(HttpStatus.OK, actualResponse.getStatusCode()); - assertTrue(actualResponse.hasBody()); - final OwningEntity actualOwningEntity = actualResponse.getBody(); - assertEquals(OWN_ENTITY_ID_VALUE, actualOwningEntity.getOwningEntityId()); - assertEquals(OWN_ENTITY_NAME_VALUE, actualOwningEntity.getOwningEntityName()); - assertNotNull(actualOwningEntity.getRelationshipList()); - assertFalse(actualOwningEntity.getRelationshipList().getRelationship().isEmpty()); - assertNotNull(actualOwningEntity.getRelationshipList().getRelationship().get(0)); - - final Relationship actualRelationship = actualOwningEntity.getRelationshipList().getRelationship().get(0); - final List relationshipDataList = actualRelationship.getRelationshipData(); - assertEquals(Constants.BELONGS_TO, actualRelationship.getRelationshipLabel()); - assertFalse(relationshipDataList.isEmpty()); - assertEquals(3, relationshipDataList.size()); - - final RelationshipData globalRelationshipData = - getRelationshipData(relationshipDataList, Constants.CUSTOMER_GLOBAL_CUSTOMER_ID); - assertNotNull(globalRelationshipData); - assertEquals(GLOBAL_CUSTOMER_ID, globalRelationshipData.getRelationshipValue()); - - final RelationshipData serviceSubscriptionRelationshipData = - getRelationshipData(relationshipDataList, Constants.SERVICE_SUBSCRIPTION_SERVICE_TYPE); - assertNotNull(serviceSubscriptionRelationshipData); - assertEquals(SERVICE_TYPE, serviceSubscriptionRelationshipData.getRelationshipValue()); - - final RelationshipData serviceInstanceRelationshipData = - getRelationshipData(relationshipDataList, Constants.SERVICE_INSTANCE_SERVICE_INSTANCE_ID); - assertNotNull(serviceInstanceRelationshipData); - assertEquals(SERVICE_INSTANCE_ID, serviceInstanceRelationshipData.getRelationshipValue()); - - final Optional optional = - customerCacheServiceProvider.getServiceInstance(GLOBAL_CUSTOMER_ID, SERVICE_TYPE, SERVICE_INSTANCE_ID); - assertTrue(optional.isPresent()); - - final ServiceInstance serviceInstance = optional.get(); - - assertNotNull(serviceInstance.getRelationshipList()); - final List serviceRelationshipList = serviceInstance.getRelationshipList().getRelationship(); - assertFalse(serviceRelationshipList.isEmpty()); - assertEquals(1, serviceRelationshipList.size()); - final Relationship relationship = serviceRelationshipList.get(0); - assertEquals(Constants.BELONGS_TO, relationship.getRelationshipLabel()); - assertEquals(TestConstants.OWNING_ENTITY_URL + OWN_ENTITY_ID_VALUE, relationship.getRelatedLink()); - - final List serviceRelationshipDataList = serviceRelationshipList.get(0).getRelationshipData(); - assertFalse(serviceRelationshipDataList.isEmpty()); - assertEquals(1, serviceRelationshipDataList.size()); - - final RelationshipData owningEntityRelationshipData = - getRelationshipData(serviceRelationshipDataList, Constants.OWNING_ENTITY_OWNING_ENTITY_ID); - assertNotNull(owningEntityRelationshipData); - assertEquals(OWN_ENTITY_ID_VALUE, owningEntityRelationshipData.getRelationshipValue()); - - } - - private void addCustomerAndServiceInstance() throws Exception, IOException { - final ResponseEntity customerResponse = - testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), TestUtils.getCustomer(), Void.class); - assertEquals(HttpStatus.ACCEPTED, customerResponse.getStatusCode()); - - final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - final ResponseEntity serviceInstanceResponse = - testRestTemplateService.invokeHttpPut(serviceInstanceUrl, TestUtils.getServiceInstance(), Void.class); - assertEquals(HttpStatus.ACCEPTED, serviceInstanceResponse.getStatusCode()); - - } - -} diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ProjectControllerTest.java b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ProjectControllerTest.java deleted file mode 100755 index 5478ef7c..00000000 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/ProjectControllerTest.java +++ /dev/null @@ -1,205 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ -package org.onap.aaisimulator.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.aaisimulator.utils.Constants.RELATIONSHIP_LIST_RELATIONSHIP_URL; -import static org.onap.aaisimulator.utils.TestConstants.CUSTOMERS_URL; -import static org.onap.aaisimulator.utils.TestConstants.GLOBAL_CUSTOMER_ID; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_ID; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_INSTANCE_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_SUBSCRIPTIONS_URL; -import static org.onap.aaisimulator.utils.TestConstants.SERVICE_TYPE; -import java.io.IOException; -import java.util.List; -import java.util.Optional; -import org.junit.After; -import org.junit.Test; -import org.onap.aai.domain.yang.Project; -import org.onap.aai.domain.yang.Relationship; -import org.onap.aai.domain.yang.RelationshipData; -import org.onap.aai.domain.yang.ServiceInstance; -import org.onap.aaisimulator.models.Results; -import org.onap.aaisimulator.service.providers.CustomerCacheServiceProvider; -import org.onap.aaisimulator.service.providers.ProjectCacheServiceProvider; -import org.onap.aaisimulator.utils.Constants; -import org.onap.aaisimulator.utils.TestConstants; -import org.onap.aaisimulator.utils.TestRestTemplateService; -import org.onap.aaisimulator.utils.TestUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.web.server.LocalServerPort; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; - -/** - * @author waqas.ikram@ericsson.com - * - */ -public class ProjectControllerTest extends AbstractSpringBootTest { - - private static final String PROJECT_NAME_VALUE = "PROJECT_NAME_VALUE"; - - @LocalServerPort - private int port; - - @Autowired - private TestRestTemplateService testRestTemplateService; - - @Autowired - private ProjectCacheServiceProvider cacheServiceProvider; - - @Autowired - private CustomerCacheServiceProvider customerCacheServiceProvider; - - @After - public void after() { - cacheServiceProvider.clearAll(); - customerCacheServiceProvider.clearAll(); - } - - @Test - public void test_putProject_successfullyAddedToCache() throws Exception { - final String url = getUrl(TestConstants.PROJECT_URL, PROJECT_NAME_VALUE); - final ResponseEntity actual = - testRestTemplateService.invokeHttpPut(url, TestUtils.getBusinessProject(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, actual.getStatusCode()); - - final ResponseEntity actualResponse = testRestTemplateService.invokeHttpGet(url, Project.class); - - assertEquals(HttpStatus.OK, actualResponse.getStatusCode()); - assertTrue(actualResponse.hasBody()); - final Project actualProject = actualResponse.getBody(); - assertEquals(PROJECT_NAME_VALUE, actualProject.getProjectName()); - assertNotNull(actualProject.getResourceVersion()); - - } - - @Test - public void test_putProjectRelationShip_successfullyAddedToCache() throws Exception { - addCustomerAndServiceInstance(); - - final String url = getUrl(TestConstants.PROJECT_URL, PROJECT_NAME_VALUE); - final ResponseEntity actual = - testRestTemplateService.invokeHttpPut(url, TestUtils.getBusinessProject(), Void.class); - assertEquals(HttpStatus.ACCEPTED, actual.getStatusCode()); - - final String projectRelationshipUrl = - getUrl(TestConstants.PROJECT_URL, PROJECT_NAME_VALUE, RELATIONSHIP_LIST_RELATIONSHIP_URL); - - final ResponseEntity putResponse = testRestTemplateService.invokeHttpPut(projectRelationshipUrl, - TestUtils.getBusinessProjectRelationship(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, putResponse.getStatusCode()); - - final ResponseEntity actualResponse = testRestTemplateService.invokeHttpGet(url, Project.class); - - assertEquals(HttpStatus.OK, actualResponse.getStatusCode()); - assertTrue(actualResponse.hasBody()); - final Project actualProject = actualResponse.getBody(); - assertEquals(PROJECT_NAME_VALUE, actualProject.getProjectName()); - assertNotNull(actualProject.getRelationshipList()); - assertFalse(actualProject.getRelationshipList().getRelationship().isEmpty()); - assertNotNull(actualProject.getRelationshipList().getRelationship().get(0)); - - final Relationship actualRelationship = actualProject.getRelationshipList().getRelationship().get(0); - final List relationshipDataList = actualRelationship.getRelationshipData(); - assertEquals(Constants.USES, actualRelationship.getRelationshipLabel()); - - assertFalse(relationshipDataList.isEmpty()); - assertEquals(3, relationshipDataList.size()); - - final RelationshipData globalRelationshipData = - getRelationshipData(relationshipDataList, Constants.CUSTOMER_GLOBAL_CUSTOMER_ID); - assertNotNull(globalRelationshipData); - assertEquals(GLOBAL_CUSTOMER_ID, globalRelationshipData.getRelationshipValue()); - - final RelationshipData serviceSubscriptionRelationshipData = - getRelationshipData(relationshipDataList, Constants.SERVICE_SUBSCRIPTION_SERVICE_TYPE); - assertNotNull(serviceSubscriptionRelationshipData); - assertEquals(SERVICE_TYPE, serviceSubscriptionRelationshipData.getRelationshipValue()); - - final RelationshipData serviceInstanceRelationshipData = - getRelationshipData(relationshipDataList, Constants.SERVICE_INSTANCE_SERVICE_INSTANCE_ID); - assertNotNull(serviceInstanceRelationshipData); - assertEquals(SERVICE_INSTANCE_ID, serviceInstanceRelationshipData.getRelationshipValue()); - - final Optional optional = - customerCacheServiceProvider.getServiceInstance(GLOBAL_CUSTOMER_ID, SERVICE_TYPE, SERVICE_INSTANCE_ID); - assertTrue(optional.isPresent()); - - final ServiceInstance serviceInstance = optional.get(); - - assertNotNull(serviceInstance.getRelationshipList()); - final List serviceRelationshipList = serviceInstance.getRelationshipList().getRelationship(); - assertFalse(serviceRelationshipList.isEmpty()); - assertEquals(1, serviceRelationshipList.size()); - final Relationship relationship = serviceRelationshipList.get(0); - assertEquals(Constants.USES, relationship.getRelationshipLabel()); - assertEquals(TestConstants.PROJECT_URL + PROJECT_NAME_VALUE, relationship.getRelatedLink()); - - - final List serviceRelationshipDataList = serviceRelationshipList.get(0).getRelationshipData(); - assertFalse(serviceRelationshipDataList.isEmpty()); - assertEquals(1, serviceRelationshipDataList.size()); - - final RelationshipData projectRelationshipData = - getRelationshipData(serviceRelationshipDataList, Constants.PROJECT_PROJECT_NAME); - assertNotNull(projectRelationshipData); - assertEquals(PROJECT_NAME_VALUE, projectRelationshipData.getRelationshipValue()); - - } - - @Test - public void test_getProjectCount_correctResult() throws Exception { - final String url = getUrl(TestConstants.PROJECT_URL, PROJECT_NAME_VALUE); - final ResponseEntity actual = - testRestTemplateService.invokeHttpPut(url, TestUtils.getBusinessProject(), Void.class); - - assertEquals(HttpStatus.ACCEPTED, actual.getStatusCode()); - - final ResponseEntity actualResponse = - testRestTemplateService.invokeHttpGet(url + "?resultIndex=0&resultSize=1&format=count", Results.class); - - assertEquals(HttpStatus.OK, actualResponse.getStatusCode()); - assertTrue(actualResponse.hasBody()); - final Results result = actualResponse.getBody(); - assertNotNull(result.getValues()); - assertFalse(result.getValues().isEmpty()); - assertEquals(1, result.getValues().get(0).get(Constants.PROJECT)); - } - - - private void addCustomerAndServiceInstance() throws Exception, IOException { - final ResponseEntity customerResponse = - testRestTemplateService.invokeHttpPut(getUrl(CUSTOMERS_URL), TestUtils.getCustomer(), Void.class); - assertEquals(HttpStatus.ACCEPTED, customerResponse.getStatusCode()); - - final String serviceInstanceUrl = getUrl(CUSTOMERS_URL, SERVICE_SUBSCRIPTIONS_URL, SERVICE_INSTANCE_URL); - final ResponseEntity serviceInstanceResponse = - testRestTemplateService.invokeHttpPut(serviceInstanceUrl, TestUtils.getServiceInstance(), Void.class); - assertEquals(HttpStatus.ACCEPTED, serviceInstanceResponse.getStatusCode()); - - } - -} 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 00000000..fc42fa55 --- /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 55247be6..00000000 --- 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 @@ - - - - c0818142-324d-4a8c-8065-45a61df247a5 - EricService - 1.0 - blah - 1594657102313 - - - 4442dfc1-0d2d-46b4-b0bc-a2ac10448269 - EricService - 2.0 - blahhhh - 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-instance-aai.json b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/resources/test-data/service-instance-aai.json new file mode 100644 index 00000000..8ea4263b --- /dev/null +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/test/resources/test-data/service-instance-aai.json @@ -0,0 +1,45 @@ +{ + "service-instance-id": "5df8b6de-2083-11e7-93ae-92361f002676", + "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", + "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/", + "orchestration-status": "Assigned", + "relationship-list": { + "relationship": [ + { + "related-to": "owning-entity", + "related-link": "/aai/v11/business/owning-entities/owning-entity/67f2e84c-734d-4e90-a1e4-d2ffa2e75849", + "relationship-data": [ + { + "relationship-key": "owning-entity.owning-entity-id", + "relationship-value": "67f2e84c-734d-4e90-a1e4-d2ffa2e75849" + } + ] + }, + { + "related-to": "pnf", + "related-link": "/aai/v11/network/pnfs/pnf/PNFDemo", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "PNFDemo" + } + ] + }, + { + "related-to": "pnf", + "related-link": "/aai/v11/network/pnfs/pnf/PNFDemo1", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "PNFDemo1" + } + ] + } + ] + } +} \ 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 ed5f6f07..de90c1f3 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_WORKAROUND_SCRIPT=$CONFIG_DIR/"wait-for-workaround-job.sh" 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 @@ export CONFIG_DIR_PATH=$CONFIG_DIR 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/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/teardown.sh b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/teardown.sh index a9d9bdd5..7257b366 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/teardown.sh +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/teardown.sh @@ -1,10 +1,10 @@ #!/bin/bash -source $SO_DOCKER_PATH/so_teardown.sh +echo 'Stop, Removing all running containers...' +docker stop $(docker ps -aq) && docker rm $(docker ps -aq) -source $SDNC_DOCKER_PATH/sdn_teardown.sh +echo 'Removing Volumes...' +echo y | docker volume prune -source $CDS_DOCKER_PATH/cds_teardown.sh - -PNFSIM_DOCKER_COMPOSE_PATH=$PNF_SIM_DOCKER_PATH/docker-compose.yml -docker-compose -f $PNFSIM_DOCKER_COMPOSE_PATH -p $PROJECT_NAME down +echo 'Removing Networks...' +echo y | docker network prune \ No newline at end of file diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/test.properties b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/test.properties index f4890902..e81100fc 100644 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/test.properties +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/test.properties @@ -13,5 +13,4 @@ SO_DOCKER_PATH=$TC_PLANS_PATH/sorch PROJECT_NAME=pnfSwU SDNC_IMAGE_TAG=1.8.1 -BP_IMAGE_TAG=0.7.1 NETOPEER_IMAGE_TAG=v2.5.0 \ No newline at end of file diff --git a/run-csit.sh b/run-csit.sh index 52d16932..ce9cf80f 100755 --- a/run-csit.sh +++ b/run-csit.sh @@ -26,13 +26,13 @@ function on_exit(){ rc=$? if [[ ${WORKSPACE} ]]; then if [[ ${WORKDIR} ]]; then - rsync -av "$WORKDIR/" "$WORKSPACE/archives" + rsync -av "$WORKDIR/" "$WORKSPACE/archives/$TESTPLAN" fi # Record list of active docker containers - docker ps --format "{{.Image}}" > "$WORKSPACE/archives/_docker-images.log" + docker ps --format "{{.Image}}" > "$WORKSPACE/archives/$TESTPLAN/_docker-images.log" # show memory consumption after all docker instances initialized - docker_stats | tee "$WORKSPACE/archives/_sysinfo-2-after-robot.txt" + docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-2-after-robot.txt" fi # Run teardown script plan if it exists cd "${TESTPLANDIR}" @@ -135,9 +135,6 @@ if [ -z "$WORKSPACE" ]; then export WORKSPACE=$(git rev-parse --show-toplevel) fi -rm -rf "$WORKSPACE/archives" -mkdir -p "$WORKSPACE/archives" - if [ -f "${WORKSPACE}/${1}/testplan.txt" ]; then export TESTPLAN="${1}" else @@ -147,6 +144,9 @@ fi export TESTOPTIONS="${2}" +rm -rf "$WORKSPACE/archives/$TESTPLAN" +mkdir -p "$WORKSPACE/archives/$TESTPLAN" + TESTPLANDIR="${WORKSPACE}/${TESTPLAN}" # Run installation of prerequired libraries @@ -175,7 +175,7 @@ if [ -f "${SETUP}" ]; then fi # show memory consumption after all docker instances initialized -docker_stats | tee "$WORKSPACE/archives/_sysinfo-1-after-setup.txt" +docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-1-after-setup.txt" # Run test plan cd "$WORKDIR" diff --git a/scripts/ccsdk/healthcheck/health_check.sh b/scripts/ccsdk/healthcheck/health_check.sh deleted file mode 100644 index aed3b5ab..00000000 --- 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/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh index 38b78f2d..224a5368 100755 --- a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh +++ b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh @@ -25,7 +25,6 @@ set -x DOCKER_SIM_NWNAME="dfcnet" echo "Creating docker network $DOCKER_SIM_NWNAME, if needed" docker network ls | grep $DOCKER_SIM_NWNAME >/dev/null || docker network create $DOCKER_SIM_NWNAME - docker-compose up -d DFC_APP="$(docker ps -q --filter='name=dfc_app0')" diff --git a/scripts/dcaegen2-services-slice-analysis-ms/Dockerfile b/scripts/dcaegen2-services-slice-analysis-ms/Dockerfile new file mode 100644 index 00000000..52d54a57 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/Dockerfile @@ -0,0 +1,15 @@ +FROM python:alpine3.7 + +ADD configdb-sim.py / + +ADD ./sim-data / + +RUN pip install Flask --trusted-host pypi.org --trusted-host files.pythonhosted.org + +RUN pip install requests --trusted-host pypi.org --trusted-host files.pythonhosted.org + +EXPOSE 5000 + +CMD ["flask", "run", "--host", "0.0.0.0"] + +CMD [ "python", "./configdb-sim.py" ] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/configdb-sim.py b/scripts/dcaegen2-services-slice-analysis-ms/configdb-sim.py new file mode 100644 index 00000000..bcda08d5 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/configdb-sim.py @@ -0,0 +1,115 @@ +import flask +import json +from flask import Flask, render_template +from flask import request +from flask import jsonify +import requests +import threading +import time + +app = flask.Flask(__name__) +app.config["DEBUG"] = True + + +def get_du_list_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('du_list_001_00110.json') as du_list: + data = json.load(du_list) + else: + with open('du_list_001_010000.json') as du_list: + data = json.load(du_list) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_du_cell_list_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('du_cell_list_001_00110.json') as du_cell_list: + data = json.load(du_cell_list) + else: + with open('du_cell_list_001_010000.json') as du_cell_list: + data = json.load(du_cell_list) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_slice_config_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('slice_config_001_00110.json') as slice_config: + data = json.load(slice_config) + else: + with open('slice_config_001_010000.json') as slice_config: + data = json.load(slice_config) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_profile_config_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('profile_config_001_00110.json') as profile_config: + data = json.load(profile_config) + else: + with open('profile_config_001_010000.json') as profile_config: + data = json.load(profile_config) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_subscriber_details_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('subscriber-details_001_00110.json') as subscriber_details: + data = json.load(subscriber_details) + else: + with open('subscriber-details_001_010000.json') as subscriber_details: + data = json.load(subscriber_details) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +@app.route("/api/sdnc-config-db/v4/du-list/", methods=["GET"]) +def get_du_list(snssai): + data, status = get_du_list_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/du-cell-list/", methods=["GET"]) +def get_du_cell_list(snssai): + data, status = get_du_cell_list_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/slice-config/", methods=["GET"]) +def get_slice_config(snssai): + data, status = get_slice_config_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/profile-config/", methods=["GET"]) +def get_profile_config(snssai): + data, status = get_profile_config_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/subscriber-details/", + methods=["GET"]) +def get_subscriber_details(snssai): + data, status = get_subscriber_details_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +app.run(host='0.0.0.0') diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_00110.json new file mode 100644 index 00000000..f01f0b98 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_00110.json @@ -0,0 +1,111 @@ +{ + +"11":[ + +{ + +"cellLocalId":103593999, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T07:02:28.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +}, + +{ + +"cellLocalId":103593989, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:03:56.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +} + +] + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_010000.json new file mode 100644 index 00000000..54b2b7c5 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_010000.json @@ -0,0 +1,323 @@ +{ + + "22":[ + + { + + "cellLocalId":112951562, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951561, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951568, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "11":[ + + { + + "cellLocalId":95697174, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697175, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697155, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ] + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_00110.json new file mode 100644 index 00000000..a4c6f2ff --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_00110.json @@ -0,0 +1,129 @@ +[ + +{ + +"gNBDUId":1, + +"gNBId":98763, + +"gNBIdLength":5, + +"gNBDUName":"gnduserver1", + +"pLMNId":"310-410", + +"nFType":"DU", + +"cellDUList":[ + +{ + +"cellLocalId":103593989, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:03:56.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +}, + +{ + +"cellLocalId":103593999, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T07:02:28.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +} + +], + +"nearRTRICId":null + +} + +] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_010000.json new file mode 100644 index 00000000..82d7fb1a --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_010000.json @@ -0,0 +1,359 @@ +[ + + { + + "gNBDUId":2, + + "gNBId":98763, + + "gNBIdLength":5, + + "gNBDUName":"gnduserver2", + + "pLMNId":"310-410", + + "nFType":"DU", + + "cellDUList":[ + + { + + "cellLocalId":95697155, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697174, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697175, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "nearRTRICId":null + + }, + + { + + "gNBDUId":4, + + "gNBId":98763, + + "gNBIdLength":5, + + "gNBDUName":"gnduserver4", + + "pLMNId":"310-410", + + "nFType":"DU", + + "cellDUList":[ + + { + + "cellLocalId":112951561, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951562, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951568, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "nearRTRICId":null + + } + +] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_00110.json new file mode 100644 index 00000000..533095fc --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_00110.json @@ -0,0 +1,9 @@ +{ + +"maxNumberOfConns":3000, + +"dLThptPerSlice":50, + +"uLThptPerSlice":40 + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_010000.json new file mode 100644 index 00000000..422a6fa3 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_010000.json @@ -0,0 +1,9 @@ +{ + + "maxNumberOfConns":3000, + + "dLThptPerSlice":54, + + "uLThptPerSlice":60 + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_00110.json new file mode 100644 index 00000000..013318a2 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_00110.json @@ -0,0 +1,15 @@ +{ + +"11":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:01:34.000+0000" + +} + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_010000.json new file mode 100644 index 00000000..7d326c20 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_010000.json @@ -0,0 +1,27 @@ +{ + + "22":{ + + "dLThptPerSlice":27, + + "uLThptPerSlice":30, + + "maxNumberOfConns":3000, + + "lastUpdatedTS":"2020-11-03T07:40:45.000+0000" + + }, + + "11":{ + + "dLThptPerSlice":27, + + "uLThptPerSlice":30, + + "maxNumberOfConns":3000, + + "lastUpdatedTS":"2020-11-03T07:40:28.000+0000" + + } + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_00110.json new file mode 100644 index 00000000..5149513e --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_00110.json @@ -0,0 +1,13 @@ +{ + +"subscriptionServiceType":"Premium", + +"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd", + +"ranNFNSSIId":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82", + +"globalSubscriberId":"Customer-001", + +"sNSSAI":"001-00110" + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_010000.json new file mode 100644 index 00000000..e7026672 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_010000.json @@ -0,0 +1,13 @@ +{ + + "subscriptionServiceType":"Premium", + + "sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd", + + "ranNFNSSIId":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82", + + "globalSubscriberId":"Customer-001", + + "sNSSAI":"001-010000" + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile new file mode 100644 index 00000000..52d54a57 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile @@ -0,0 +1,15 @@ +FROM python:alpine3.7 + +ADD configdb-sim.py / + +ADD ./sim-data / + +RUN pip install Flask --trusted-host pypi.org --trusted-host files.pythonhosted.org + +RUN pip install requests --trusted-host pypi.org --trusted-host files.pythonhosted.org + +EXPOSE 5000 + +CMD ["flask", "run", "--host", "0.0.0.0"] + +CMD [ "python", "./configdb-sim.py" ] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py new file mode 100644 index 00000000..bcda08d5 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py @@ -0,0 +1,115 @@ +import flask +import json +from flask import Flask, render_template +from flask import request +from flask import jsonify +import requests +import threading +import time + +app = flask.Flask(__name__) +app.config["DEBUG"] = True + + +def get_du_list_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('du_list_001_00110.json') as du_list: + data = json.load(du_list) + else: + with open('du_list_001_010000.json') as du_list: + data = json.load(du_list) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_du_cell_list_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('du_cell_list_001_00110.json') as du_cell_list: + data = json.load(du_cell_list) + else: + with open('du_cell_list_001_010000.json') as du_cell_list: + data = json.load(du_cell_list) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_slice_config_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('slice_config_001_00110.json') as slice_config: + data = json.load(slice_config) + else: + with open('slice_config_001_010000.json') as slice_config: + data = json.load(slice_config) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_profile_config_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('profile_config_001_00110.json') as profile_config: + data = json.load(profile_config) + else: + with open('profile_config_001_010000.json') as profile_config: + data = json.load(profile_config) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_subscriber_details_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('subscriber-details_001_00110.json') as subscriber_details: + data = json.load(subscriber_details) + else: + with open('subscriber-details_001_010000.json') as subscriber_details: + data = json.load(subscriber_details) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +@app.route("/api/sdnc-config-db/v4/du-list/", methods=["GET"]) +def get_du_list(snssai): + data, status = get_du_list_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/du-cell-list/", methods=["GET"]) +def get_du_cell_list(snssai): + data, status = get_du_cell_list_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/slice-config/", methods=["GET"]) +def get_slice_config(snssai): + data, status = get_slice_config_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/profile-config/", methods=["GET"]) +def get_profile_config(snssai): + data, status = get_profile_config_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/subscriber-details/", + methods=["GET"]) +def get_subscriber_details(snssai): + data, status = get_subscriber_details_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +app.run(host='0.0.0.0') diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_00110.json new file mode 100644 index 00000000..f01f0b98 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_00110.json @@ -0,0 +1,111 @@ +{ + +"11":[ + +{ + +"cellLocalId":103593999, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T07:02:28.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +}, + +{ + +"cellLocalId":103593989, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:03:56.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +} + +] + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_010000.json new file mode 100644 index 00000000..54b2b7c5 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_010000.json @@ -0,0 +1,323 @@ +{ + + "22":[ + + { + + "cellLocalId":112951562, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951561, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951568, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "11":[ + + { + + "cellLocalId":95697174, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697175, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697155, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ] + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_00110.json new file mode 100644 index 00000000..a4c6f2ff --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_00110.json @@ -0,0 +1,129 @@ +[ + +{ + +"gNBDUId":1, + +"gNBId":98763, + +"gNBIdLength":5, + +"gNBDUName":"gnduserver1", + +"pLMNId":"310-410", + +"nFType":"DU", + +"cellDUList":[ + +{ + +"cellLocalId":103593989, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:03:56.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +}, + +{ + +"cellLocalId":103593999, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T07:02:28.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +} + +], + +"nearRTRICId":null + +} + +] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_010000.json new file mode 100644 index 00000000..82d7fb1a --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_010000.json @@ -0,0 +1,359 @@ +[ + + { + + "gNBDUId":2, + + "gNBId":98763, + + "gNBIdLength":5, + + "gNBDUName":"gnduserver2", + + "pLMNId":"310-410", + + "nFType":"DU", + + "cellDUList":[ + + { + + "cellLocalId":95697155, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697174, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697175, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "nearRTRICId":null + + }, + + { + + "gNBDUId":4, + + "gNBId":98763, + + "gNBIdLength":5, + + "gNBDUName":"gnduserver4", + + "pLMNId":"310-410", + + "nFType":"DU", + + "cellDUList":[ + + { + + "cellLocalId":112951561, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951562, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951568, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "nearRTRICId":null + + } + +] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_00110.json new file mode 100644 index 00000000..533095fc --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_00110.json @@ -0,0 +1,9 @@ +{ + +"maxNumberOfConns":3000, + +"dLThptPerSlice":50, + +"uLThptPerSlice":40 + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_010000.json new file mode 100644 index 00000000..422a6fa3 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_010000.json @@ -0,0 +1,9 @@ +{ + + "maxNumberOfConns":3000, + + "dLThptPerSlice":54, + + "uLThptPerSlice":60 + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_00110.json new file mode 100644 index 00000000..013318a2 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_00110.json @@ -0,0 +1,15 @@ +{ + +"11":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:01:34.000+0000" + +} + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_010000.json new file mode 100644 index 00000000..7d326c20 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_010000.json @@ -0,0 +1,27 @@ +{ + + "22":{ + + "dLThptPerSlice":27, + + "uLThptPerSlice":30, + + "maxNumberOfConns":3000, + + "lastUpdatedTS":"2020-11-03T07:40:45.000+0000" + + }, + + "11":{ + + "dLThptPerSlice":27, + + "uLThptPerSlice":30, + + "maxNumberOfConns":3000, + + "lastUpdatedTS":"2020-11-03T07:40:28.000+0000" + + } + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_00110.json new file mode 100644 index 00000000..5149513e --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_00110.json @@ -0,0 +1,13 @@ +{ + +"subscriptionServiceType":"Premium", + +"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd", + +"ranNFNSSIId":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82", + +"globalSubscriberId":"Customer-001", + +"sNSSAI":"001-00110" + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_010000.json new file mode 100644 index 00000000..e7026672 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_010000.json @@ -0,0 +1,13 @@ +{ + + "subscriptionServiceType":"Premium", + + "sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd", + + "ranNFNSSIId":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82", + + "globalSubscriberId":"Customer-001", + + "sNSSAI":"001-010000" + +} diff --git a/scripts/dmaap-buscontroller/dmaapbc-init.sh b/scripts/dmaap-buscontroller/dmaapbc-init.sh index 804603f2..5e9cbb1e 100755 --- a/scripts/dmaap-buscontroller/dmaapbc-init.sh +++ b/scripts/dmaap-buscontroller/dmaapbc-init.sh @@ -1,56 +1,38 @@ #!/bin/bash # $1 is the IP address of the buscontroller -# $2 is the IP address of the DRPS -# $3 is the IP address of the MRC -# $4 is the protocol (defaults to http) - -PROTO=${4:-http} -if [ "$PROTO" = "http" ] -then - PORT=8080 - CURLOPT="-v" - MRPORT=3904 - DRPORT=8080 -else - PORT=8443 - CURLOPT="-v -k" - MRPORT=3905 - DRPORT=8443 -fi # INITIALIZE: dmaap object JSON=/tmp/$$.dmaap cat << EOF > $JSON { - "version": "1", - "topicNsRoot": "org.onap.dmaap", - "drProvUrl": "${PROTO}://dmaap-dr-prov:${DRPORT}", - "dmaapName": "onapCSIT", - "bridgeAdminTopic": "MM_AGENT_PROV" + "version": "1", + "topicNsRoot": "org.onap.dmaap", + "drProvUrl": "https://dmaap-dr-prov:8443", + "dmaapName": "onapCSIT", + "bridgeAdminTopic": "MM_AGENT_PROV" } EOF echo "Initializing /dmaap endpoint" -curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/dmaap - +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/dmaap # INITIALIZE: dcaeLocation object JSON=/tmp/$$.loc cat << EOF > $JSON { - "dcaeLocationName": "csit-sanfrancisco", - "dcaeLayer": "central-cloud", - "clli": "CSIT12345", - "zone": "zoneA" + "dcaeLocationName": "csit-sanfrancisco", + "dcaeLayer": "central-cloud", + "clli": "CSIT12345", + "zone": "zoneA" } EOF echo "Initializing /dcaeLocations endpoint" -curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/dcaeLocations +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/dcaeLocations # INITIALIZE: MR object in 1 site @@ -64,13 +46,13 @@ DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+' | head -1 ) JSON=/tmp/$$.mrc cat << EOF > $JSON { - "dcaeLocationName": "csit-sanfrancisco", - "fqdn": "$DOCKER_HOST", - "topicProtocol" : "http", - "topicPort": "${MRPORT}" + "dcaeLocationName": "csit-sanfrancisco", + "fqdn": "message-router", + "topicProtocol" : "http", + "topicPort": "3904" } EOF echo "Initializing /mr_clusters endpoint" -curl ${CURLOPT} -X POST -d @${JSON} -H "Content-Type: application/json" ${PROTO}://$1:${PORT}/webapi/mr_clusters +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/mr_clusters diff --git a/scripts/dmaap-buscontroller/dmaapbc-launch.sh b/scripts/dmaap-buscontroller/dmaapbc-launch.sh index 0a653fa1..3e446d89 100755 --- a/scripts/dmaap-buscontroller/dmaapbc-launch.sh +++ b/scripts/dmaap-buscontroller/dmaapbc-launch.sh @@ -4,34 +4,23 @@ # sets global var IP with assigned IP address function dmaapbc_launch() { - TAG="nexus3.onap.org:10001/onap/dmaap/buscontroller" - CONTAINER_NAME=dmaapbc - IP="" + export dmaap_prov_ip=$1 + export dmaap_mr_ip=$1 + cd ${WORKSPACE}/scripts/dmaap-buscontroller/docker-compose + docker-compose -f docker-compose-bc.yml up -d - cd ${WORKSPACE}/scripts/dmaap-buscontroller + sleep 10 - TMP_CFG=/tmp/docker-databus-controller.conf - . ./onapCSIT.env > $TMP_CFG - ADDHOSTS="" - if [ ! -z "$2" ] - then - ADDHOSTS="$ADDHOSTS --add-host=message-router:$2" - fi - if [ ! -z "$3" ] - then - ADDHOSTS="$ADDHOSTS --add-host=dmaap-dr-prov:$3" - fi - docker run -d $ADDHOSTS --name $CONTAINER_NAME -v $TMP_CFG:/opt/app/config/conf $TAG - IP=`get-instance-ip.sh ${CONTAINER_NAME}` + DMAAP_BC_IP=`get-instance-ip.sh dmaap-bc` source ${SCRIPTS}/common_functions.sh - bypass_ip_adress ${IP} + bypass_ip_adress ${DMAAP_BC_IP} - # Wait for initialization - for i in {1..10}; do - curl -sS ${IP}:8080 && break - echo sleep $i - sleep $i - done + # Wait for initialization + for i in 1 2 3 4 5 6 7 8 9 10; do + curl -sS ${DMAAP_BC_IP}:8080 && break + echo sleep ${i} + sleep ${i} + done } diff --git a/scripts/dmaap-buscontroller/docker-compose/buscontroller.env b/scripts/dmaap-buscontroller/docker-compose/buscontroller.env new file mode 100644 index 00000000..cc3a3c7d --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/buscontroller.env @@ -0,0 +1,4 @@ +DMAAPBC_WAIT_TO_EXIT=Y +DMAAPBC_PG_ENABLED=false +DMAAPBC_CSIT=Yes +DMAAPBC_KSTOREFILE=/opt/app/osaaf/local/org.onap.dmaap-bc.jks \ No newline at end of file diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props new file mode 100644 index 00000000..52536a14 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props @@ -0,0 +1,17 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:38:49.244+0000 +# @copyright 2019, AT&T +############################################################ +Challenge=secret +cadi_alias=dmaap-bc@dmaap-bc.onap.org +cadi_key_password=secret +#cadi_keyfile=/opt/app/osaaf/local/org.onap.dmaap-dr.keyfile +cadi_keystore=/opt/app/osaaf/local/org.onap.dmaap-bc.jks +cadi_keystore_password=secret +cadi_keystore_password_jks=secret +cadi_keystore_password_p12=secret +cadi_truststore=/opt/app/osaaf/local/truststore.jks +cadi_truststore_password=secret +cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks new file mode 100644 index 00000000..ca8301ca Binary files /dev/null and b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks differ diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props new file mode 100644 index 00000000..a8374dc7 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props @@ -0,0 +1,8 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:25:54.608+0000 +# @copyright 2019, AT&T +############################################################ +cadi_latitude=38.0 +cadi_longitude=-72.0 diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props new file mode 100644 index 00000000..f3747fad --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props @@ -0,0 +1,24 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:25:54.617+0000 +# @copyright 2019, AT&T +############################################################ +aaf_env=DEV +aaf_id=dmaap-bc@dmaap-bc.onap.org +aaf_locate_url=https://aaf-locate.onap:8095 +aaf_locator_app_ns=org.osaaf.aaf +aaf_locator_container=oom +aaf_locator_container_ns=onap +aaf_locator_fqdn=dmaap-bc +aaf_locator_public_fqdn=aaf.osaaf.org +aaf_oauth2_introspect_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.introspect:2.1/introspect +aaf_oauth2_token_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.token:2.1/token +aaf_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.service:2.1 +aaf_url_cm=https://AAF_LOCATE_URL/%CNS.%AAF_NS.cm:2.1 +aaf_url_fs=https://AAF_LOCATE_URL/%CNS.%AAF_NS.fs:2.1 +aaf_url_gui=https://AAF_LOCATE_URL/%CNS.%AAF_NS.gui:2.1 +aaf_url_hello=https://aaf-locate.onap:8095/locate/onap.org.osaaf.aaf.hello:2.1 +aaf_url_oauth=https://AAF_LOCATE_URL/%CNS.%AAF_NS.oauth:2.1 +cadi_prop_files=/opt/app/osaaf/local/org.onap.dmaap-bc.location.props:/opt/app/osaaf/local/org.onap.dmaap-bc.cred.props +cadi_protocols=TLSv1.1,TLSv1.2 diff --git a/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks new file mode 100644 index 00000000..91547c60 Binary files /dev/null and b/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks differ diff --git a/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties b/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties new file mode 100644 index 00000000..611a172f --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties @@ -0,0 +1,168 @@ + +##################################################### +# +# Hooks for specific environment configurations +# +##################################################### +# Indicator for whether to use AAF for authentication +UseAAF: false + +# Stub out southbound calls for Unit Test cases to run. e.g. not timeout +# Comment out in other environments to get default (No) +#UnitTest: Yes + + +##################################################### +# +# Settings for Southbound API: Datarouter +# +##################################################### + +# URI to retrieve dynamic DR configuration +ProvisioningURI: /internal/prov + +# indicator for handling feed delete: +# DeleteOnDR - means use the DR API to DELETE a feed. (default for backwards compatibility) +# SimulateDelete - means preserve the feed on DR (after cleaning it up), and mark as DELETED in DBCL. Better for cloudify environments. +Feed.deleteHandling: SimulateDelete + +########################################################### +# The following properties default to match ONAP DR instance. +# However, there are some non-ONAP DR instances that require other values. +# Sets the X-DR-ON-BEHALF-OF HTTP Header value +#DR.onBehalfHeader: +# Value for the Content-Type Header in DR Feed API +#DR.feedContentType: +# Value for the Content-Type Header in DR Subscription API +#DR.subContentType: +# +# END OF properties helpful for non-ONAP DR instance. +############################################################ + +##################################################### +# +# Settings for Soutbound API: Postgresql +# +##################################################### +# flag indicates if we are using postgresql +UsePGSQL: false + + +##################################################### +# +# Settings for Soutbound API: Message Router +# +##################################################### +# indicator for multi-site (locations) deployment. Give clue to buscontroller whether +# there is a need for message replication between edge and central. +# ONAP Casablanca is a single site deployment +MR.multisite: false + +# FQDN of primary message router. +# In ONAP Casablanca, there is only 1 message router service, so use that. +# In a multi-site, MR cluster deployment, use the CNAME DNS entry which resolves to the primary central MR +MR.CentralCname: message-router + +# Indicator for whether we want hostname verification on SSL connection to MR +MR.hostnameVerify: false + + +# MR Client Delete Level thoroughness: +# 0 = don't delete +# 1 = delete from persistent store +# 2 = delete from persistent store (DB) and authorization store (AAF) +MR.ClientDeleteLevel: 1 + +# namespace of MR Topic Factory +MR.TopicFactoryNS: org.onap.dmaap.mr.topicFactory + +# AAF Role assigned to Topic Manager Identity +MR.TopicMgrRole: org.onap.dmaap-bc-topic-mgr.client + +# MR topic ProjectID (used in certain topic name generation formats) +MR.projectID: mr + +# Use Basic Authentication when provisioning topics +MR.authentication: basicAuth + +# MR topic name style (default is FQTN_LEGACY_FORMAT) +#MR.topicStyle: FQTN_LEGACY_FORMAT +# +# end of MR Related Properties +################################################################################ + + +##################################################### +# +# Settings for Southbound API: AAF proxy +# +##################################################### +# URL of the AAF server +aaf.URL: {{ .Values.aafURL }} + +# TopicMgr Identity +aaf.TopicMgrUser: {{ .Values.topicMgrUser }} + +# Password for TopicMgr identity +aaf.TopicMgrPassword: {{ .Values.topicMgrPwd }} + +# Buscontroller Admin Identity +aaf.AdminUser: {{ .Values.adminUser }} + +# Admin Password +aaf.AdminPassword: {{ .Values.adminPwd }} + +# Identity that is owner of any created namespaces for topics +aaf.NsOwnerIdentity: {{ .Values.adminUser }} + + +# +# endof AAF Properties +#################################################### + + +##################################################### +# +# Settings for authorization of DBCAPI +# +##################################################### +# Namespace for URI values for the API used to create AAF permissions +# e.g. if ApiNamespace is X.Y.dmaapbc.api then for URI /mr_clients we create AAF perm X.Y.dmaapbc.api.mr_clients +ApiNamespace: org.onap.dmaap-bc.api + +# If API authorization is required, then implement a class to enforce it. +# This overrides the Class used for API permission check. +ApiPermission.Class: org.onap.dmaap.dbcapi.authentication.AllowAll + + +##################################################### +# +# Certificate Management +# +##################################################### + +# Indicates how we are expecting certificates to be provided: +# cadi - a set of artifacts will be downloaded from AAF at deployment time, and details will be in a cadi properties file +# legacy (default) - artifacts will be installed manually or some other way and details will be in this file +CertificateManagement: cadi + +# When CertificateManagement is cadi, then this is where all the cadi properties will be. +# Note that the cadi properties include where the cert is, and the encrypted passwords to read. +cadi.properties: /opt/app/osaaf/local/org.onap.dmaap-bc.props + + +##################################################### +# +# HTTP Server Configuration +# +##################################################### + +# Allow http access to dbcapi +HttpAllowed: true + +# listen to http port within this container (server) +IntHttpPort: 8080 + +# listen to https port within this container (server) +# set to 0 if no certificates are available. +IntHttpsPort: 8443 diff --git a/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml b/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml new file mode 100644 index 00000000..7357f900 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml @@ -0,0 +1,25 @@ +version: '2.1' +services: + dmaap-bc: + container_name: dmaap-bc + hostname: dmaap-bc + image: nexus3.onap.org:10001/onap/dmaap/dmaap-bc + ports: + - "30241:8080" + - "30242:8443" + volumes: + - ./buscontroller.env:/opt/app/config/conf/buscontroller.env + - ./dmaapbc.properties:/opt/app/config/conf/dmaapbc.properties + - ./cadi_aaf:/opt/app/osaaf/local + - ./logback.xml:/opt/app/dmaapbc/etc/logback.xml + networks: + dockercompose_net: + aliases: + - dmaap-bc + extra_hosts: + - dmaap-dr-prov:$dmaap_prov_ip + - message-router:$dmaap_prov_ip + +networks: + dockercompose_net: + external: true diff --git a/scripts/dmaap-buscontroller/docker-compose/logback.xml b/scripts/dmaap-buscontroller/docker-compose/logback.xml new file mode 100644 index 00000000..9e8492b1 --- /dev/null +++ b/scripts/dmaap-buscontroller/docker-compose/logback.xml @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${defaultPattern} + + + + + + + + + + + + ${logDirectory}/${generalLogName}.log + + ${logDirectory}/${generalLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + + 256 + + + + + + ${logDirectory}/${securityLogName}.log + + ${logDirectory}/${securityLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + + 256 + 0 + + + + + + ${logDirectory}/${performanceLogName}.log + + ${logDirectory}/${performanceLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + 256 + + + + + + ${logDirectory}/${serverLogName}.log + + ${logDirectory}/${serverLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + 256 + + + + + + + ${logDirectory}/${policyLogName}.log + + ${logDirectory}/${policyLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + 256 + + + + + + + + ${logDirectory}/${auditLogName}.log + + ${logDirectory}/${auditLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${auditLoggerPattern} + + + + 256 + + + + + ${logDirectory}/${metricsLogName}.log + + ${logDirectory}/${metricsLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${metricsLoggerPattern} + + + + + + 256 + + + + + ${logDirectory}/${errorLogName}.log + + ${logDirectory}/${errorLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${errorLoggerPattern} + + + + + 256 + + + + + ${debugLogDirectory}/${debugLogName}.log + + ${debugLogDirectory}/${debugLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${debugLoggerPattern} + + + + + 256 + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/dmaap-buscontroller/dr-launch.sh b/scripts/dmaap-buscontroller/dr-launch.sh deleted file mode 100644 index bba1b73d..00000000 --- a/scripts/dmaap-buscontroller/dr-launch.sh +++ /dev/null @@ -1,58 +0,0 @@ - -#!/bin/bash - -#!/bin/bash - -# script to launch DMaaP DR docker containers -# sets global var IP with assigned IP address of DR Prov - -function dmaap_dr_launch() { - IP="" - - - # This next section was copied from scripts/dmaap-datarouter/dr-suite/setup.sh - # and slightly modified... - - # Clone DMaaP Data Router repo - mkdir -p $WORKSPACE/archives/dmaapdr - cd $WORKSPACE/archives/dmaapdr - - git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master - cd datarouter - git pull - cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources - - # start DMaaP DR containers with docker compose and configuration from docker-compose.yml - docker login -u docker -p docker nexus3.onap.org:10001 - docker-compose up -d - - # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb - for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' mariadb) ] - then - echo "DR Service Running" - break - else - echo sleep $i - sleep $i - fi - done - - DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov) - DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node) - DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) - - echo DR_PROV_IP=${DR_PROV_IP} - echo DR_NODE_IP=${DR_NODE_IP} - echo DR_GATEWAY_IP=${DR_GATEWAY_IP} - - docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" - docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" - - #Pass any variables required by Robot test suites in ROBOT_VARIABLES - ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP}" - - IP=${DR_GATEWAY_IP} -} diff --git a/scripts/dmaap-buscontroller/init-mock-aaf.sh b/scripts/dmaap-buscontroller/init-mock-aaf.sh deleted file mode 100755 index f25404ce..00000000 --- a/scripts/dmaap-buscontroller/init-mock-aaf.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -# $1 is the IP address of the AAF mock server - -#curl -v -X PUT -d @- http://$1:1080/expectation << EOF -#{ -# "httpRequest": { -# "method": "GET", -# "path": "/hello" -# }, -# "httpResponse": { -# "body": "Hello world!", -# "statusCode": 200 -# }, -# "times" : { -# "unlimited" : true -# } -#} -#EOF -# "httpRequest": { -# "method": "POST", -# "path": "/proxy/authz/.*" -# }, - -curl -v -X PUT -d @- http://$1:1080/expectation << EOF -{ - "httpRequest": { - "method": ".*", - "path": "/.*" - }, - "httpResponse": { - "body": "Hello world!", - "statusCode": 200 - }, - "times" : { - "unlimited" : true - } -} -EOF - -#curl -v -X PUT -d @- http://$1:1080/expectation << EOF -#{ -# "httpRequest": { -# "method": "POST", -# "path": "/proxy/authz/role/perm" -# }, -# "httpResponse": { -# "body": "Hello world!", -# "statusCode": 200 -# } -#} -#EOF - diff --git a/scripts/dmaap-buscontroller/init-mock-drps.sh b/scripts/dmaap-buscontroller/init-mock-drps.sh deleted file mode 100755 index e0f1d0f1..00000000 --- a/scripts/dmaap-buscontroller/init-mock-drps.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# $1 is the IP address of the DRPS (Data Router Provisioning Server) mock server - -curl -v -X PUT -d @- http://$1:1080/expectation << EOF -{ - "httpRequest": { - "method": "GET", - "path": "/hello" - }, - "httpResponse": { - "body": "Hello world!", - "statusCode": 200 - } -} -EOF - diff --git a/scripts/dmaap-buscontroller/init-mock-mrc.sh b/scripts/dmaap-buscontroller/init-mock-mrc.sh deleted file mode 100755 index 75c1a419..00000000 --- a/scripts/dmaap-buscontroller/init-mock-mrc.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# $1 is the IP address of the MRC (MR Central) mock server - -curl -v -X PUT -d @- http://$1:1080/expectation << EOF -{ - "httpRequest": { - "method": "GET", - "path": "/hello" - }, - "httpResponse": { - "body": "Hello world!", - "statusCode": 200 - } -} -EOF - diff --git a/scripts/dmaap-buscontroller/onapCSIT.env b/scripts/dmaap-buscontroller/onapCSIT.env deleted file mode 100644 index db865818..00000000 --- a/scripts/dmaap-buscontroller/onapCSIT.env +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# -# environment settings for Dmaap Bus Controller Integration Test. -# assumes args are: -# $1 - FQDN of AAF server -# $2 - FQDN of MR server -# $3 - FQDN of DRPS Server -# Only need to set values where defaults aren't appropriate -# -cat < 0: - outfile.seek(-1, os.SEEK_CUR) - char = outfile.read(1) - if char == b'\n': - count += 1 - if count == number_of_lines_to_delete: - outfile.truncate() - print("Removed " + str(number_of_lines_to_delete) + " lines from end of CA File") - exit(0) - outfile.seek(-1, os.SEEK_CUR) - else: - print("No DR cert in CA File to remove") - -if count < number_of_lines_to_delete + 1: - print("Number of lines in file less than number of lines to delete. Exiting...") - exit(1) diff --git a/scripts/dmaap-datarouter/robot_ssl/onap_ca_cert.pem b/scripts/dmaap-datarouter/robot_ssl/onap_ca_cert.pem new file mode 100644 index 00000000..1f9d08e5 --- /dev/null +++ b/scripts/dmaap-datarouter/robot_ssl/onap_ca_cert.pem @@ -0,0 +1,40 @@ + +# Issuer: C=US,O=ONAP,OU=OSAAF +# Subject: C=US,O=ONAP,OU=OSAAF +# Label: "" +# Serial: 0x9EAEEDC0A7CEB59D +# MD5 Fingerprint: 77:EB:5E:94:2E:B7:A3:45:97:6C:87:FE:A7:F7:64:0F +# SHA1 Fingerprint: 90:25:D1:D3:8B:3C:BE:2C:73:E9:6C:1A:48:5B:06:A8:39:0D:54:3B +# SHA256 Fingerprint: 1F:C2:BB:F6:7E:11:6F:F0:4C:C3:D9:6C:73:E5:99:B7:CA:7D:4D:EF:AA:6C:69:46:0D:2C:7B:A9:E4:23:5F:EA +-----BEGIN CERTIFICATE----- +MIIFczCCA1ugAwIBAgIUVl0TXS1NTKZy68+AFpfvCBbs3JwwDQYJKoZIhvcNAQEL +BQAwQTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExDTALBgNVBAoM +BE9OQVAxDjAMBgNVBAsMBU9TQUFGMB4XDTIxMDMxNjE1MjA1MloXDTQxMDMxMTE1 +MjA1MlowQTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExDTALBgNV +BAoMBE9OQVAxDjAMBgNVBAsMBU9TQUFGMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEA1NdArmwTe6C9NZnMAPP0uvy9IH/+Lc9dgO9+j6F+JqLDXn+O5vaj +6EMU5o60sGzymbMdwk26jiR7KYG8puZzI0EsjwELrLV5NYrUR1y7g+sbJWFUiB0X +SseifQD9bSG0YBX7J6bQEilh18+oWpXIygl8/VJuiuDhaYdakmwn9AxQRm/zRDcI +tMS49gq7ARpwMrZaZkQ5eL2R0eX4yj915fAgsvLNmfNTkkTCTBuGYAfixz2+uz8r +4xZqxXrln6CVe6pV5MOxxQsJq0QfSfNxKFqhVJTSj3STG8UDKDPIcTqVLS6v3/iY +WX43pHuqjfrGLy3HjPCIWphsx9EWq02bnLvwsnibRgfXjZNbdhePOZV8Xd+4MfHy +uyFRf5xHvQm3f3vLtCQ1rmHk/3wb2Mb1SbTGt6sL6Waqs/VnnPyTwhXJk6RnU991 +qAnqSCLzKNEPNnpSTQKU35NPbdCAw/z97K5Ar8JWH2XiM65dV0j0d/Ura0PXUXRN +Royi7rREJKBMFszwxqCCHZkH6/Fbs8vmBWC1gLQgDqK+IgU1/+ytUPOsMVqPcNjM +RrZyd8xCoxEyd+Ly6y2EF9RE6qS/rlW/yUh3AIBlpcsVxc+Kh1nvNRLLJzHvrvSs +wvd6LpWHVaffO02hp3suXDwOtLq91lAHLA48iDty/Js+jFjohZJ/+LsCAwEAAaNj +MGEwHQYDVR0OBBYEFMeiRem06VRh0sL0L5k9B5A01QAoMB8GA1UdIwQYMBaAFMei +Rem06VRh0sL0L5k9B5A01QAoMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBGdpwWyOIw7jBkEJbheeje8ccc51Z0SY/8 +oo/cYi9cI2SNtE4yt9SOZtXiWO1ga1PuFP5vNkPZu3MtqtsDt8CsSgYfgCKX1DH4 +RloTJJO73UKuMmnoqHNsuE6rHRrcoqcV8XJJ9uBz2cDVWfVDG5Pf92lB1cLQ5AGb +X7O7MKNHu4woFdbbI8f3TN6Qx5oAcrS1alLMuPJhIkwcHuiWdjJuORx2MK4K9gov +yRJceVyqMiTr7GGYFi/FQKIzIaHeKgQy+YGLfQ1GcbUmVItU4aQMfSM2RXb7wJ90 +XBFi0NjXZfMXVZ9kxqIki/s6NefrDAOFjHINUxGucXjEw1raewprErlsNt/8SUKT +EDSLe1YD558jzUaqVdWinL6gMRTyyHOwt/51mg4sn3i2WLdL1Hno4F7GUIbkBmi5 +VSDDWnXdpwaFWeqA8JAvy+JIh+Ju671U1HhB68lGRvNOgfZbvW3m8GGpXldR5krR +OYhwbxdU1rNYHH+DJ0KE4L1Y6es/571+UH7NFbvO6jAk9G/Fudel+SwhXVfFo0pi +mmXAwT2bmDEiYBzDNHFwyT3+OGKXiDXuMvMB9ic7p3Zk9X0mRtpubW1gfZvUqIqe +jaVeZdad0DX1yfjwi5zYT+ViI7pjXVYlgiBAnjMrEmWOpRcs793F5zBiyDjaUNFt +3arVcS9XgA== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/scripts/dmaap-datarouter/robot_ssl/update_ca.py b/scripts/dmaap-datarouter/robot_ssl/update_ca.py new file mode 100644 index 00000000..d36f8acc --- /dev/null +++ b/scripts/dmaap-datarouter/robot_ssl/update_ca.py @@ -0,0 +1,65 @@ +# ============LICENSE_START=================================================== +# Copyright (C) 2019-2021 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===================================================== + +import certifi +import os + + +def add_onap_ca_cert(): + cafile = certifi.where() + dir_path = os.path.dirname(os.path.realpath(__file__)) + datarouter_ca = dir_path + '/onap_ca_cert.pem' + with open(datarouter_ca, 'rb') as infile: + customca = infile.read() + + with open(cafile, 'ab') as outfile: + outfile.write(customca) + + print("Added DR Cert to CA") + + +def remove_onap_ca_cert(): + cafile = certifi.where() + number_of_lines_to_delete = 40 + count = 0 + dr_cert_exists = False + + with open(cafile, 'r+b', buffering=0) as outfile: + for line in outfile.readlines()[-36:-35]: + if '# Serial: 0x9EAEEDC0A7CEB59D'.encode() in line: + dr_cert_exists = True + if dr_cert_exists: + outfile.seek(0, os.SEEK_END) + end = outfile.tell() + while outfile.tell() > 0: + outfile.seek(-1, os.SEEK_CUR) + char = outfile.read(1) + if char == b'\n': + count += 1 + if count == number_of_lines_to_delete: + outfile.truncate() + print( + "Removed " + str(number_of_lines_to_delete) + " lines from end of CA File") + exit(0) + outfile.seek(-1, os.SEEK_CUR) + else: + print("No DR cert in CA File to remove") + + if count < number_of_lines_to_delete + 1: + print("Number of lines in file less than number of lines to delete. Exiting...") + exit(1) diff --git a/scripts/dmaap-datarouter/update_ca.py b/scripts/dmaap-datarouter/update_ca.py deleted file mode 100644 index 0d76e224..00000000 --- a/scripts/dmaap-datarouter/update_ca.py +++ /dev/null @@ -1,33 +0,0 @@ -# -# ============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========================================================= -# - -import certifi -import os - -cafile = certifi.where() -dir_path = os.path.dirname(os.path.realpath(__file__)) -datarouter_ca = dir_path + '/datarouterCA.crt' -with open(datarouter_ca, 'rb') as infile: - customca = infile.read() - -with open(cafile, 'ab') as outfile: - outfile.write(customca) - -print("Added DR Cert to CA") diff --git a/scripts/dmaap-message-router/dmaap-mr-launch.sh b/scripts/dmaap-message-router/dmaap-mr-launch.sh index 4fef6821..ccbe368c 100755 --- a/scripts/dmaap-message-router/dmaap-mr-launch.sh +++ b/scripts/dmaap-message-router/dmaap-mr-launch.sh @@ -31,101 +31,101 @@ source ${SCRIPTS}/common_functions.sh # (kafka and zk containers are not called externally) function dmaap_mr_launch() { - # - # the default prefix for docker containers is the directory name containing the docker-compose.yml file. - # It can be over-written by an env variable COMPOSE_PROJECT_NAME. This env var seems to be set in the Jenkins CSIT environment - COMPOSE_PREFIX=${COMPOSE_PROJECT_NAME:-dockercompose} - export COMPOSE_PROJECT_NAME=$COMPOSE_PREFIX - echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME" - echo "COMPOSE_PREFIX=$COMPOSE_PREFIX" - - # Clone DMaaP Message Router repo - mkdir -p $WORKSPACE/archives/dmaapmr - cd $WORKSPACE/archives/dmaapmr - #unset http_proxy https_proxy - git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master - cd messageservice - git pull - cd $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose - cp $WORKSPACE/archives/dmaapmr/messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/ - - - # start DMaaP MR containers with docker compose and configuration from docker-compose.yml - docker login -u docker -p docker nexus3.onap.org:10001 - docker-compose up -d - docker ps - - # Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper - for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] - then - echo "DMaaP Service Running" - break - else - echo sleep $i - sleep $i - fi - done - - - DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) - IP=${DMAAP_MR_IP} - KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) - ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) - - echo DMAAP_MR_IP=${DMAAP_MR_IP} - echo IP=${IP} - echo KAFKA_IP=${KAFKA_IP} - echo ZOOKEEPER_IP=${ZOOKEEPER_IP} - - # Initial docker-compose up and down is for populating kafka and zookeeper IPs in /var/tmp/MsgRtrApi.properites - docker-compose down - - # Update kafkfa and zookeeper properties in MsgRtrApi.propeties which will be copied to DMaaP Container - sed -i -e 's//zookeeper/' /var/tmp/MsgRtrApi.properties - sed -i -e 's/:/kafka:9092/' /var/tmp/MsgRtrApi.properties - - docker-compose build - docker login -u docker -p docker nexus3.onap.org:10001 - docker-compose up -d - docker ps - - # Wait for initialization of Docker containers - for i in {1..50}; do - if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ - [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] - then - echo "DMaaP Service Running" - break - else - echo sleep $i - sleep $i - fi - done - DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) - IP=${DMAAP_MR_IP} - KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) - ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) - - echo "After restart of ZK and Kafka..." - echo DMAAP_MR_IP=${DMAAP_MR_IP} - echo IP=${IP} - echo KAFKA_IP=${KAFKA_IP} - echo ZOOKEEPER_IP=${ZOOKEEPER_IP} + # + # the default prefix for docker containers is the directory name containing the docker-compose.yml file. + # It can be over-written by an env variable COMPOSE_PROJECT_NAME. This env var seems to be set in the Jenkins CSIT environment + COMPOSE_PREFIX=${COMPOSE_PROJECT_NAME:-dockercompose} + export COMPOSE_PROJECT_NAME=$COMPOSE_PREFIX + echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME" + echo "COMPOSE_PREFIX=$COMPOSE_PREFIX" + + # Clone DMaaP Message Router repo + mkdir -p $WORKSPACE/archives/dmaapmr + cd $WORKSPACE/archives/dmaapmr + #unset http_proxy https_proxy + git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master + cd messageservice + git pull + cd $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose + cp $WORKSPACE/archives/dmaapmr/messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/ + + + # start DMaaP MR containers with docker compose and configuration from docker-compose.yml + docker login -u docker -p docker nexus3.onap.org:10001 + docker-compose up -d + docker ps + + # Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper + for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] + then + echo "DMaaP Service Running" + break + else + echo sleep $i + sleep $i + fi + done + + + DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) + IP=${DMAAP_MR_IP} + KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) + ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) + + echo DMAAP_MR_IP=${DMAAP_MR_IP} + echo IP=${IP} + echo KAFKA_IP=${KAFKA_IP} + echo ZOOKEEPER_IP=${ZOOKEEPER_IP} + + # Initial docker-compose up and down is for populating kafka and zookeeper IPs in /var/tmp/MsgRtrApi.properites + docker-compose down + + # Update kafkfa and zookeeper properties in MsgRtrApi.propeties which will be copied to DMaaP Container + sed -i -e 's//zookeeper/' /var/tmp/MsgRtrApi.properties + sed -i -e 's/:/kafka:9092/' /var/tmp/MsgRtrApi.properties + + docker-compose build + docker login -u docker -p docker nexus3.onap.org:10001 + docker-compose up -d + docker ps + + # Wait for initialization of Docker containers + for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_zookeeper_1) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' ${COMPOSE_PREFIX}_dmaap_1) ] + then + echo "DMaaP Service Running" + break + else + echo sleep $i + sleep $i + fi + done + DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_dmaap_1) + IP=${DMAAP_MR_IP} + KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_kafka_1) + ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${COMPOSE_PREFIX}_zookeeper_1) + + echo "After restart of ZK and Kafka..." + echo DMAAP_MR_IP=${DMAAP_MR_IP} + echo IP=${IP} + echo KAFKA_IP=${KAFKA_IP} + echo ZOOKEEPER_IP=${ZOOKEEPER_IP} source ${SCRIPTS}/common_functions.sh bypass_ip_adress ${DMAAP_MR_IP} bypass_ip_adress ${KAFKA_IP} bypass_ip_adress ${ZOOKEEPER_IP} - # Wait for initialization of docker services - for i in {1..50}; do - curl -sS -m 1 ${DMAAP_MR_IP}:3904/events/TestTopic && break - echo sleep $i - sleep $i - done + # Wait for initialization of docker services + for i in {1..50}; do + curl -sS -m 1 ${DMAAP_MR_IP}:3904/events/TestTopic && break + echo sleep $i + sleep $i + done } diff --git a/scripts/integration/nfsimulator/netconf-server/docker-compose.yml b/scripts/integration/nfsimulator/netconf-server/docker-compose.yml new file mode 100644 index 00000000..c1c7333a --- /dev/null +++ b/scripts/integration/nfsimulator/netconf-server/docker-compose.yml @@ -0,0 +1,43 @@ +version: '3' + +services: + zookeeper: + image: wurstmeister/zookeeper + ports: + - "2181:2181" + networks: + - netconfnetwork + + kafka1: + image: wurstmeister/kafka:1.1.0 + ports: + - "9092:9092" + hostname: kafka1 + networks: + - netconfnetwork + environment: + KAFKA_ADVERTISED_PORT: 9092 + KAFKA_ADVERTISED_HOST_NAME: kafka1 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_CREATE_TOPICS: "config:1:1" + KAFKA_DELETE_RETENTION_MS: 604800000 + KAFKA_LOG_CLEANER_DELETE_RETENTION_MS: 604800000 + depends_on: + - zookeeper + + netconf-server: + container_name: netconf-server + image: nexus3.onap.org:10003/onap/org.onap.integration.nfsimulator.netconfserver:latest + ports: + - "830:830" + - "6513:6513" + - "6555:6555" + networks: + - netconfnetwork + depends_on: + - zookeeper + - kafka1 + +networks: + netconfnetwork: + driver: bridge diff --git a/scripts/optf-has/has/simulator_teardown_script.sh b/scripts/integration/nfsimulator/netconf-server/start-netconf-server.sh similarity index 71% rename from scripts/optf-has/has/simulator_teardown_script.sh rename to scripts/integration/nfsimulator/netconf-server/start-netconf-server.sh index eb29445a..8fadcd1a 100755 --- a/scripts/optf-has/has/simulator_teardown_script.sh +++ b/scripts/integration/nfsimulator/netconf-server/start-netconf-server.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# Copyright (C) 2021 Nokia. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,12 +13,7 @@ # 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. -# -echo "optf/has scripts docker containers killing"; -docker stop aaisim -docker stop multicloudsim -docker stop aafsim -docker rm aaisim -docker rm multicloudsim -docker rm aafsim + +echo "Starting netconf server" +docker-compose -f ${WORKSPACE}/scripts/integration/nfsimulator/netconf-server/docker-compose.yml up -d diff --git a/scripts/policy/config/db/db.conf b/scripts/integration/nfsimulator/netconf-server/stop-netconf-server.sh old mode 100644 new mode 100755 similarity index 67% rename from scripts/policy/config/db/db.conf rename to scripts/integration/nfsimulator/netconf-server/stop-netconf-server.sh index d6764f97..01d38509 --- a/scripts/policy/config/db/db.conf +++ b/scripts/integration/nfsimulator/netconf-server/stop-netconf-server.sh @@ -1,16 +1,18 @@ -# Copyright 2019 AT&T Intellectual Property. All rights reserved +#!/bin/bash +# +# Copyright (C) 2021 Nokia. All rights reserved. # # 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 +# 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. -MYSQL_ROOT_PASSWORD=secret -MYSQL_USER=policy_user -MYSQL_PASSWORD=policy_user + +echo "Stopping netconf server" +docker-compose -f ${WORKSPACE}/scripts/integration/nfsimulator/netconf-server/docker-compose.yml down diff --git a/scripts/optf-has/has/has-properties/AAF_RootCA.cer b/scripts/optf-has/has/has-properties/AAF_RootCA.cer deleted file mode 100644 index e9a50d7e..00000000 --- a/scripts/optf-has/has/has-properties/AAF_RootCA.cer +++ /dev/null @@ -1,31 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFPjCCAyagAwIBAgIJAJ6u7cCnzrWdMA0GCSqGSIb3DQEBCwUAMCwxDjAMBgNV -BAsMBU9TQUFGMQ0wCwYDVQQKDARPTkFQMQswCQYDVQQGEwJVUzAeFw0xODA0MDUx -NDE1MjhaFw0zODAzMzExNDE1MjhaMCwxDjAMBgNVBAsMBU9TQUFGMQ0wCwYDVQQK -DARPTkFQMQswCQYDVQQGEwJVUzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC -ggIBAMA5pkgRs7NhGG4ew5JouhyYakgYUyFaG121+/h8qbSdt0hVQv56+EA41Yq7 -XGie7RYDQK9NmAFF3gruE+6X7wvJiChp+Cyd7sFMnb65uWhxEdxWTM2BJFrgfzUn -H8ZCxgaCo3XH4PzlKRy2LQQJEJECwl/RZmRCXijMt5e9h8XoZY/fKkKcZZUsWNCM -pTo266wjvA9MXLmdgReRj0+vrCjrNqy+htwJDztoiHWiYPqT6o8EvGcgjNqjlZx7 -NUNf8MfLDByqKF6+wRbHv1GKjn3/Vijd45Fv8riyRYROiFanvbV6jIfBkv8PZbXg -2VDWsYsgp8NAvMxK+iV8cO+Ck3lBI2GOPZbCEqpPVTYbLUz6sczAlCXwQoPzDIZY -wYa3eR/gYLY1gP2iEVHORag3bLPap9ZX5E8DZkzTNTjovvLk8KaCmfcaUMJsBtDd -ApcUitz10cnRyZc1sX3gE1f3DpzQM6t9C5sOVyRhDcSrKqqwb9m0Ss04XAS9FsqM -P3UWYQyqDXSxlUAYaX892u8mV1hxnt2gjb22RloXMM6TovM3sSrJS0wH+l1nznd6 -aFXftS/G4ZVIVZ/LfT1is4StoyPWZCwwwly1z8qJQ/zhip5NgZTxQw4mi7ww35DY -PdAQOCoajfSvFjqslQ/cPRi/MRCu079heVb5fQnnzVtnpFQRAgMBAAGjYzBhMB0G -A1UdDgQWBBRTVTPyS+vQUbHBeJrBKDF77+rtSTAfBgNVHSMEGDAWgBRTVTPyS+vQ -UbHBeJrBKDF77+rtSTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAN -BgkqhkiG9w0BAQsFAAOCAgEAPx/IaK94n02wPxpnYTy+LVLIxwdq/kawNd6IbiMz -L87zmNMDmHcGbfoRCj8OkhuggX9Lx1/CkhpXimuYsZOFQi5blr/u+v4mIbsgbmi9 -7j+cUHDP0zLycvSvxKHty51LwmaX9a4wkJl5zBU4O1sd/H9tWcEmwJ39ltKoBKBx -c94Zc3iMm5ytRWGj+0rKzLDAXEWpoZ5bE5PLJauA6UDCxDLfs3FwhbS7uDggxYvf -jySF5FCNET94oJ+m8s7VeHvoa8iPGKvXrIqdd7XDHnqJJlVKr7m9S0fMbyEB8ci2 -RtOXDt93ifY1uhoEtEykn4dqBSp8ezvNMnwoXdYPDvTd9uCAFeWFLVreBAWxd25h -PsBTkZA5hpa/rA+mKv6Af4VBViYr8cz4dZCsFChuioVebe9ighrfjB//qKepFjPF -CyjzKN1u0JKm/2x/ORqxkTONG8p3uDwoIOyimUcTtTMv42bfYD88RKakqSFXE9G+ -Z0LlaKABqfjK49o/tsAp+c5LoNlYllKhnetO3QAdraHwdmC36BhoghzR1jpX751A -cZn2VH3Q4XKyp01cJNCJIrua+A+bx6zh3RyW6zIIkbRCbET+UD+4mr8WIcSE3mtR -ZVlnhUDO4z9//WKMVzwS9Rh8/kuszrGFI1KQozXCHLrce3YP6RYZfOed79LXaRwX -dYY= ------END CERTIFICATE----- diff --git a/scripts/optf-has/has/has-properties/conductor.conf.onap b/scripts/optf-has/has/has-properties/conductor.conf.onap deleted file mode 100644 index 3ce7fa05..00000000 --- a/scripts/optf-has/has/has-properties/conductor.conf.onap +++ /dev/null @@ -1,587 +0,0 @@ -[DEFAULT] - -# -# From conductor -# - -# Configuration file for WSGI definition of API. (string value) -api_paste_config = /usr/local/etc/conductor/api_paste.ini - -# Music keyspace for content (string value) -#keyspace = conductor - -# Delay time (Seconds) for MUSIC requests. Set it to 2 seconds by default. -# (integer value) -#delay_time = 2 - -# (boolean value) -#HPA_enabled = true - -# -# From oslo.log -# - -# If set to true, the logging level will be set to DEBUG instead of the default -# INFO level. (boolean value) -# Note: This option can be changed without restarting. -debug = true - -# The name of a logging configuration file. This file is appended to any -# existing logging configuration files. For details about logging configuration -# files, see the Python logging module documentation. Note that when logging -# configuration files are used then all logging configuration is set in the -# configuration file and other logging configuration options are ignored (for -# example, logging_context_format_string). (string value) -# Note: This option can be changed without restarting. -# Deprecated group/name - [DEFAULT]/log_config -log_config_append = /usr/local/bin/log.conf - -# Defines the format string for %%(asctime)s in log records. Default: -# %(default)s . This option is ignored if log_config_append is set. (string -# value) -#log_date_format = %Y-%m-%d %H:%M:%S - -# (Optional) Name of log file to send logging output to. If no default is set, -# logging will go to stderr as defined by use_stderr. This option is ignored if -# log_config_append is set. (string value) -# Deprecated group/name - [DEFAULT]/logfile -#log_file = application.log - -# (Optional) The base directory used for relative log_file paths. This option -# is ignored if log_config_append is set. (string value) -# Deprecated group/name - [DEFAULT]/logdir -log_dir = /var/log - -# Uses logging handler designed to watch file system. When log file is moved or -# removed this handler will open a new log file with specified path -# instantaneously. It makes sense only if log_file option is specified and -# Linux platform is used. This option is ignored if log_config_append is set. -# (boolean value) -#watch_log_file = false - -# Use syslog for logging. Existing syslog format is DEPRECATED and will be -# changed later to honor RFC5424. This option is ignored if log_config_append -# is set. (boolean value) -#use_syslog = false - -# Enable journald for logging. If running in a systemd environment you may wish -# to enable journal support. Doing so will use the journal native protocol -# which includes structured metadata in addition to log messages.This option is -# ignored if log_config_append is set. (boolean value) -#use_journal = false - -# Syslog facility to receive log lines. This option is ignored if -# log_config_append is set. (string value) -#syslog_log_facility = LOG_USER - -# Use JSON formatting for logging. This option is ignored if log_config_append -# is set. (boolean value) -#use_json = false - -# Log output to standard error. This option is ignored if log_config_append is -# set. (boolean value) -#use_stderr = false - -# Format string to use for log messages with context. (string value) -#logging_context_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user_identity)s] %(instance)s%(message)s - -# Format string to use for log messages when context is undefined. (string -# value) -#logging_default_format_string = %(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s - -# Additional data to append to log message when logging level for the message -# is DEBUG. (string value) -#logging_debug_format_suffix = %(funcName)s %(pathname)s:%(lineno)d - -# Prefix each line of exception output with this format. (string value) -#logging_exception_prefix = %(asctime)s.%(msecs)03d %(process)d ERROR %(name)s %(instance)s - -# Defines the format string for %(user_identity)s that is used in -# logging_context_format_string. (string value) -#logging_user_identity_format = %(user)s %(tenant)s %(domain)s %(user_domain)s %(project_domain)s - -# List of package logging levels in logger=LEVEL pairs. This option is ignored -# if log_config_append is set. (list value) -#default_log_levels = amqp=WARN,amqplib=WARN,boto=WARN,qpid=WARN,sqlalchemy=WARN,suds=INFO,oslo.messaging=INFO,oslo_messaging=INFO,iso8601=WARN,requests.packages.urllib3.connectionpool=WARN,urllib3.connectionpool=WARN,websocket=WARN,requests.packages.urllib3.util.retry=WARN,urllib3.util.retry=WARN,keystonemiddleware=WARN,routes.middleware=WARN,stevedore=WARN,taskflow=WARN,keystoneauth=WARN,oslo.cache=INFO,dogpile.core.dogpile=INFO - -# Enables or disables publication of error events. (boolean value) -#publish_errors = false - -# The format for an instance that is passed with the log message. (string -# value) -#instance_format = "[instance: %(uuid)s] " - -# The format for an instance UUID that is passed with the log message. (string -# value) -#instance_uuid_format = "[instance: %(uuid)s] " - -# Interval, number of seconds, of log rate limiting. (integer value) -#rate_limit_interval = 0 - -# Maximum number of logged messages per rate_limit_interval. (integer value) -#rate_limit_burst = 0 - -# Log level name used by rate limiting: CRITICAL, ERROR, INFO, WARNING, DEBUG -# or empty string. Logs with level greater or equal to rate_limit_except_level -# are not filtered. An empty string means that all levels are filtered. (string -# value) -#rate_limit_except_level = CRITICAL - -# Enables or disables fatal status of deprecations. (boolean value) -#fatal_deprecations = false - - -[auth] -# appkey = h@ss3crtky400fdntc#001 -appkey = - -[aaf_api] - -# -# From conductor -# - -# is_aaf_enabled. (boolean value) -#is_aaf_enabled = true - -# aaf_cache_expiry_hrs. (integer value) -#aaf_cache_expiry_hrs = 3 - -# aaf_url. (string value) -aaf_url = http://localhost:8100/authz/perms/user/ - -# aaf_cert_file. (string value) -#aaf_cert_file = - -# aaf_cert_key_file. (string value) -#aaf_cert_key_file = - -# aaf_ca_bundle_file. (string value) -#aaf_ca_bundle_file = -aaf_ca_bundle_file = /usr/local/bin/AAF_RootCA.cer - -# aaf_retries. (integer value) -#aaf_retries = 3 - -# aaf_timeout. (integer value) -#aaf_timeout = 100 - -# aaf_user_roles. (list value) -#aaf_permissions = {"type": "org.onap.oof.access","instance": "*","action": "*"} - - -[aaf_sms] - -# -# From conductor -# - -# Is Secret Management service enabled (boolean value) -#is_enabled = true - -# Base URL for SMS, up to and not including the version, and without a trailing -# slash. (string value) -aaf_sms_url = http://aaf-sms.onap:10443 - -# Timeout for SMS API Call (integer value) -#aaf_sms_timeout = 30 - -# Path to the cacert that will be used to verify If this is None, verify will -# be False and the server certis not verified by the client. (string value) -#aaf_ca_certs = AAF_RootCA.cer -aaf_ca_certs = /usr/local/bin/AAF_RootCA.cer - -# Domain Name for HAS (string value) -#secret_domain = has - - -[aai] - -# -# From conductor -# - -# Interval with which to refresh the local cache, in minutes. (integer value) -#cache_refresh_interval = 1440 -cache_refresh_interval = 1 - -# Interval with which to refresh the local complex cache, in minutes. (integer -# value) -#complex_cache_refresh_interval = 1440 -complex_cache_refresh_interval = 60 - -# Data Store table prefix. (string value) -#table_prefix = aai - -# Base URL for A&AI, up to and not including the version, and without a -# trailing slash. (string value) -#server_url = https://controller:8443/aai -server_url = http://localhost:8081/aai/ - -# Timeout for A&AI Rest Call (string value) -#aai_rest_timeout = 30 - -# Number of retry for A&AI Rest Call (string value) -#aai_retries = 3 - -# The version of A&AI in v# format. (string value) -server_url_version = v14 - -# SSL/TLS certificate file in pem format. This certificate must be registered -# with the A&AI endpoint. (string value) -#certificate_file = certificate.pem -certificate_file = - -# Private Certificate Key file in pem format. (string value) -#certificate_key_file = certificate_key.pem -certificate_key_file = - -# Certificate Authority Bundle file in pem format. Must contain the appropriate -# trust chain for the Certificate file. (string value) -#certificate_authority_bundle_file = certificate_authority_bundle.pem -certificate_authority_bundle_file = /usr/local/bin/AAF_RootCA.cer - -[api] - -# -# From conductor -# - -# Toggle Pecan Debug Middleware. (boolean value) -#pecan_debug = false - -# Default maximum number of items returned by API request. (integer value) -# Minimum value: 1 -#default_api_return_limit = 100 - - -[conductor_api] - -# -# From conductor -# - -# Base URL for plans. (string value) -#server_url = - -# auth toggling. (boolean value) -basic_auth_secure = false - - -[controller] - -# -# From conductor -# - -# Timeout for planning requests. Default value is 10. (integer value) -# Minimum value: 1 -#timeout = 10 - -# Maximum number of result sets to return. Default value is 1. (integer value) -# Minimum value: 1 -#limit = 1 - -# Number of workers for controller service. Default value is 1. (integer value) -# Minimum value: 1 -#workers = 1 - -# Set to True when controller will run in active-active mode. When set to -# False, controller will flush any abandoned messages at startup. The -# controller always restarts abandoned template translations at startup. -# (boolean value) -#concurrent = false -concurrent = true - -# Time between checking for new plans. Default value is 1. (integer value) -# Minimum value: 1 -#polling_interval = 1 -opt_schema_file = /opt/has/conductor/etc/conductor/opt_schema.json - -# (integer value) -# Minimum value: 1 -#max_translation_counter = 1 - - -[data] - -# -# From conductor -# - -# Number of workers for data service. Default value is 1. (integer value) -# Minimum value: 1 -#workers = 1 - -# Set to True when data will run in active-active mode. When set to False, data -# will flush any abandoned messages at startup. (boolean value) -#concurrent = false -concurrent = true - -# Default value is -8000, which is the diameter of the earth. The distance -# cannot larger than this value (floating point value) -#existing_placement_cost = -8000.0 - -# (floating point value) -#cloud_candidate_cost = 2.0 - -# (floating point value) -#service_candidate_cost = 1.0 - - -[inventory_provider] - -# -# From conductor -# - -# Extensions list to use (list value) -extensions = aai,generator - - -[messaging_server] - -# -# From conductor -# - -# Music keyspace for messages (string value) -#keyspace = conductor_rpc - -# Wait interval while checking for a message response. Default value is 1 -# second. (integer value) -# Minimum value: 1 -#check_interval = 1 - -# Overall message response timeout. Default value is 120 seconds. (integer -# value) -# Minimum value: 1 -#response_timeout = 120 - -# Timeout for detecting a VM is down, and other VMs can pick the plan up. -# Default value is 5 minutes. (integer value) (integer value) -# Minimum value: 1 -#timeout = 300 - -# Number of workers for messaging service. Default value is 1. (integer value) -# Minimum value: 1 -#workers = 1 - -# Time between checking for new messages. Default value is 1. (integer value) -# Minimum value: 1 -#polling_interval = 1 - -# Log debug messages. Default value is False. (boolean value) -#debug = false - - -[multicloud] - -# -# From conductor -# - -# Base URL for Multicloud without a trailing slash. (string value) -server_url = http://msb.onap.org:8082/api/multicloud - -# Timeout for Multicloud Rest Call (string value) -#multicloud_rest_timeout = 30 - -# Number of retry for Multicloud Rest Call (string value) -#multicloud_retries = 3 - -# The version of Multicloud API. (string value) -#server_url_version = v0 - -# Certificate Authority Bundle file in pem format. Must contain the appropriate -# trust chain for the Certificate file. (string value) -#certificate_authority_bundle_file = certificate_authority_bundle.pem -certificate_authority_bundle_file = /usr/local/bin/AAF_RootCA.cer - -# Enabling HTTPs mode (boolean value) -# enable_https_mode = -enable_https_mode = True -[music_api] - -# -# From conductor -# - -# Base URL for Music REST API without a trailing slash. (string value) -server_url = http://localhost:8080/MUSIC/rest/v2 -version = v2 - -# DEPRECATED: List of hostnames (round-robin access) (list value) -# This option is deprecated for removal. -# Its value may be silently ignored in the future. -# Reason: Use server_url instead -#hostnames = - -# DEPRECATED: Port (integer value) -# This option is deprecated for removal. -# Its value may be silently ignored in the future. -# Reason: Use server_url instead -#port = - -# DEPRECATED: Path (string value) -# This option is deprecated for removal. -# Its value may be silently ignored in the future. -# Reason: Use server_url instead -#path = - -# Socket connection timeout (floating point value) -#connect_timeout = 3.05 - -# Socket read timeout (floating point value) -#read_timeout = 12.05 - -# Lock timeout (integer value) -#lock_timeout = 10 - -# Replication factor (integer value) -#replication_factor = 1 - -# Use mock API (boolean value) -#mock = false - -# (string value) -#music_topology = SimpleStrategy - -# Name of the first data center (string value) -#first_datacenter_name = - -# Number of replicas in first data center (integer value) -#first_datacenter_replicas = - -# Name of the second data center (string value) -#second_datacenter_name = - -# Number of replicas in second data center (integer value) -#second_datacenter_replicas = - -# Name of the third data center (string value) -#third_datacenter_name = - -# Number of replicas in third data center (integer value) -#third_datacenter_replicas = - -# new or old version (boolean value) -#music_new_version = -music_new_version = True - -# for version (string value) -#music_version = -music_version = "3.0.21" - -[prometheus] - -# -# From conductor -# - -# Prometheus Metrics Endpoint (list value) -#metrics_port = 8000,8001,8002,8003,8004 - - -[reservation] - -# -# From conductor -# - -# Number of workers for reservation service. Default value is 1. (integer -# value) -# Minimum value: 1 -#workers = 1 - -# Number of times reservation/release should be attempted. (integer value) -#reserve_retries = 1 - -# Timeout for detecting a VM is down, and other VMs can pick the plan up and -# resereve. Default value is 600 seconds. (integer value) (integer value) -# Minimum value: 1 -#timeout = 600 - -# Set to True when reservation will run in active-active mode. When set to -# False, reservation will restart any orphaned reserving requests at startup. -# (boolean value) -#concurrent = false -concurrent = true - -# (integer value) -# Minimum value: 1 -#max_reservation_counter = 1 - - -[sdnc] - -# -# From conductor -# - -# Interval with which to refresh the local cache, in minutes. (integer value) -#cache_refresh_interval = 1440 - -# Data Store table prefix. (string value) -#table_prefix = sdnc - -# Base URL for SDN-C, up to and including the version. (string value) -#server_url = https://controller:8443/restconf/ -server_url = http://localhost:8083/restconf/ - -# Timeout for SDNC Rest Call (string value) -#sdnc_rest_timeout = 30 - -# Retry Numbers for SDNC Rest Call (string value) -#sdnc_retries = 3 - - -[service_controller] - -# -# From conductor -# - -# Extensions list to use (list value) -#extensions = sdnc - - -[solver] - -# -# From conductor -# - -# Number of workers for solver service. Default value is 1. (integer value) -# Minimum value: 1 -#workers = 1 - -# The timeout value for solver service. Default value is 480 seconds. (integer -# value) -# Minimum value: 1 -#solver_timeout = 480 - -# Set to True when solver will run in active-active mode. When set to False, -# solver will restart any orphaned solving requests at startup. (boolean value) -#concurrent = false -concurrent = true - -# Timeout for detecting a VM is down, and other VMs can pick the plan up. This -# value should be larger than solver_timeoutDefault value is 10 minutes. -# (integer value) (integer value) -# Minimum value: 1 -#timeout = 600 - -# (integer value) -# Minimum value: 1 -#max_solver_counter = 1 - - -[vim_controller] - -# -# From conductor -# - -# Extensions list to use (list value) -#extensions = multicloud diff --git a/scripts/optf-has/has/has-properties/has.json b/scripts/optf-has/has/has-properties/has.json deleted file mode 100644 index 4f487712..00000000 --- a/scripts/optf-has/has/has-properties/has.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "domain": { - "name": "has", - "secrets": [ - { - "name": "aai", - "values": { - "username": "oof@oof.onap.org", - "password": "demo123456!" - } - }, - { - "name": "conductor_api", - "values": { - "username": "admin1", - "password": "plan.15" - } - }, - { - "name": "sdnc", - "values": { - "username": "admin", - "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" - } - }, - { - "name": "music_api", - "values": { - "aafuser": "conductor", - "aafpass": "c0nduct0r", - "aafns": "conductor" - } - }, - { - "name": "aaf_api", - "values": { - "username": "aaf_admin@people.osaaf.org", - "password": "demo123456!", - "aaf_conductor_user": "oof@oof.onap.org" - } - } - ] - } -} diff --git a/scripts/optf-has/has/has-properties/log.conf.onap b/scripts/optf-has/has/has-properties/log.conf.onap deleted file mode 100644 index 41d66444..00000000 --- a/scripts/optf-has/has/has-properties/log.conf.onap +++ /dev/null @@ -1,65 +0,0 @@ -[loggers] -keys=root - -[handlers] -keys=trfhand,consoleHandler,audithand,metrichand,errhand,debughand - -[logger_root] -level=NOTSET -handlers=trfhand,consoleHandler,audithand,metrichand,errhand,debughand - -[handler_consoleHandler] -class=StreamHandler -level=NOTSET -formatter=generic -args=(sys.stdout,) - -[handler_trfhand] -class=handlers.TimedRotatingFileHandler -level=NOTSET -formatter=generic -args=('application.log','midnight', 1, 10) - -[handler_audithand] -class=handlers.TimedRotatingFileHandler -level=INFO -formatter=audit -args=('audit.log', 'midnight', 1, 10) - -[handler_metrichand] -class=handlers.TimedRotatingFileHandler -level=INFO -formatter=metric -args=('metric.log','midnight', 1, 10) - -[handler_errhand] -class=handlers.TimedRotatingFileHandler -level=ERROR -formatter=error -args=('error.log','midnight', 1, 10) - -[handler_debughand] -class=handlers.TimedRotatingFileHandler -level=DEBUG -formatter=generic -args=('debug.log','midnight', 1, 10) - -[formatters] -keys=generic,audit,metric,error - -[formatter_audit] -format=%(asctime)s|%(asctime)s|00000000-0000-0000-0000-000000000000||%(thread)d||Conductor|N/A|COMPLETE|200|sucessful||%(levelname)s|||0|%(module)s|||||||||%(name)s : [-] %(message)s -datefmt= - -[formatter_metric] -format=%(asctime)s|%(asctime)s|00000000-0000-0000-0000-000000000000||%(thread)d||Conductor|N/A|N/A|N/A|COMPLETE|200|sucessful||%(levelname)s|||0|%(module)s||||||||||%(name)s : [-] %(message)s -datefmt= - -[formatter_error] -format=%(asctime)s|00000000-0000-0000-0000-000000000000|%(thread)d|Conductor|N/A|N/A|N/A|ERROR|500|N/A|%(name)s : [-] %(message)s -datefmt= - -[formatter_generic] -format=%(asctime)s||%(thread)d|%(levelname)s|%(module)s|%(name)s: [-] %(message)s -datefmt= - diff --git a/scripts/optf-has/has/has_proxy_settings.sh b/scripts/optf-has/has/has_proxy_settings.sh deleted file mode 100755 index 48096103..00000000 --- a/scripts/optf-has/has/has_proxy_settings.sh +++ /dev/null @@ -1,31 +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. -# -# put into this file local proxy settings in case they are needed on your local environment -echo "### This is ${WORKSPACE}/scripts/optf-has/has/has_proxy_settings.sh" - -echo "optf/has proxy settings" -if [ "$#" -eq "1" ]; then - echo "$1" - cd $1 - pwd -else - exit 1 -fi - -# don't remove following lines: commands can be attached here - - diff --git a/scripts/optf-has/has/has_script.sh b/scripts/optf-has/has/has_script.sh deleted file mode 100755 index 3b24d47a..00000000 --- a/scripts/optf-has/has/has_script.sh +++ /dev/null @@ -1,111 +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. -# -echo "### This is ${WORKSPACE}/scripts/optf-has/has/has_script.sh" -# -# add here whatever commands is needed to prepare the optf/has CSIT testing -# - -# assume the base is /tmp dir -DIR=/tmp - -# the directory of the script -echo ${DIR} -cd ${DIR} - -# create directory for volume and copy configuration file -# run docker containers -COND_CONF=/tmp/conductor/properties/conductor.conf -LOG_CONF=/tmp/conductor/properties/log.conf -IMAGE_NAME=nexus3.onap.org:10001/onap/optf-has -IMAGE_VER=2.1.2-SNAPSHOT-latest -BUNDLE=/tmp/conductor/properties/AAF_RootCA.cer - -mkdir -p /tmp/conductor/properties -mkdir -p /tmp/sms/properties -mkdir -p /tmp/conductor/logs -cp ${WORKSPACE}/scripts/optf-has/has/has-properties/conductor.conf.onap /tmp/conductor/properties/conductor.conf -cp ${WORKSPACE}/scripts/optf-has/has/has-properties/log.conf.onap /tmp/conductor/properties/log.conf -cp ${WORKSPACE}/scripts/optf-has/has/has-properties/AAF_RootCA.cer /tmp/conductor/properties/AAF_RootCA.cer -cp ${WORKSPACE}/scripts/optf-has/has/has-properties/has.json /tmp/sms/properties/has.json -#chmod -R 777 /tmp/conductor/properties - -MUSIC_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat` -echo "MUSIC_IP=${MUSIC_IP}" -SMS_IP=`get-instance-ip.sh sms` -echo "SMS_IP=${SMS_IP}" - -# change MUSIC reference to the local instance -sed -i -e "s%localhost:8080/MUSIC%${MUSIC_IP}:8080/MUSIC%g" /tmp/conductor/properties/conductor.conf - -AAISIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aaisim` -echo "AAISIM_IP=${AAISIM_IP}" - -# change AAI reference to the local instance -sed -i -e "s%localhost:8081/%${AAISIM_IP}:8081/%g" /tmp/conductor/properties/conductor.conf - -MULTICLOUDSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' multicloudsim` -echo "MULTICLOUDSIM_IP=${MULTICLOUDSIM_IP}" - -# change MULTICLOUD reference to the local instance -sed -i -e "s%msb.onap.org:8082/%${MULTICLOUDSIM_IP}:8082/%g" /tmp/conductor/properties/conductor.conf - -AAFSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aafsim` -echo "AAFSIM_IP=${AAFSIM_IP}" - -# change AAF reference to the local instance -sed -i -e "s%localhost:8100/%${AAFSIM_IP}:8100/%g" /tmp/conductor/properties/conductor.conf - -#SMS -sed -i -e "s%aaf-sms.onap:10443%${SMS_IP}:10443%g" /tmp/conductor/properties/conductor.conf -#Preload secrets -docker exec --user root -i sms /bin/sh -c "mkdir -p /preload/config" -docker cp /tmp/sms/properties/has.json sms:/preload/config/has.json -docker exec --user root -i sms /bin/sh -c "/sms/bin/preload -cacert /sms/certs/aaf_root_ca.cer -jsondir /preload/config -serviceport 10443 -serviceurl http://localhost" -docker logs vault - -#onboard conductor into music -echo "Query MUSIC to check for reachability. Query Version" -curl -vvvvv --noproxy "*" --request GET http://${MUSIC_IP}:8080/MUSIC/rest/v2/version -H "Content-Type: application/json" - -echo "Onboard conductor into music" -curl -vvvvv --noproxy "*" --request POST http://${MUSIC_IP}:8080/MUSIC/rest/v2/admin/onboardAppWithMusic -H "Content-Type: application/json" -H "Authorization: Basic Y29uZHVjdG9yOmMwbmR1Y3Qwcg==" --data @${WORKSPACE}/tests/optf-has/has/data/onboard.json - -docker run -d --name cond-cont --user root -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-controller --config-file=/usr/local/bin/conductor.conf -sleep 15 -docker run -d --name cond-api --user root -p "8091:8091" -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-api --port=8091 -- --config-file=/usr/local/bin/conductor.conf -sleep 15 -docker run -d --name cond-solv --user root -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-solver --config-file=/usr/local/bin/conductor.conf -sleep 15 -docker run -d --name cond-resv --user root -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-reservation --config-file=/usr/local/bin/conductor.conf -sleep 5 -docker run -d --name cond-data --user root -v ${COND_CONF}:/usr/local/bin/conductor.conf -v ${LOG_CONF}:/usr/local/bin/log.conf -v ${BUNDLE}:/usr/local/bin/AAF_RootCA.cer ${IMAGE_NAME}:${IMAGE_VER} python /usr/local/bin/conductor-data --config-file=/usr/local/bin/conductor.conf -sleep 15 - -COND_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' cond-api` -${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${COND_IP} 8091 - -echo "inspect docker things for tracing purpose" -docker inspect cond-data -docker inspect cond-cont -docker inspect cond-api -docker inspect cond-solv -docker inspect cond-resv - -echo "dump music content just after conductor is started" -docker exec music-db /usr/bin/nodetool status -docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM system_schema.keyspaces' -docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM admin.keyspace_master' diff --git a/scripts/optf-has/has/has_teardown_script.sh b/scripts/optf-has/has/has_teardown_script.sh deleted file mode 100755 index bef28b43..00000000 --- a/scripts/optf-has/has/has_teardown_script.sh +++ /dev/null @@ -1,34 +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. -# -echo "print meaningful data before scratching everything" -docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM system_schema.keyspaces' -docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM admin.keyspace_master' -docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM conductor.plans' - -echo "optf/has scripts docker containers killing"; -docker stop cond-api -docker stop cond-solv -docker stop cond-cont -docker stop cond-data -docker stop cond-resv - -docker rm cond-api -docker rm cond-solv -docker rm cond-cont -docker rm cond-data -docker rm cond-resv - diff --git a/scripts/optf-has/has/music-properties/log4j.properties b/scripts/optf-has/has/music-properties/log4j.properties deleted file mode 100644 index 1312e9bb..00000000 --- a/scripts/optf-has/has/music-properties/log4j.properties +++ /dev/null @@ -1,3 +0,0 @@ -# No longer needed, please see the logback properties - - diff --git a/scripts/optf-has/has/music-properties/music.properties b/scripts/optf-has/has/music-properties/music.properties deleted file mode 100644 index 02fb52df..00000000 --- a/scripts/optf-has/has/music-properties/music.properties +++ /dev/null @@ -1,17 +0,0 @@ -my.public.ip=localhost -all.public.ips=localhost -my.id=0 -all.ids=0 -####################################### -# Optional current values are defaults -####################################### -zookeeper.host=music-zk -cassandra.host=music-db -#music.ip=localhost -#debug=true -#music.rest.ip=localhost -#lock.lease.period=6000 -cassandra.user=nelson24 -cassandra.password=winman123 - - diff --git a/scripts/optf-has/has/music_script.sh b/scripts/optf-has/has/music_script.sh deleted file mode 100755 index 4257dad7..00000000 --- a/scripts/optf-has/has/music_script.sh +++ /dev/null @@ -1,173 +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. -# -echo "### This is ${WORKSPACE}/scripts/optf-has/has/music_script.sh" -# -# add here whatever commands is needed to prepare the music setup for optf-has CSIT testing -# - -# -# add here all the configuration steps eventually needed to be carried out for music CSIT testing -# -echo "########## music configuration step ##########"; -CASS_IMG=nexus3.onap.org:10001/onap/music/cassandra_3_11:3.0.23 -CASS_IMG_JOB=nexus3.onap.org:10001/onap/music/cassandra_job:3.0.23 -TOMCAT_IMG=nexus3.onap.org:10001/library/tomcat:8.5 -ZK_IMG=nexus3.onap.org:10001/library/zookeeper:3.4 -BUSYBOX_IMG=nexus3.onap.org:10001/library/busybox:latest -MUSIC_IMG=nexus3.onap.org:10001/onap/music/music:3.0.23 -TT=10 -WORK_DIR=/tmp/music -CASS_USERNAME=nelson24 -CASS_PASSWORD=winman123 -MUSIC_SOURCE_PROPERTIES=${WORKSPACE}/scripts/optf-has/has/music-properties -MUSIC_PROPERTIES=/tmp/music/properties -MUSIC_LOGS=/tmp/music/logs -CQL_FILES=${WORKSPACE}/scripts/music/cql -MUSIC_TRIGGER_DIR=/tmp/triggers -TRIGGER_JAR=musictrigger-0.1.0.jar -TRIGGER_JAR_URL=https://nexus.onap.org/service/local/repositories/autorelease-72298/content/org/onap/music/musictrigger/0.1.0/musictrigger-0.1.0.jar - -mkdir -p ${MUSIC_PROPERTIES} -mkdir -p ${MUSIC_LOGS} -mkdir -p ${MUSIC_LOGS}/MUSIC -mkdir -p /tmp/triggers - -# Get Trigger -echo "########## Get Trigger Jar ##########" -curl -o $MUSIC_TRIGGER_DIR/$TRIGGER_JAR $TRIGGER_JAR_URL - -cp ${MUSIC_SOURCE_PROPERTIES}/* ${WORK_DIR}/properties - -# Create Volume for mapping war file and tomcat -echo "########## create music-vol ##########" -docker volume create --name music-vol; - -# Create a network for all the containers to run in. -echo "########## create music-net ##########" -docker network create music-net; - -# Start Cassandra -echo "########## Start Cassandra (music-db) ##########" -docker run -d --name music-db --network music-net -p "7000:7000" -p "7001:7001" -p "7199:7199" -p "9042:9042" -p "9160:9160" \ --v $MUSIC_TRIGGER_DIR/$TRIGGER_JAR:/etc/cassandra/triggers/$TRIGGER_JAR \ -${CASS_IMG}; - -# See if cassandra is up. -echo "########## Running Test to see if Cassandra is up ##########" -CASSA_IP=`docker inspect -f '{{ $network := index .NetworkSettings.Networks "music-net" }}{{ $network.IPAddress}}' music-db` -echo "CASSANDRA_IP=${CASSA_IP}" -${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${CASSA_IP} 9042 - -# Sleep 60 seconds to ensure Cassandra is up and running. -sleep 60; - -# Check to see if Keyspaces are there. -docker exec music-db cqlsh -u cassandra -p cassandra -e "DESCRIBE keyspaces;" - -# Load data into Cassandra via Cassandra Job -echo "########## Running Cassandra Job (music-job) to load cql files ##########" -docker run -d --name music-job --network music-net \ --v $CQL_FILES/admin.cql:/cql/admin.cql \ --v $CQL_FILES/admin_pw.cql:/cql/admin_pw.cql \ --v $CQL_FILES/extra:/cql/extra \ --e PORT=9042 \ --e CASS_HOSTNAME=music-db \ --e USERNAME=$CASS_USERNAME \ --e PASSWORD=$CASS_PASSWORD \ -$CASS_IMG_JOB - -sleep 70; - -# Logs -echo "########## Cassandra Job logs ##########" -docker logs music-job -# Check to see if Keyspaces are there. -# "############## Check if new username and password work ##########" -docker exec music-db cqlsh -u $CASS_USERNAME -p $CASS_PASSWORD -e "DESCRIBE keyspaces;" -# Check to see if Keyspaces are there. -# "############## Check if original username and password work ##########" -docker exec music-db cqlsh -u cassandra -p cassandra -e "DESCRIBE keyspaces;" -# Check to see if Keyspaces are there. -# "############## Check if new cassandra username and password work ##########" -docker exec music-db cqlsh -u cassandra -p SomeLongRandomStringNoonewillthinkof -e "DESCRIBE keyspaces;" - - -# Start Music war -echo "########## Start music-war ##########" -docker run -d --name music-war -v music-vol:/app ${MUSIC_IMG}; - -# Start Zookeeper -echo "########## Start zookeeper (music-zk) ##########" -docker run -d --name music-zk --network music-net -p "2181:2181" -p "2888:2888" -p "3888:3888" ${ZK_IMG}; - -ZOO_IP=`docker inspect -f '{{ $network := index .NetworkSettings.Networks "music-net" }}{{ $network.IPAddress}}' music-zk` -echo "ZOOKEEPER_IP=${ZOO_IP}" - -# Delay between Cassandra/Zookeeper and Tomcat -sleep 120; - -# Start Up tomcat - Needs to have properties,logs dir and war file volume mapped. -echo "########## Start Tomcat (music-tomcat) ##########" -docker run -d --name music-tomcat --network music-net -p "8080:8080" -v music-vol:/usr/local/tomcat/webapps -v ${WORK_DIR}/properties:/opt/app/music/etc:ro -v ${WORK_DIR}/logs:/opt/app/music/logs ${TOMCAT_IMG}; - -# Connect tomcat to host bridge network so that its port can be seen. -echo "########## Create Bridge for Tomcat ##########" -docker network connect bridge music-tomcat; - -TOMCAT_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat` -echo "TOMCAT_IP=${TOMCAT_IP}" - -${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${TOMCAT_IP} 8080 - -sleep 20; -echo "########## TOMCAT Logs ##########" -docker logs music-tomcat -# Needed only if we need to look at localhost logs. -echo "########## MUSIC localhost Log ##########" -docker exec music-tomcat /bin/bash -c "cat /usr/local/tomcat/logs/localhost*" - -echo "########## MUSIC Log ##########" -ls -al $MUSIC_LOGS/MUSIC -docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/music.log" -#echo "########## MUSIC error log ##########" -#docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/error.log" - -echo "########## inspect docker things for tracing purpose ##########" -docker inspect music-db -docker inspect music-zk -docker inspect music-tomcat -docker inspect music-war -docker volume inspect music-vol -docker network inspect music-net - -echo "########## dump music content just after music is started ##########" -docker exec music-db /usr/bin/nodetool status -docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM system_schema.keyspaces' -docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'DESCRIBE keyspace admin' -docker exec music-db /usr/bin/cqlsh -unelson24 -pwinman123 -e 'SELECT * FROM admin.keyspace_master' - - -# -# add here all ROBOT_VARIABLES settings -# -echo "########## music robot variables settings ##########"; -ROBOT_VARIABLES="-v MUSIC_HOSTNAME:http://${TOMCAT_IP} -v MUSIC_PORT:8080 -v COND_HOSTNAME:http://localhost -v COND_PORT:8091" - -echo ${ROBOT_VARIABLES} - - - diff --git a/scripts/optf-has/has/music_teardown_script.sh b/scripts/optf-has/has/music_teardown_script.sh deleted file mode 100755 index 2e7d707b..00000000 --- a/scripts/optf-has/has/music_teardown_script.sh +++ /dev/null @@ -1,61 +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. -# - - -# -# add here below the killing of all docker containers used for music CSIT testing -# -echo "dump music.log files" -ls -alF /tmp/music -ls -alFR /tmp/music -ls -alF /tmp/music/properties -cat /tmp/music/properties/music.properties -echo "===== MUSIC log ==================" -docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/music.log" -#cat /tmp/music/logs/MUSIC/music.log -echo "===== MUSIC error log ==================" -docker exec music-tomcat /bin/bash -c "cat /opt/app/music/logs/MUSIC/error.log" -#cat /tmp/music/logs/MUSIC/error.log - -echo "##########################################################"; -echo "#"; -echo "# music scripts docker containers killing"; -echo "#"; -echo "##########################################################"; -docker stop music-tomcat -docker stop music-war -docker stop music-zk -docker stop music-job -docker stop music-db - -docker rm music-zk -docker rm music-tomcat -docker rm music-war -docker rm music-job -docker rm music-db - -docker network rm music-net; -sleep 5; - -docker volume rm music-vol - -#rm -Rf /tmp/music - - - - - diff --git a/scripts/optf-has/has/setup-sms.sh b/scripts/optf-has/has/setup-sms.sh deleted file mode 100755 index e6a4b227..00000000 --- a/scripts/optf-has/has/setup-sms.sh +++ /dev/null @@ -1,71 +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 - -CONFIG_FILE=$(pwd)/config/smsconfig.json - -mkdir -p $(pwd)/config - -docker login -u docker -p docker nexus3.onap.org:10001 -docker pull nexus3.onap.org:10001/onap/aaf/sms -docker pull docker.io/vault:1.3.3 - -# -# Running vault in dev server mode here for CSIT -# In HELM it runs in production mode -# -docker run -e "VAULT_DEV_ROOT_TOKEN_ID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" \ - -e SKIP_SETCAP=true \ - --name vault -d -p 8200:8200 vault:1.3.3 - -SMSDB_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vault) -cat << EOF > $CONFIG_FILE -{ - "cafile": "auth/selfsignedca.pem", - "servercert": "auth/server.cert", - "serverkey": "auth/server.key", - - "smsdbaddress": "http://$SMSDB_IP:8200", - "vaulttoken": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", - "disable_tls": true -} -EOF - -cat $CONFIG_FILE - -docker run --workdir /sms -v $CONFIG_FILE:/sms/smsconfig.json \ - --name sms -d -p 10443:10443 --user root nexus3.onap.org:10001/onap/aaf/sms - -SMS_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sms) - -echo "###### WAITING FOR ALL CONTAINERS TO COME UP" -sleep 20 -for i in {1..20}; do - curl -sS -m 1 http://${SMSDB_IP}:8200/v1/sys/seal-status && break - echo sleep $i - sleep $i -done - -# -# add here all ROBOT_VARIABLES settings -# -echo "# sms robot variables settings"; -ROBOT_VARIABLES="-v SMS_HOSTNAME:http://${SMS_IP} -v SMS_PORT:10443" - -echo ${ROBOT_VARIABLES} diff --git a/scripts/optf-has/has/simulator_script.sh b/scripts/optf-has/has/simulator_script.sh deleted file mode 100755 index c52535cb..00000000 --- a/scripts/optf-has/has/simulator_script.sh +++ /dev/null @@ -1,102 +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. -# -echo "### This is ${WORKSPACE}/scripts/optf-has/has/simulator_script.sh" -# -# add here whatever commands is needed to prepare the optf/has CSIT testing -# - -# assume the base is /tmp dir -DIR=/tmp - -# the directory of the script -echo ${DIR} -cd ${DIR} - -# the temp directory used, within $DIR -# omit the -p parameter to create a temporal directory in the default location -WORK_DIR=`mktemp -d -p "$DIR"` -echo ${WORK_DIR} -cd ${WORK_DIR} - -# clone optf-has project -git clone https://gerrit.onap.org/r/optf/has - -#echo "i am ${USER} : only non jenkins users may need proxy settings" -if [ ${USER} != 'jenkins' ]; then - - # add proxy settings into this script when you work behind a proxy - ${WORKSPACE}/scripts/optf-has/has/has_proxy_settings.sh ${WORK_DIR} - -fi - -# prepare aaisim -cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/ - -# run aaisim -./run_aaisim.sh - -AAISIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aaisim` -echo "AAISIM_IP=${AAISIM_IP}" - -${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${AAISIM_IP} 8081 - -# prepare multicloudsim -cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/multicloudsim/ - -# check Dockerfile content -cat ./Dockerfile - -# build multicloudsim -docker build -t multicloudsim . - -# run multicloudsim -docker run -d --name multicloudsim -p 8082:8082 multicloudsim - -MULTICLOUDSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' multicloudsim` -echo "MULTICLOUDSIM_IP=${MULTICLOUDSIM_IP}" - -${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${MULTICLOUDSIM_IP} 8082 - -# prepare aafsim -echo "simulator_script: prepare aafsim " -cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/aafsim/ - -# check Dockerfile content -echo "simulator_script: Dockerfile " -cat ./Dockerfile - -# build aafsim -echo "simulator_script: build docker " -docker build -t aafsim . - -# run aafsim -echo "simulator_script: run docker " -docker run -d --name aafsim -p 8100:8100 aafsim - -AAFSIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aafsim` -echo "simulator_script: AAFSIM_IP=${AAFSIM_IP}" - -#echo "simulator_script: wait_for_port" -${WORKSPACE}/scripts/optf-has/has/wait_for_port.sh ${AAFSIM_IP} 8100 - -# wait a while before continuing -sleep 2 - -echo "inspect docker things for tracing purpose" -docker inspect aaisim -docker inspect multicloudsim -docker inspect aafsim diff --git a/scripts/optf-has/has/wait_for_port.sh b/scripts/optf-has/has/wait_for_port.sh deleted file mode 100755 index 10f08ded..00000000 --- a/scripts/optf-has/has/wait_for_port.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -if [[ $# -ne 2 ]]; then - echo "Usage: wait-for-port hostname port" >&2 - exit 1 -fi - -host=$1 -port=$2 - -echo "Waiting for $host port $port open" -until telnet $host $port /dev/null | grep -q '^Connected'; do - sleep 1 -done - -echo "$host port $port is open" - -exit 0 diff --git a/scripts/optf-osdf/osdf/osdf-properties/aaf_root_ca.cer b/scripts/optf-osdf/osdf/osdf-properties/aaf_root_ca.cer deleted file mode 100644 index e9a50d7e..00000000 --- a/scripts/optf-osdf/osdf/osdf-properties/aaf_root_ca.cer +++ /dev/null @@ -1,31 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFPjCCAyagAwIBAgIJAJ6u7cCnzrWdMA0GCSqGSIb3DQEBCwUAMCwxDjAMBgNV -BAsMBU9TQUFGMQ0wCwYDVQQKDARPTkFQMQswCQYDVQQGEwJVUzAeFw0xODA0MDUx -NDE1MjhaFw0zODAzMzExNDE1MjhaMCwxDjAMBgNVBAsMBU9TQUFGMQ0wCwYDVQQK -DARPTkFQMQswCQYDVQQGEwJVUzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC -ggIBAMA5pkgRs7NhGG4ew5JouhyYakgYUyFaG121+/h8qbSdt0hVQv56+EA41Yq7 -XGie7RYDQK9NmAFF3gruE+6X7wvJiChp+Cyd7sFMnb65uWhxEdxWTM2BJFrgfzUn -H8ZCxgaCo3XH4PzlKRy2LQQJEJECwl/RZmRCXijMt5e9h8XoZY/fKkKcZZUsWNCM -pTo266wjvA9MXLmdgReRj0+vrCjrNqy+htwJDztoiHWiYPqT6o8EvGcgjNqjlZx7 -NUNf8MfLDByqKF6+wRbHv1GKjn3/Vijd45Fv8riyRYROiFanvbV6jIfBkv8PZbXg -2VDWsYsgp8NAvMxK+iV8cO+Ck3lBI2GOPZbCEqpPVTYbLUz6sczAlCXwQoPzDIZY -wYa3eR/gYLY1gP2iEVHORag3bLPap9ZX5E8DZkzTNTjovvLk8KaCmfcaUMJsBtDd -ApcUitz10cnRyZc1sX3gE1f3DpzQM6t9C5sOVyRhDcSrKqqwb9m0Ss04XAS9FsqM -P3UWYQyqDXSxlUAYaX892u8mV1hxnt2gjb22RloXMM6TovM3sSrJS0wH+l1nznd6 -aFXftS/G4ZVIVZ/LfT1is4StoyPWZCwwwly1z8qJQ/zhip5NgZTxQw4mi7ww35DY -PdAQOCoajfSvFjqslQ/cPRi/MRCu079heVb5fQnnzVtnpFQRAgMBAAGjYzBhMB0G -A1UdDgQWBBRTVTPyS+vQUbHBeJrBKDF77+rtSTAfBgNVHSMEGDAWgBRTVTPyS+vQ -UbHBeJrBKDF77+rtSTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAN -BgkqhkiG9w0BAQsFAAOCAgEAPx/IaK94n02wPxpnYTy+LVLIxwdq/kawNd6IbiMz -L87zmNMDmHcGbfoRCj8OkhuggX9Lx1/CkhpXimuYsZOFQi5blr/u+v4mIbsgbmi9 -7j+cUHDP0zLycvSvxKHty51LwmaX9a4wkJl5zBU4O1sd/H9tWcEmwJ39ltKoBKBx -c94Zc3iMm5ytRWGj+0rKzLDAXEWpoZ5bE5PLJauA6UDCxDLfs3FwhbS7uDggxYvf -jySF5FCNET94oJ+m8s7VeHvoa8iPGKvXrIqdd7XDHnqJJlVKr7m9S0fMbyEB8ci2 -RtOXDt93ifY1uhoEtEykn4dqBSp8ezvNMnwoXdYPDvTd9uCAFeWFLVreBAWxd25h -PsBTkZA5hpa/rA+mKv6Af4VBViYr8cz4dZCsFChuioVebe9ighrfjB//qKepFjPF -CyjzKN1u0JKm/2x/ORqxkTONG8p3uDwoIOyimUcTtTMv42bfYD88RKakqSFXE9G+ -Z0LlaKABqfjK49o/tsAp+c5LoNlYllKhnetO3QAdraHwdmC36BhoghzR1jpX751A -cZn2VH3Q4XKyp01cJNCJIrua+A+bx6zh3RyW6zIIkbRCbET+UD+4mr8WIcSE3mtR -ZVlnhUDO4z9//WKMVzwS9Rh8/kuszrGFI1KQozXCHLrce3YP6RYZfOed79LXaRwX -dYY= ------END CERTIFICATE----- diff --git a/scripts/optf-osdf/osdf/osdf-properties/osdf.json b/scripts/optf-osdf/osdf/osdf-properties/osdf.json deleted file mode 100644 index ae059f3e..00000000 --- a/scripts/optf-osdf/osdf/osdf-properties/osdf.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "domain": { - "name": "osdf", - "secrets": [ - { - "name": "so", - "values": { - "UserName": "", - "Password": "" - } - }, - { - "name": "conductor", - "values": { - "UserName": "admin1", - "Password": "plan.15" - } - }, - { - "name": "policyPlatform", - "values": { - "UserName": "testpdp", - "Password": "alpha123" - } - }, - { - "name": "policyClient", - "values": { - "UserName": "python", - "Password": "test" - } - }, - { - "name": "dmaap", - "values": { - "UserName": "NA", - "Password": "NA" - } - }, - { - "name": "sdc", - "values": { - "UserName": "NA", - "Password": "NA" - } - }, - { - "name": "osdfPlacement", - "values": { - "UserName": "test", - "Password": "testpwd" - } - }, - { - "name": "osdfPlacementSO", - "values": { - "UserName": "so_test", - "Password": "so_testpwd" - } - }, - { - "name": "osdfPlacementVFC", - "values": { - "UserName": "vfc_test", - "Password": "vfc_testpwd" - } - }, - { - "name": "osdfCMScheduler", - "values": { - "UserName": "test1", - "Password": "testpwd1" - } - }, - { - "name": "configDb", - "values": { - "UserName": "osdf", - "Password": "passwd" - } - }, - { - "name": "pciHMS", - "values": { - "UserName": "", - "Password": "" - } - }, - { - "name": "osdfPCIOpt", - "values": { - "UserName": "pci_test", - "Password": "pci_testpwd" - } - }, - { - "name": "osdfOptEngine", - "values": { - "UserName": "opt_test", - "Password": "opt_testpwd" - } - } - ] - } -} \ No newline at end of file diff --git a/scripts/optf-osdf/osdf/osdf-properties/osdf_config.yaml b/scripts/optf-osdf/osdf/osdf-properties/osdf_config.yaml deleted file mode 100755 index 95856df8..00000000 --- a/scripts/optf-osdf/osdf/osdf-properties/osdf_config.yaml +++ /dev/null @@ -1,52 +0,0 @@ -placementVersioningEnabled: False - -# Placement API latest version numbers to be set in HTTP header -placementMajorVersion: "1" -placementMinorVersion: "0" -placementPatchVersion: "0" - -# Placement API default version numbers to be set in HTTP header -placementDefaultMajorVersion: "1" -placementDefaultMinorVersion: "0" -placementDefaultPatchVersion: "0" - -# Config for Conductor -conductorUrl: "http://127.0.0.1:5000/simulated/oof/has-api/flow1-success-simple/main.json" -conductorPingWaitTime: 2 # seconds to wait before calling the conductor retry URL -conductorMaxRetries: 5 # if we don't get something in 30 minutes, give up -# versions to be set in HTTP header -conductorMinorVersion: 0 - -# Policy Platform -- requires ClientAuth, Authorization, and Environment -policyPlatformUrl: http://127.0.0.1:5000/simulated/policy/pdpx/decision/v1 # Policy Dev platform URL -policyPlatformEnv: TEST # Environment for policy platform - -# Config for DMaaP -messageReaderHosts: https://DMAAP-HOST1:3905,https://DMAAP-HOST2:3905,https://DMAAP-HOST3:3905 -messageReaderTopic: org.onap.oof.osdf.multicloud - -# Config for SDC -sdcUrl: https://SDC-HOST:8443/sdc/v1/catalog -sdcONAPInstanceID: ONAP-OSDF - -osdfPlacementUrl: "http://127.0.0.1:24699/osdf/api/v2/placement" - -is_aaf_enabled: False -aaf_cache_expiry_hrs: 3 -aaf_url: https://aaftest.simpledemo.onap.org:8095 -aaf_user_roles: - - /api/oof/v1/placement:org.onap.osdf.access|*|read ALL - -# Secret Management Service from AAF -aaf_sms_url: http://aaf-sms.onap:10443 -aaf_sms_timeout: 30 -secret_domain: osdf -aaf_ca_certs: ssl_certs/aaf_root_ca.cer - -# config db api -configDbUrl: http://127.0.0.1:5000/simulated/configdb -configDbGetCellListUrl: 'getCellList' -configDbGetNbrListUrl: 'getNbrList' - -#key -appkey: diff --git a/scripts/optf-osdf/osdf/osdf_proxy_settings.sh b/scripts/optf-osdf/osdf/osdf_proxy_settings.sh deleted file mode 100755 index b68fca97..00000000 --- a/scripts/optf-osdf/osdf/osdf_proxy_settings.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# ------------------------------------------------------------------------- -# Copyright (c) 2018 AT&T Intellectual Property -# -# 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. -# -# ------------------------------------------------------------------------- -# - -# put into this file local proxy settings in case they are needed on your local environment -echo "### This is ${WORKSPACE}/scripts/optf-osdf/osdf/osdf_proxy_settings.sh" - -echo "optf/osdf proxy settings" -if [ "$#" -eq "1" ]; then - echo "$1" - cd $1 - pwd -else - exit 1 -fi - -# don't remove following lines: commands can be attached here - - diff --git a/scripts/optf-osdf/osdf/osdf_script.sh b/scripts/optf-osdf/osdf/osdf_script.sh deleted file mode 100755 index 2f2d0c90..00000000 --- a/scripts/optf-osdf/osdf/osdf_script.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# -# ------------------------------------------------------------------------- -# Copyright (c) 2018 AT&T Intellectual Property -# -# 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. -# -# ------------------------------------------------------------------------- -# - -echo "### This is ${WORKSPACE}/scripts/optf-osdf/osdf/osdf_script.sh" -# -# add here whatever commands is needed to prepare the optf/osdf CSIT testing -# - -# assume the base is /tmp dir -DIR=/tmp - -# the directory of the script -echo ${DIR} -cd ${DIR} - -# create directory for volume and copy configuration file -# run docker containers -OSDF_CONF=/tmp/osdf/properties/osdf_config.yaml -IMAGE_NAME=nexus3.onap.org:10001/onap/optf-osdf -IMAGE_VER=2.0.3-SNAPSHOT-latest - -mkdir -p /tmp/osdf/properties -mkdir -p /tmp/sms/properties - -cp ${WORKSPACE}/scripts/optf-osdf/osdf/osdf-properties/*.yaml /tmp/osdf/properties/. -cp ${WORKSPACE}/scripts/optf-osdf/osdf/osdf-properties/osdf.json /tmp/sms/properties/. - -#change conductor/configdb simulator urls -OSDF_SIM_IP=`get-instance-ip.sh osdf_sim` -echo "OSDF_SIM_IP=${OSDF_SIM_IP}" -SMS_IP=`get-instance-ip.sh sms` -echo "SMS_IP=${SMS_IP}" - -sed -i -e "s%127.0.0.1:5000%${OSDF_SIM_IP}:5000%g" $OSDF_CONF -sed -i -e "s%aaf-sms.onap:10443%${SMS_IP}:10443%g" $OSDF_CONF - -#Preload secrets -docker exec --user root -i sms /bin/sh -c "mkdir -p /preload/config" -docker cp /tmp/sms/properties/osdf.json sms:/preload/config/osdf.json -docker exec --user root -i sms /bin/sh -c "/sms/bin/preload -cacert /sms/certs/aaf_root_ca.cer -jsondir /preload/config -serviceport 10443 -serviceurl http://localhost" - -docker logs vault -docker run -d --name optf-osdf -v ${OSDF_CONF}:/opt/osdf/config/osdf_config.yaml -p "8698:8699" ${IMAGE_NAME}:${IMAGE_VER} - -sleep 20 - -OSDF_IP=`get-instance-ip.sh optf-osdf` -${WORKSPACE}/scripts/optf-osdf/osdf/wait_for_port.sh ${OSDF_IP} 8699 - -echo "inspect docker things for tracing purpose" -docker inspect optf-osdf diff --git a/scripts/optf-osdf/osdf/setup-sms.sh b/scripts/optf-osdf/osdf/setup-sms.sh deleted file mode 100755 index e6a4b227..00000000 --- a/scripts/optf-osdf/osdf/setup-sms.sh +++ /dev/null @@ -1,71 +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 - -CONFIG_FILE=$(pwd)/config/smsconfig.json - -mkdir -p $(pwd)/config - -docker login -u docker -p docker nexus3.onap.org:10001 -docker pull nexus3.onap.org:10001/onap/aaf/sms -docker pull docker.io/vault:1.3.3 - -# -# Running vault in dev server mode here for CSIT -# In HELM it runs in production mode -# -docker run -e "VAULT_DEV_ROOT_TOKEN_ID=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" \ - -e SKIP_SETCAP=true \ - --name vault -d -p 8200:8200 vault:1.3.3 - -SMSDB_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vault) -cat << EOF > $CONFIG_FILE -{ - "cafile": "auth/selfsignedca.pem", - "servercert": "auth/server.cert", - "serverkey": "auth/server.key", - - "smsdbaddress": "http://$SMSDB_IP:8200", - "vaulttoken": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", - "disable_tls": true -} -EOF - -cat $CONFIG_FILE - -docker run --workdir /sms -v $CONFIG_FILE:/sms/smsconfig.json \ - --name sms -d -p 10443:10443 --user root nexus3.onap.org:10001/onap/aaf/sms - -SMS_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sms) - -echo "###### WAITING FOR ALL CONTAINERS TO COME UP" -sleep 20 -for i in {1..20}; do - curl -sS -m 1 http://${SMSDB_IP}:8200/v1/sys/seal-status && break - echo sleep $i - sleep $i -done - -# -# add here all ROBOT_VARIABLES settings -# -echo "# sms robot variables settings"; -ROBOT_VARIABLES="-v SMS_HOSTNAME:http://${SMS_IP} -v SMS_PORT:10443" - -echo ${ROBOT_VARIABLES} diff --git a/scripts/optf-osdf/osdf/simulator_script.sh b/scripts/optf-osdf/osdf/simulator_script.sh deleted file mode 100755 index 8f3f7d36..00000000 --- a/scripts/optf-osdf/osdf/simulator_script.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# -# ------------------------------------------------------------------------- -# Copyright (c) 2018 AT&T Intellectual Property -# -# 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. -# -# ------------------------------------------------------------------------- -# - -echo "### This is ${WORKSPACE}/scripts/optf-osdf/osdf/simulator_script.sh" -# -# add here whatever commands is needed to prepare the optf/osdf CSIT testing -# -# assume the base is /tmp dir - -DIR=/tmp - -# the directory of the script -echo ${DIR} -cd ${DIR} - -# the temp directory used, within $DIR -# omit the -p parameter to create a temporal directory in the default location -WORK_DIR=`mktemp -d -p "$DIR"` -echo ${WORK_DIR} -cd ${WORK_DIR} - -# clone optf-osdf project -git clone https://gerrit.onap.org/r/optf/osdf - -#echo "i am ${USER} : only non jenkins users may need proxy settings" -if [ ${USER} != 'jenkins' ]; then - - # add proxy settings into this script when you work behind a proxy - ${WORKSPACE}/scripts/optf-osdf/osdf/osdf_proxy_settings.sh ${WORK_DIR} - -fi - -# prepare osdf_sim -cd ${WORK_DIR}/osdf/test/functest/simulators - -# check Dockerfile content -cat ./Dockerfile - -# build osdf_sim -chmod +x ./build_sim_image.sh -./build_sim_image.sh - -# run osdf_sim -docker run -d --name osdf_sim -p "5000:5000" osdf_sim:latest; - -OSDF_SIM_IP=`get-instance-ip.sh osdf_sim` -echo "OSDF_SIM_IP=${OSDF_SIM_IP}" - -${WORKSPACE}/scripts/optf-osdf/osdf/wait_for_port.sh ${OSDF_SIM_IP} 5000 - - -# wait a while before continuing -sleep 2 - -echo "inspect docker things for tracing purpose" -docker inspect osdf_sim - diff --git a/scripts/optf-osdf/osdf/wait_for_port.sh b/scripts/optf-osdf/osdf/wait_for_port.sh deleted file mode 100755 index 360fc210..00000000 --- a/scripts/optf-osdf/osdf/wait_for_port.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# ------------------------------------------------------------------------- -# Copyright (c) 2018 AT&T Intellectual Property -# -# 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. -# -# ------------------------------------------------------------------------- -# - -if [[ $# -ne 2 ]]; then - echo "Usage: wait-for-port hostname port" >&2 - exit 1 -fi - -host=$1 -port=$2 - -echo "Waiting for $host port $port open" -until telnet $host $port /dev/null | grep -q '^Connected'; do - sleep 1 -done - -echo "$host port $port is open" - -exit 0 diff --git a/scripts/policy/config/apex-pdp/OnapPfConfig.json b/scripts/policy/config/apex-pdp/OnapPfConfig.json deleted file mode 100644 index 59ba604d..00000000 --- a/scripts/policy/config/apex-pdp/OnapPfConfig.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name":"OnapPfParameterGroup", - "restServerParameters": { - "host": "0.0.0.0", - "port": 6969, - "userName": "healthcheck", - "password": "zb!XztG34", - "https": true - }, - "pdpStatusParameters":{ - "pdpGroup": "defaultGroup", - "timeIntervalMs": 120000, - "pdpType":"apex", - "description":"Pdp Heartbeat", - "supportedPolicyTypes": [ - { - "name": "onap.policies.controlloop.operational.common.Apex", - "version": "1.0.0" - }, - { - "name": "onap.policies.native.Apex", - "version": "1.0.0" - } - ] - }, - "topicParameterGroup": { - "topicSources" : [{ - "topic" : "POLICY-PDP-PAP", - "servers" : [ "policy.api.simpledemo.onap.org" ], - "topicCommInfrastructure" : "dmaap", - "useHttps" : true, - "allowSelfSignedCerts" : true - }], - "topicSinks" : [{ - "topic" : "POLICY-PDP-PAP", - "servers" : [ "policy.api.simpledemo.onap.org" ], - "topicCommInfrastructure" : "dmaap", - "useHttps" : true, - "allowSelfSignedCerts" : true - }] - } -} diff --git a/scripts/policy/config/db/db.sh b/scripts/policy/config/db/db.sh deleted file mode 100755 index 24b04003..00000000 --- a/scripts/policy/config/db/db.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -xv -# Copyright 2019 AT&T Intellectual Property. All rights reserved -# -# 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. - -for db in support onap_sdk log migration operationshistory10 pooling policyadmin operationshistory -do - mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};" - mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;" -done - -mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;" diff --git a/scripts/policy/config/distribution/defaultConfig.json b/scripts/policy/config/distribution/defaultConfig.json deleted file mode 100644 index facee9bc..00000000 --- a/scripts/policy/config/distribution/defaultConfig.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name":"SDCDistributionGroup", - "restServerParameters":{ - "host":"0.0.0.0", - "port":6969, - "userName":"healthcheck", - "password":"zb!XztG34", - "https": true - }, - "receptionHandlerParameters":{ - "FileReceptionHandler":{ - "receptionHandlerType":"File", - "receptionHandlerClassName":"org.onap.policy.distribution.reception.handling.file.FileSystemReceptionHandler", - "receptionHandlerConfigurationName":"fileConfiguration", - "pluginHandlerParameters":{ - "policyDecoders":{ - "ApexDecoder":{ - "decoderType":"ApexDecoder", - "decoderClassName":"org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicy", - "decoderConfigurationName": "apexDecoderConfiguration" - } - }, - "policyForwarders":{ - "LifeCycleApiForwarder":{ - "forwarderType":"LifeCycleAPI", - "forwarderClassName":"org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiPolicyForwarder", - "forwarderConfigurationName": "lifecycleApiConfiguration" - } - } - } - } - }, - "receptionHandlerConfigurationParameters":{ - "fileConfiguration":{ - "parameterClassName":"org.onap.policy.distribution.reception.handling.file.FileSystemReceptionHandlerConfigurationParameterGroup", - "parameters":{ - "watchPath": "/opt/app/policy/distribution/etc/temp/", - "maxThread": 1 - } - } - }, - "policyDecoderConfigurationParameters":{ - "apexDecoderConfiguration":{ - "parameterClassName":"org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicyParameterGroup", - "parameters":{ - "policyFileName": "apex_policy.json", - "policyTypeFileName": "apex_policy_type.json" - } - } - }, - "policyForwarderConfigurationParameters":{ - "lifecycleApiConfiguration":{ - "parameterClassName":"org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiForwarderParameters", - "parameters":{ - "apiParameters": { - "hostName": "policy-api", - "port": 6969, - "userName": "healthcheck", - "password": "zb!XztG34" - }, - "papParameters": { - "hostName": "policy-pap", - "port": 6969, - "userName": "healthcheck", - "password": "zb!XztG34" - }, - "isHttps": true, - "deployPolicies": true - } - } - } -} diff --git a/scripts/policy/config/drools-apps/custom/features.pre.sh b/scripts/policy/config/drools-apps/custom/features.pre.sh deleted file mode 100755 index e9c77a0f..00000000 --- a/scripts/policy/config/drools-apps/custom/features.pre.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -x -# ============LICENSE_START=================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END===================================================== - -bash -c "features disable distributed-locking" diff --git a/scripts/policy/config/drools-apps/custom/standalone-settings.xml b/scripts/policy/config/drools-apps/custom/standalone-settings.xml deleted file mode 100644 index ebd6dd2a..00000000 --- a/scripts/policy/config/drools-apps/custom/standalone-settings.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - true - - - - - policy-local - - - - file-repository - file:${user.home}/.m2/file-repository - - true - always - - - true - always - - - - - - - - - - policy-local - - - diff --git a/scripts/policy/config/drools-apps/env/base.conf b/scripts/policy/config/drools-apps/env/base.conf deleted file mode 100644 index 673cfaf3..00000000 --- a/scripts/policy/config/drools-apps/env/base.conf +++ /dev/null @@ -1,132 +0,0 @@ -# ============LICENSE_START================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# =========================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END==================================================== - -# JVM options - -JVM_OPTIONS=-server -Xms512m -Xmx512m - -# SYSTEM software configuration - -DEBUG=y -POLICY_HOME=/opt/app/policy -POLICY_LOGS=/var/log/onap/policy/pdpd -KEYSTORE_PASSWD=Pol1cy_0nap -TRUSTSTORE_PASSWD=Pol1cy_0nap - -# Telemetry credentials - -TELEMETRY_PORT=9696 -TELEMETRY_HOST=0.0.0.0 -TELEMETRY_USER=demo@people.osaaf.org -TELEMETRY_PASSWORD=demo123456! - -# nexus repository - -SNAPSHOT_REPOSITORY_ID= -SNAPSHOT_REPOSITORY_URL= -RELEASE_REPOSITORY_ID= -RELEASE_REPOSITORY_URL= -REPOSITORY_USERNAME= -REPOSITORY_PASSWORD= -REPOSITORY_OFFLINE=true - -# Relational (SQL) DB access - -SQL_HOST=mariadb -SQL_USER=policy_user -SQL_PASSWORD=policy_user - -# AAF - -AAF=false -AAF_NAMESPACE=org.onap.policy -AAF_HOST=aaf.api.simpledemo.onap.org - -# PDP-D DMaaP configuration channel - -PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION -PDPD_CONFIGURATION_API_KEY= -PDPD_CONFIGURATION_API_SECRET= -PDPD_CONFIGURATION_CONSUMER_GROUP= -PDPD_CONFIGURATION_CONSUMER_INSTANCE= -PDPD_CONFIGURATION_PARTITION_KEY= - -# PAP-PDP configuration channel - -POLICY_PDP_PAP_TOPIC=POLICY-PDP-PAP -POLICY_PDP_PAP_API_KEY= -POLICY_PDP_PAP_API_SECRET= - -# PAP - -PAP_HOST=pap -PAP_USERNAME=testpap -PAP_PASSWORD=alpha123 - -# PDP-X - -GUARD_DISABLED=false -PDP_HOST=policy-xacml-pdp -PDP_PORT=6969 -PDP_CONTEXT_URI=policy/pdpx/v1/ -PDP_USERNAME=healthcheck -PDP_PASSWORD=zb!XztG34 -PDP_CLIENT_USERNAME=python -PDP_CLIENT_PASSWORD=test -PDP_ENVIRONMENT=TEST - -# DCAE DMaaP - -DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT -DCAE_SERVERS=policy.api.simpledemo.onap.org -DCAE_CONSUMER_GROUP=dcae.policy.shared - -# Open DMaaP - -DMAAP_SERVERS=policy.api.simpledemo.onap.org - -# AAI - -AAI_HOST=policy.api.simpledemo.onap.org -AAI_PORT=6666 -AAI_CONTEXT_URI= -AAI_USERNAME=policy@policy.onap.org -AAI_PASSWORD=demo123456! - -# MSO - -SO_HOST=policy.api.simpledemo.onap.org -SO_PORT=6669 -SO_CONTEXT_URI= -SO_URL=https://policy.api.simpledemo.onap.org:6669/ -SO_USERNAME=InfraPortalClient -SO_PASSWORD=password1$ - -# VFC - -VFC_HOST=policy.api.simpledemo.onap.org -VFC_PORT=6670 -VFC_CONTEXT_URI= -VFC_USERNAME= -VFC_PASSWORD= - -# SDNC - -SDNC_HOST=policy.api.simpledemo.onap.org -SDNC_PORT=6668 -SDNC_CONTEXT_URI= -SDNC_USERNAME= -SDNC_PASSWORD= diff --git a/scripts/policy/config/drools-apps/env/feature-healthcheck.conf b/scripts/policy/config/drools-apps/env/feature-healthcheck.conf deleted file mode 100644 index 1c710547..00000000 --- a/scripts/policy/config/drools-apps/env/feature-healthcheck.conf +++ /dev/null @@ -1,18 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= - -HEALTHCHECK_USER=demo@people.osaaf.org -HEALTHCHECK_PASSWORD=demo123456! diff --git a/scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf b/scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf deleted file mode 100644 index 3808e3d9..00000000 --- a/scripts/policy/config/drools-apps/env/feature-pooling-dmaap.conf +++ /dev/null @@ -1,17 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= - -POOLING_TOPIC=POOLING diff --git a/scripts/policy/config/drools/custom/noop.pre.sh b/scripts/policy/config/drools/custom/noop.pre.sh deleted file mode 100755 index 63bdc4cf..00000000 --- a/scripts/policy/config/drools/custom/noop.pre.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -x -# ============LICENSE_START======================================================= -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= - -sed -i "s/^dmaap/noop/g" \ - ${POLICY_HOME}/config/engine.properties \ - ${POLICY_HOME}/config/feature-lifecycle.properties - -chmod 644 ${POLICY_HOME}/config/engine.properties ${POLICY_HOME}/config/feature-lifecycle.properties diff --git a/scripts/policy/config/drools/env/base.conf b/scripts/policy/config/drools/env/base.conf deleted file mode 100644 index 891de49f..00000000 --- a/scripts/policy/config/drools/env/base.conf +++ /dev/null @@ -1,132 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= - -# JVM options - -JVM_OPTIONS=-server -Xms512m -Xmx512m - -# SYSTEM software configuration - -DEBUG=y -POLICY_HOME=/opt/app/policy -POLICY_LOGS=/var/log/onap/policy/pdpd -KEYSTORE_PASSWD=Pol1cy_0nap -TRUSTSTORE_PASSWD=Pol1cy_0nap - -# Telemetry credentials - -TELEMETRY_PORT=9696 -TELEMETRY_HOST=0.0.0.0 -TELEMETRY_USER=demo@people.osaaf.org -TELEMETRY_PASSWORD=demo123456! - -# nexus repository - -SNAPSHOT_REPOSITORY_ID=policy-nexus-snapshots -SNAPSHOT_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/snapshots/ -RELEASE_REPOSITORY_ID=policy-nexus-releases -RELEASE_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/releases/ -REPOSITORY_USERNAME=admin -REPOSITORY_PASSWORD=admin123 -REPOSITORY_OFFLINE=false - -# Relational (SQL) DB access - -SQL_HOST=mariadb -SQL_USER=policy_user -SQL_PASSWORD=policy_user - -# AAF - -AAF=false -AAF_NAMESPACE=org.onap.policy -AAF_HOST=aaf.api.simpledemo.onap.org - -# PDP-D DMaaP configuration channel - -PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION -PDPD_CONFIGURATION_API_KEY= -PDPD_CONFIGURATION_API_SECRET= -PDPD_CONFIGURATION_CONSUMER_GROUP= -PDPD_CONFIGURATION_CONSUMER_INSTANCE= -PDPD_CONFIGURATION_PARTITION_KEY= - -# PAP-PDP configuration channel - -POLICY_PDP_PAP_TOPIC=POLICY-PDP-PAP -POLICY_PDP_PAP_API_KEY= -POLICY_PDP_PAP_API_SECRET= - -# PAP - -PAP_HOST= -PAP_USERNAME= -PAP_PASSWORD= - -# PDP-X - -PDP_HOST= -PDP_PORT= -PDP_CONTEXT_URI=policy/pdpx/v1/ -PDP_USERNAME= -PDP_PASSWORD= -PDP_CLIENT_USERNAME= -PDP_CLIENT_PASSWORD= -PDP_ENVIRONMENT= -GUARD_DISABLED=false - -# DCAE DMaaP - -DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT -DCAE_SERVERS= -DCAE_CONSUMER_GROUP=dcae.policy.shared - -# Open DMaaP - -DMAAP_SERVERS=mr.api.simpledemo.onap.org - -# AAI - -AAI_HOST=aai.api.simpledemo.onap.org -AAI_PORT=8443 -AAI_CONTEXT_URI= -AAI_USERNAME=policy@policy.onap.org -AAI_PASSWORD=demo123456! - -# MSO - -SO_HOST=vm1.mso.simpledemo.onap.org -SO_PORT=8080 -SO_CONTEXT_URI=onap/so/infra/ -SO_URL=http://vm1.mso.simpledemo.onap.org:8080/onap/so/infra -SO_USERNAME=InfraPortalClient -SO_PASSWORD=password1$ - -# VFC - -VFC_HOST= -VFC_PORT= -VFC_CONTEXT_URI=api/nslcm/v1/ -VFC_USERNAME= -VFC_PASSWORD= - -# SDNC - -SDNC_HOST= -SDNC_PORT= -SDNC_CONTEXT_URI=restconf/operations/ -SDNC_USERNAME= -SDNC_PASSWORD= diff --git a/scripts/policy/config/pap/defaultConfig.json b/scripts/policy/config/pap/defaultConfig.json deleted file mode 100644 index 1e47c7e7..00000000 --- a/scripts/policy/config/pap/defaultConfig.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "PapGroup", - "restServerParameters": { - "host": "0.0.0.0", - "port": 6969, - "userName": "healthcheck", - "password": "zb!XztG34", - "https": true, - "aaf": false - }, - "pdpParameters": { - "heartBeatMs": 120000, - "updateParameters": { - "maxRetryCount": 1, - "maxWaitMs": 30000 - }, - "stateChangeParameters": { - "maxRetryCount": 1, - "maxWaitMs": 30000 - } - }, - "databaseProviderParameters": { - "name": "PolicyProviderParameterGroup", - "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl", - "databaseDriver": "org.mariadb.jdbc.Driver", - "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin", - "databaseUser": "policy_user", - "databasePassword": "policy_user", - "persistenceUnit": "PolicyMariaDb" - }, - "topicParameterGroup": { - "topicSources" : [{ - "topic" : "POLICY-PDP-PAP", - "servers" : [ "policy.api.simpledemo.onap.org" ], - "topicCommInfrastructure" : "dmaap", - "useHttps": true, - "allowSelfSignedCerts" : true - }], - "topicSinks" : [{ - "topic" : "POLICY-PDP-PAP", - "servers" : [ "policy.api.simpledemo.onap.org" ], - "topicCommInfrastructure" : "dmaap", - "useHttps": true, - "allowSelfSignedCerts" : true - }, - { - "topic" : "POLICY-NOTIFICATION", - "servers" : [ "policy.api.simpledemo.onap.org" ], - "topicCommInfrastructure" : "dmaap", - "useHttps": true, - "allowSelfSignedCerts" : true - }] - }, - "healthCheckRestClientParameters":[{ - "clientName": "api", - "hostname": "policy-api", - "port": 6969, - "userName": "healthcheck", - "password": "zb!XztG34", - "useHttps": true, - "allowSelfSignedCerts" : true, - "basePath": "policy/api/v1/healthcheck" - }] -} diff --git a/scripts/policy/config/policy-csit.conf b/scripts/policy/config/policy-csit.conf deleted file mode 100644 index 95c14504..00000000 --- a/scripts/policy/config/policy-csit.conf +++ /dev/null @@ -1,7 +0,0 @@ -POLICY_MARIADB_VER=10.2.25 -NEXUS_URL=https://nexus.onap.org/content/repositories/snapshots - -GIT_TOP=$(git rev-parse --show-toplevel) -GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \ - "${GIT_TOP}"/.gitreview) -echo GERRIT_BRANCH=${GERRIT_BRANCH} diff --git a/scripts/policy/config/sim-all/simParameters.json b/scripts/policy/config/sim-all/simParameters.json deleted file mode 100644 index 4b009b6f..00000000 --- a/scripts/policy/config/sim-all/simParameters.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "dmaapProvider": { - "name": "DMaaP simulator", - "topicSweepSec": 300 - }, - "restServers": [ - { - "name": "DMaaP simulator", - "providerClass": "org.onap.policy.models.sim.dmaap.rest.DmaapSimRestControllerV1", - "host": "0.0.0.0", - "port": 3905, - "https": true - }, - { - "name": "A&AI simulator", - "providerClass": "org.onap.policy.simulators.AaiSimulatorJaxRs", - "host": "0.0.0.0", - "port": 6666, - "https": true, - "userName": "policy@policy.onap.org", - "password": "demo123456!" - }, - { - "name": "SDNC simulator", - "providerClass": "org.onap.policy.simulators.SdncSimulatorJaxRs", - "host": "0.0.0.0", - "port": 6668, - "https": true - }, - { - "name": "SO simulator", - "providerClass": "org.onap.policy.simulators.SoSimulatorJaxRs", - "host": "0.0.0.0", - "port": 6669, - "https": false, - "userName": "InfraPortalClient", - "password": "password1$" - }, - { - "name": "VFC simulator", - "providerClass": "org.onap.policy.simulators.VfcSimulatorJaxRs", - "host": "0.0.0.0", - "port": 6670, - "https": true - } - ], - "topicSinks": [ - { - "topic": "APPC-CL", - "servers": ["${HOST_NAME}"], - "topicCommInfrastructure": "DMAAP", - "useHttps": true, - "apiKey": "some-key", - "apiSecret": "some-secret" - }, - { - "topic": "APPC-LCM-WRITE", - "servers": ["${HOST_NAME}"], - "topicCommInfrastructure": "DMAAP", - "useHttps": true, - "apiKey": "some-key", - "apiSecret": "some-secret" - } - ], - "topicSources": [ - { - "topic": "APPC-CL", - "servers": ["${HOST_NAME}"], - "topicCommInfrastructure": "DMAAP", - "useHttps": true, - "apiKey": "some-key", - "apiSecret": "some-secret" - }, - { - "topic": "APPC-LCM-READ", - "servers": ["${HOST_NAME}"], - "topicCommInfrastructure": "DMAAP", - "useHttps": true, - "apiKey": "some-key", - "apiSecret": "some-secret" - } - ], - "topicServers": [ - { - "name": "APPC Legacy simulator", - "providerClass": "org.onap.policy.simulators.AppcLegacyTopicServer", - "sink": "APPC-CL", - "source": "APPC-CL" - }, - { - "name": "APPC-LCM simulator", - "providerClass": "org.onap.policy.simulators.AppcLcmTopicServer", - "sink": "APPC-LCM-WRITE", - "source": "APPC-LCM-READ" - } - ], - "grpcServer": { - "name": "CDS simulator", - "providerClass": "org.onap.policy.simulators.CdsSimulator", - "host": "0.0.0.0", - "port": 6680, - "timeout": 30, - "username": "ccsdkapps", - "password": "ccsdkapps", - "resourceLocation": "org/onap/policy/simulators/cds/", - "successRepeatCount": 0, - "requestedResponseDelayMs": 0 - } -} diff --git a/scripts/policy/config/xacml-pdp/defaultConfig.json b/scripts/policy/config/xacml-pdp/defaultConfig.json deleted file mode 100644 index 5a6573a3..00000000 --- a/scripts/policy/config/xacml-pdp/defaultConfig.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "XacmlPdpParameters", - "pdpGroup": "defaultGroup", - "restServerParameters": { - "host": "0.0.0.0", - "port": 6969, - "userName": "healthcheck", - "password": "zb!XztG34", - "https": true, - "aaf": false - }, - "policyApiParameters": { - "host": "policy-api", - "port": 6969, - "userName": "healthcheck", - "password": "zb!XztG34", - "https": true, - "aaf": false - }, - "applicationPath": "/opt/app/policy/pdpx/apps", - "topicParameterGroup": { - "topicSources" : [{ - "topic" : "POLICY-PDP-PAP", - "servers" : [ "policy.api.simpledemo.onap.org" ], - "topicCommInfrastructure" : "dmaap", - "useHttps" : true, - "allowSelfSignedCerts" : true - }], - "topicSinks" : [{ - "topic" : "POLICY-PDP-PAP", - "servers" : [ "policy.api.simpledemo.onap.org" ], - "topicCommInfrastructure" : "dmaap", - "useHttps" : true, - "allowSelfSignedCerts" : true - }] - } -} diff --git a/scripts/policy/detmVers.sh b/scripts/policy/detmVers.sh deleted file mode 100644 index d37b4792..00000000 --- a/scripts/policy/detmVers.sh +++ /dev/null @@ -1,80 +0,0 @@ -# ============LICENSE_START==================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================= -# 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====================================================== - -SCRIPTS="${SCRIPTS-scripts}" - -source ${SCRIPTS}/policy/config/policy-csit.conf -export POLICY_MARIADB_VER - -echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER} - -POLICY_MODELS_VERSION=$( - curl -q --silent \ - https://git.onap.org/policy/models/plain/pom.xml?h=${GERRIT_BRANCH} | - xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -) -export POLICY_MODELS_VERSION=${POLICY_MODELS_VERSION:0:3}-SNAPSHOT-latest -echo POLICY_MODELS_VERSION=${POLICY_MODELS_VERSION} - -POLICY_API_VERSION=$( - curl -q --silent \ - https://git.onap.org/policy/api/plain/pom.xml?h=${GERRIT_BRANCH} | - xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -) -export POLICY_API_VERSION=${POLICY_API_VERSION:0:3}-SNAPSHOT-latest -echo POLICY_API_VERSION=${POLICY_API_VERSION} - -POLICY_PAP_VERSION=$( - curl -q --silent \ - https://git.onap.org/policy/pap/plain/pom.xml?h=${GERRIT_BRANCH} | - xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -) -export POLICY_PAP_VERSION=${POLICY_PAP_VERSION:0:3}-SNAPSHOT-latest -echo POLICY_PAP_VERSION=${POLICY_PAP_VERSION} - -POLICY_XACML_PDP_VERSION=$( - curl -q --silent \ - https://git.onap.org/policy/xacml-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | - xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -) -export POLICY_XACML_PDP_VERSION=${POLICY_XACML_PDP_VERSION:0:3}-SNAPSHOT-latest -echo POLICY_XACML_PDP_VERSION=${POLICY_XACML_PDP_VERSION} - -POLICY_DROOLS_VERSION=$( - curl -q --silent \ - https://git.onap.org/policy/drools-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | - xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -) -export POLICY_DROOLS_VERSION=${POLICY_DROOLS_VERSION:0:3}-SNAPSHOT-latest -echo POLICY_DROOLS_VERSION=${POLICY_DROOLS_VERSION} - -POLICY_DROOLS_APPS_VERSION=$( - curl -q --silent \ - https://git.onap.org/policy/drools-applications/plain/pom.xml?h=${GERRIT_BRANCH} | - xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -) -export POLICY_DROOLS_APPS_VERSION=${POLICY_DROOLS_APPS_VERSION:0:3}-SNAPSHOT-latest -echo POLICY_DROOLS_APPS_VERSION=${POLICY_DROOLS_APPS_VERSION} - -POLICY_APEX_PDP_VERSION=$( - curl -q --silent \ - https://git.onap.org/policy/apex-pdp/plain/pom.xml?h=${GERRIT_BRANCH} | - xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -) -export POLICY_APEX_PDP_VERSION=${POLICY_APEX_PDP_VERSION:0:3}-SNAPSHOT-latest -echo POLICY_APEX_PDP_VERSION=${POLICY_APEX_PDP_VERSION} - -POLICY_DISTRIBUTION_VERSION=$( - curl -q --silent \ - https://git.onap.org/policy/distribution/plain/pom.xml?h=${GERRIT_BRANCH} | - xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' -) -export POLICY_DISTRIBUTION_VERSION=${POLICY_DISTRIBUTION_VERSION:0:3}-SNAPSHOT-latest -echo POLICY_DISTRIBUTION_VERSION=${POLICY_DISTRIBUTION_VERSION} diff --git a/scripts/policy/docker-compose-all.yml b/scripts/policy/docker-compose-all.yml deleted file mode 100644 index 7b1f00a0..00000000 --- a/scripts/policy/docker-compose-all.yml +++ /dev/null @@ -1,190 +0,0 @@ -# -# ===========LICENSE_START==================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END===================================================== -# -version: '2' -services: - mariadb: - image: nexus3.onap.org:10001/mariadb:${POLICY_MARIADB_VER} - container_name: mariadb - hostname: mariadb - command: ['--lower-case-table-names=1', '--wait_timeout=28800'] - env_file: config/db/db.conf - volumes: - - ./config/db:/docker-entrypoint-initdb.d:ro - expose: - - 3306 - policy.api.simpledemo.onap.org: - image: nexus3.onap.org:10001/onap/policy-models-simulator:${POLICY_MODELS_VERSION} - container_name: policy.api.simpledemo.onap.org - hostname: policy.api.simpledemo.onap.org - volumes: - - ./config/sim-all:/opt/app/policy/simulators/etc/mounted:ro - expose: - - 6666 - - 6668 - - 6669 - - 6670 - - 3905 - api: - image: nexus3.onap.org:10001/onap/policy-api:${POLICY_API_VERSION} - container_name: policy-api - depends_on: - - mariadb - hostname: policy-api - expose: - - 6969 - volumes: - - ./wait_for_port.sh:/opt/app/policy/api/bin/wait_for_port.sh:ro - entrypoint: ./wait_for_port.sh - command: [ - '-c', 'bash ./policy-api.sh', - 'mariadb', '3306' - ] - pap: - image: nexus3.onap.org:10001/onap/policy-pap:${POLICY_PAP_VERSION} - container_name: policy-pap - depends_on: - - mariadb - - policy.api.simpledemo.onap.org - - api - hostname: policy-pap - expose: - - 6969 - volumes: - - ./config/pap/defaultConfig.json:/opt/app/policy/pap/etc/defaultConfig.json:ro - - ./wait_for_port.sh:/opt/app/policy/pap/bin/wait_for_port.sh:ro - entrypoint: ./wait_for_port.sh - command: [ - '-c', 'bash ./policy-pap.sh', - 'mariadb', '3306', - 'policy.api.simpledemo.onap.org', '3905', - 'api', '6969' - ] - xacml-pdp: - image: nexus3.onap.org:10001/onap/policy-xacml-pdp:${POLICY_XACML_PDP_VERSION} - container_name: policy-xacml-pdp - depends_on: - - mariadb - - policy.api.simpledemo.onap.org - - pap - hostname: policy-xacml-pdp - expose: - - 6969 - volumes: - - ./config/xacml-pdp/defaultConfig.json:/opt/app/policy/pdpx/etc/defaultConfig.json:ro - - ./wait_for_port.sh:/opt/app/policy/pdpx/bin/wait_for_port.sh:ro - entrypoint: ./wait_for_port.sh - command: [ - '-c', 'bash ./policy-pdpx.sh', - 'mariadb', '3306', - 'policy.api.simpledemo.onap.org', '3905', - 'pap', '6969' - ] - drools: - image: nexus3.onap.org:10001/onap/policy-drools:${POLICY_DROOLS_VERSION} - container_name: drools - depends_on: - - mariadb - - policy.api.simpledemo.onap.org - - pap - hostname: drools - expose: - - 6969 - - 9696 - volumes: - - ./config/drools/custom:/tmp/policy-install/config:ro - - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro - env_file: - - config/drools/env/base.conf - entrypoint: /opt/app/policy/bin/wait_for_port.sh - command: [ - '-c', '/opt/app/policy/bin/pdpd-entrypoint.sh boot', - 'mariadb', '3306', - 'policy.api.simpledemo.onap.org', '3905' - ] - drools-apps: - image: nexus3.onap.org:10001/onap/policy-pdpd-cl:${POLICY_DROOLS_APPS_VERSION} - container_name: drools-apps - depends_on: - - mariadb - - policy.api.simpledemo.onap.org - - pap - - xacml-pdp - hostname: drools-apps - expose: - - 6969 - - 9696 - volumes: - - ./config/drools-apps/custom:/tmp/policy-install/config:ro - - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro - env_file: - - config/drools-apps/env/base.conf - - config/drools-apps/env/feature-healthcheck.conf - - config/drools-apps/env/feature-pooling-dmaap.conf - entrypoint: /opt/app/policy/bin/wait_for_port.sh - command: [ - '-c', '/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot', - 'mariadb', '3306', - 'policy.api.simpledemo.onap.org', '3905', - 'pap', '6969', - 'policy.api.simpledemo.onap.org', '6666', - 'policy.api.simpledemo.onap.org', '6668', - 'policy.api.simpledemo.onap.org', '6669', - 'policy.api.simpledemo.onap.org', '6670' - ] - apex-pdp: - image: nexus3.onap.org:10001/onap/policy-apex-pdp:${POLICY_APEX_PDP_VERSION} - container_name: policy-apex-pdp - depends_on: - - mariadb - - policy.api.simpledemo.onap.org - - pap - hostname: policy-apex-pdp - expose: - - 6969 - - 23324 - volumes: - - ./config/apex-pdp/OnapPfConfig.json:/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json:ro - - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro - entrypoint: /opt/app/policy/bin/wait_for_port.sh - command: [ - '-c', '/opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json', - 'mariadb', '3306', - 'policy.api.simpledemo.onap.org', '3905', - 'pap', '6969' - ] - distribution: - image: nexus3.onap.org:10001/onap/policy-distribution:${POLICY_DISTRIBUTION_VERSION} - container_name: policy-distribution - depends_on: - - mariadb - - api - - pap - - apex-pdp - hostname: policy-distribution - volumes: - - ./config/distribution/defaultConfig.json:/opt/app/policy/distribution/etc/defaultConfig.json:ro - - ./policy-distribution/config/distribution/temp/:/opt/app/policy/distribution/etc/temp/:ro - - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro - entrypoint: /opt/app/policy/bin/wait_for_port.sh - command: [ - '-c', './policy-dist.sh', - 'mariadb', '3306', - 'policy.api.simpledemo.onap.org', '3905', - 'pap', '6969', - 'apex-pdp', '6969' - ] diff --git a/scripts/policy/drools-apps/deploy.drools.policies.json b/scripts/policy/drools-apps/deploy.drools.policies.json deleted file mode 100644 index 24c90d0d..00000000 --- a/scripts/policy/drools-apps/deploy.drools.policies.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "groups": [ - { - "name": "defaultGroup", - "deploymentSubgroups": [ - { - "pdpType": "drools", - "action": "POST", - "policies": [ - { - "name": "operational.restart", - "version": "1.0.0" - }, - { - "name": "operational.scaleout", - "version": "1.0.0" - }, - { - "name": "operational.modifyconfig", - "version": "1.0.0" - } - ] - } - ] - } - ] -} diff --git a/scripts/policy/drools-apps/deploy.xacml.policies.json b/scripts/policy/drools-apps/deploy.xacml.policies.json deleted file mode 100644 index 46da9021..00000000 --- a/scripts/policy/drools-apps/deploy.xacml.policies.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "groups": [ - { - "name": "defaultGroup", - "deploymentSubgroups": [ - { - "pdpType": "xacml", - "action": "POST", - "policies": [ - { - "name": "onap.restart.tca", - "version": "1.0.0" - }, - { - "name": "onap.scaleout.tca", - "version": "1.0.0" - }, - { - "name": "onap.vfirewall.tca", - "version": "1.0.0" - } - ] - } - ] - } - ] -} diff --git a/scripts/policy/drools-apps/make_topic.sh b/scripts/policy/drools-apps/make_topic.sh deleted file mode 100755 index 36d43e9d..00000000 --- a/scripts/policy/drools-apps/make_topic.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# -# ===========LICENSE_START==================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END===================================================== -# - -# -# Creates a topic, which happens as a side-effect of polling it. -# - -if [ $# -ne 1 ] -then - echo "arg(s): topic-name" >&2 - exit 1 -fi - -topic="${1}" - -curl -s -k "https://${SIM_IP}:3905/events/${topic}/script/1?limit=1&timeout=0" -echo diff --git a/scripts/policy/drools-apps/onset.sh b/scripts/policy/drools-apps/onset.sh deleted file mode 100755 index f2918a68..00000000 --- a/scripts/policy/drools-apps/onset.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# ===========LICENSE_START==================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END===================================================== -# - -# -# Injects an ONSET event on the DCAE_CL_OUTPUT topic. -# - -if [ $# -ne 1 ] -then - echo "arg(s): json-message-file-name" >&2 - exit 1 -fi - -curl -k -H "Content-type: application/json" --data-binary @$1 \ - https://${SIM_IP}:3905/events/unauthenticated.DCAE_CL_OUTPUT -echo diff --git a/scripts/policy/drools-apps/vcpeOnset.json b/scripts/policy/drools-apps/vcpeOnset.json deleted file mode 100644 index 7dd9d5a0..00000000 --- a/scripts/policy/drools-apps/vcpeOnset.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "closedLoopAlarmStart": 1463679805324, - "closedLoopEventClient": "DCAE_INSTANCE_ID.dcae-tca", - "closedLoopEventStatus": "ONSET", - "requestID": "664be3d2-6c12-4f4b-a3e7-c349acced200", - "target_type": "VNF", - "target": "generic-vnf.vnf-id", - "AAI": { - "vserver.is-closed-loop-disabled": "false", - "vserver.prov-status": "ACTIVE", - "generic-vnf.vnf-id": "vCPE_Infrastructure_vGMUX_demo_app" - }, - "from": "DCAE", - "version": "1.0.2" -} diff --git a/scripts/policy/drools-apps/vdnsOnset.json b/scripts/policy/drools-apps/vdnsOnset.json deleted file mode 100644 index 13f69095..00000000 --- a/scripts/policy/drools-apps/vdnsOnset.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "closedLoopAlarmStart": 1463679805324, - "closedLoopEventClient": "microservice.stringmatcher", - "closedLoopEventStatus": "ONSET", - "requestID": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65", - "target_type": "VNF", - "target": "vserver.vserver-name", - "AAI": { - "vserver.is-closed-loop-disabled": "false", - "vserver.prov-status": "ACTIVE", - "vserver.vserver-name": "OzVServer" - }, - "from": "DCAE", - "version": "1.0.2" -} diff --git a/scripts/policy/drools-apps/vfwOnset.json b/scripts/policy/drools-apps/vfwOnset.json deleted file mode 100644 index 7782867a..00000000 --- a/scripts/policy/drools-apps/vfwOnset.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a", - "closedLoopAlarmStart": 1463679805324, - "closedLoopEventClient": "microservice.stringmatcher", - "closedLoopEventStatus": "ONSET", - "requestID": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65", - "target_type": "VNF", - "target": "generic-vnf.vnf-name", - "AAI": { - "vserver.is-closed-loop-disabled": "false", - "vserver.prov-status": "ACTIVE", - "generic-vnf.vnf-name": "fw0002vm002fw002", - "vserver.vserver-name": "OzVServer" - }, - "from": "DCAE", - "version": "1.0.2" -} diff --git a/scripts/policy/drools-apps/wait_topic.sh b/scripts/policy/drools-apps/wait_topic.sh deleted file mode 100755 index 4271abc6..00000000 --- a/scripts/policy/drools-apps/wait_topic.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# ===========LICENSE_START==================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END===================================================== -# - -# -# Polls a topic for a message. Additional text items can be specified, -# in which case, it discards messages that do not contain all of the -# specified text items. -# -# Exits with a non-zero status if no matching message is received on the -# topic before the timeout. -# - -if [ $# -lt 1 ] -then - echo "arg(s): topic-name [text-to-match1 [text-to-match2 ...]]" >&2 - exit 1 -fi - -topic="${1}" -shift - -matched=no - -while [ ${matched} = "no" ] -do - msg=`curl -s -k "https://${SIM_IP}:3905/events/${topic}/script/1?limit=1"` - if [ $? -ne 0 -o "${msg}" = "[]" ] - then - echo not found >&2 - exit 2 - fi - - matched=yes - for text in "$@" - do - echo "${msg}" | grep -q "${text}" - if [ $? -ne 0 ] - then - matched=no - break - fi - done -done - -echo "${msg}" diff --git a/scripts/policy/get-models-examples.sh b/scripts/policy/get-models-examples.sh deleted file mode 100644 index 1860511e..00000000 --- a/scripts/policy/get-models-examples.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START=================================================== -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. -# ============================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END===================================================== -# - -source ${SCRIPTS}/policy/config/policy-csit.conf - -rm -rf ${WORKSPACE}/models -mkdir ${WORKSPACE}/models -cd ${WORKSPACE} - -# download models examples -git clone --depth 1 https://gerrit.onap.org/r/policy/models -b ${GERRIT_BRANCH} diff --git a/scripts/policy/policy-distribution/config/distribution/csar/sample_csar_with_apex_policy.csar b/scripts/policy/policy-distribution/config/distribution/csar/sample_csar_with_apex_policy.csar deleted file mode 100644 index 4d293e42..00000000 Binary files a/scripts/policy/policy-distribution/config/distribution/csar/sample_csar_with_apex_policy.csar and /dev/null differ diff --git a/scripts/policy/wait_for_port.sh b/scripts/policy/wait_for_port.sh deleted file mode 100755 index c50cd970..00000000 --- a/scripts/policy/wait_for_port.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -tmout=120 -cmd= - -while getopts c:t: opt; do - case "$opt" in - c) cmd="$OPTARG" ;; - t) tmout="$OPTARG" ;; - esac -done -let nargs=$OPTIND-1 -shift $nargs - -let even_args=$#%2 -if [[ $# -lt 2 || $even_args -ne 0 ]]; then - echo "args: [-t timeout] [-c command] hostname1 port1 hostname2 port2 ..." >&2 - exit 1 -fi - -while [[ $# -ge 2 ]]; do - export host=$1 - export port=$2 - shift - shift - - echo "Waiting for $host port $port..." - timeout $tmout bash -c 'until nc -vz "$host" "$port"; do echo -n "."; - sleep 1; done' - rc=$? - - if [[ $rc != 0 ]]; then - echo "$host port $port cannot be reached" - exit $rc - fi -done - -$cmd - -exit 0 diff --git a/scripts/sdnc/sdnc/certs/keys0.zip b/scripts/sdnc/sdnc/certs/keys0.zip index 48b4d90a..6f7f756b 100644 Binary files a/scripts/sdnc/sdnc/certs/keys0.zip and b/scripts/sdnc/sdnc/certs/keys0.zip differ diff --git a/scripts/sdnc/sdnc/docker-compose.yml b/scripts/sdnc/sdnc/docker-compose.yml index c47fab50..61bf8b6e 100755 --- a/scripts/sdnc/sdnc/docker-compose.yml +++ b/scripts/sdnc/sdnc/docker-compose.yml @@ -9,7 +9,10 @@ services: volumes: - /etc/localtime:/etc/localtime:ro environment: - - MYSQL_ROOT_PASSWORD=password + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} hostname: mariadb.so.testlab.onap.org logging: @@ -29,12 +32,38 @@ services: - "8282:8181" hostname: sdnc + links: + - mariadb:dbhost + - mariadb:sdnctldb01 + - mariadb:sdnctldb02 environment: - - MYSQL_ROOT_PASSWORD=password + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_DATABASE=${MYSQL_DATABASE} - SDNC_CONFIG_DIR=/opt/onap/sdnc/data/properties - - MYSQL_PASSWD=password - - ODL_ADMIN_USERNAME=admin - - ODL_ADMIN_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + - SDNC_BIN=/opt/onap/sdnc/bin + - ODL_CERT_DIR=/tmp + - ODL_ADMIN_USERNAME=${ODL_USER} + - ODL_ADMIN_PASSWORD=${ODL_PASSWORD} + - ODL_USER=${ODL_USER} + - ODL_PASSWORD=${ODL_PASSWORD} + - ODL_CERT_DIR=/opt/opendaylight/current/certs + - SDNC_DB_INIT=true + - HONEYCOMB_USER=${HONEYCOMB_USER} + - HONEYCOMB_PASSWORD=${HONEYCOMB_PASSWORD} + - TRUSTSTORE_PASSWORD=${TRUSTSTORE_PASSWORD} + - KEYSTORE_PASSWORD=${KEYSTORE_PASSWORD} + - SO_USER=${SO_USER} + - SO_PASSWORD=${SO_PASSWORD} + - NENG_USER=${NENG_USER} + - NENG_PASSWORD=${NENG_PASSWORD} + - CDS_USER=${CDS_USER} + - CDS_PASSWORD=${CDS_PASSWORD} + - ANSIBLE_USER=${ANSIBLE_USER} + - ANSIBLE_PASSWORD=${ANSIBLE_PASSWORD} + - SQL_CRYPTKEY=${SQL_CRYPTKEY} + - A1_TRUSTSTORE_PASSWORD=a1adapter depends_on: - mariadb dns: @@ -44,7 +73,3 @@ services: options: max-size: "30m" max-file: "5" - extra_hosts: - - sdnctldb02:${LOCAL_IP} - - sdnctldb01:${LOCAL_IP} - - dbhost:${LOCAL_IP} \ No newline at end of file diff --git a/tests/ccsdk-oran/polmansuite/__init__.robot b/tests/ccsdk-oran/polmansuite/__init__.robot deleted file mode 100644 index bf52713b..00000000 --- a/tests/ccsdk-oran/polmansuite/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -*** Settings *** -Documentation Non-RT RIC Policy Management - polmansuite diff --git a/tests/ccsdk-oran/polmansuite/test.robot b/tests/ccsdk-oran/polmansuite/test.robot deleted file mode 100644 index eebe478b..00000000 --- a/tests/ccsdk-oran/polmansuite/test.robot +++ /dev/null @@ -1,23 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library Process - -*** Test Cases *** - -Functional Test Case 1 - [Documentation] Functional Test Case 1 - FTC1 - Start Process ${AUTOTEST_ROOT}/FTC1.sh remote auto-clean --env-file ${TEST_ENV} shell=true cwd=${AUTOTEST_ROOT} - ${cli_cmd_output}= Wait For Process timeout=3600 - Should Be Equal as Integers ${cli_cmd_output.rc} 0 - ${ResultFileContent}= Get File ${AUTOTEST_ROOT}/.resultFTC1.txt - Should Be Equal As Integers ${ResultFileContent} 0 - -Functional Test Case 2 - [Documentation] Functional Test Case 2 - FTC150 - Start Process ${AUTOTEST_ROOT}/FTC150.sh remote auto-clean --env-file ${TEST_ENV} shell=true cwd=${AUTOTEST_ROOT} - ${cli_cmd_output}= Wait For Process timeout=3600 - Should Be Equal as Integers ${cli_cmd_output.rc} 0 - ${ResultFileContent}= Get File ${AUTOTEST_ROOT}/.resultFTC150.txt - Should Be Equal As Integers ${ResultFileContent} 0 - - diff --git a/tests/ccsdk/healthcheck/__init__.robot b/tests/ccsdk/healthcheck/__init__.robot deleted file mode 100644 index 1259b890..00000000 --- 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 fea86c3d..00000000 --- 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/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/FuncSingleFileFtp.robot similarity index 90% rename from tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot rename to tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/FuncSingleFileFtp.robot index 8213c702..bb70b502 100755 --- a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/FuncSingleFile.robot +++ b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/FuncSingleFileFtp.robot @@ -95,10 +95,19 @@ Set Default Environment Variables Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A Set Environment Variable DR_REDIR_FEEDS 2:A Set Environment Variable FTP_FILE_PREFIXES A + Set Environment Variable HTTP_FILE_PREFIXES A + Set Environment Variable HTTP_TYPE HTTP Set Environment Variable NUM_FTPFILES 1 + Set Environment Variable NUM_HTTPFILES 1 Set Environment Variable NUM_PNFS 1 Set Environment Variable NUM_FTP_SERVERS 1 + Set Environment Variable NUM_HTTP_SERVERS 1 Set Environment Variable DR_FEEDS 2:A Set Environment Variable DR_REDIR_SIM drsim_redir Set Environment Variable SFTP_SIMS sftp-server0:22 Set Environment Variable FTPES_SIMS ftpes-server-vsftpd0:21 + Set Environment Variable HTTP_SIMS http-https-server0:80 + Set Environment Variable HTTPS_SIMS http-https-server0:443 + Set Environment Variable HTTPS_SIMS_NO_AUTH http-https-server0:8080 + Set Environment Variable HTTP_JWT_SIMS http-https-server0:32000 + Set Environment Variable HTTPS_JWT_SIMS http-https-server0:32100 diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/__init__.robot b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/__init__.robot new file mode 100755 index 00000000..d99ffc36 --- /dev/null +++ b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Ftp-suite/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation DFC Functional test suite. Single event with single file - FTPES and SFTP protocols. diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/FuncSingleFileHttp.robot b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/FuncSingleFileHttp.robot new file mode 100755 index 00000000..f96c2f96 --- /dev/null +++ b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/FuncSingleFileHttp.robot @@ -0,0 +1,116 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library Process + +Resource ../../resources/common-keywords.robot + +*** Variables *** +${CONSUL_UPL_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_HTTPS.json +${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw +${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0 + +*** Test Cases *** + +######## Single file, HTTP + +Verify single event with single 1MB HTTP file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_20 + [Documentation] Verify single event with single HTTP 1MB file from event poll to published file. + ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT + Verify Single Event From Event Poll To Published File 1 --tc300 HTTP + + +Verify single event with single 5MB HTTP file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_21 + [Documentation] Verify single event with single HTTP 5MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 5 --tc301 HTTP + + +Verify single event with single 50MB HTTP file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_22 + [Documentation] Verify single event with single HTTP 50MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 50 --tc302 HTTP + +######## Single file, HTTP +Verify single event with single 1MB HTTPS (basic authentication) file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_30 + [Documentation] Verify single event with single HTTPS (basic authentication) 1MB file from event poll to published file. + ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT + Verify Single Event From Event Poll To Published File 1 --tc400 HTTPS + + +Verify single event with single 5MB HTTPS (basic authentication) file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_31 + [Documentation] Verify single event with single HTTPS (basic authentication) 5MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 5 --tc401 HTTPS + + +Verify single event with single 50MB HTTPS (basic authentication) file. From event poll to published file + [TAGS] DFC_FUNCTIONAL_32 + [Documentation] Verify single event with single HTTPS (basic authentication) 50MB file from event poll to published file. + Verify Single Event From Event Poll To Published File 50 --tc402 HTTPS + + +*** Keywords *** +Verify Single Event From Event Poll To Published File + [Documentation] Keyword to verify single event with file with given parameters. + [Arguments] ${file_size_in_mb} ${mr_tc} ${http_type} + Set Environment Variable MR_TC ${mr_tc} + Set Environment Variable FILE_SIZE ${file_size_in_mb}MB + Set Environment Variable HTTP_TYPE ${http_type} + Set Default Environment Variables + + ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} + Log To Console Simulator-start: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim + DR Sim Published Files Equal 0 #Verify 0 file published to DR sim + + ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes + Log To Console Consul APP write: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes + Log To Console Consul APP read: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes + Log To Console CBS merged configuration: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + Sleep 10 + + Start DFC + + Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim + DR Redir Sim Downloaded Volume Equal ${file_size_in_mb} 000 000 #Verify correct number of bytes published file data in DR redir sim + + [Teardown] Test Teardown + +Set Default Environment Variables + [Documentation] Set default environment variables for simulators setup + Set Environment Variable DR_TC --tc normal + Set Environment Variable DR_REDIR_TC --tc normal + Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES + Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A + Set Environment Variable DR_REDIR_FEEDS 2:A + Set Environment Variable FTP_FILE_PREFIXES A + Set Environment Variable FTP_TYPE SFTP + Set Environment Variable HTTP_FILE_PREFIXES A + Set Environment Variable NUM_FTPFILES 1 + Set Environment Variable NUM_HTTPFILES 1 + Set Environment Variable NUM_PNFS 1 + Set Environment Variable NUM_FTP_SERVERS 1 + Set Environment Variable NUM_HTTP_SERVERS 1 + Set Environment Variable DR_FEEDS 2:A + Set Environment Variable DR_REDIR_SIM drsim_redir + Set Environment Variable SFTP_SIMS sftp-server0:22 + Set Environment Variable FTPES_SIMS ftpes-server-vsftpd0:21 + Set Environment Variable HTTP_SIMS http-https-server0:80 + Set Environment Variable HTTPS_SIMS http-https-server0:443 + Set Environment Variable HTTPS_SIMS_NO_AUTH http-https-server0:8080 + Set Environment Variable HTTP_JWT_SIMS http-https-server0:32000 + Set Environment Variable HTTPS_JWT_SIMS http-https-server0:32100 diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/__init__.robot b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/__init__.robot similarity index 75% rename from tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/__init__.robot rename to tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/__init__.robot index dc2d8379..5245d659 100755 --- a/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-suite/__init__.robot +++ b/tests/dcaegen2-collectors-datafile/testsuites/Functional-Single-File-Http-suite/__init__.robot @@ -1,2 +1,2 @@ *** Settings *** -Documentation DFC Functional test suite. Single event with single file. +Documentation DFC Functional test suite. Single event with single file - HTTP protocol. diff --git a/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/HttpVariousConnectionTypes.robot b/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/HttpVariousConnectionTypes.robot new file mode 100755 index 00000000..9e69e536 --- /dev/null +++ b/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/HttpVariousConnectionTypes.robot @@ -0,0 +1,110 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary +Library Process + +Resource ../../resources/common-keywords.robot + +*** Variables *** +${CONSUL_UPL_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary @${SIMGROUP_ROOT}/consul/c12_feed2_PM_HTTPS.json +${CONSUL_GET_APP} /usr/bin/curl -v http://127.0.0.1:8500/v1/kv/dfc_app0?raw +${CBS_GET_MERGED_CONFIG} /usr/bin/curl -v http://127.0.0.1:10000/service_component_all/dfc_app0 + +*** Test Cases *** + +######## Single file, HTTPS with various connections +Verify single event with single 1MB file with HTTPS connection (basic authentication). From event poll to published file + [TAGS] DFC_FUNCTIONAL_40 + [Documentation] Verify single event with single HTTPS (basic authentication) 1MB file from event poll to published file. + ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT + Verify Single Event From Event Poll To Published File 1 --tc400 HTTPS + + +Verify single event with single 1MB file HTTPS connection (client certificate authentication). From event poll to published file + [TAGS] DFC_FUNCTIONAL_41 + [Documentation] Verify single event with single 1MB file HTTPS connection (client certificate authentication). From event poll to published file + Verify Single Event From Event Poll To Published File 1 --tc403 HTTPS + + +Verify single event with single 1MB file HTTPS (no authentication). From event poll to published file + [TAGS] DFC_FUNCTIONAL_42 + [Documentation] Verify single event with single 1MB file HTTPS (no authentication). From event poll to published file + Verify Single Event From Event Poll To Published File 1 --tc404 HTTPS + + +Verify single event with single 1MB file with HTTP JWT. From event poll to published file + [TAGS] DFC_FUNCTIONAL_43 + [Documentation] Verify single event with single 1MB file with HTTP JWT. From event poll to published file + ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT + Verify Single Event From Event Poll To Published File 1 --tc303 HTTP + + +Verify single event with single 1MB file with HTTPS JWT. From event poll to published file + [TAGS] DFC_FUNCTIONAL_44 + [Documentation] Verify single event with single 1MB file with HTTPS JWT. From event poll to published file + ${cli_cmd_output}= Run Process ${DFC_ROOT}/../dfc-containers-clean.sh stderr=STDOUT + Verify Single Event From Event Poll To Published File 1 --tc405 HTTPS + + +*** Keywords *** +Verify Single Event From Event Poll To Published File + [Documentation] Keyword to verify single event with file with given parameters. + [Arguments] ${file_size_in_mb} ${mr_tc} ${http_type} + Set Environment Variable MR_TC ${mr_tc} + Set Environment Variable FILE_SIZE ${file_size_in_mb}MB + Set Environment Variable HTTP_TYPE ${http_type} + Set Default Environment Variables + + ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} + Log To Console Simulator-start: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + MR Sim Emitted Files Equal 0 #Verify 0 file emitted from MR sim + DR Sim Published Files Equal 0 #Verify 0 file published to DR sim + + ${cli_cmd_output}= Run Process ${CONSUL_UPL_APP} shell=yes + Log To Console Consul APP write: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + ${cli_cmd_output}= Run Process ${CONSUL_GET_APP} shell=yes + Log To Console Consul APP read: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + ${cli_cmd_output}= Run Process ${CBS_GET_MERGED_CONFIG} shell=yes + Log To Console CBS merged configuration: + Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} + + Sleep 10 + + Start DFC + + Wait Until Keyword Succeeds 1 minute 10 sec MR Sim Emitted Files Equal 1 #Verify 1 file emitted from MR sim + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Query Not Published Equal 1 #Verify 1 query response for not published files + Wait Until Keyword Succeeds 1 minute 10 sec DR Sim Published Files Equal 1 #Verify 1 file published to DR sim + DR Redir Sim Downloaded Volume Equal ${file_size_in_mb} 000 000 #Verify correct number of bytes published file data in DR redir sim + + [Teardown] Test Teardown + +Set Default Environment Variables + [Documentation] Set default environment variables for simulators setup + Set Environment Variable DR_TC --tc normal + Set Environment Variable DR_REDIR_TC --tc normal + Set Environment Variable MR_GROUPS OpenDcae-c12:PM_MEAS_FILES + Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A + Set Environment Variable DR_REDIR_FEEDS 2:A + Set Environment Variable FTP_FILE_PREFIXES A + Set Environment Variable FTP_TYPE SFTP + Set Environment Variable HTTP_FILE_PREFIXES A + Set Environment Variable NUM_FTPFILES 1 + Set Environment Variable NUM_HTTPFILES 1 + Set Environment Variable NUM_PNFS 1 + Set Environment Variable NUM_FTP_SERVERS 1 + Set Environment Variable NUM_HTTP_SERVERS 1 + Set Environment Variable DR_FEEDS 2:A + Set Environment Variable DR_REDIR_SIM drsim_redir + Set Environment Variable SFTP_SIMS sftp-server0:22 + Set Environment Variable FTPES_SIMS ftpes-server-vsftpd0:21 + Set Environment Variable HTTP_SIMS http-https-server0:80 + Set Environment Variable HTTPS_SIMS http-https-server0:443 + Set Environment Variable HTTPS_SIMS_NO_AUTH http-https-server0:8080 + Set Environment Variable HTTP_JWT_SIMS http-https-server0:32000 + Set Environment Variable HTTPS_JWT_SIMS http-https-server0:32100 diff --git a/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/__init__.robot b/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/__init__.robot new file mode 100755 index 00000000..b4fa2714 --- /dev/null +++ b/tests/dcaegen2-collectors-datafile/testsuites/HTTP-Various-Connection-Types-suite/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation DFC HTTP/HTTPS various connection types test suite. Single event with single file. diff --git a/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot b/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot index 3962d4e5..61f689d1 100755 --- a/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot +++ b/tests/dcaegen2-collectors-datafile/testsuites/Strict-Host-Checking-suite/StrictHostChecking.robot @@ -77,15 +77,24 @@ Setup Strict Host Key Checking Test Set Environment Variable MR_FILE_PREFIX_MAPPING PM_MEAS_FILES:A Set Environment Variable DR_REDIR_FEEDS 2:A Set Environment Variable FTP_FILE_PREFIXES A + Set Environment Variable HTTP_FILE_PREFIXES A Set Environment Variable NUM_FTPFILES 1 + Set Environment Variable NUM_HTTPFILES 1 Set Environment Variable NUM_PNFS 1 Set Environment Variable FILE_SIZE 1MB Set Environment Variable FTP_TYPE SFTP + Set Environment Variable HTTP_TYPE HTTP Set Environment Variable NUM_FTP_SERVERS 1 + Set Environment Variable NUM_HTTP_SERVERS 1 Set Environment Variable DR_FEEDS 2:A Set Environment Variable DR_REDIR_SIM drsim_redir Set Environment Variable SFTP_SIMS sftp-server0:22 - Set Environment Variable FTPS_SIMS ftpes-server-vsftpd0:21 + Set Environment Variable FTPES_SIMS ftpes-server-vsftpd0:21 + Set Environment Variable HTTP_SIMS http-https-server0:80 + Set Environment Variable HTTPS_SIMS http-https-server0:443 + Set Environment Variable HTTPS_SIMS_NO_AUTH http-https-server0:8080 + Set Environment Variable HTTP_JWT_SIMS http-https-server0:32000 + Set Environment Variable HTTPS_JWT_SIMS http-https-server0:32100 ${cli_cmd_output}= Run Process ./simulators-start.sh cwd=${SIMGROUP_ROOT} Log To Console Simulator-start: @@ -107,6 +116,6 @@ Setup Strict Host Key Checking Test Sleep 10 - ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} env:KNOWN_HOSTS=${known_hosts_file} + ${cli_cmd_output}= Run Process ${DFC_ROOT}/dfc-start.sh cwd=${DFC_ROOT} env:KNOWN_HOSTS=${known_hosts_file} env:SIMGROUP_ROOT=${SIMGROUP_ROOT} Log To Console Dfc-start: Log To Console ${cli_cmd_output.stdout} ${cli_cmd_output.stderr} diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot b/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot index 40923aab..9898a968 100644 --- a/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot +++ b/tests/dcaegen2-collectors-hv-ves/testcases/message-routing.robot @@ -2,6 +2,7 @@ # csit-dcaegen2-collectors-hv-ves # ================================================================================ # Copyright (C) 2018-2019 NOKIA +# Modification copyright (C) 2021 Samsung Electronics Co., Ltd. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,7 +38,7 @@ Message Routing Suite Setup *** Test Cases *** Correct Messages Routing [Documentation] VES-HV Collector should route all valid messages to topics specified in configuration - ... and do not change message payload generated in XNF simulator + ... without changing message payload generated in xNF simulator Send Messages From xNF Simulators ${XNF_SIMULATOR} ${XNF_FIXED_PAYLOAD_REQUEST} @@ -47,7 +48,7 @@ Correct Messages Routing Too big payload message handling - [Documentation] VES-HV Collector should interrupt the stream when encountered message with too big payload + [Documentation] VES-HV Collector should interrupt the stream when a message with too big payload is encountered Send Messages From xNF Simulators ${XNF_SIMULATOR} ${XNF_TOO_BIG_PAYLOAD_REQUEST} diff --git a/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot b/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot index fee8bfd8..bab8a907 100644 --- a/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot +++ b/tests/dcaegen2-collectors-hv-ves/testcases/resources/common-keywords.robot @@ -2,6 +2,7 @@ # csit-dcaegen2-collectors-hv-ves # ================================================================================ # Copyright (C) 2018-2019 NOKIA +# Modification copyright (C) 2021 Samsung Electronics Co., Ltd. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -53,11 +54,11 @@ Get xNF Simulators Using Valid Certificates Send Messages From xNF Simulators [Arguments] ${XNF_HOSTS_LIST} ${MESSAGE_FILEPATH} - :FOR ${HOST} IN @{XNF_HOSTS_LIST} - \ ${XNF_SIM_API_ACCESS}= Get xNF Sim Api Access Url ${HTTP_METHOD_URL} ${HOST} - \ ${XNF_SIM_API_URL}= Catenate SEPARATOR= ${XNF_SIM_API_ACCESS} ${XNF_SIM_API_PATH} - \ Send messages ${XNF_SIM_API_URL} ${MESSAGE_FILEPATH} - + FOR ${HOST} IN @{XNF_HOSTS_LIST} + ${XNF_SIM_API_ACCESS}= Get xNF Sim Api Access Url ${HTTP_METHOD_URL} ${HOST} + ${XNF_SIM_API_URL}= Catenate SEPARATOR= ${XNF_SIM_API_ACCESS} ${XNF_SIM_API_PATH} + Send messages ${XNF_SIM_API_URL} ${MESSAGE_FILEPATH} + END VES-HV Collector Test Shutdown Reset DCAE App Simulator ${DEFAULT_PERF3GPP_TOPIC} diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/__init__.robot b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/__init__.robot new file mode 100644 index 00000000..9eda6de0 --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Files Processing Config PM Mapper Testcases diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/.gitattributes b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/.gitattributes new file mode 100644 index 00000000..57cdc503 --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/.gitattributes @@ -0,0 +1 @@ +*.gz binary diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/ABigFile.xml b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/ABigFile.xml new file mode 100644 index 00000000..8a3bcf4d --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/ABigFile.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + attTCHSeizures + succTCHSeizures + attImmediateAssignProcs + succImmediateAssignProcs + + 234 + 345 + 567 + 789 + + + 890 + 901 + 123 + 234 + + + 456 + 567 + 678 + 789 + true + + + + + + + attTCHSeizures1 + succTCHSeizures2 + attImmediateAssignProcs3 + succImmediateAssignProcs4 + + 4 + 86,87,2,6,77,96,75,33,24 + 40 + 90 + false + + + + + + + attTCHSeizures5 + succTCHSeizures6 + attImmediateAssignProcs7 + succImmediateAssignProcs8 + + 238 + 344 + 563 + 787 + + + 898 + 905 + 127 + 238 + + + 454 + 569 + 672 + 785 + true + + + + + + + + + + attTCHSeizures + succTCHSeizures + attImmediateAssignProcs + succImmediateAssignProcs + + 234 + 345 + 567 + 789 + + + 890 + 901 + 123 + 234 + + + 456 + 567 + 678 + 789 + true + + + + + + + attTCHSeizures1 + succTCHSeizures2 + attImmediateAssignProcs3 + succImmediateAssignProcs4 + + 4 + 86,87,2,6,77,96,75,33,24 + 40 + 90 + false + + + + + + + attTCHSeizures5 + succTCHSeizures6 + attImmediateAssignProcs7 + succImmediateAssignProcs8 + + 238 + 344 + 563 + 787 + + + 898 + 905 + 127 + 238 + + + 454 + 569 + 672 + 785 + true + + + + + + + diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_10_1.env b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_10_1.env new file mode 100644 index 00000000..050d2f2a --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_10_1.env @@ -0,0 +1,3 @@ +PROCESSING_LIMIT_RATE=10 +THREADS_MULTIPLIER=1 +PROCESSING_THREADS_COUNT=1 diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_1_1.env b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_1_1.env new file mode 100644 index 00000000..c138912b --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_1_1.env @@ -0,0 +1,3 @@ +PROCESSING_LIMIT_RATE=1 +THREADS_MULTIPLIER=1 +PROCESSING_THREADS_COUNT=1 diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_1_10.env b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_1_10.env new file mode 100644 index 00000000..b4c290e8 --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_1_10.env @@ -0,0 +1,3 @@ +PROCESSING_LIMIT_RATE=1 +THREADS_MULTIPLIER=1 +PROCESSING_THREADS_COUNT=10 diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/valid_metadata.json b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/valid_metadata.json new file mode 100644 index 00000000..da809d7b --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/valid_metadata.json @@ -0,0 +1,12 @@ +{ + "productName": "gnb", + "vendorName": "Ericsson", + "lastEpochMicrosec": "1538478000000", + "sourceName": "oteNB5309", + "startEpochMicrosec": "1538478900000", + "timeZoneOffset": "UTC+05.00", + "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", + "compression": "gzip", + "fileFormatType": "org.3GPP.32.435#measCollec", + "fileFormatVersion": "V9" + } \ No newline at end of file diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/files-processing-config-pmmapper.robot b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/files-processing-config-pmmapper.robot new file mode 100644 index 00000000..09a7de4f --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/files-processing-config-pmmapper.robot @@ -0,0 +1,148 @@ +*** Settings *** +Documentation Testing PM Mapper functionality +Library Collections +Library OperatingSystem +Library RequestsLibrary +Library Process +Library String +Library libraries/DockerContainerManager.py +Library libraries/LogReader.py + +*** Variables *** + +${NR_VALID_METADATA_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/valid_metadata.json +${CLI_EXEC_CLI_PM_LOG_CLEAR} docker exec pmmapper /bin/sh -c "echo -n "" > /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" +${PUBLISH_NODE_URL} https://${DR_NODE_IP}:8443/publish/1 +${CLI_EXEC_LOGS_LIST} docker exec datarouter-node /bin/sh -c "ls /opt/app/datartr/logs" +${DOCKER_CLIENT_IMAGE} nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:latest +${CLIENT_CONTAINER_NAME} pmmapper +${FILE_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/ABigFile.xml +${CONFIG_ENVS_1_1} %{WORKSPACE}/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_1_1.env +${CONFIG_ENVS_4_1} %{WORKSPACE}/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_4_1.env +${CONFIG_ENVS_10_1} %{WORKSPACE}/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_10_1.env +${CONFIG_ENVS_1_10} %{WORKSPACE}/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/assets/config_1_10.env + +*** Test Cases *** + +Verify that PM Mapper rejects 6-9 messages when limitRate is 1 and threads count is 1 + [Tags] FILES_PROCESSING_CONFIG_PM_MAPPER_1 + [Documentation] Verify that PM Mapper rejects 6-9/10 messages. Configuration: limitRate=1, threadsCount=1 + [Timeout] 15 minute + + RestartPmmapper ${CONFIG_ENVS_1_1} + + ${testname}= Set Variable Afirst- + + SendFilesToDatarouter ${testname} + ${alllogs}= GetLogsOutput + ${filtered_logs}= GetFilteredLogs ${alllogs} ${testname} + ${dropped_nr}= GetDroppedNumber ${filtered_logs} + + Sleep 40s + ${isCorrectDroppedCount}= Evaluate ${5} < ${dropped_nr} < ${10} + SavePmMapperLogsAndDroppedCount config_1_1 ${dropped_nr} + Should Be True ${isCorrectDroppedCount} Pm-mapper drop: ${dropped_nr} messages. Expected drop count: 6-9 + ClearLogs + +Verify that PM Mapper rejects 0 messages when limitRate is 10 and threads count is 1 + [Tags] FILES_PROCESSING_CONFIG_PM_MAPPER_2 + [Documentation] Verify that PM Mapper rejects 0/10 messages. Configuration: limitRate=10, threadsCount=1 + [Timeout] 25 minute + + RestartPmmapper ${CONFIG_ENVS_10_1} + + ${testname}= Set Variable Athird- + + SendFilesToDatarouter ${testname} + ${alllogs}= GetLogsOutput + ${filtered_logs}= GetFilteredLogs ${alllogs} ${testname} + ${dropped_nr}= GetDroppedNumber ${filtered_logs} + + Sleep 15s + SavePmMapperLogsAndDroppedCount config_10_1 ${dropped_nr} + Should Be Equal As Numbers ${dropped_nr} 0 Pm-mapper drop: ${dropped_nr} messages. Expected drop count: 0 + ClearLogs + +Verify that PM Mapper rejects 0 messages when limitRate is 1 and threads count is 10 + [Tags] FILES_PROCESSING_CONFIG_PM_MAPPER_3 + [Documentation] Verify that PM Mapper rejects 0/10 messages. Configuration: limitRate=1, threadsCount=10 + [Timeout] 25 minute + + RestartPmmapper ${CONFIG_ENVS_1_10} + + ${testname}= Set Variable Afourth- + + SendFilesToDatarouter ${testname} + ${alllogs}= GetLogsOutput + ${filtered_logs}= GetFilteredLogs ${alllogs} ${testname} + ${dropped_nr}= GetDroppedNumber ${filtered_logs} + + Sleep 15s + SavePmMapperLogsAndDroppedCount config_1_10 ${dropped_nr} + Should Be Equal As Numbers ${dropped_nr} 0 Pm-mapper drop: ${dropped_nr} messages. Expected drop count: 0 + ClearLogs + +*** Keywords *** + +SendFilesToDatarouter + [Arguments] ${testnr} + FOR ${i} IN RANGE 10 + SendToDatarouter ${FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=${i} ${testnr} ${i} + END + Sleep 20s + +SendToDatarouter + [Arguments] ${filepath} ${metadatapath} ${request_id} ${testnr} ${i} + ${pmdata}= Get File ${filepath} + ${metatdata} Get File ${metadatapath} + ${newFilename} Catenate SEPARATOR= ${testnr} ${i} .xml + ${resp}= PutCall ${PUBLISH_NODE_URL}/${newFilename} ${request_id} ${pmdata} ${metatdata.replace("\n","")} pmmapper + VerifyResponse ${resp.status_code} 204 + +PutCall + [Arguments] ${url} ${request_id} ${data} ${meta} ${user} + ${headers}= Create Dictionary X-ONAP-RequestID=${request_id} X-DMAAP-DR-META=${meta} Content-Type=application/octet-stream X-DMAAP-DR-ON-BEHALF-OF=${user} Authorization=Basic cG1tYXBwZXI6cG1tYXBwZXI= + ${resp}= Evaluate requests.put('${url}', data="""${data}""", headers=${headers}, verify=False, allow_redirects=False) requests + [Return] ${resp} + +VerifyResponse + [Arguments] ${actual_response_value} ${expected_response_value} + Should Be Equal As Strings ${actual_response_value} ${expected_response_value} + +ClearLogs + Run Process ${CLI_EXEC_CLI_PM_LOG_CLEAR} shell=yes + +GetLogsOutput + ${filesString}= Run Process ${CLI_EXEC_LOGS_LIST} shell=yes + ${filesList}= Get Log Files List ${filesString.stdout} + ${output}= Set Variable ${EMPTY} + FOR ${file} IN @{filesList} + ${file_path}= Catenate SEPARATOR= "cat /opt/app/datartr/logs/ ${file} " + ${exec}= Catenate docker exec datarouter-node /bin/sh -c ${file_path} + ${single_file}= Run Process ${exec} shell=yes + ${output}= Catenate SEPARATOR=\n ${output} ${single_file.stdout} + END + [Return] ${output} + +GetFilteredLogs + [Arguments] ${all_logs} ${testname} + ${filtered_logs}= Filter Unique ${all_logs} ${testname} + [Return] ${filtered_logs} + +GetDroppedNumber + [Arguments] ${logs_output} + ${number}= Get Number Of Dropped Messages ${logs_output} + [Return] ${number} + +RestartPmmapper + [Arguments] ${envs} + Remove Container ${CLIENT_CONTAINER_NAME} + Sleep 5s + Run Pmmapper Container ${DOCKER_CLIENT_IMAGE} ${CLIENT_CONTAINER_NAME} ${envs} ${DR_NODE_IP} ${NODE_IP} + Sleep 15s + +SavePmMapperLogsAndDroppedCount + [Arguments] ${test_name} ${dropped_count} + Run Process echo "Dropped: ${dropped_count}" > %{WORKSPACE}/archives/${test_name}_dropped_count.log shell=yes + Run Process docker logs ${CLIENT_CONTAINER_NAME} > %{WORKSPACE}/archives/${test_name}_pm_mapper_container_logs.log shell=yes + diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/DockerContainerManager.py b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/DockerContainerManager.py new file mode 100644 index 00000000..3e3ae58e --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/DockerContainerManager.py @@ -0,0 +1,29 @@ +import docker +from EnvsReader import EnvsReader +from docker.types import Mount + +class DockerContainerManager: + + def run_pmmapper_container(self, client_image, container_name, path_to_env, dr_node_ip, mr_ip): + client = docker.from_env() + environment = EnvsReader().read_env_list_from_file(path_to_env) + environment.append("CONFIG_BINDING_SERVICE_SERVICE_HOST=172.18.0.5") + environment.append("CONFIG_BINDING_SERVICE_SERVICE_PORT=10000") + environment.append("HOSTNAME=pmmapper") + client.containers.run( + image=client_image, + name=container_name, + environment=environment, + ports={'8081': 8081}, + network='filesprocessingconfigpmmapper_pmmapper-network', + extra_hosts={'dmaap-dr-node': dr_node_ip, 'message-router': mr_ip}, + user='root', + mounts=[Mount(target='/opt/app/pm-mapper/etc/certs/', source='/var/tmp/', type='bind')], + detach=True + ) + + def remove_container(self, container_name): + client = docker.from_env() + container = client.containers.get(container_name) + container.stop() + container.remove() diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/EnvsReader.py b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/EnvsReader.py new file mode 100644 index 00000000..cc60eed6 --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/EnvsReader.py @@ -0,0 +1,11 @@ + +class EnvsReader: + + def read_env_list_from_file(self, path): + f = open(path, "r") + r_list = [] + for line in f: + line = line.strip() + if line[0] != "#": + r_list.append(line) + return r_list diff --git a/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py new file mode 100644 index 00000000..01718e35 --- /dev/null +++ b/tests/dcaegen2-pmmapper/files-processing-config-pmmapper/libraries/LogReader.py @@ -0,0 +1,22 @@ +import re + +class LogReader: + + def filter_unique(self, merged_logs_output, testname): + logs = merged_logs_output.splitlines() + del_logs = list(filter(lambda line: "|DEL|" in line, logs)) + nrs_set = set() + ret_logs = set() + for log in del_logs: + filename = re.findall(testname + "\d", log) + if len(filename) > 0 and filename[0] not in nrs_set: + ret_logs.add(log) + nrs_set.add(filename[0]) + return ret_logs + + def get_number_of_dropped_messages(self, logs_output): + return len(list(filter(lambda line: "|429|" in line, logs_output))) + + def get_log_files_list(self, fileNames): + files = fileNames.split() + return files diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot index 4c9afb03..bd02e7ff 100644 --- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot +++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot @@ -10,7 +10,7 @@ Test Setup Create Session mapper_session ${PMMAPPER_BASE_URL} Test Teardown CleanSessionsAndLogs *** Variables *** -${CLI_EXEC_CLI_CONFIG} { head -n 10 | tail -5;} < /tmp/pmmapper.log +${CLI_EXEC_CLI_CONFIG} { head -n 100 | tail -50;} < /tmp/pmmapper.log ${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov ${PMMAPPER_BASE_URL} http://${PMMAPPER_IP}:8081 ${DELIVERY_ENDPOINT} /delivery diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json new file mode 100644 index 00000000..534b7ce1 --- /dev/null +++ b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json @@ -0,0 +1,63 @@ +{ + "cambria.partition":"AAI", + "event-header":{ + "severity":"NORMAL", + "entity-type":"pnf", + "top-entity-type":"pnf", + "entity-link":"/aai/v16/network/pnfs/pnf/pnf_newly_discovered", + "event-type":"AAI-EVENT", + "domain":"dev", + "action":"UPDATE", + "sequence-number":"0", + "id":"db09e090-196e-4f84-9645-e449b1cd3640", + "source-name":"dcae-curl", + "version":"v16", + "timestamp":"20200203-15:14:08:807" + }, + "entity":{ + "ipaddress-v4-oam":"10.10.10.37", + "nf-role":"gNB", + "equip-type":"val8", + "relationship-list":{ + "relationship":[ + { + "related-to":"service-instance", + "relationship-data":[ + { + "relationship-value":"Demonstration", + "relationship-key":"customer.global-customer-id" + }, + { + "relationship-value":"vCPE", + "relationship-key":"service-subscription.service-type" + }, + { + "relationship-value":"2c03b2a8-e31a-4749-9e99-3089ab441400", + "relationship-key":"service-instance.service-instance-id" + } + ], + "related-link":"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400", + "relationship-label":"org.onap.relationships.inventory.ComposedOf", + "related-to-property":[ + { + "property-key":"service-instance.service-instance-name", + "property-value":"Svc6_1" + } + ] + } + ] + }, + "equip-vendor":"Ericsson", + "serial-number":"6061ZW3", + "ipaddress-v6-oam":"2001:0db8:0:0:0:0:1428:57ab", + "equip-model":"val6", + "in-maint":false, + "resource-version":"1578668956804", + "sw-version":"val7", + "pnf-id":"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8", + "pnf-name":"pnf_newly_discovered", + "model-invariant-id":"7129e420-d396-4efb-af02-6b83499b12f8", + "model-version-id":"e80a6ae3-cafd-4d24-850d-e14c084a5ca9", + "orchestration-status":"Active" + } +} \ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json new file mode 100644 index 00000000..f2ffd050 --- /dev/null +++ b/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json @@ -0,0 +1,63 @@ +{ + "cambria.partition":"AAI", + "event-header":{ + "severity":"NORMAL", + "entity-type":"pnf", + "top-entity-type":"pnf", + "entity-link":"/aai/v16/network/pnfs/pnf/pnf_newly_discovered", + "event-type":"AAI-EVENT", + "domain":"dev", + "action":"DELETE", + "sequence-number":"0", + "id":"db09e090-196e-4f84-9645-e449b1cd3640", + "source-name":"dcae-curl", + "version":"v16", + "timestamp":"20200203-15:14:08:807" + }, + "entity":{ + "ipaddress-v4-oam":"10.10.10.37", + "nf-role":"gNB", + "equip-type":"val8", + "relationship-list":{ + "relationship":[ + { + "related-to":"service-instance", + "relationship-data":[ + { + "relationship-value":"Demonstration", + "relationship-key":"customer.global-customer-id" + }, + { + "relationship-value":"vCPE", + "relationship-key":"service-subscription.service-type" + }, + { + "relationship-value":"2c03b2a8-e31a-4749-9e99-3089ab441400", + "relationship-key":"service-instance.service-instance-id" + } + ], + "related-link":"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400", + "relationship-label":"org.onap.relationships.inventory.ComposedOf", + "related-to-property":[ + { + "property-key":"service-instance.service-instance-name", + "property-value":"Svc6_1" + } + ] + } + ] + }, + "equip-vendor":"Ericsson", + "serial-number":"6061ZW3", + "ipaddress-v6-oam":"2001:0db8:0:0:0:0:1428:57ab", + "equip-model":"val6", + "in-maint":false, + "resource-version":"1578668956804", + "sw-version":"val7", + "pnf-id":"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8", + "pnf-name":"pnf_newly_discovered", + "model-invariant-id":"7129e420-d396-4efb-af02-6b83499b12f8", + "model-version-id":"e80a6ae3-cafd-4d24-850d-e14c084a5ca9", + "orchestration-status":"Active" + } +} \ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json index b67c0cb1..f22d456a 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json @@ -24,11 +24,14 @@ "^pnf.*", "^vnf.*" ], - "modelInvariantUUIDs": [ + "modelInvariantIDs": [ "7129e420-d396-4efb-af02-6b83499b12f8" ], "modelVersionIDs": [ + ], + "modelNames": [ + ] }, "measurementGroups": [ @@ -86,7 +89,7 @@ "dmaap_info": { "client_id": "1475976809466", "client_role": "org.onap.dcae.pmPublisher", - "topic_url": "https://mr-sim:3095/events/unauthenticated.DCAE_CL_OUTPUT", + "topic_url": "http://dmaap:3904/events/unauthenticated.DCAE_CL_OUTPUT", "location": "san-francisco" }, "type": "message_router" @@ -98,14 +101,14 @@ "dmaap_info": { "client_id": "1575976809466", "client_role": "org.onap.dcae.aaiSub", - "topic_url": "https://mr-sim:3095/events/AAI_EVENT", + "topic_url": "http://dmaap:3904/events/AAI_EVENT", "location": "san-francisco" } }, "policy_pm_subscriber": { "dmaap_info": { "location": "san-francisco", - "topic_url": "https://mr-sim:3095/events/unauthenticated.PMSH_CL_INPUT", + "topic_url": "http://dmaap:3904/events/unauthenticated.PMSH_CL_INPUT", "client_role": "org.onap.dcae.pmSubscriber", "client_id": "1575876809456" }, diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json deleted file mode 100644 index b433892a..00000000 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "httpRequest": { - "path": "/events/AAI_EVENT/.*", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [ - "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"UPDATE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"model-invariant-id\":\"7129e420-d396-4efb-af02-6b83499b12f8\",\"model-version-id\":\"e80a6ae3-cafd-4d24-850d-e14c084a5ca9\",\"orchestration-status\":\"Active\"}}" - ] - }, - "times": { - "remainingTimes": 1, - "unlimited": false - } - }, - { - "httpRequest": { - "path": "/events/AAI_EVENT/.*", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [] - } - } -] diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json deleted file mode 100644 index 3df66a61..00000000 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "httpRequest": { - "path": "/events/AAI_EVENT/.*", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [ - "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"DELETE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"model-invariant-id\":\"7129e420-d396-4efb-af02-6b83499b12f8\",\"model-version-id\":\"e80a6ae3-cafd-4d24-850d-e14c084a5ca9\",\"orchestration-status\":\"Active\"}}" - ] - }, - "times": { - "remainingTimes": 1, - "unlimited": false - } - }, - { - "httpRequest": { - "path": "/events/AAI_EVENT/.*", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [] - } - } -] diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json deleted file mode 100644 index cd75deb3..00000000 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "httpRequest": { - "path": "/events/unauthenticated.PMSH_CL_INPUT/.*", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [ - "{\"name\": \"ResponseEvent\", \"nameSpace\": \"org.onap.policy.apex.onap.pmcontrol\", \"source\": \"APEX\", \"target\": \"DCAE\", \"version\": \"0.0.1\", \"status\": {\"subscriptionName\": \"ExtraPM-All-gNB-R2B\", \"nfName\": \"pnf-existing\", \"changeType\": \"CREATE\", \"message\": \"success\"}}" - ] - }, - "times": { - "remainingTimes": 1, - "unlimited": false - } - }, - { - "httpRequest": { - "path": "/events/unauthenticated.PMSH_CL_INPUT/.*", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [] - } - } -] diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json new file mode 100644 index 00000000..0d1c9081 --- /dev/null +++ b/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json @@ -0,0 +1,13 @@ +{ + "name":"ResponseEvent", + "nameSpace":"org.onap.policy.apex.onap.pmcontrol", + "source":"APEX", + "target":"DCAE", + "version":"0.0.1", + "status":{ + "subscriptionName":"ExtraPM-All-gNB-R2B", + "nfName":"pnf-existing", + "changeType":"CREATE", + "message":"success" + } +} \ No newline at end of file diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot index 2f0e5bf6..4b0dc6e4 100644 --- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot +++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot @@ -15,14 +15,16 @@ Test Teardown Delete All Sessions *** Variables *** ${PMSH_BASE_URL} https://${PMSH_IP}:8443 -${MR_BASE_URL} https://${MR_SIM_IP_ADDRESS}:3095 +${MR_BASE_URL} http://${MR_IP_ADDRESS}:3904 ${CBS_BASE_URL} https://${CBS_SIM_IP_ADDRESS}:10443 ${SUBSCRIPTIONS_ENDPOINT} /subscriptions +${POLICY_PUBLISH_MR_TOPIC} /events/unauthenticated.PMSH_CL_INPUT +${AAI_MR_TOPIC} /events/AAI_EVENT -${MR_EXPECTATION_AAI_PNF_CREATED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json -${MR_EXPECTATION_AAI_PNF_REMOVED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json -${MR_EXPECTATION_POLICY_RESPONSE_PNF_EXISTING} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json -${CBS_EXPECTATION_ADMIN_STATE_UNLOCKED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json +${MR_AAI_PNF_CREATED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-create.json +${MR_AAI_PNF_REMOVED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/aai-pnf-delete.json +${MR_POLICY_RESPONSE_PNF_EXISTING} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/policy-sub-created-pnf-existing.json +${CBS_EXPECTATION_ADMIN_STATE_UNLOCKED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json ${ADMIN_STATE_LOCKED_PATTERN} 'administrativeState': 'LOCKED' ${CLI_EXEC_GET_CBS_CONFIG_FIRST} docker exec pmsh /bin/sh -c "grep -m 1 'PMSH config from CBS' /var/log/ONAP/dcaegen2/services/pmsh/application.log" @@ -42,54 +44,54 @@ Verify database tables exist and are empty [Tags] PMSH_02 [Documentation] Verify database has been created and is empty [Timeout] 10 seconds - ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} + ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Be True ${resp.status_code} == 200 Should Contain ${resp.text} [] Verify PNF detected in AAI when administrative state unlocked [Tags] PMSH_03 [Documentation] Verify PNF detected when administrative state unlocked - [Timeout] 40 seconds + [Timeout] 60 seconds SetAdministrativeStateToUnlocked Sleep 31 Allow PMSH time to pick up changes in CBS config - ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} - Should Be Equal As Strings ${resp.json()[0]['subscription_status']} UNLOCKED - Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_name']} pnf-existing - Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} PENDING_CREATE + ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} + Should Be Equal As Strings ${resp.json()[0]['subscription_status']} UNLOCKED + Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_name']} pnf-existing + Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} PENDING_CREATE Verify Policy response on MR is handled [Tags] PMSH_04 [Documentation] Verify policy response on MR is handled [Timeout] 60 seconds - SimulatePolicyResponse ${MR_EXPECTATION_POLICY_RESPONSE_PNF_EXISTING} + SimulatePolicyResponse ${MR_POLICY_RESPONSE_PNF_EXISTING} Sleep 31 seconds Ensure Policy response on MR is picked up - ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} - Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} CREATED + ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} + Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} CREATED Verify AAI event on MR detailing new PNF being detected is handled [Tags] PMSH_05 [Documentation] Verify PNF created AAI event on MR is handled [Timeout] 60 seconds - SimulateNewPNF + SimulateNewPNF ${MR_AAI_PNF_CREATED} Sleep 31 seconds Ensure AAI event on MR is picked up - ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} + ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_name']} pnf_newly_discovered - Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_sub_status']} PENDING_CREATE + Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_sub_status']} PENDING_CREATE Verify AAI event on MR detailing PNF being deleted is handled [Tags] PMSH_06 [Documentation] Verify PNF deleted AAI event on MR is handled [Timeout] 60 seconds - SimulateDeletedPNF + SimulateDeletedPNF ${MR_AAI_PNF_REMOVED} Sleep 31 seconds Ensure AAI event on MR is picked up - ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} - Should Not Contain ${resp.text} pnf_newly_discovered + ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} + Should Not Contain ${resp.text} pnf_newly_discovered *** Keywords *** CreateSessions - Create Session pmsh_session ${PMSH_BASE_URL} - Create Session mr_sim_session ${MR_BASE_URL} + Create Session pmsh_session ${PMSH_BASE_URL} + Create Session mr_sim_session ${MR_BASE_URL} Create Session cbs_sim_session ${CBS_BASE_URL} SetAdministrativeStateToUnlocked @@ -100,24 +102,36 @@ SetAdministrativeStateToUnlocked ${resp} = Put Request cbs_sim_session /expectation data=${data} Should Be True ${resp.status_code} == 201 -SimulateNewPNF - ${data}= Get Data From File ${MR_EXPECTATION_AAI_PNF_CREATED} - ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event"} - Should Be True ${resp.status_code} == 200 - ${resp} = Put Request mr_sim_session /expectation data=${data} - Should Be True ${resp.status_code} == 201 SimulatePolicyResponse [Arguments] ${expected_contents} - ${data}= Get Data From File ${expected_contents} - ${resp} = Put Request mr_sim_session /clear data={"path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input"} - Should Be True ${resp.status_code} == 200 - ${resp} = Put Request mr_sim_session /expectation data=${data} - Should Be True ${resp.status_code} == 201 + ${json_value}= json_from_file ${expected_contents} + ${resp}= PostCall ${POLICY_PUBLISH_MR_TOPIC} ${json_value} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${count}= Evaluate $resp.json().get('count') + log 'JSON Response Code:'${resp} + +SimulateNewPNF + [Arguments] ${expected_contents} + ${json_value}= json_from_file ${expected_contents} + ${resp}= PostCall ${AAI_MR_TOPIC} ${json_value} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${count}= Evaluate $resp.json().get('count') + log 'JSON Response Code:'${resp} SimulateDeletedPNF - ${data}= Get Data From File ${MR_EXPECTATION_AAI_PNF_REMOVED} - ${resp} = Put Request mr_sim_session /clear data={"path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event"} - Should Be True ${resp.status_code} == 200 - ${resp} = Put Request mr_sim_session /expectation data=${data} - Should Be True ${resp.status_code} == 201 + [Arguments] ${expected_contents} + ${json_value}= json_from_file ${expected_contents} + ${resp}= PostCall ${AAI_MR_TOPIC} ${json_value} + log ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + ${count}= Evaluate $resp.json().get('count') + log 'JSON Response Code:'${resp} + +PostCall + [Arguments] ${url} ${data} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Post Request mr_sim_session ${url} json=${data} headers=${headers} + [Return] ${resp} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_ml_payload.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_ml_payload.json new file mode 100644 index 00000000..73425aaf --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_ml_payload.json @@ -0,0 +1 @@ +{"name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","serviceInstanceID":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","globalSubscriberId":"Customer-001","subscriptionServiceType":"Premium","networkType":"AN","additionalProperties":{"modifyAction":"reconfigure","snssaiList":["001-00110"],"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd","resourceConfig":{"snssai":"001-00110","data":[{"gNBCUName":"cucpserver1","nearRTRICId":"11","cellCUList":[{"cellLocalId":103593989,"configData":{"maxNumberofConns":"20","predictedMaxNumberofConns":"25","lastUpdatedTS":"yyyy/MM/dd HH:mm:ss"}}]}]},"nsiInfo":{"nsiName":"","nsiId":"23b250a7-61f3-460a-9bb2-d35923148541"},"scriptName":"AN"}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_ml_response.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_ml_response.json new file mode 100644 index 00000000..576fc891 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_ml_response.json @@ -0,0 +1 @@ +{"closedLoopControlName":"ControlLoop-Slicing-116d7b00-dbeb-4d03-8719-d0a658fa735b","closedLoopAlarmStart":1604468227374,"closedLoopEventClient":"microservice.sliceAnalysisMS","closedLoopEventStatus":"ONSET","requestID":"0196f8a4-117b-4e51-b013-92e0b7ad95a8","target":"vserver.vserver-name","payload":{"name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","serviceInstanceID":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","globalSubscriberId":"Customer-001","subscriptionServiceType":"Premium","networkType":"AN","additionalProperties":{"modifyAction":"reconfigure","snssaiList":["001-00110"],"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd","resourceConfig":{"snssai":"001-00110","data":[{"gNBCUName":"cucpserver1","nearRTRICId":"11","cellCUList":[{"cellLocalId":103593989,"configData":{"maxNumberofConns":"20","predictedMaxNumberofConns":"25","lastUpdatedTS":"yyyy/MM/dd HH:mm:ss"}}]}]},"nsiInfo":{"nsiName":"","nsiId":"2d43ff64-76bd-437b-ab98-1e7aa3e5df5f"},"scriptName":"AN"}},"from":"DCAE","version":"1.0.2","target_type":"VNF","AAI":{"vserver.is-closed-loop-disabled":"false","vserver.prov-status":"ACTIVE","vserver.vserver-name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82"}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_payload_pm1.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_payload_pm1.json new file mode 100644 index 00000000..545b90c7 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_payload_pm1.json @@ -0,0 +1 @@ +{"name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","serviceInstanceID":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","globalSubscriberId":"Customer-001","subscriptionServiceType":"Premium","networkType":"AN","additionalProperties":{"modifyAction":"reconfigure","snssaiList":["001-00110"],"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd","resourceConfig":{"11":{"dLThptPerSlice":50,"uLThptPerSlice":40}},"nsiInfo":{"nsiName":"","nsiId":"b149c982-a124-4aaf-a917-89c32ec7b284"},"scriptName":"AN"}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_payload_pm2.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_payload_pm2.json new file mode 100644 index 00000000..b1ea24b1 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_payload_pm2.json @@ -0,0 +1 @@ +{"name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","serviceInstanceID":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","globalSubscriberId":"Customer-001","subscriptionServiceType":"Premium","networkType":"AN","additionalProperties":{"modifyAction":"reconfigure","snssaiList":["001-010000"],"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd","resourceConfig":{"11":{"dLThptPerSlice":29,"uLThptPerSlice":32},"22":{"dLThptPerSlice":25,"uLThptPerSlice":28}},"nsiInfo":{"nsiName":"","nsiId":"493bf7aa-59a5-4f72-b1bc-f1bad9fc8600"},"scriptName":"AN"}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm.json new file mode 100644 index 00000000..a1b49165 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm.json @@ -0,0 +1 @@ +{"closedLoopControlName":"ControlLoop-Slicing-116d7b00-dbeb-4d03-8719-d0a658fa735b","closedLoopAlarmStart":1608198244852,"closedLoopEventClient":"microservice.sliceAnalysisMS","closedLoopEventStatus":"ONSET","requestID":"4fae9c22-59f1-47e8-a8a2-c4cbb79418cc","target":"vserver.vserver-name","payload":{"name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","serviceInstanceID":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","globalSubscriberId":"Customer-001","subscriptionServiceType":"Premium","networkType":"AN","additionalProperties":{"modifyAction":"reconfigure","snssaiList":["001-010000"],"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd","resourceConfig":{"11":{"dLThptPerSlice":29,"uLThptPerSlice":32},"22":{"dLThptPerSlice":25,"uLThptPerSlice":28}},"nsiInfo":{"nsiName":"","nsiId":"f61681df-cbbe-4851-9ab6-fab24c8c77b4"},"scriptName":"AN"}},"from":"DCAE","version":"1.0.2","target_type":"VNF","AAI":{"vserver.is-closed-loop-disabled":"false","vserver.prov-status":"ACTIVE","vserver.vserver-name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82"}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm1.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm1.json new file mode 100644 index 00000000..bd4ca924 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm1.json @@ -0,0 +1 @@ +{"closedLoopControlName":"ControlLoop-Slicing-116d7b00-dbeb-4d03-8719-d0a658fa735b","closedLoopAlarmStart":1604494201291,"closedLoopEventClient":"microservice.sliceAnalysisMS","closedLoopEventStatus":"ONSET","requestID":"0afb48b6-db08-45d6-aff3-675255f51ed5","target":"vserver.vserver-name","payload":{"name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","serviceInstanceID":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","globalSubscriberId":"Customer-001","subscriptionServiceType":"Premium","networkType":"AN","additionalProperties":{"modifyAction":"reconfigure","snssaiList":["001-00110"],"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd","resourceConfig":{"11":{"dLThptPerSlice":50,"uLThptPerSlice":40}},"nsiInfo":{"nsiName":"","nsiId":"a7f1242d-5889-46c3-bb0a-800c6ae388d1"},"scriptName":"AN"}},"from":"DCAE","version":"1.0.2","target_type":"VNF","AAI":{"vserver.is-closed-loop-disabled":"false","vserver.prov-status":"ACTIVE","vserver.vserver-name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82"}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm2.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm2.json new file mode 100644 index 00000000..bd4ca924 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm2.json @@ -0,0 +1 @@ +{"closedLoopControlName":"ControlLoop-Slicing-116d7b00-dbeb-4d03-8719-d0a658fa735b","closedLoopAlarmStart":1604494201291,"closedLoopEventClient":"microservice.sliceAnalysisMS","closedLoopEventStatus":"ONSET","requestID":"0afb48b6-db08-45d6-aff3-675255f51ed5","target":"vserver.vserver-name","payload":{"name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","serviceInstanceID":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82","globalSubscriberId":"Customer-001","subscriptionServiceType":"Premium","networkType":"AN","additionalProperties":{"modifyAction":"reconfigure","snssaiList":["001-00110"],"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd","resourceConfig":{"11":{"dLThptPerSlice":50,"uLThptPerSlice":40}},"nsiInfo":{"nsiName":"","nsiId":"a7f1242d-5889-46c3-bb0a-800c6ae388d1"},"scriptName":"AN"}},"from":"DCAE","version":"1.0.2","target_type":"VNF","AAI":{"vserver.is-closed-loop-disabled":"false","vserver.prov-status":"ACTIVE","vserver.vserver-name":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82"}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm3.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm3.json new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/expected_pm3.json @@ -0,0 +1 @@ + diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/ml_response.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/ml_response.json new file mode 100644 index 00000000..d287d036 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/ml_response.json @@ -0,0 +1,69 @@ +{ + + + +"snssai":"001-00110", + + + +"data":[ + + + +{ + + + +"gNBCUName":"cucpserver1", + + + +"cellCUList":[ + + + +{ + + + +"cellLocalId":103593989, + + + +"configData":{ + + + +"maxNumberofConns":"20", + + + +"predictedMaxNumberofConns":"25", + + + +"lastUpdatedTS":"yyyy/MM/dd HH:mm:ss" + + + +} + + + +} + + + +] + + + +} + + + +] + + + +} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification1.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification1.json new file mode 100644 index 00000000..1919e95d --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification1.json @@ -0,0 +1,56 @@ +{ + "event": { + "commonEventHeader": { + "domain": "perf3gpp", + "eventId": "9e7c7db8-7a51-4bff-94f5-b530296edd7c", + "sequence": 0, + "eventName": "perf3gpp_AcmeNode-Acme_pmMeasResult", + "sourceName": "oteNB5309", + "reportingEntityName": "", + "priority": "Normal", + "startEpochMicrosec": 1538478000000, + "lastEpochMicrosec": 1538478900000, + "version": "4.0", + "vesEventListenerVersion": "7.1", + "timeZoneOffset": "UTC+05:00" + }, + "perf3gppFields": { + "perf3gppFieldsVersion": "1.0", + "measDataCollection": { + "granularityPeriod": 1538482500000, + "measuredEntityUserName": "", + "measuredEntityDn": "1", + "measuredEntitySoftwareVersion": "r0.1", + "measInfoList": [{ + "measInfoId": { + "sMeasInfoId": "some measInfoId" + }, + "measTypes": { + "sMeasTypesList": ["SM.PrbUsedDl.001-00110", "SM.PrbUsedUl.001-00110"] + }, + "measValuesList": [{ + "measObjInstId": "103593989", + "suspectFlag": "false", + "measResults": [{ + "p": 1, + "sValue": "75" + }, { + "p": 2, + "sValue": "84" + }] + }, { + "measObjInstId": "103593999", + "suspectFlag": "false", + "measResults": [{ + "p": 1, + "sValue": "90" + }, { + "p": 2, + "sValue": "95" + }] + }] + }] + } + } + } +} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification2.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification2.json new file mode 100644 index 00000000..7ca8a652 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification2.json @@ -0,0 +1,56 @@ +{ + "event": { + "commonEventHeader": { + "domain": "perf3gpp", + "eventId": "9e7c7db8-7a51-4bff-94f5-b530296edd7c", + "sequence": 0, + "eventName": "perf3gpp_AcmeNode-Acme_pmMeasResult", + "sourceName": "oteNB5309", + "reportingEntityName": "", + "priority": "Normal", + "startEpochMicrosec": 1538478000000, + "lastEpochMicrosec": 1538478900000, + "version": "4.0", + "vesEventListenerVersion": "7.1", + "timeZoneOffset": "UTC+05:00" + }, + "perf3gppFields": { + "perf3gppFieldsVersion": "1.0", + "measDataCollection": { + "granularityPeriod": 1538482500000, + "measuredEntityUserName": "", + "measuredEntityDn": "1", + "measuredEntitySoftwareVersion": "r0.1", + "measInfoList": [{ + "measInfoId": { + "sMeasInfoId": "some measInfoId" + }, + "measTypes": { + "sMeasTypesList": ["SM.PrbUsedDl.001-010000", "SM.PrbUsedUl.001-010000"] + }, + "measValuesList": [{ + "measObjInstId": "103593989", + "suspectFlag": "false", + "measResults": [{ + "p": 1, + "sValue": "75" + }, { + "p": 2, + "sValue": "84" + }] + }, { + "measObjInstId": "103593999", + "suspectFlag": "false", + "measResults": [{ + "p": 1, + "sValue": "90" + }, { + "p": 2, + "sValue": "95" + }] + }] + }] + } + } + } +} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification3.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification3.json new file mode 100644 index 00000000..78f5ccb6 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification3.json @@ -0,0 +1 @@ +{"event": {"commonEventHeader": {"domain":"perf3gpp","eventId": "65e9a550-5f74-4952-bb89-07ce5aa51ce3","sequence": 0,"eventName": "perf3gpp_AcmeNode-Acme_pmMeasResult","sourceName": "oteNB5309","reportingEntityName": "","priority": "Normal","startEpochMicrosec": 1538478000000,"lastEpochMicrosec": 1538478900000,"version": "4.0","vesEventListenerVersion": "7.1","timeZoneOffset": "UTC+05:00"},"perf3gppFields": {"perf3gppFieldsVersion": "1.0","measDataCollection": {"granularityPeriod": 1538482500000,"measuredEntityUserName": "","measuredEntityDn": "2","measuredEntitySoftwareVersion": "r0.1","measInfoList": [{"measInfoId": {"sMeasInfoId": "some measInfoId"},"measTypes": {"sMeasTypesList":["SM.PrbUsedDl.001-010000","SM.PrbUsedUl.001-010000"]},"measValuesList": [{"measObjInstId": "95697155","suspectFlag": "false","measResults": [{"p": 1,"sValue": "80"},{"p": 2,"sValue": "70"}]},{"measObjInstId": "95697175","suspectFlag": "false","measResults": [{"p": 1,"sValue": "82"},{"p": 2,"sValue": "72"}]},{"measObjInstId": "95697174","suspectFlag": "false","measResults": [{"p": 1,"sValue": "85"},{"p": 2,"sValue": "75"}]}]}]}}}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification4.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification4.json new file mode 100644 index 00000000..4f81e9ba --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification4.json @@ -0,0 +1 @@ +{"event": {"commonEventHeader": {"domain": "perf3gpp","eventId": "0556fcae-e684-41fe-b85f-d033a11fe161","sequence": 0,"eventName": "perf3gpp_AcmeNode-Acme_pmMeasResult","sourceName": "oteNB5309","reportingEntityName": "","priority": "Normal","startEpochMicrosec": 1538478000000,"lastEpochMicrosec": 1538478900000,"version": "4.0","vesEventListenerVersion": "7.1","timeZoneOffset": "UTC+05:00"},"perf3gppFields": {"perf3gppFieldsVersion": "1.0","measDataCollection": {"granularityPeriod": 1538482500000,"measuredEntityUserName": "","measuredEntityDn": "2","measuredEntitySoftwareVersion": "r0.1","measInfoList": [{"measInfoId": {"sMeasInfoId": "some measInfoId"},"measTypes": {"sMeasTypesList":["SM.PrbUsedDl.001-010000","SM.PrbUsedUl.001-010000"]},"measValuesList": [{"measObjInstId": "95697155","suspectFlag": "false","measResults": [{"p": 1,"sValue": "81"},{"p": 2,"sValue": "71"}]},{"measObjInstId": "95697175","suspectFlag": "false","measResults": [{"p": 1,"sValue": "83"},{"p": 2,"sValue": "73"}]},{"measObjInstId": "95697174","suspectFlag": "false","measResults": [{"p": 1,"sValue": "86"},{"p": 2,"sValue": "76"}]}]}]}}}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification5.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification5.json new file mode 100644 index 00000000..877d205b --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification5.json @@ -0,0 +1 @@ +{"event": {"commonEventHeader": {"domain": "perf3gpp","eventId": "246cd43f-3e6e-4e54-84cd-c9dcf2723c3c","sequence": 0,"eventName": "perf3gpp_AcmeNode-Acme_pmMeasResult","sourceName": "oteNB5309","reportingEntityName": "","priority": "Normal","startEpochMicrosec": 1538478000000,"lastEpochMicrosec": 1538478900000,"version": "4.0","vesEventListenerVersion": "7.1","timeZoneOffset": "UTC+05:00"},"perf3gppFields": {"perf3gppFieldsVersion": "1.0","measDataCollection": {"granularityPeriod": 1538482500000,"measuredEntityUserName": "","measuredEntityDn": "2","measuredEntitySoftwareVersion": "r0.1","measInfoList": [{"measInfoId": {"sMeasInfoId": "some measInfoId"},"measTypes": {"sMeasTypesList":["SM.PrbUsedDl.001-010000","SM.PrbUsedUl.001-010000"]},"measValuesList": [{"measObjInstId": "95697155","suspectFlag": "false","measResults": [{"p": 1,"sValue": "82"},{"p": 2,"sValue": "72"}]},{"measObjInstId": "95697175","suspectFlag": "false","measResults": [{"p": 1,"sValue": "84"},{"p": 2,"sValue": "74"}]},{"measObjInstId": "95697174","suspectFlag": "false","measResults": [{"p": 1,"sValue": "87"},{"p": 2,"sValue": "77"}]}]}]}}}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification6.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification6.json new file mode 100644 index 00000000..74857e02 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification6.json @@ -0,0 +1 @@ +{"event": {"commonEventHeader": {"domain": "perf3gpp","eventId": "c37b045f-4339-4ef2-9b64-3b781d6d8378","sequence": 0,"eventName": "perf3gpp_AcmeNode-Acme_pmMeasResult","sourceName": "oteNB5309","reportingEntityName": "","priority": "Normal","startEpochMicrosec": 1538478000000,"lastEpochMicrosec": 1538478900000,"version": "4.0","vesEventListenerVersion": "7.1","timeZoneOffset": "UTC+05:00"},"perf3gppFields": {"perf3gppFieldsVersion": "1.0","measDataCollection": {"granularityPeriod": 1538482500000,"measuredEntityUserName": "","measuredEntityDn": "4","measuredEntitySoftwareVersion": "r0.1","measInfoList": [{"measInfoId": {"sMeasInfoId": "some measInfoId"},"measTypes": {"sMeasTypesList":["SM.PrbUsedDl.001-010000","SM.PrbUsedUl.001-010000"]},"measValuesList": [{"measObjInstId": "112951561","suspectFlag": "false","measResults": [{"p": 1,"sValue": "70"},{"p": 2,"sValue": "60"}]},{"measObjInstId": "112951562","suspectFlag": "false","measResults": [{"p": 1,"sValue": "72"},{"p": 2,"sValue": "63"}]},{"measObjInstId": "112951568","suspectFlag": "false","measResults": [{"p": 1,"sValue": "75"},{"p": 2,"sValue": "65"}]}]}]}}}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification7.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification7.json new file mode 100644 index 00000000..312bc547 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification7.json @@ -0,0 +1 @@ +{"event": {"commonEventHeader": {"domain": "perf3gpp","eventId": "88a3ad1f-9b58-4f49-85ba-2645856bb885","sequence": 0,"eventName": "perf3gpp_AcmeNode-Acme_pmMeasResult","sourceName": "oteNB5309","reportingEntityName": "","priority": "Normal","startEpochMicrosec": 1538478000000,"lastEpochMicrosec": 1538478900000,"version": "4.0","vesEventListenerVersion": "7.1","timeZoneOffset": "UTC+05:00"},"perf3gppFields": {"perf3gppFieldsVersion": "1.0","measDataCollection": {"granularityPeriod": 1538482500000,"measuredEntityUserName": "","measuredEntityDn": "4","measuredEntitySoftwareVersion": "r0.1","measInfoList": [{"measInfoId": {"sMeasInfoId": "some measInfoId"},"measTypes": {"sMeasTypesList":["SM.PrbUsedDl.001-010000","SM.PrbUsedUl.001-010000"]},"measValuesList": [{"measObjInstId": "112951561","suspectFlag": "false","measResults": [{"p": 1,"sValue": "71"},{"p": 2,"sValue": "61"}]},{"measObjInstId": "112951562","suspectFlag": "false","measResults": [{"p": 1,"sValue": "73"},{"p": 2,"sValue": "63"}]},{"measObjInstId": "112951568","suspectFlag": "false","measResults": [{"p": 1,"sValue": "76"},{"p": 2,"sValue": "66"}]}]}]}}}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification8.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification8.json new file mode 100644 index 00000000..82cec2c6 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/performance_notification8.json @@ -0,0 +1 @@ +{"event": {"commonEventHeader": {"domain": "perf3gpp","eventId": "c99eb88b-2907-4aec-8bf3-4532ebd9d50b","sequence": 0,"eventName": "perf3gpp_AcmeNode-Acme_pmMeasResult","sourceName": "oteNB5309","reportingEntityName": "","priority": "Normal","startEpochMicrosec": 1538478000000,"lastEpochMicrosec": 1538478900000,"version": "4.0","vesEventListenerVersion": "7.1","timeZoneOffset": "UTC+05:00"},"perf3gppFields": {"perf3gppFieldsVersion": "1.0","measDataCollection": {"granularityPeriod": 1538482500000,"measuredEntityUserName": "","measuredEntityDn": "4","measuredEntitySoftwareVersion": "r0.1","measInfoList": [{"measInfoId": {"sMeasInfoId": "some measInfoId"},"measTypes": {"sMeasTypesList":["SM.PrbUsedDl.001-010000","SM.PrbUsedUl.001-010000"]},"measValuesList": [{"measObjInstId": "112951561","suspectFlag": "false","measResults": [{"p": 1,"sValue": "72"},{"p": 2,"sValue": "62"}]},{"measObjInstId": "112951562","suspectFlag": "false","measResults": [{"p": 1,"sValue": "74"},{"p": 2,"sValue": "64"}]},{"measObjInstId": "112951568","suspectFlag": "false","measResults": [{"p": 1,"sValue": "77"},{"p": 2,"sValue": "67"}]}]}]}}}} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test.robot b/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test.robot new file mode 100644 index 00000000..db9925f8 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test.robot @@ -0,0 +1,124 @@ +*** Settings *** +Library Collections +Library Process +Library RequestsLibrary +Library String +Library OperatingSystem + +Suite Teardown Delete All Sessions + +*** Variables *** +${SLICE_ANALYSIS_MS_BASE_URL} http://${SLICE_ANALYSIS_MS_IP}:8080 +${HEALTHCHECK_ENDPOINT} /healthcheck +${DMAAP_URL} http://${DMAAP_IP}:3904/events +${unauthenticated.DCAE_CL_OUTPUT} /unauthenticated.DCAE_CL_OUTPUT/23/23 +${POST_DMAAP_EVENT_FOR_ML_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthenticated.ML_RESPONSE_TOPIC +${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthenticated.PERFORMANCE_MEASUREMENTS + + +*** Test Cases *** + +HealthCheck + + Create Session sliceanalysisms ${SLICE_ANALYSIS_MS_BASE_URL} + ${resp}= Get Request sliceanalysisms ${HEALTHCHECK_ENDPOINT} + Should Be Equal As Strings ${resp.status_code} 200 + + +Post ml notification to dmaap + Create Session dmaap ${DMAAP_URL} + ${headers}= Create Dictionary Content-Type application/json + ${data}= Get File ${TEST_ROBOT_DIR}/data/ml_response.json + ${response}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_ML_NOTIF_URL}', data=$data) + Should Be Equal As Strings ${response.status_code} 200 + + +Verify ml notification trigger + Create Session dmaap ${DMAAP_URL} + FOR ${i} IN RANGE 30 + ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT} + Exit For Loop If ${result.json()} != @{EMPTY} + Log Waiting for slice-analysis-ms to handle trigger... console=${True} + Sleep 5s + END + + ${expected_string}= Get File ${TEST_ROBOT_DIR}/data/expected_ml_payload.json + ${expected_payload}= Evaluate json.loads("""${expected_string}""") json + ${result}= Convert To String ${result.content} + ${result_string}= Get Substring ${result} 2 -2 + ${actual_data}= Evaluate json.loads("""${result_string}""") json + ${actual_payload_str}= Set Variable ${actual_data['payload']} + ${actual_payload}= Evaluate json.loads("""${actual_payload_str}""") json + set to dictionary ${expected_payload['additionalProperties']['nsiInfo']} nsiId=${actual_payload['additionalProperties']['nsiInfo']['nsiId']} + Should Be True """${actual_payload}""".strip() == """${expected_payload}""".strip() + + +Post pm notification-1 to dmaap + ${data}= Get File ${TEST_ROBOT_DIR}/data/performance_notification1.json + FOR ${j} IN RANGE 6 + ${response}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL}', data=$data) + Sleep 10s + END + Should Be Equal As Strings ${response.status_code} 200 + + +Verify pm notification-1 trigger + Create Session dmaap ${DMAAP_URL} + FOR ${i} IN RANGE 20 + ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT} + Exit For Loop If ${result.json()} != @{EMPTY} + Log Waiting for sliceanalysisms to handle trigger... console=${True} + Sleep 30s + END + ${expected_string}= Get File ${TEST_ROBOT_DIR}/data/expected_payload_pm1.json + ${expected_payload}= Evaluate json.loads("""${expected_string}""") json + ${result}= Convert To String ${result.content} + ${result_string}= Get Substring ${result} 2 -2 + ${actual_data}= Evaluate json.loads("""${result_string}""") json + ${actual_payload_str}= Set Variable ${actual_data['payload']} + ${actual_payload}= Evaluate json.loads("""${actual_payload_str}""") json + set to dictionary ${expected_payload['additionalProperties']['nsiInfo']} nsiId=${actual_payload['additionalProperties']['nsiInfo']['nsiId']} + Should Be True """${actual_payload}""".strip() == """${expected_payload}""".strip() + + + +Post pm notification-2 to dmaap + ${data}= Get File ${TEST_ROBOT_DIR}/data/performance_notification3.json + ${data1}= Get File ${TEST_ROBOT_DIR}/data/performance_notification4.json + ${data2}= Get File ${TEST_ROBOT_DIR}/data/performance_notification5.json + ${data3}= Get File ${TEST_ROBOT_DIR}/data/performance_notification6.json + ${data4}= Get File ${TEST_ROBOT_DIR}/data/performance_notification7.json + ${data5}= Get File ${TEST_ROBOT_DIR}/data/performance_notification8.json + FOR ${i} IN RANGE 6 + ${response}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL}', data=$data) + ${response1}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL}', data=$data1) + ${response2}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL}', data=$data2) + ${response3}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL}', data=$data3) + ${response4}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL}', data=$data4) + ${response5}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL}', data=$data5) + END + Should Be Equal As Strings ${response.status_code} 200 + Should Be Equal As Strings ${response1.status_code} 200 + Should Be Equal As Strings ${response2.status_code} 200 + Should Be Equal As Strings ${response3.status_code} 200 + Should Be Equal As Strings ${response4.status_code} 200 + Should Be Equal As Strings ${response5.status_code} 200 + + +Verify pm notification-2 trigger + Create Session dmaap ${DMAAP_URL} + FOR ${i} IN RANGE 20 + ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT} + Exit For Loop If ${result.json()} != @{EMPTY} + Log Waiting for sliceanalysisms to handle trigger... console=${True} + Sleep 30s + END + ${expected_string}= Get File ${TEST_ROBOT_DIR}/data/expected_payload_pm2.json + ${expected_payload}= Evaluate json.loads("""${expected_string}""") json + ${result}= Convert To String ${result.content} + ${result_string}= Get Substring ${result} 2 -2 + ${actual_data}= Evaluate json.loads("""${result_string}""") json + ${actual_payload_str}= Set Variable ${actual_data['payload']} + ${actual_payload}= Evaluate json.loads("""${actual_payload_str}""") json + set to dictionary ${expected_payload['additionalProperties']['nsiInfo']} nsiId=${actual_payload['additionalProperties']['nsiInfo']['nsiId']} + Should Be True """${actual_payload}""".strip() == """${expected_payload}""".strip() diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot index 212dfe0b..c53d5d1e 100644 --- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot +++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot @@ -57,7 +57,7 @@ Verify AAI not responding is logged ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json Ensure Container Is Exited aai_simulator Set VES event in DMaaP ${ves_event} - Wait for one of PRH log entries 90s connection timed out: aai Host is unreachable: aai No route to host: aai + Wait for one of PRH log entries 90s connection timed out: aai Host is unreachable: aai No route to host: aai failed to resolve 'aai' [Teardown] Ensure Container Is Running aai_simulator Verify PNF re registration @@ -217,4 +217,4 @@ Verify logs with heartbeat Verify PRH logs contains [Arguments] ${expected_entry} ${log}= Get docker logs since test start prh - Should Contain ${log} ${expected_entry} \ No newline at end of file + Should Contain ${log} ${expected_entry} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_pnf_registration_event.json b/tests/dcaegen2/testcases/assets/json_events/ves7_pnf_registration_event.json index dcd3aa5d..1726e064 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves7_pnf_registration_event.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_pnf_registration_event.json @@ -28,7 +28,7 @@ "unitFamily": "BBU", "vendorName": "Nokia", "oamV4IpAddress": "10.11.12.13", - "oamV6IpAddress": "1::::9", + "oamV6IpAddress": "2001:db2:31:1041:204a::1337", "softwareVersion": "val7" } } diff --git a/tests/dmaap-buscontroller/single-mr-suite/__init__.robot b/tests/dmaap-buscontroller/single-mr-suite/__init__.robot deleted file mode 100644 index 41c7a003..00000000 --- a/tests/dmaap-buscontroller/single-mr-suite/__init__.robot +++ /dev/null @@ -1,3 +0,0 @@ -*** Settings *** -Documentation dmaap-buscontroller - Suite 1 - diff --git a/tests/dmaap-buscontroller/ssl_suite/__init__.robot b/tests/dmaap-buscontroller/ssl_suite/__init__.robot deleted file mode 100644 index 41c7a003..00000000 --- a/tests/dmaap-buscontroller/ssl_suite/__init__.robot +++ /dev/null @@ -1,3 +0,0 @@ -*** Settings *** -Documentation dmaap-buscontroller - Suite 1 - diff --git a/tests/dmaap-buscontroller/ssl_suite/test1.robot b/tests/dmaap-buscontroller/ssl_suite/test1.robot deleted file mode 100644 index 999c6baf..00000000 --- a/tests/dmaap-buscontroller/ssl_suite/test1.robot +++ /dev/null @@ -1,77 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary -Library HttpLibrary.HTTP -Library Collections -Library String - -*** Variables *** -${MESSAGE} Hello, world! -${DBC_URI} /webapi - -*** Test Cases *** -String Equality Test - Should Be Equal ${MESSAGE} Hello, world! - -Dir Test - [Documentation] Check if /tmp exists - Log ${MESSAGE} - CheckDir /tmp - -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session openo http://www.onap.org - CheckUrl openo / 200 - -HTTPS Heartbeat Test - [Documentation] Check ${DBC_URI}/info SSL endpoint - Create Session heartbeat https://${DMAAPBC_IP}:8443 - CheckUrl heartbeat ${DBC_URI}/info 204 - -HTTPS Dmaap Init Test - [Documentation] Check ${DBC_URI}/dmaap SSL endpoint - Create Session heartbeat https://${DMAAPBC_IP}:8443 - CheckStatus heartbeat ${DBC_URI}/dmaap "VALID" - -HTTPS Dmaap dcaeLocations Test - [Documentation] Check ${DBC_URI}/dcaeLocations SSL endpoint - Create Session heartbeat https://${DMAAPBC_IP}:8443 - CheckStatus0 heartbeat ${DBC_URI}/dcaeLocations "VALID" - -HTTPS Dmaap mr_clusters Test - [Documentation] Check ${DBC_URI}/mr_clusters SSL endpoint - Create Session heartbeat https://${DMAAPBC_IP}:8443 - CheckStatus0 heartbeat ${DBC_URI}/mr_clusters "VALID" - - -*** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - Should Be Equal As Integers ${resp.status_code} ${expect} - -CheckStatus - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - log ${resp.content} - ${val}= Get Json value ${resp.content} /status - log ${val} - should be equal as strings ${val} ${expect} - -CheckStatus0 - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - log ${resp.json()} - log ${resp.content} -# silliness to strip off the brackets returned for a List to get a Dict - ${t1}= Remove String ${resp.content} [ - ${dict}= Remove String ${t1} ] - log ${dict} - ${val}= Get Json value ${dict} /status - log ${val} - should be equal as strings ${val} ${expect} - diff --git a/tests/dmaap-buscontroller/suite1/__init__.robot b/tests/dmaap-buscontroller/suite1/__init__.robot deleted file mode 100644 index 41c7a003..00000000 --- a/tests/dmaap-buscontroller/suite1/__init__.robot +++ /dev/null @@ -1,3 +0,0 @@ -*** Settings *** -Documentation dmaap-buscontroller - Suite 1 - diff --git a/tests/dmaap-buscontroller/suite1/test1.robot b/tests/dmaap-buscontroller/suite1/test1.robot deleted file mode 100644 index be4e8cc6..00000000 --- a/tests/dmaap-buscontroller/suite1/test1.robot +++ /dev/null @@ -1,42 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary - -*** Variables *** -${MESSAGE} Hello, world! -${DBC_URI} /webapi - -*** Test Cases *** -String Equality Test - Should Be Equal ${MESSAGE} Hello, world! - -Dir Test - [Documentation] Check if /tmp exists - Log ${MESSAGE} - CheckDir /tmp - -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session openo http://www.onap.org - CheckUrl openo / 200 - -Mock Hello Server Test - [Documentation] Check /hello endpoint - Create Session hello http://${AAF_IP}:1080 - CheckUrl hello /hello 200 - -Heartbeat Test - [Documentation] Check ${DBC_URI}/info endpoint - Create Session heartbeat http://${DMAAPBC_IP}:8080 - CheckUrl heartbeat ${DBC_URI}/info 204 - -*** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - Should Be Equal As Integers ${resp.status_code} ${expect} - diff --git a/tests/dmaap-buscontroller/with_dr/__init__.robot b/tests/dmaap-buscontroller/with_dr/__init__.robot new file mode 100644 index 00000000..2d404124 --- /dev/null +++ b/tests/dmaap-buscontroller/with_dr/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation dmaap-buscontroller - dr diff --git a/tests/dmaap-buscontroller/with_dr/orig b/tests/dmaap-buscontroller/with_dr/orig deleted file mode 100755 index fcac2026..00000000 --- a/tests/dmaap-buscontroller/with_dr/orig +++ /dev/null @@ -1,116 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary -Library requests -Library Collections -Library String - -*** Variables *** -${TARGET_URL} https://${DR_PROV_IP}:8443 -${TARGET_URL_FEED} https://${DR_PROV_IP}:8443/feed/1 -${TARGET_URL_SUBSCRIBE} https://${DR_PROV_IP}:8443/subscribe/1 -${TARGET_URL_SUBSCRIPTION} https://${DR_PROV_IP}:8443/subs/1 -${TARGET_URL_PUBLISH} https://${DR_NODE_IP}:8443/publish/1/csit_test -${CREATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "CSIT_Test", "business_description": "CSIT_Test", "suspend": false, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} -${UPDATE_FEED_DATA} {"name": "CSIT_Test", "version": "m1.0", "description": "UPDATED-CSIT_Test", "business_description": "CSIT_Test", "suspend": true, "deleted": false, "changeowner": true, "authorization": {"classification": "unclassified", "endpoint_addrs": [], "endpoint_ids": [{"password": "rs873m", "id": "rs873m"}]}} -${SUBSCRIBE_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"rs873m", "password":"rs873m", "use100":true}, "metadataOnly":false, "suspend":false, "groupid":29, "subscriber":"sg481n"} -${UPDATE_SUBSCRIPTION_DATA} {"delivery":{ "url":"https://${DR_PROV_IP}:8080/", "user":"sg481n", "password":"sg481n", "use100":true}, "metadataOnly":false, "suspend":true, "groupid":29, "subscriber":"sg481n"} -${FEED_CONTENT_TYPE} application/vnd.att-dr.feed -${SUBSCRIBE_CONTENT_TYPE} application/vnd.att-dr.subscription -${PUBLISH_FEED_CONTENT_TYPE} application/octet-stream - -*** Test Cases *** -Run Feed Creation - [Documentation] Feed Creation - [Timeout] 1 minute - ${resp}= PostCall ${TARGET_URL} ${CREATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m - log ${TARGET_URL} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 201 - log 'JSON Response Code:'${resp} - -Run Subscribe to Feed - [Documentation] Subscribe to Feed - [Timeout] 1 minute - ${resp}= PostCall ${TARGET_URL_SUBSCRIBE} ${SUBSCRIBE_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n - log ${TARGET_URL_SUBSCRIBE} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 201 - log 'JSON Response Code:'${resp} - -Run Publish Feed - [Documentation] Publish to Feed - [Timeout] 1 minute - Sleep 10s Behaviour was noticed where feed was not created in time for publish to be sent - ${resp}= PutCall ${TARGET_URL_PUBLISH} ${CREATE_FEED_DATA} ${PUBLISH_FEED_CONTENT_TYPE} rs873m - log ${TARGET_URL_PUBLISH} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 204 - log 'JSON Response Code:'${resp} - -Run Update Subscription - [Documentation] Update Subscription to suspend and change delivery credentials - [Timeout] 1 minute - ${resp}= PutCall ${TARGET_URL_SUBSCRIPTION} ${UPDATE_SUBSCRIPTION_DATA} ${SUBSCRIBE_CONTENT_TYPE} sg481n - log ${TARGET_URL_SUBSCRIPTION} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - log 'JSON Response Code:'${resp} - ${resp}= GetCall ${TARGET_URL_SUBSCRIPTION} ${SUBSCRIBE_CONTENT_TYPE} sg481n - log ${resp.text} - Should Contain ${resp.text} "password":"sg481n","user":"sg481n" - log 'JSON Response Code:'${resp} - -Run Update Feed - [Documentation] Update Feed description and suspend - [Timeout] 1 minute - ${resp}= PutCall ${TARGET_URL_FEED} ${UPDATE_FEED_DATA} ${FEED_CONTENT_TYPE} rs873m - log ${TARGET_URL_FEED} - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - log 'JSON Response Code:'${resp} - ${resp}= GetCall ${TARGET_URL_FEED} ${FEED_CONTENT_TYPE} rs873m - log ${resp.text} - Should Contain ${resp.text} "UPDATED-CSIT_Test" - log 'JSON Response Code:'${resp} - -Run Delete Subscription - [Documentation] Delete Subscription - [Timeout] 1 minute - ${resp}= DeleteCall ${TARGET_URL_SUBSCRIPTION} sg481n - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 204 - log 'JSON Response Code:'${resp} - -Run Delete Feed - [Documentation] Delete Feed - [Timeout] 1 minute - ${resp}= DeleteCall ${TARGET_URL_FEED} rs873m - log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 204 - log 'JSON Response Code:'${resp} - -*** Keywords *** -PostCall - [Arguments] ${url} ${data} ${content_type} ${user} - ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} - ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests - [Return] ${resp} - -PutCall - [Arguments] ${url} ${data} ${content_type} ${user} - ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} Authorization=Basic cnM4NzNtOnJzODczbQ== - ${resp}= Evaluate requests.put('${url}',data='${data}', headers=${headers},verify=False) requests - [Return] ${resp} - -GetCall - [Arguments] ${url} ${content_type} ${user} - ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} Content-Type=${content_type} - ${resp}= Evaluate requests.get('${url}', headers=${headers},verify=False) requests - [Return] ${resp} - -DeleteCall - [Arguments] ${url} ${user} - ${headers}= Create Dictionary X-ATT-DR-ON-BEHALF-OF=${user} - ${resp}= Evaluate requests.delete('${url}', headers=${headers},verify=False) requests - [Return] ${resp} diff --git a/tests/dmaap-buscontroller/with_dr/test1.robot b/tests/dmaap-buscontroller/with_dr/test1.robot index a3aef42b..671e89b7 100644 --- a/tests/dmaap-buscontroller/with_dr/test1.robot +++ b/tests/dmaap-buscontroller/with_dr/test1.robot @@ -9,127 +9,60 @@ Library String *** Variables *** -${MESSAGE} Hello, world! -${DBC_URI} webapi -${DBC_URL} http://${DMAAPBC_IP}:8080/${DBC_URI} +${DBC_URI} webapi +${DBC_URL} http://${DMAAPBC_IP}:8080/${DBC_URI} ${LOC} csit-sanfrancisco -${PUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.pub", "action": [ "pub", "view" ] -${SUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.sub", "action": [ "sub", "view" ] -${PUB} { ${PUB_CORE} } -${SUB} { ${SUB_CORE} } ${FEED1_DATA} { "feedName":"feed1", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } ${FEED2_DATA} { "feedName":"feed2", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" } ${PUB2_DATA} { "dcaeLocationName": "${LOC}", "username": "pub2", "userpwd": "topSecret123", "feedId": "2" } ${SUB2_DATA} { "dcaeLocationName": "${LOC}", "username": "sub2", "userpwd": "someSecret123", "deliveryURL": "https://${DMAAPBC_IP}:8443/webapi/noURI", "feedId": "2" } -${TOPIC2_DATA} { "topicName":"singleMRtopic2", "topicDescription":"generated for CSIT", "owner":"dgl", "clients": [ ${PUB}, ${SUB}] } -${TOPIC3_DATA} { "topicName":"singleMRtopic3", "topicDescription":"generated for CSIT", "owner":"dgl"} -#${PUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${PUB_CORE} } -#${SUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${SUB_CORE} } - *** Test Cases *** -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session sanity http://onap.readthedocs.io - ${resp}= Get Request sanity / - Should Be Equal As Integers ${resp.status_code} 200 - (DMAAP-441c1) [Documentation] Create Feed w no clients POST ${DBC_URI}/feeds endpoint - ${resp}= PostCall ${DBC_URL}/feeds ${FEED1_DATA} - Should Be Equal As Integers ${resp.status_code} 200 + ${resp}= PostCall ${DBC_URL}/feeds ${FEED1_DATA} + Should Be Equal As Integers ${resp.status_code} 200 (DMAAP-441c2) [Documentation] Create Feed w clients POST ${DBC_URI}/feeds endpoint - ${resp}= PostCall ${DBC_URL}/feeds ${FEED2_DATA} - Should Be Equal As Integers ${resp.status_code} 200 + ${resp}= PostCall ${DBC_URL}/feeds ${FEED2_DATA} + Should Be Equal As Integers ${resp.status_code} 200 (DMAAP-441c3) [Documentation] Add Publisher to existing feed - ${resp}= PostCall ${DBC_URL}/dr_pubs ${PUB2_DATA} - Should Be Equal As Integers ${resp.status_code} 201 - ${tmp}= Get Json Value ${resp.text} /pubId - ${tmp}= Remove String ${tmp} \" - Set Suite Variable ${pubId} ${tmp} + ${resp}= PostCall ${DBC_URL}/dr_pubs ${PUB2_DATA} + Should Be Equal As Integers ${resp.status_code} 201 + ${JSON}= Evaluate json.loads(r"""${resp.content}""", strict=False) + ${result}= Set Variable ${JSON['pubId']} + Set Suite Variable ${pubId} ${result} (DMAAP-441c4) [Documentation] Add Subscriber to existing feed - ${resp}= PostCall ${DBC_URL}/dr_subs ${SUB2_DATA} - Should Be Equal As Integers ${resp.status_code} 201 - ${tmp}= Get Json Value ${resp.text} /subId - ${tmp}= Remove String ${tmp} \" - Set Suite Variable ${subId} ${tmp} + ${resp}= PostCall ${DBC_URL}/dr_subs ${SUB2_DATA} + Should Be Equal As Integers ${resp.status_code} 201 + ${JSON}= Evaluate json.loads(r"""${resp.content}""", strict=False) + ${result}= Set Variable ${JSON['subId']} + Set Suite Variable ${subId} ${result} (DMAAP-443) [Documentation] List existing feeds Create Session get ${DBC_URL} - ${resp}= Get Request get /feeds - Should Be Equal As Integers ${resp.status_code} 200 + ${resp}= GET On Session get /feeds + Should Be Equal As Integers ${resp.status_code} 200 (DMAAP-444) [Documentation] Delete existing subscriber - ${resp}= DelCall ${DBC_URL}/dr_subs/${subId} - Should Be Equal As Integers ${resp.status_code} 204 + ${resp}= DelCall ${DBC_URL}/dr_subs/${subId} + Should Be Equal As Integers ${resp.status_code} 204 (DMAAP-445) [Documentation] Delete existing publisher - ${resp}= DelCall ${DBC_URL}/dr_pubs/${pubId} - Should Be Equal As Integers ${resp.status_code} 204 - -#(DMAAP-294) -# [Documentation] Create Topic w pub and sub clients POST ${DBC_URI}/topics endpoint -# ${resp}= PostCall ${DBC_URL}/topics ${TOPIC2_DATA} -# Should Be Equal As Integers ${resp.status_code} 201 -# -#(DMAAP-295) -# [Documentation] Create Topic w no clients and then add a client POST ${DBC_URI}/mr_clients endpoint -# ${resp}= PostCall ${DBC_URL}/topics ${TOPIC3_DATA} -# Should Be Equal As Integers ${resp.status_code} 201 -# ${resp}= PostCall ${DBC_URL}/mr_clients ${PUB3_DATA} -# Should Be Equal As Integers ${resp.status_code} 200 -# ${resp}= PostCall ${DBC_URL}/mr_clients ${SUB3_DATA} -# Should Be Equal As Integers ${resp.status_code} 200 -# -#(DMAAP-297) -# [Documentation] Query for all topics and specific topic -# Create Session get ${DBC_URL} -# ${resp}= Get Request get /topics -# Should Be Equal As Integers ${resp.status_code} 200 -# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 -# Should Be Equal As Integers ${resp.status_code} 200 -# -#(DMAAP-301) -# [Documentation] Delete a subscriber -# Create Session get ${DBC_URL} -# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 -# Should Be Equal As Integers ${resp.status_code} 200 -# ${tmp}= Get Json Value ${resp.text} /clients/1/mrClientId -# ${clientId}= Remove String ${tmp} \" -# ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} -# Should Be Equal As Integers ${resp.status_code} 204 -# -#(DMAAP-302) -# [Documentation] Delete a publisher -# Create Session get ${DBC_URL} -# ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 -# Should Be Equal As Integers ${resp.status_code} 200 -# ${tmp}= Get Json Value ${resp.text} /clients/0/mrClientId -# ${clientId}= Remove String ${tmp} \" -# ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} -# Should Be Equal As Integers ${resp.status_code} 204 + ${resp}= DelCall ${DBC_URL}/dr_pubs/${pubId} + Should Be Equal As Integers ${resp.status_code} 204 *** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - Should Be Equal As Integers ${resp.status_code} ${expect} - PostCall [Arguments] ${url} ${data} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json diff --git a/tests/dmaap-buscontroller/with_mr/__init__.robot b/tests/dmaap-buscontroller/with_mr/__init__.robot new file mode 100644 index 00000000..ffcec41b --- /dev/null +++ b/tests/dmaap-buscontroller/with_mr/__init__.robot @@ -0,0 +1,3 @@ +*** Settings *** +Documentation dmaap-buscontroller - mr + diff --git a/tests/dmaap-buscontroller/single-mr-suite/test1.robot b/tests/dmaap-buscontroller/with_mr/test1.robot similarity index 74% rename from tests/dmaap-buscontroller/single-mr-suite/test1.robot rename to tests/dmaap-buscontroller/with_mr/test1.robot index d68b9ed1..37d3e158 100644 --- a/tests/dmaap-buscontroller/single-mr-suite/test1.robot +++ b/tests/dmaap-buscontroller/with_mr/test1.robot @@ -9,9 +9,8 @@ Library String *** Variables *** -${MESSAGE} Hello, world! -${DBC_URI} webapi -${DBC_URL} http://${DMAAPBC_IP}:8080/${DBC_URI} +${DBC_URI} webapi +${DBC_URL} http://${DMAAP_BC_IP}:8080/${DBC_URI} ${TOPIC_NS} org.onap.dmaap.onapCSIT ${LOC} csit-sanfrancisco ${PUB_CORE} "dcaeLocationName": "${LOC}", "clientRole": "org.onap.dmaap.client.pub", "action": [ "pub", "view" ] @@ -25,14 +24,7 @@ ${PUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${PUB_CORE} } ${SUB3_DATA} { "fqtn": "${TOPIC_NS}.singleMRtopic3", ${SUB_CORE} } - *** Test Cases *** -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session sanity http://onap.readthedocs.io - ${resp}= Get Request sanity / - Should Be Equal As Integers ${resp.status_code} 200 - (DMAAP-293) [Documentation] Create Topic w no clients POST ${DBC_URI}/topics endpoint ${resp}= PostCall ${DBC_URL}/topics ${TOPIC1_DATA} @@ -55,42 +47,33 @@ Url Test (DMAAP-297) [Documentation] Query for all topics and specific topic Create Session get ${DBC_URL} - ${resp}= Get Request get /topics + ${resp}= GET On Session get /topics Should Be Equal As Integers ${resp.status_code} 200 - ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 + ${resp}= GET On Session get /topics/${TOPIC_NS}.singleMRtopic3 Should Be Equal As Integers ${resp.status_code} 200 (DMAAP-301) [Documentation] Delete a subscriber Create Session get ${DBC_URL} - ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 + ${resp}= GET On Session get /topics/${TOPIC_NS}.singleMRtopic3 Should Be Equal As Integers ${resp.status_code} 200 - ${tmp}= Get Json Value ${resp.text} /clients/1/mrClientId - ${clientId}= Remove String ${tmp} \" + ${JSON}= Evaluate json.loads(r"""${resp.content}""", strict=False) + ${clientId}= Set Variable ${JSON['clients'][1]['mrClientId']} ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} Should Be Equal As Integers ${resp.status_code} 204 (DMAAP-302) [Documentation] Delete a publisher Create Session get ${DBC_URL} - ${resp}= Get Request get /topics/${TOPIC_NS}.singleMRtopic3 + ${resp}= GET On Session get /topics/${TOPIC_NS}.singleMRtopic3 Should Be Equal As Integers ${resp.status_code} 200 - ${tmp}= Get Json Value ${resp.text} /clients/0/mrClientId - ${clientId}= Remove String ${tmp} \" + ${JSON}= Evaluate json.loads(r"""${resp.content}""", strict=False) + ${clientId}= Set Variable ${JSON['clients'][0]['mrClientId']} ${resp}= DelCall ${DBC_URL}/mr_clients/${clientId} Should Be Equal As Integers ${resp.status_code} 204 *** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} ${expect} - ${resp}= Get Request ${session} ${path} - Should Be Equal As Integers ${resp.status_code} ${expect} - PostCall [Arguments] ${url} ${data} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json diff --git a/tests/integration/nfsimulator/netconf-server/__init__.robot b/tests/integration/nfsimulator/netconf-server/__init__.robot new file mode 100644 index 00000000..aa8babbc --- /dev/null +++ b/tests/integration/nfsimulator/netconf-server/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Integration - Netconf Server diff --git a/tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml b/tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml new file mode 100644 index 00000000..ff4879e5 --- /dev/null +++ b/tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml @@ -0,0 +1,4 @@ + + 42 + 35 + diff --git a/tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot b/tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot new file mode 100644 index 00000000..fea34b43 --- /dev/null +++ b/tests/integration/nfsimulator/netconf-server/netconf-server-rest-test.robot @@ -0,0 +1,26 @@ +*** Settings *** +Documentation Run healthcheck +Library RequestsLibrary +Resource ./resources/netconf-server-keywords.robot + + +*** Test Cases *** + +Netconf Server Healthy Check + [Tags] Netconf-Server + [Documentation] Server Should be healthy + Verify That Server Is Healthy + +Netconf Server Readiness Check + [Tags] Netconf-Server + [Documentation] Server Should be ready + Verify That Server Is Ready + +Netconf Module Configuration Update + [Tags] Netconf-Server + [Documentation] Update Should Be Distributed + Update NetConf Module Configuration pnf-simulator ${PNF_SIMULATOR_DATA_XML} 202 + Sleep 20s Wait for message distribution in Kafka + Verify That Change Is Available In NetConf Module Change Configuration History 200 + + diff --git a/tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot b/tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot new file mode 100644 index 00000000..9dccd048 --- /dev/null +++ b/tests/integration/nfsimulator/netconf-server/resources/netconf-server-keywords.robot @@ -0,0 +1,39 @@ +*** Settings *** +Library RequestsLibrary +Resource ../../../../common.robot +Resource ./netconf-server-properties.robot + +*** Keywords *** + +Verify That Server Is Healthy + [Documentation] Verify that server is healthy + Create Session netconf_server_session ${NETCONF_SERVER_URL} + ${resp}= GET On Session netconf_server_session /healthcheck + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.text} UP + +Verify That Server Is Ready + [Documentation] Verify that server is ready + Create Session netconf_server_session ${NETCONF_SERVER_URL} + ${resp}= GET On Session netconf_server_session /readiness + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.text} Ready + +Update NetConf Module Configuration + [Documentation] Update module configuration + [Arguments] ${module} ${path_to_data} ${resp_code} + ${data}= Get Data From File ${path_to_data} + + Create Session netconf_server_session ${NETCONF_SERVER_URL} + ${resp}= POST On Session netconf_server_session /change_config/${module} data=${data} + Should Be Equal As Strings ${resp.status_code} ${resp_code} + +Verify That Change Is Available In NetConf Module Change Configuration History + [Documentation] Verify that configuration was distributed to Kafka + [Arguments] ${resp_code} + + Create Session netconf_server_session ${NETCONF_SERVER_URL} + ${resp}= GET On Session netconf_server_session /change_history + Should Be Equal As Strings ${resp.status_code} ${resp_code} + ${actual_data}= Convert To String ${resp.json()} + Should Be Equal ${actual_data} [{u'new': {u'path': u'/pnf-simulator:config/itemValue1', u'value': 42}, u'type': u'ChangeCreated'}, {u'new': {u'path': u'/pnf-simulator:config/itemValue2', u'value': 35}, u'type': u'ChangeCreated'}] diff --git a/tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot b/tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot new file mode 100644 index 00000000..c10fe24c --- /dev/null +++ b/tests/integration/nfsimulator/netconf-server/resources/netconf-server-properties.robot @@ -0,0 +1,4 @@ +*** Variables *** + +${NETCONF_SERVER_URL} http://%{NETCONF_SERVER_IP}:%{NETCONF_SERVER_REST_PORT} +${PNF_SIMULATOR_DATA_XML} %{WORKSPACE}/tests/integration/nfsimulator/netconf-server/assets/pnf-simulator-data.xml 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 d1da7f38..00000000 --- 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 96811ee9..00000000 --- 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 de26e5f6..00000000 --- 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/oom-platform-cert-service/certservice/assets/invalid_client_docker.env b/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker.env index 4f19a9e7..9761d1ef 100644 --- a/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker.env +++ b/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker.env @@ -13,4 +13,4 @@ ORGANIZATION_UNIT=ONAP LOCATION=San-Francisco STATE=California COUNTRY=US -SANS=example.com:sample.com \ No newline at end of file +SANS=example.com,sample.com diff --git a/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker_output_type.env b/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker_output_type.env index 4cdcd9ed..71604d7a 100644 --- a/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker_output_type.env +++ b/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker_output_type.env @@ -14,4 +14,4 @@ ORGANIZATION_UNIT=ONAP LOCATION=San-Francisco STATE=California COUNTRY=US -SANS=example.com:sample.com +SANS=example.com,sample.com diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker.env index 6fad6d21..93f67a36 100644 --- a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker.env +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker.env @@ -13,4 +13,4 @@ ORGANIZATION_UNIT=ONAP LOCATION=San-Francisco STATE=California COUNTRY=US -SANS=example.com:sample.com \ No newline at end of file +SANS=example.com,sample.com diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_all_sans_types.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_all_sans_types.env new file mode 100644 index 00000000..f78817ca --- /dev/null +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_all_sans_types.env @@ -0,0 +1,16 @@ +#Client envs +REQUEST_TIMEOUT=30000 +OUTPUT_PATH=/var/certs +CA_NAME=RA +KEYSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PASSWORD=secret +TRUSTSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/truststore.jks +TRUSTSTORE_PASSWORD=secret +#Csr config envs +COMMON_NAME=onap.org +ORGANIZATION=Linux-Foundation +ORGANIZATION_UNIT=ONAP +LOCATION=San-Francisco +STATE=California +COUNTRY=US +SANS=example.com,sample.com,onap@onap.org,127.0.0.1,onap://cluster.local/ diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_jks.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_jks.env index 0e2d8367..c68cfffc 100644 --- a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_jks.env +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_jks.env @@ -14,4 +14,4 @@ ORGANIZATION_UNIT=ONAP LOCATION=San-Francisco STATE=California COUNTRY=US -SANS=example.com:sample.com +SANS=example.com,sample.com diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_p12.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_p12.env index c3ed729f..a9eadb46 100644 --- a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_p12.env +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_p12.env @@ -14,4 +14,4 @@ ORGANIZATION_UNIT=ONAP LOCATION=San-Francisco STATE=California COUNTRY=US -SANS=example.com:sample.com +SANS=example.com,sample.com diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_pem.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_pem.env index aca2a54b..d81cd555 100644 --- a/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_pem.env +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_pem.env @@ -14,4 +14,4 @@ ORGANIZATION_UNIT=ONAP LOCATION=San-Francisco STATE=California COUNTRY=US -SANS=example.com:sample.com +SANS=example.com,sample.com diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_ra.csr b/tests/oom-platform-cert-service/certservice/assets/valid_ra.csr index 5decd8ee..0918f029 100644 --- a/tests/oom-platform-cert-service/certservice/assets/valid_ra.csr +++ b/tests/oom-platform-cert-service/certservice/assets/valid_ra.csr @@ -1 +1 @@ -LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0KTUlJRERqQ0NBZllDQVFBd2daWXhDekFKQmdOVkJBWVRBbFZUTVJNd0VRWURWUVFJREFwRFlXeHBabTl5Ym1saApNUll3RkFZRFZRUUhEQTFUWVc0dFJuSmhibU5wYzJOdk1Sa3dGd1lEVlFRS0RCQk1hVzUxZUMxR2IzVnVaR0YwCmFXOXVNUTB3Q3dZRFZRUUxEQVJQVGtGUU1RNHdEQVlEVlFRRERBVkRiREV5TXpFZ01CNEdDU3FHU0liM0RRRUoKQVJZUlEyOXRiVzl1VG1GdFpVQmpiaTVqYjIwd2dnRWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUJEd0F3Z2dFSwpBb0lCQVFDL2VCWEprWi80UFdQV2F4Qy9veW9ybmNjdzNiVlM2QmRJbzJUaGh0SzU4OG9wczg4RG8zZkN3Tkk0Cm1aV0xhYUEzbi9lVzJ6SG1TVENzeE4yd1BCREJhWWNwNmxCN1B5bmJDd1ZmcU55ZWhNNWFXQjY4TXFWKzVEcTQKc1BhT0haandNYnlSMTA3dHh3dGtub3lZeHh3SzVCY21vUkNkTjhxYndpY2Q0ajd4bDVDeVBiV1hyYUc0bFY3SgpRU1hlYmRJVUkvaVVNY3dKVThFdEgxZnNUS01CVTNMTE5pSlJsMzBJSGZQSEhZVndWVGhOUC82cFo5WktOeHR5Cm5oK2ZJaUZpNm9mU2h1dXRFZ25xRXdxS2UyenRUV20xYTNGNVlIUk5Pb1FMODA0OXhhQWNhanVTaEZnejZOZzYKOWRha1hhdkd5ejlrOUJHMDh3TU9BejFNQlBoL0FnTUJBQUdnTWpBd0Jna3Foa2lHOXcwQkNRNHhJekFoTUI4RwpBMVVkRVFRWU1CYUNCVU5zTVRJemdnMTBaWE4wTG05dVlYQXViM0puTUEwR0NTcUdTSWIzRFFFQkN3VUFBNElCCkFRQ1kwaUxKQWpWS3FSc0dBdTJOVzBHaGdPbTAvdkF0RmNNTWJOTTRBUGFNS2hiWTd6SGdob2U5VHMxTlBaUXkKSnZFRHJzOFhsSWIxeFN4NXJ1dktlY0JzamVLbEIzaU13V0dDeGViQ0lCMEsvbTV0YWI4cGtYQU0wVmJ3QTVIOAprWGRJS0xwK2grTVRLRnBNczY0OHk3eFRtcGFmb05CWld2d1ArODRsR295RDROZWJiRTN1anY1R21Id1JuK0xQCkRRNmJjSWxoWGNSN0JEMnZYNFdqdmY1YmVwL00yeVd4SkJPaTRzYjQ1NWdtTVpvYUJGSjF2OWpybUd6aDk2THEKck9NTEhCK1VOS0o1Tm1aQXZZVkNaNFVvVFpXZ3VQZVlMaXR6U2F0L0l3RGdJb3NSYXQrUGdJSkJWbXgzY212LwpJU0tncmRxckpKVFlmWGZrRnE5RG5vWHAKLS0tLS1FTkQgQ0VSVElGSUNBVEUgUkVRVUVTVC0tLS0t \ No newline at end of file +LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0KTUlJREVUQ0NBZmtDQVFBd2dZSXhDekFKQmdOVkJBWVRBbFZUTVJNd0VRWURWUVFJRXdwRFlXeHBabTl5Ym1saApNUll3RkFZRFZRUUhFdzFUWVc0dFJuSmhibU5wYzJOdk1Sa3dGd1lEVlFRS0V4Qk1hVzUxZUMxR2IzVnVaR0YwCmFXOXVNUTB3Q3dZRFZRUUxFd1JQVGtGUU1Sd3dHZ1lEVlFRREV4TmpaWEowYVhOemRXVnlMbTl1WVhBdWIzSm4KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF6VExIQzFnd0tsR01aVXFYY1F4MgppQnVldk9SRDVzWE1lZmZLWVdLZ2tYUEFDVWVxSzhuRWVZTW1zQjRVY0RaTU5ld2R2UTA1VUQ0b1pMMnl4aFBGCmwzRWRRblBPd1hxLzIzMEZIajd0ZnRPUFJhYVF5dHNxdU1haHdPZkhKWm5VdWg5bnpGaTRkT3BoOXgweENZV3EKaFgyRFRUcXlnR29sbUtZUGpqdHE3RlJmeHB0VkxzMnQ5T1crcDhoWEtpM2c1MXNJUVR4REFuaHdFcE1vRVd1dAowQkk0NUhSbVcvSTIzellFMUQxNEl1aCtwcjczbzlnS0RKWEx3SHFQKzMzdjdaSjJyUEdvZlJsZ2hHWDgwK1NBCm14eVJiQ21DK29FczVDQ3kyMzJuY1ZKVWx6MDA5eFNUSGtLZFV0T0ZWRWJ0UUhkeE9FR1JnQ0pEYnNCYlNlemQKb3dJREFRQUJvRWt3UndZSktvWklodmNOQVFrT01Ub3dPREFwQmdOVkhSRUVJakFnZ2dsc2IyTmhiR2h2YzNTQwpFMk5sY25ScGMzTjFaWEl1YjI1aGNDNXZjbWN3Q3dZRFZSMFBCQVFEQWdXZ01BMEdDU3FHU0liM0RRRUJDd1VBCkE0SUJBUUJjeVVpbTBZVEViTTF3UVExMHV6SDducmxRZDNNZGJMc2trYVNOOEJCTzlDRExOSlVhNHh0OW5SSkUKd0gvR2xZay91M3hpcEdzZVlRNHpVUGdYdUFBMk5LZWEwajQ0WWNXTkluVXMrTVZic2tiV3pTVHJXSisrSG1mUAo1YWRrcTJWYWo2czNidmxYcHVleUhVRjV5TGVpZE5xWEpGY0M3WGVLQTRKTEZRcnRWRURhUEVHSGJ4UXNDdFBHCk9UUzdITmpPQjNaazJBQlMwdnA1TTh2UEFmUVNZR2V1cjZjbyt0Q0lCcXNiWFIzckUxZUJUVTBzeVBycG4yTGUKSkJmTkd1cnRnZW1CN1VDZWQwMU95dUNkUnJFKytQelo1WGIxaTJ0RnN0YTh5K0lObjZaY2FxTnZVZmU4SlYvawpMVVk5VkdZOXFMQWo4MDVRY2pVM0lQTTYxdWhkCi0tLS0tRU5EIENFUlRJRklDQVRFIFJFUVVFU1QtLS0tLQo= \ No newline at end of file diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_ra.pk b/tests/oom-platform-cert-service/certservice/assets/valid_ra.pk index b1ad633a..27c70cab 100644 --- a/tests/oom-platform-cert-service/certservice/assets/valid_ra.pk +++ b/tests/oom-platform-cert-service/certservice/assets/valid_ra.pk @@ -1 +1 @@ -LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktnd2dnU2tBZ0VBQW9JQkFRQy9lQlhKa1ovNFBXUFcKYXhDL295b3JuY2N3M2JWUzZCZElvMlRoaHRLNTg4b3BzODhEbzNmQ3dOSTRtWldMYWFBM24vZVcyekhtU1RDcwp4TjJ3UEJEQmFZY3A2bEI3UHluYkN3VmZxTnllaE01YVdCNjhNcVYrNURxNHNQYU9IWmp3TWJ5UjEwN3R4d3RrCm5veVl4eHdLNUJjbW9SQ2ROOHFid2ljZDRqN3hsNUN5UGJXWHJhRzRsVjdKUVNYZWJkSVVJL2lVTWN3SlU4RXQKSDFmc1RLTUJVM0xMTmlKUmwzMElIZlBISFlWd1ZUaE5QLzZwWjlaS054dHluaCtmSWlGaTZvZlNodXV0RWducQpFd3FLZTJ6dFRXbTFhM0Y1WUhSTk9vUUw4MDQ5eGFBY2FqdVNoRmd6Nk5nNjlkYWtYYXZHeXo5azlCRzA4d01PCkF6MU1CUGgvQWdNQkFBRUNnZ0VCQUxOUFE2QXN0OUpqczU3M1Q0MFl3Z0pzMVVGbk1FdC9QV2J5VmlSNi9kZlYKZnN0Rk1DYXBMUnYvTmlCNWZMbzk1aVNScyszY1EwUDE0UmE3bXgxVGN5R2VzVTFJdWF4aVA5RjU1Y05yUVlsVwp1R1dWUnR0YTF2QVp6d0J1QWNpZjRUMTRacTl5SXVHOVdXY1dzSGJYYU9TdUxSd3BGSVVYM2ErMnlLbE0yME9sCjI2T0o2MDk2RjBtZWIvR1RMUTdLVms4MnBiOW5xSHE4OUtTY1VVZjA0b3FtV2kxdkRHMDVUUkNncHdGc1dtUHYKYVQyamNkN2x1TTdSWFFZN3Y3Ylp0Qjk1MzdMVDBHZHMyWnRSazBDK0JZVWxlYVR4VXNCcTJvM3FvRWN2T3NINQp3SUVEMElZc3h0anFuaSttaGRwVzdrSHViWFpoeVRKczYxQnBoTHkxZHFrQ2dZRUE5Vzc4bm0vZ0wxNmdCK3BJClJucTRvMVowR21xYlJpQXlCWm1QN25WK0RJRzBvZkdSSlR4bFBHT3JDd3QySUFjSVpxT3d0ZDVXdjd1KzdpdHAKVjdXNG1WQlh1NDZabTIzZ2RSMkpwNUpRWnRCaElxa3B3ZVBTN1doYjZ2YjFGT0tiWXFLZXoyYWdNSzFnZHZxawpLcmVYMmd4bXhjTmN4cDFoM1hHYWlhNDdTU3NDZ1lFQXg3WldFREpMbC9lbnp5UE1jOEF4QWszZFhLaVhhNXhBCnRzSzM5YUMrQ1BOaGV4YnBtNHlmc0JzL0hrdzJzdEk1Y3FEVnlrZGU2L05yM21Femg2RDJoK05tQmxwZ3RyaU8KK3R4RDJqRzRMME9mVEFXeEFsTzBwY2syNm1UUkt4VHlhWlBhcklidW42dXFlVThVNmQyeDkzS2ZQV1N0LzQ2ZQpFTnF6V2M3U2UvMENnWUIwd0w5YmYwemVPOTFVNXBaTE1NWDByWU85clVrQUt3Q2d1VlJHMDQySzFZamdJTkl6CkxHL2NNbTJEYTRoZDQvcVRHUHRQQ04ycmg5eGo0RExVanBXcUdSWWpHc3JuclhWQlFUUGlpeS9FT1F4OE9JeXMKdDN2M2c5VjJDTlM5Z3E3NFZQUEhKY0srWlR1bVhjVUtyUnVIbHE2dEZTcGxNU2tFOXEzVklSVUMwUUtCZ1FDNQpHQ0VEdWRtZDZ3WTRVUEY0aGpQbDhzeXF5QVl1MGc2WVZEZXpDMXVWYUJ4OHZHdWVvdUtOa1hNYVhZQ0VrNXB5Cnh1WGVKKyt0dDFuT0xVQlkvN0g5bDZCRFd4Z3Z3VFdqQXVwUUc2eWRBWXR1SmdnOEkrQlZsdnV5bWVYU2pBTncKSG55WlVpVnZEdWRjcnhLdS9hMm5yVEF3OGxMaGZBaTdqamFUa2NBNjhRS0JnRmRMREQycVc4RStHb3FhU1hFYgphT0w0ZHhNY1MyQnc0Ni92T1ZDREw4WGExbis4WVA0MHdDbXg2eEc4ZDdFUjdUTjFSUWovNElKRjByajl4bFhiCnFJejVkSGNBM3JKTVpKTHc4MmJURDR0S1VZNVZtOFVGQnE4NHhzaG4yblJqdTZkaTMrTkk1ajFMMVExcjBiU28KVnZCZE1zS0F1RXdiRS85aDlsbjFCRkNsCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0= \ No newline at end of file +LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBelRMSEMxZ3dLbEdNWlVxWGNReDJpQnVldk9SRDVzWE1lZmZLWVdLZ2tYUEFDVWVxCks4bkVlWU1tc0I0VWNEWk1OZXdkdlEwNVVENG9aTDJ5eGhQRmwzRWRRblBPd1hxLzIzMEZIajd0ZnRPUFJhYVEKeXRzcXVNYWh3T2ZISlpuVXVoOW56Rmk0ZE9waDl4MHhDWVdxaFgyRFRUcXlnR29sbUtZUGpqdHE3RlJmeHB0VgpMczJ0OU9XK3A4aFhLaTNnNTFzSVFUeERBbmh3RXBNb0VXdXQwQkk0NUhSbVcvSTIzellFMUQxNEl1aCtwcjczCm85Z0tESlhMd0hxUCszM3Y3WkoyclBHb2ZSbGdoR1g4MCtTQW14eVJiQ21DK29FczVDQ3kyMzJuY1ZKVWx6MDAKOXhTVEhrS2RVdE9GVkVidFFIZHhPRUdSZ0NKRGJzQmJTZXpkb3dJREFRQUJBb0lCQVFDOWZ3a0YxdmtUKzU4MQo0MzZiYmJFQTNORHBDN3dSSDlWSFJhZmw2MWp4T2YyOEZDeDRwNm9EdFRSRExHUWZoR1U0M3NaUDBpaDlqQWx0Cmp5bkxkbkxnK2hyVlJYRkloLzBweXZpeEI5ZjNhWlJEOUNCKzFZdE1mRkxnZktzU2RFOVpXcXRXc1JBWEdHUkQKK3ZkUUhkcHQwSTB6QXVQWlp5MDFIUlg4ZWE2eWMwaVhCQks0aHljVmhhNk8zdUtTdTNpMjd3eDgra0J6TVNabgpOL3pvV2pJZGNLTGlOdmtKbWp6dm5udWtjRUV0RGxkL1MrRjdYOHI2bmk3OGxuU0g0dXZuQ1FCM2tQTXFBU0NECiswSm5BVmZZT1R4dERLNWdMeUNzRUdMckd5NnQyRndPNmdKWSt6dSs3ZzBDWEtkY2hnc3doeUtJNFNtSkFwcXAKSUxKUm1oNWhBb0dCQVBSWllobkdhSGlOY1dqWDFKSE1udXI0YnBsVmFXdzF2WU8xektzZVEwNjlzN2MwUWp2SwpibUR4UHBBMWhLb2F1MWF3Smt4eFQrZzlmL08ybG1NSzJncEhwaWx4QXZCL2xYci81czU5UVdtei96ZThFU3hMCjQ3dGVIaHRSUW10K2dLNGVDNlF4UmRqNTBLSENqVDQ4OVFod280bzNXaE0xR1E4VXJKYTZkbVliQW9HQkFOYjcKZ1VqajIzT3k0TkJrT25SU3BTdDVKZTJXc3RqRjhFNVE2KzRxUGlsalNJa0pRcm1qRW00L1p3aTZxQWZoN0d0OQppa3JZRzlabjFGRUVuV05pcWE4MXZqKy9OR1BXV0cyaFJ4dTNxYTg0M1cwRVpFSTVDUWZkWlFyTUtvYndrSE9YCldBU2tOemY2N3ljMG9iUUZxSkxNL2d0VVhvbDFqL3lDb3NwWWVQOFpBb0dCQUxEeGNTcTlGTFlIcHhLSENMV3oKK1hpcUFsMGpEcjUvaEFjMnhVazlGdnlVUHVueCsreVVRSzRPeElGbFgvWldlVWJqTkRpeTdXeDk3SVF0dW1WcQpYRTZKWi9nbWtEeGNCNEVVZ3EwUTR5ZUtZc3lYY2RBai9IdVlRakVCL1JrZWVFeWVFVXdMS2t0ZlRBZDNmUlNPCnk5b2F4eksxdHBLbUpzbFc3VXdSSnQvMUFvR0FYMm9xM0UzOUZXRzc4K0c0Sys2T1RqZ3J4RUpSU0hLNWtCak0KVGQxRHo1eTRFZEloWWtEbEtqZExwSTByakt3U0FUY3J6TUlUd05vK1dtTUE4NTVUajJiNzlGRUprSklPbDBHdwpUTFg4UXIrclR2cFhBU2xOUDhkY1ZDbC9hbnFVc2lqbXNOQ3RqVlA3RnR4K05HY2FoV1VrRDZVM2ZDeklaaHNZCjQxUFhCK2tDZ1lCblNaNTJtL0ZvRW5wRXlSRWRIUEpmZ1g4SDBUT3hRUkVVMm9wbXhSay9CQUVRWllleE5ERmYKRFNYalRJeVJUK2NwclJrNzZEbjhEUVQyVDBLSlhvRThnTkkwa2pLMXNrNzlTc0djZHY3YThsQW9DNmhDRG4zSAovK2xYczROdTYxSFV2UjJNSllwbVVTRkxpdGVrN2ZuVjhYOHROOXJRQXZIOUJHNmlpTFNSWXc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= \ No newline at end of file diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_ra_all_sans.csr b/tests/oom-platform-cert-service/certservice/assets/valid_ra_all_sans.csr new file mode 100644 index 00000000..9255ce19 --- /dev/null +++ b/tests/oom-platform-cert-service/certservice/assets/valid_ra_all_sans.csr @@ -0,0 +1 @@ +LS0tLS1CRUdJTiBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0KTUlJRE5UQ0NBaDBDQVFBd2R6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2tOaGJHbG1iM0p1YVdFeApGakFVQmdOVkJBY1REVk5oYmkxR2NtRnVZMmx6WTI4eEdUQVhCZ05WQkFvVEVFeHBiblY0TFVadmRXNWtZWFJwCmIyNHhEVEFMQmdOVkJBc1RCRTlPUVZBeEVUQVBCZ05WQkFNVENHOXVZWEF1YjNKbk1JSUJJakFOQmdrcWhraUcKOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXhSWVZGT29zeUFCTXEreUFOejlwaG1ZeWZtSGJ3OUY5cjNDYQp2MW9aMnh3MUxiRjJIR0JxOEY0NW5YZk1qWDJIK0x4azhtL1htSURiKzlseklOVTZKNnhtRHJLWmlpaWY1T1JhCm9SRU5mUVpOV2tBV1BndVd5S0d0SGs2dWVlU2pTOEQwU1d3bG9jMWcwaEIzR1JFZmZvY3VKMjRLK3QyblhnbGYKN1hWZ21IeGppRThrK3BEM1NVbzVyQTdGeDFUbUxndUVBOGFDUkdhWWcvYW9mQ05lOWhEbTM0aXFVem01dFBQUQpPZ1IzTHBxeDJKVzBpSlliUVhtWDNjRy9SRTBxRmwrcmdyTmhDZDhwdFg3SVVpV3RRbXR0c3NSM2JFOEpWZ2FmCng5RVU5R1o1ZFpYaWZTRkp6czQyVVk3WDZEUGlRREZlcmZXUk5jM2RSVFlCbGtiVGl3SURBUUFCb0hrd2R3WUoKS29aSWh2Y05BUWtPTVdvd2FEQlpCZ05WSFJFRVVqQlFnZ2xzYjJOaGJHaHZjM1NDQ0c5dVlYQXViM0puZ2cxMApaWE4wTG05dVlYQXViM0puZ1ExdmJtRndRRzl1WVhBdWIzSm5od1IvQUFBQmhoVnZibUZ3T2k4dlkyeDFjM1JsCmNpNXNiMk5oYkM4d0N3WURWUjBQQkFRREFnV2dNQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUJBUUFrOWxSd2JXeUwKVlJXU001Y0JpUksybkNLaGZ1cjIwa2hIRlFnWWNQQUQ4QlJYRWs1L0YwS0JTQk1OR01yQmdPWXFxM0lZc29NYwptdnM5S0tWcUlWMytsQmVqMlFURjNjeGRIWVBUckN2dmtvaGVNWXQ1cXFqa3JRUmJpeWR6ajcvd3ZmbG1CWHMxCjdUVmlVK1Rxb0o4cTVEV1RFdnYwWDV0L1dGNnNTSXhGSEhLRDdvdERYUFc1Q0FlcVhPNUE5OWJUclNpWG1WQUgKNzIvbi9KRkh1ZVVSditOYnBIeUJOWHdlZXpObkI1QkRycnFkdWFia2huMzFUaEEwd3plUEROUjAyYVh3eHhIbgo3N3NTYTNpdUFOM0lhVldZZnhDT1g0ZkV3OEYrd01BQU1UaVdJdE04TGM5RFQ1cnNZZVJIQVptT01WRW5vd2MyCjNlS0xGZVdESWkyWgotLS0tLUVORCBDRVJUSUZJQ0FURSBSRVFVRVNULS0tLS0K \ No newline at end of file diff --git a/tests/oom-platform-cert-service/certservice/assets/valid_ra_all_sans.pk b/tests/oom-platform-cert-service/certservice/assets/valid_ra_all_sans.pk new file mode 100644 index 00000000..855c92ce --- /dev/null +++ b/tests/oom-platform-cert-service/certservice/assets/valid_ra_all_sans.pk @@ -0,0 +1 @@ +LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2Z0lCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktnd2dnU2tBZ0VBQW9JQkFRREZGaFVVNml6SUFFeXIKN0lBM1AybUdaakorWWR2RDBYMnZjSnEvV2huYkhEVXRzWFljWUdyd1hqbWRkOHlOZllmNHZHVHliOWVZZ052NwoyWE1nMVRvbnJHWU9zcG1LS0ovazVGcWhFUTE5QmsxYVFCWStDNWJJb2EwZVRxNTU1S05Md1BSSmJDV2h6V0RTCkVIY1pFUjkraHk0bmJncjYzYWRlQ1YvdGRXQ1lmR09JVHlUNmtQZEpTam1zRHNYSFZPWXVDNFFEeG9KRVpwaUQKOXFoOEkxNzJFT2JmaUtwVE9ibTA4OUE2QkhjdW1ySFlsYlNJbGh0QmVaZmR3YjlFVFNvV1g2dUNzMkVKM3ltMQpmc2hTSmExQ2EyMnl4SGRzVHdsV0JwL0gwUlQwWm5sMWxlSjlJVW5PempaUmp0Zm9NK0pBTVY2dDlaRTF6ZDFGCk5nR1dSdE9MQWdNQkFBRUNnZ0VBQkc3RXRwMjF1Q0habDV4UUhlMzlMNXFvMUJMYllJSWJzNUJ5eW83Nk9lVmUKaE5LUzkzeHJxMUJUTjJsMFhsSk9kcGUySllYQ2NabWtXUHZCRFNIK2x0blh5Y2pXanpidXNiVTVISnBIbFdKSQo1eGk5NTFOWFp0Zk1Ednh5RENmS1RHL2dqcTR5QW51ZUM5dDI4a2RpVC9RMlk0aWtFcFJkcVUzSXJJeVJTWnlvCmR1QldmcjNBRFU1eHhuV2NUdDYxdnBBUXNZaDRYaXdvc3lCaFhUd3NNbldnUmtPcjZlNFZ1Mkord0w2dlVpZDcKN1ZPcjhQdE91NzNDallBN3pJeTBYU09yUnE1UTNIN2VHZ3lsbjBBUXRhTzBxTzJDT0pIYTZjdjN5SWdlc1NVTAo4bHRpV0FHaVpaNnFaNzJCM3REbkttb0VrdXZFMS9LcGVpdGV3R2NLa1FLQmdRRHhxSFI5SUpCT0JSampteUtpCnJhNTRtSmpLd0hRNWR4SlFwVkZMRUlSTDJIM3VqalJOSDNnZ0xBT2lIMDJUcVpHUzNmblRzVHNBcG5rcHk1Si8KcXR5c2pWMFNGeFAwZ3ByUVExd002NE5XVGFlREF0OWxYSUk5MThZckFMQUFSODZpa3JUeE95b1Mxa3FPU0VtWApRWnUzVnJna0F2cytWNWNrdkVYalpXeE8xd0tCZ1FEUXlIRXJUN2FKZVVCdWtqNnNrYWhuemhtVk5UbWpzbjNQCnp5eS9jT21Cejh3bjdKc3hnVGRwV0VUcEhPVnNPMEc1d2c5VHM3VjNLcmg2QW1yRWYvNi9ObFdMZHlnRGZJdk0KOUp4YzhEMmRMRVVVbTE4ancxNXRFc1F0SXRqM1J0MGU1R0ppUU8xck5CTWIrMlE4RkRsWDF0dTB4Z01NWjRFbgppempuQUVLT2JRS0JnSG5XWnJUWGdDbjE0L0NOUE04c0pmVGphdFYrWnBxNmI5OTlHaGx3Z0dNRkNha0d4VlBFCjgvbTBkemg3ODg3cEJWNDQwRVpzNnNTUEtqTnFVYmhRV3VZY2Q3b3hMSHh3aE1GUDFNOG14cGJ5bSt3dnZKWU0KS0JZcC9kMmNnU0FERkNsZk1oOFZwMGJNQjlib2wwSE5jRWJsVC8zSUN3Z0pmVWltSzg1VVNtRU5Bb0dCQU1ubApPMExGMTkvQzZDTEV1MlRIaWhHdnhSOTdrOXlQeTRmOGNPcEQ5eHEzNWxXcFFUNHpGWEdDa1VqWHo2ZkUrYjczClFUa1E3R2RyWVc5akRQb3VTQnVDSUdFNGZmSTVLenVzUTlTLzRPVXZuVEhiT2Jwc3Y5QThPSWJwVHVSNG0zVzMKSnNpYXZyeFBaRGRIOTlyOU42S1F2RzlvbUNRVHAxcWxFQWFhUXNKVkFvR0JBTzRjY2dtemJrdTYyT0tMSUFxeQpKTjRaOGk5UGFDRVBncWZzMFRITUlLdWoxbDhGTzcyM3pUWk13c0JXZ1o0R2QzMkViWVc5dGJ3dkxibEdkZDZICnhBWExmTGpSV2VmS202aTJpSWRrZU5NSm1UVENZakhGeW9UZTg0TWlxOWQzY0VuVzdzMDU1UG0xdXhSUFhZaysKR0ZScEhsdGcycVgydTZNOHJ5c2tBTWFoCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K \ No newline at end of file diff --git a/tests/oom-platform-cert-service/certservice/cert-service-test.robot b/tests/oom-platform-cert-service/certservice/cert-service-test.robot index 58e8a7e3..3cc2fce8 100644 --- a/tests/oom-platform-cert-service/certservice/cert-service-test.robot +++ b/tests/oom-platform-cert-service/certservice/cert-service-test.robot @@ -28,6 +28,11 @@ Generate Certificate In RA Mode For CA Name [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}${RA_CA_NAME} endpoint and expect 200 Send Get Request with Header And Expect Success ${CERT_SERVICE_ENDPOINT}${RA_CA_NAME} ${VALID_RA_CSR_FILE} ${VALID_RA_PK_FILE} +Generate Certificate with all Sans types In RA Mode For CA Name + [Tags] OOM-CERT-SERVICE + [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}${RA_CA_NAME} endpoint and expect 200 + Send Get Request with Header And Expect Success ${CERT_SERVICE_ENDPOINT}${RA_CA_NAME} ${VALID_RA_ALL_SANS_CSR_FILE} ${VALID_RA_ALL_SANS_PK_FILE} + Report Not Found Error When Path To Service Is Not Valid [Tags] OOM-CERT-SERVICE [Documentation] Send request to ${CERT_SERVICE_ENDPOINT} endpoint and expect 404 @@ -63,6 +68,11 @@ Cert Service Client successfully creates keystore and truststore with expected d [Documentation] Run with correct env and PKCS12 files created with correct data Run Cert Service Client And Validate PKCS12 Files Contain Expected Data ${VALID_ENV_FILE} 0 +Cert Service Client successfully creates keystore and truststore with all SANs types provided + [Tags] OOM-CERT-SERVICE + [Documentation] Run with correct env and expected exit code 0 + Run Cert Service Client And Validate PKCS12 Files Contain Expected Data ${VALID_ENV_FILE_ALL_SANS_TYPES} 0 + Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=JKS [Tags] OOM-CERT-SERVICE [Documentation] Run with correct env and JKS files created with correct data diff --git a/tests/oom-platform-cert-service/certservice/libraries/ArtifactParser.py b/tests/oom-platform-cert-service/certservice/libraries/ArtifactParser.py index 54e8d0ff..bc796ed6 100644 --- a/tests/oom-platform-cert-service/certservice/libraries/ArtifactParser.py +++ b/tests/oom-platform-cert-service/certservice/libraries/ArtifactParser.py @@ -1,5 +1,7 @@ from cryptography.x509.oid import ExtensionOID -from cryptography import x509 + +SANS_DELIMITER = ',' + class ArtifactParser: @@ -19,14 +21,21 @@ class ArtifactParser: return dict((k, v) for k, v in list) def get_sans(self, cert): - extension = cert.to_cryptography().extensions.get_extension_for_oid(ExtensionOID.SUBJECT_ALTERNATIVE_NAME) - dnsList = extension.value.get_values_for_type(x509.DNSName) - return ':'.join(map(lambda dns: dns.encode('ascii','ignore'), dnsList)) + sans = cert.to_cryptography().extensions.get_extension_for_oid(ExtensionOID.SUBJECT_ALTERNATIVE_NAME).value + sans_strings = [str(alt_name.value) for alt_name in sans] + return self.get_sorted_sans(sans_strings) def get_envs_as_dict(self, list): envs = self.get_list_of_pairs_by_mappings(list) + SANS = 'SANS' + sans_env_strings = SANS in envs and envs[SANS].split(SANS_DELIMITER) or [] + envs[SANS] = self.get_sorted_sans(sans_env_strings) return self.remove_nones_from_dict(envs) + def get_sorted_sans(self, sans_strings): + sans_strings.sort() + return SANS_DELIMITER.join(sans_strings) + def remove_nones_from_dict(self, dictionary): return dict((k, v) for k, v in dictionary.iteritems() if k is not None) diff --git a/tests/oom-platform-cert-service/certservice/resources/cert-service-keywords.robot b/tests/oom-platform-cert-service/certservice/resources/cert-service-keywords.robot index fea210b5..dd5728cc 100644 --- a/tests/oom-platform-cert-service/certservice/resources/cert-service-keywords.robot +++ b/tests/oom-platform-cert-service/certservice/resources/cert-service-keywords.robot @@ -63,9 +63,10 @@ Check Message Recieved On Success List Should Contain Certificates [Documentation] Verify if list contains certificates [Arguments] @{list} - :FOR ${content} IN @{list} - \ Should Contain ${content} BEGIN CERTIFICATE - \ Should Contain ${content} END CERTIFICATE + FOR ${content} IN @{list} + Should Contain ${content} BEGIN CERTIFICATE + Should Contain ${content} END CERTIFICATE + END Send Get Request with Header And Expect Error [Documentation] Send request to passed url and validate received response diff --git a/tests/oom-platform-cert-service/certservice/resources/cert-service-properties.robot b/tests/oom-platform-cert-service/certservice/resources/cert-service-properties.robot index ff0500a2..f417f5ec 100644 --- a/tests/oom-platform-cert-service/certservice/resources/cert-service-properties.robot +++ b/tests/oom-platform-cert-service/certservice/resources/cert-service-properties.robot @@ -13,6 +13,8 @@ ${VALID_CLIENT_CSR_FILE} %{WORKSPACE}/tests/oom-platform-cert-se ${VALID_CLIENT_PK_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client.pk ${VALID_RA_CSR_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_ra.csr ${VALID_RA_PK_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_ra.pk +${VALID_RA_ALL_SANS_CSR_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_ra_all_sans.csr +${VALID_RA_ALL_SANS_PK_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_ra_all_sans.pk ${INVALID_CSR_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/invalid.csr ${INVALID_PK_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/invalid.key @@ -22,6 +24,7 @@ ${VALID_ENV_FILE} %{WORKSPACE}/tests/oom-platform-cert-se ${VALID_ENV_FILE_JKS} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_jks.env ${VALID_ENV_FILE_P12} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_p12.env ${VALID_ENV_FILE_PEM} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_pem.env +${VALID_ENV_FILE_ALL_SANS_TYPES} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_all_sans_types.env ${INVALID_ENV_FILE_OUTPUT_TYPE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker_output_type.env ${INVALID_ENV_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker.env ${DOCKER_CLIENT_IMAGE} nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-certservice-client:latest diff --git a/tests/optf-has/has/__init__.robot b/tests/optf-has/has/__init__.robot deleted file mode 100644 index fb654d7b..00000000 --- a/tests/optf-has/has/__init__.robot +++ /dev/null @@ -1,4 +0,0 @@ -*** Settings *** -Documentation Integration - Suite 1 - - diff --git a/tests/optf-has/has/data/healthcheck.json b/tests/optf-has/has/data/healthcheck.json deleted file mode 100644 index 926bb289..00000000 --- a/tests/optf-has/has/data/healthcheck.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "consistencyInfo": { - "type": "eventual" - }, - "values": { - "created": 1479482603641, - "message": "", - "name": "foo", - "recommend_max": 1, - "solution": "{\"healthcheck\": \" healthcheck\"}", - "status": "solved", - "template": "{\"healthcheck\": \"healthcheck\"}", - "timeout": 3600, - "translation": "{\"healthcheck\": \" healthcheck\"}", - "updated": 1484324150629 - } -} - - diff --git a/tests/optf-has/has/data/nsi_selection_template_with_create.json b/tests/optf-has/has/data/nsi_selection_template_with_create.json deleted file mode 100644 index 6d659f9e..00000000 --- a/tests/optf-has/has/data/nsi_selection_template_with_create.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "files": {}, - "limit": 10, - "name": "urllc_sample", - "num_solution": "1", - "template": { - "constraints": { - "URLLC_Threshold": { - "demands": [ - "URLLC" - ], - "properties": { - "evaluate": [ - { - "attribute": "latency", - "operator": "lte", - "threshold": { - "get_param": "latency" - }, - "unit": "ms" - }, - { - "attribute": "reliability", - "operator": "gte", - "threshold": { - "get_param": "reliability" - }, - "unit": "" - }, - { - "attribute": "coverage_area_ta_list", - "operator": "eq", - "threshold": { - "get_param": "coverage_area_ta_list" - }, - "unit": "" - } - ] - }, - "type": "threshold" - } - }, - "demands": { - "URLLC": [ - { - "default_attributes": { - "creation_cost": 0.1 - }, - "filtering_attributes": { - "service-function": "shared", - "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", - "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22", - "service-role": "nsi" - }, - "inventory_provider": "aai", - "inventory_type": "nsi", - "unique": "true" - }, - { - "default_attributes": { - "creation_cost": 0.9 - }, - "filtering_attributes": { - "service_profile": { - "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, - "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}, - "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"} - }, - "subnets":{ - "core": { - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "core_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "core_reliability" - } - ] - } - }, - "ran": { - "coverage_area_ta_list": { - "values": [ - { - "get_param": "coverage_area_ta_list" - } - ] - }, - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "ran_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "ran_reliability" - } - ] - } - }, - "transport": { - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "tn_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "tn_reliability" - } - ] - } - } - } - }, - "inventory_provider": "generator", - "inventory_type": "slice_profiles", - "unique": "true" - } - ] - }, - "homing_template_version": "2020-08-13", - "optimization": { - "goal": "maximize", - "operation_function": { - "operands": [ - { - "function": "attribute", - "params": { - "attribute": "creation_cost", - "demand": "URLLC" - } - } - ], - "operator": "sum" - } - }, - "parameters": { - "core_latency": 10, - "core_reliability": 99.9, - "coverage_area_ta_list": "Chennai", - "latency": 30, - "ran_latency": 7, - "ran_reliability": 99.9, - "reliability": 99.9, - "tn_latency": 10, - "tn_reliability": 99.9 - } - }, - "timeout": 1200 -} diff --git a/tests/optf-has/has/data/nsi_selection_template_with_nonsi.json b/tests/optf-has/has/data/nsi_selection_template_with_nonsi.json deleted file mode 100644 index 1b5b99e4..00000000 --- a/tests/optf-has/has/data/nsi_selection_template_with_nonsi.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "files": {}, - "limit": 10, - "name": "urllc_sample", - "num_solution": "1", - "template": { - "constraints": { - "URLLC_Threshold": { - "demands": [ - "URLLC" - ], - "properties": { - "evaluate": [ - { - "attribute": "latency", - "operator": "lte", - "threshold": { - "get_param": "latency" - }, - "unit": "ms" - }, - { - "attribute": "reliability", - "operator": "gte", - "threshold": { - "get_param": "reliability" - }, - "unit": "" - }, - { - "attribute": "coverage_area_ta_list", - "operator": "eq", - "threshold": { - "get_param": "coverage_area_ta_list" - }, - "unit": "" - } - ] - }, - "type": "threshold" - } - }, - "demands": { - "URLLC": [ - { - "default_attributes": { - "creation_cost": 0.1 - }, - "filtering_attributes": { - "service-function": "shared", - "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", - "model-version-id": "637762da-0764-43cc-8b9a-535085770821", - "service-role": "nsi" - }, - "inventory_provider": "aai", - "inventory_type": "nsi", - "unique": "true" - }, - { - "default_attributes": { - "creation_cost": 0.9 - }, - "filtering_attributes": { - "service_profile": { - "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, - "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}, - "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"} - }, - "subnets":{ - "core": { - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "core_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "core_reliability" - } - ] - } - }, - "ran": { - "coverage_area_ta_list": { - "values": [ - { - "get_param": "coverage_area_ta_list" - } - ] - }, - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "ran_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "ran_reliability" - } - ] - } - }, - "transport": { - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "tn_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "tn_reliability" - } - ] - } - } - } - }, - "inventory_provider": "generator", - "inventory_type": "slice_profiles", - "unique": "true" - } - ] - }, - "homing_template_version": "2020-08-13", - "optimization": { - "goal": "minimize", - "operation_function": { - "operands": [ - { - "function": "attribute", - "params": { - "attribute": "creation_cost", - "demand": "URLLC" - } - } - ], - "operator": "sum" - } - }, - "parameters": { - "core_latency": 10, - "core_reliability": 99.9, - "coverage_area_ta_list": "Chennai", - "latency": 30, - "ran_latency": 7, - "ran_reliability": 99.9, - "reliability": 99.9, - "tn_latency": 10, - "tn_reliability": 99.9 - } - }, - "timeout": 1200 -} diff --git a/tests/optf-has/has/data/nsi_selection_template_with_reuse.json b/tests/optf-has/has/data/nsi_selection_template_with_reuse.json deleted file mode 100644 index ff66b2d2..00000000 --- a/tests/optf-has/has/data/nsi_selection_template_with_reuse.json +++ /dev/null @@ -1,168 +0,0 @@ -{ - "files": {}, - "limit": 10, - "name": "urllc_sample", - "num_solution": "1", - "template": { - "constraints": { - "URLLC_Threshold": { - "demands": [ - "URLLC" - ], - "properties": { - "evaluate": [ - { - "attribute": "latency", - "operator": "lte", - "threshold": { - "get_param": "latency" - }, - "unit": "ms" - }, - { - "attribute": "reliability", - "operator": "gte", - "threshold": { - "get_param": "reliability" - }, - "unit": "" - }, - { - "attribute": "coverage_area_ta_list", - "operator": "eq", - "threshold": { - "get_param": "coverage_area_ta_list" - }, - "unit": "" - } - ] - }, - "type": "threshold" - } - }, - "demands": { - "URLLC": [ - { - "default_attributes": { - "creation_cost": 0.1 - }, - "filtering_attributes": { - "service-function": "shared", - "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", - "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22", - "service-role": "nsi" - }, - "inventory_provider": "aai", - "inventory_type": "nsi", - "unique": "true" - }, - { - "default_attributes": { - "creation_cost": 0.9 - }, - "filtering_attributes": { - "service_profile": { - "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, - "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}, - "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"} - }, - "subnets":{ - "core": { - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "core_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "core_reliability" - } - ] - } - }, - "ran": { - "coverage_area_ta_list": { - "values": [ - { - "get_param": "coverage_area_ta_list" - } - ] - }, - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "ran_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "ran_reliability" - } - ] - } - }, - "transport": { - "latency": { - "max": { - "get_param": "latency" - }, - "min": { - "get_param": "tn_latency" - }, - "steps": 1 - }, - "reliability": { - "values": [ - { - "get_param": "tn_reliability" - } - ] - } - } - } - }, - "inventory_provider": "generator", - "inventory_type": "slice_profiles", - "unique": "true" - } - ] - }, - "homing_template_version": "2020-08-13", - "optimization": { - "goal": "minimize", - "operation_function": { - "operands": [ - { - "function": "attribute", - "params": { - "attribute": "creation_cost", - "demand": "URLLC" - } - } - ], - "operator": "sum" - } - }, - "parameters": { - "core_latency": 10, - "core_reliability": 99.9, - "coverage_area_ta_list": "Chennai", - "latency": 30, - "ran_latency": 7, - "ran_reliability": 99.9, - "reliability": 99.9, - "tn_latency": 10, - "tn_reliability": 99.9 - } - }, - "timeout": 1200 -} diff --git a/tests/optf-has/has/data/nssi_selection_template.json b/tests/optf-has/has/data/nssi_selection_template.json deleted file mode 100644 index a498ca0b..00000000 --- a/tests/optf-has/has/data/nssi_selection_template.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "files": {}, - "limit": 10, - "name": "urllc_sample", - "num_solution": "1", - "timeout": 1200, - "template": { - "homing_template_version": "2020-08-13", - "parameters": { - "coverage_area_ta_list": "Chennai", - "latency": 30, - "reliability": 99.9 - }, - "demands": { - "URLLC_core": [ - { - "default_attributes": { - "creation_cost": 0.1 - }, - "filtering_attributes": { - "service-function": "shared", - "model-invariant-id": "c343a533-c045-4ec0-bbb6-f30eb8eb5a41", - "model-version-id": "8d770214-d3e7-43ea-b7a6-9b235dcbcd34", - "service-role": "nssi" - }, - "inventory_provider": "aai", - "inventory_type": "nssi", - "unique": "true" - } - ] - }, - "constraints": { - "URLLC_Threshold": { - "demands": [ - "URLLC_core" - ], - "properties": { - "evaluate": [ - { - "attribute": "latency", - "operator": "lte", - "threshold": { - "get_param": "latency" - }, - "unit": "ms" - }, - { - "attribute": "reliability", - "operator": "gte", - "threshold": { - "get_param": "reliability" - }, - "unit": "" - }, - { - "attribute": "coverage_area_ta_list", - "operator": "eq", - "threshold": { - "get_param": "coverage_area_ta_list" - }, - "unit": "" - } - ] - }, - "type": "threshold" - } - }, - "optimization": { - "goal": "minimize", - "operation_function": { - "operands": [ - { - "function": "attribute", - "params": { - "attribute": "latency", - "demand": "URLLC_core" - } - } - ], - "operator": "sum" - } - } - } -} diff --git a/tests/optf-has/has/data/nssi_selection_template_unmatched.json b/tests/optf-has/has/data/nssi_selection_template_unmatched.json deleted file mode 100644 index 49302801..00000000 --- a/tests/optf-has/has/data/nssi_selection_template_unmatched.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "files": {}, - "limit": 10, - "name": "urllc_sample", - "num_solution": "1", - "timeout": 1200, - "template": { - "homing_template_version": "2020-08-13", - "parameters": { - "coverage_area_ta_list": "Chennai", - "latency": 5, - "reliability": 99.9 - }, - "demands": { - "URLLC_core": [ - { - "default_attributes": { - "creation_cost": 0.1 - }, - "filtering_attributes": { - "service-function": "shared", - "model-invariant-id": "c343a533-c045-4ec0-bbb6-f30eb8eb5a41", - "model-version-id": "8d770214-d3e7-43ea-b7a6-9b235dcbcd34", - "service-role": "nssi" - }, - "inventory_provider": "aai", - "inventory_type": "nssi", - "unique": "true" - } - ] - }, - "constraints": { - "URLLC_Threshold": { - "demands": [ - "URLLC_core" - ], - "properties": { - "evaluate": [ - { - "attribute": "latency", - "operator": "lte", - "threshold": { - "get_param": "latency" - }, - "unit": "ms" - }, - { - "attribute": "reliability", - "operator": "gte", - "threshold": { - "get_param": "reliability" - }, - "unit": "" - }, - { - "attribute": "coverage_area_ta_list", - "operator": "eq", - "threshold": { - "get_param": "coverage_area_ta_list" - }, - "unit": "" - } - ] - }, - "type": "threshold" - } - }, - "optimization": { - "goal": "minimize", - "operation_function": { - "operands": [ - { - "function": "attribute", - "params": { - "attribute": "latency", - "demand": "URLLC_core" - } - } - ], - "operator": "sum" - } - } - } -} diff --git a/tests/optf-has/has/data/onboard.json b/tests/optf-has/has/data/onboard.json deleted file mode 100644 index a4939c45..00000000 --- a/tests/optf-has/has/data/onboard.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "appname": "conductor", - "userId": "conductor", - "isAAF": "false", - "password": "c0nduct0r" -} diff --git a/tests/optf-has/has/data/plan_with_hpa.json b/tests/optf-has/has/data/plan_with_hpa.json deleted file mode 100644 index 21985776..00000000 --- a/tests/optf-has/has/data/plan_with_hpa.json +++ /dev/null @@ -1,260 +0,0 @@ -{ - "name":"vCPE-with-HPA", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - "constraint_vg_customer":{ - "type":"distance_to_location", - "demands":[ - "vG" - ], - "properties":{ - "distance":"< 100 km", - "location":"customer_loc" - } - }, - "hpa_constraint":{ - "type":"hpa", - "demands":[ - "vG" - ], - "properties":{ - "evaluate":[ - { - "id":"vg_1", - "type":"vnfc", - "directives":[ - { - "type": "flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_1", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "score": "5", - "directives": [], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"4", - "operator":">=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"4", - "operator":">=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"numa", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "score": "5", - "directives": [], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numaNodes", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-0", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-1", - "hpa-attribute-value":"4", - "operator":"=" - }, - { - "hpa-attribute-key":"numaMem-0", - "hpa-attribute-value":"2", - "operator":"=", - "unit":"GB" - }, - { - "hpa-attribute-key":"numaMem-1", - "hpa-attribute-value":"4", - "operator":"=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"cpuPinning", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "score": "5", - "directives": [], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"logicalCpuThreadPinningPolicy", - "hpa-attribute-value":"prefer", - "operator":"=" - }, - { - "hpa-attribute-key":"logicalCpuPinningPolicy", - "hpa-attribute-value":"dedicated", - "operator":"=" - } - ] - } - ] - }, - { - "id":"vg_2", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_2", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "score": "5", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"8", - "operator":">=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"16", - "operator":">=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"numa", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "score": "5", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numaNodes", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-0", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-1", - "hpa-attribute-value":"4", - "operator":"=" - }, - { - "hpa-attribute-key":"numaMem-0", - "hpa-attribute-value":"2", - "operator":"=", - "unit":"GB" - }, - { - "hpa-attribute-key":"numaMem-1", - "hpa-attribute-value":"4", - "operator":"=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"ovsDpdk", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "score": "5", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"dataProcessingAccelerationLibrary", - "hpa-attribute-value":"v18.02", - "operator":"=" - } - ] - } - ] - } - ] - } - } - }, - "optimization":{ - "minimize":{ - "sum":[ - { - "distance_between":[ - "customer_loc", - "vG" - ] - }, - { - "distance_between":[ - "customer_loc", - "vG" - ] - } - ] - } - } - }, - "timeout":5, - "limit":3 -} diff --git a/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json b/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json deleted file mode 100644 index bb613abd..00000000 --- a/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json +++ /dev/null @@ -1,193 +0,0 @@ -{ - "name":"vCPE-with-HPA-requirement-mandatory", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - "constraint_vg_customer":{ - "type":"distance_to_location", - "demands":[ - "vG" - ], - "properties":{ - "distance":"< 100 km", - "location":"customer_loc" - } - }, - "hpa_constraint":{ - "type":"hpa", - "demands":[ - "vG" - ], - "properties":{ - "evaluate":[ - { - "id":"vg_1", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_1", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"64", - "operator":"=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"64", - "operator":"=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"numa", - "hpa-version":"v1", - "architecture":"generic", - "mandatory":"True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numaNodes", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-0", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-1", - "hpa-attribute-value":"4", - "operator":"=" - }, - { - "hpa-attribute-key":"numaMem-0", - "hpa-attribute-value":"2", - "operator":"=", - "unit":"GB" - }, - { - "hpa-attribute-key":"numaMem-1", - "hpa-attribute-value":"4", - "operator":"=", - "unit":"GB" - } - ] - } - ] - }, - { - "id":"vg_2", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_2", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"32", - "operator":"=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"128", - "operator":"=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"ovsDpdk", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"dataProcessingAccelerationLibrary", - "hpa-attribute-value":"v18.02", - "operator":"=" - } - ] - } - ] - } - ] - } - } - }, - "optimization":{ - "minimize":{ - "sum":[ - { - "distance_between":[ - "customer_loc", - "vG" - ] - } - ] - } - } - }, - "timeout":5, - "limit":3 -} diff --git a/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json b/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json deleted file mode 100644 index 50c23ee8..00000000 --- a/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "name":"vCPE-HPA-Requirement-Optional", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - "constraint_vg_customer":{ - "type":"distance_to_location", - "demands":[ - "vG" - ], - "properties":{ - "distance":"< 100 km", - "location":"customer_loc" - } - }, - "hpa_constraint":{ - "type":"hpa", - "demands":[ - "vG" - ], - "properties":{ - "evaluate":[ - { - "id":"vg_1", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_1", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"4", - "operator":">=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"8", - "operator":">=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"instructionSetExtensions", - "hpa-version":"v1", - "architecture":"Intel64", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"instructionSetExtensions", - "hpa-attribute-value":["aes", "sse", "avx", "smt"], - "operator":"ALL", - "unit":"" - } - ] - }, - { - "hpa-feature":"numa", - "hpa-version":"v1", - "architecture":"generic", - "mandatory":"False", - "score":"3", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numaNodes", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-0", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-1", - "hpa-attribute-value":"4", - "operator":"=" - }, - { - "hpa-attribute-key":"numaMem-0", - "hpa-attribute-value":"2", - "operator":"=", - "unit":"GB" - }, - { - "hpa-attribute-key":"numaMem-1", - "hpa-attribute-value":"4", - "operator":"=", - "unit":"GB" - } - ] - } - ] - }, - { - "id":"vg_2", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_2", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"4", - "operator":">=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"8", - "operator":">=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"ovsDpdk", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "score":"5", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"dataProcessingAccelerationLibrary", - "hpa-attribute-value":"v18.02", - "operator":"=" - } - ] - }, - { - "hpa-feature":"numa", - "hpa-version":"v1", - "architecture":"generic", - "mandatory":"False", - "score":"3", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numaNodes", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-0", - "hpa-attribute-value":"2", - "operator":"=" - }, - { - "hpa-attribute-key":"numaCpu-1", - "hpa-attribute-value":"4", - "operator":"=" - }, - { - "hpa-attribute-key":"numaMem-0", - "hpa-attribute-value":"2", - "operator":"=", - "unit":"GB" - }, - { - "hpa-attribute-key":"numaMem-1", - "hpa-attribute-value":"4", - "operator":"=", - "unit":"GB" - } - ] - } - ] - } - ] - } - } - }, - "optimization":{ - "minimize":{ - "sum":[ - { - "distance_between":[ - "customer_loc", - "vG" - ] - } - ] - } - } - }, - "timeout":5, - "limit":3 -} diff --git a/tests/optf-has/has/data/plan_with_hpa_score_multi_objective.json b/tests/optf-has/has/data/plan_with_hpa_score_multi_objective.json deleted file mode 100644 index 4a6d3bc8..00000000 --- a/tests/optf-has/has/data/plan_with_hpa_score_multi_objective.json +++ /dev/null @@ -1,267 +0,0 @@ -{ - "name": "vCPE-HPA-Requirement-Optional", - "template": { - "homing_template_version": "2017-10-10", - "parameters": { - "service_name": "Residential vCPE", - "service_id": "vcpe_service_id", - "customer_lat": 45.395968, - "customer_long": -71.135344, - "REQUIRED_MEM": 4, - "REQUIRED_DISK": 100, - "pnf_id": "some_pnf_id" - }, - "locations": { - "customer_loc": { - "latitude": { - "get_param": "customer_lat" - }, - "longitude": { - "get_param": "customer_long" - } - } - }, - "demands": { - "vG": [ - { - "inventory_provider": "aai", - "inventory_type": "cloud" - } - ] - }, - "constraints": { - "constraint_vg_customer": { - "type": "distance_to_location", - "demands": [ - "vG" - ], - "properties": { - "distance": "< 100 km", - "location": "customer_loc" - } - }, - "hpa_constraint": { - "type": "hpa", - "demands": [ - "vG" - ], - "properties": { - "evaluate": [ - { - "id":"vg_1", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_1", - "attribute_value":"" - } - ] - } - ], - "flavorProperties": [ - { - "hpa-feature": "basicCapabilities", - "hpa-version": "v1", - "architecture": "generic", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes": [ - { - "hpa-attribute-key": "numVirtualCpu", - "hpa-attribute-value": "4", - "operator": ">=" - }, - { - "hpa-attribute-key": "virtualMemSize", - "hpa-attribute-value": "8", - "operator": ">=", - "unit": "GB" - } - ] - }, - { - "hpa-feature": "instructionSetExtensions", - "hpa-version": "v1", - "architecture": "Intel64", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes": [ - { - "hpa-attribute-key": "instructionSetExtensions", - "hpa-attribute-value": [ - "aes", - "sse", - "avx", - "smt" - ], - "operator": "ALL", - "unit": "" - } - ] - }, - { - "hpa-feature": "numa", - "hpa-version": "v1", - "architecture": "generic", - "mandatory": "False", - "score": "3", - "directives":[], - "hpa-feature-attributes": [ - { - "hpa-attribute-key": "numaNodes", - "hpa-attribute-value": "2", - "operator": "=" - }, - { - "hpa-attribute-key": "numaCpu-0", - "hpa-attribute-value": "2", - "operator": "=" - }, - { - "hpa-attribute-key": "numaCpu-1", - "hpa-attribute-value": "4", - "operator": "=" - }, - { - "hpa-attribute-key": "numaMem-0", - "hpa-attribute-value": "2", - "operator": "=", - "unit": "GB" - }, - { - "hpa-attribute-key": "numaMem-1", - "hpa-attribute-value": "4", - "operator": "=", - "unit": "GB" - } - ] - } - ] - }, - { - "id":"vg_2", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_2", - "attribute_value":"" - } - ] - } - ], - "flavorProperties": [ - { - "hpa-feature": "basicCapabilities", - "hpa-version": "v1", - "architecture": "generic", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes": [ - { - "hpa-attribute-key": "numVirtualCpu", - "hpa-attribute-value": "4", - "operator": ">=" - }, - { - "hpa-attribute-key": "virtualMemSize", - "hpa-attribute-value": "8", - "operator": ">=", - "unit": "GB" - } - ] - }, - { - "hpa-feature": "ovsDpdk", - "hpa-version": "v1", - "architecture": "generic", - "mandatory": "False", - "score": "5", - "directives":[], - "hpa-feature-attributes": [ - { - "hpa-attribute-key": "dataProcessingAccelerationLibrary", - "hpa-attribute-value": "v18.02", - "operator": "=" - } - ] - }, - { - "hpa-feature": "numa", - "hpa-version": "v1", - "architecture": "generic", - "mandatory": "False", - "score": "3", - "directives":[], - "hpa-feature-attributes": [ - { - "hpa-attribute-key": "numaNodes", - "hpa-attribute-value": "2", - "operator": "=" - }, - { - "hpa-attribute-key": "numaCpu-0", - "hpa-attribute-value": "2", - "operator": "=" - }, - { - "hpa-attribute-key": "numaCpu-1", - "hpa-attribute-value": "4", - "operator": "=" - }, - { - "hpa-attribute-key": "numaMem-0", - "hpa-attribute-value": "2", - "operator": "=", - "unit": "GB" - }, - { - "hpa-attribute-key": "numaMem-1", - "hpa-attribute-value": "4", - "operator": "=", - "unit": "GB" - } - ] - } - ] - } - ] - } - } - }, - "optimization": { - "minimize": { - "sum": [ - { - "product": [ - 100, - { - "distance_between": [ - "customer_loc", - "vG" - ] - } - ] - }, - { - "product": [ - 200, - { - "hpa_score": [ - "vG" - ] - } - ] - } - ] - } - } - }, - "timeout": 5, - "limit": 3 -} diff --git a/tests/optf-has/has/data/plan_with_hpa_simple.json b/tests/optf-has/has/data/plan_with_hpa_simple.json deleted file mode 100644 index d343dc80..00000000 --- a/tests/optf-has/has/data/plan_with_hpa_simple.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "name":"vCPE-with-HPA", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - "hpa_constraint":{ - "type":"hpa", - "demands":[ - "vG" - ], - "properties":{ - "evaluate":[ - { - "id":"vg_1", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_1", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "directives":[], - "score": "5", - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"32", - "operator":"=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"64", - "operator":"=", - "unit":"GB" - } - ] - }, - { - "hpa-feature":"ovsDpdk", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "directives":[], - "score": "5", - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"dataProcessingAccelerationLibrary", - "hpa-attribute-value":"v18.02", - "operator":"=" - } - ] - } - ] - }, - { - "id":"vg_2", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_2", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "False", - "directives":[], - "score": "5", - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"8", - "operator":">=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"16", - "operator":">=", - "unit":"GB" - } - ] - } - ] - } - ] - } - } - }, - "optimization":{ - "minimize":{ - "sum":[ - { - "distance_between":[ - "customer_loc", - "vG" - ] - }, - { - "distance_between":[ - "customer_loc", - "vG" - ] - } - ] - } - } - }, - "timeout":5, - "limit":3 -} diff --git a/tests/optf-has/has/data/plan_with_hpa_unmatched.json b/tests/optf-has/has/data/plan_with_hpa_unmatched.json deleted file mode 100644 index e95ecedd..00000000 --- a/tests/optf-has/has/data/plan_with_hpa_unmatched.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "name":"vCPE-with-HPA-unmatched-requirements", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - "constraint_vgmux_customer":{ - "type":"distance_to_location", - "demands":[ - "vG" - ], - "properties":{ - "distance":"< 100 km", - "location":"customer_loc" - } - }, - "hpa_constraint":{ - "type":"hpa", - "demands":[ - "vG" - ], - "properties":{ - "evaluate":[ - { - "id":"vg_1", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_1", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory": "True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"60", - "operator":"=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"64", - "operator":"=", - "unit":"GB" - } - ] - } - ] - }, - { - "id":"vg_2", - "type":"vnfc", - "directives":[ - { - "type":"flavor_directives", - "attributes":[ - { - "attribute_name":"flavor_label_2", - "attribute_value":"" - } - ] - } - ], - "flavorProperties":[ - { - "hpa-feature":"basicCapabilities", - "hpa-version":"v1", - "architecture":"generic", - "mandatory":"True", - "directives":[], - "hpa-feature-attributes":[ - { - "hpa-attribute-key":"numVirtualCpu", - "hpa-attribute-value":"30", - "operator":"=" - }, - { - "hpa-attribute-key":"virtualMemSize", - "hpa-attribute-value":"128", - "operator":"=", - "unit":"GB" - } - ] - } - ] - } - ] - } - } - }, - "optimization":{ - "minimize":{ - "sum":[ - { - "distance_between":[ - "customer_loc", - "vG" - ] - } - ] - } - } - }, - "timeout":5, - "limit":3 -} diff --git a/tests/optf-has/has/data/plan_with_lati_and_longi.json b/tests/optf-has/has/data/plan_with_lati_and_longi.json deleted file mode 100644 index 5e35d6ab..00000000 --- a/tests/optf-has/has/data/plan_with_lati_and_longi.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name":"onap template with lati and longi without constraints and without optimizations", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "physical_location":"DLLSTX233", - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - - }, - "optimization":{ - - } - } -} - diff --git a/tests/optf-has/has/data/plan_with_short_distance_constraint.json b/tests/optf-has/has/data/plan_with_short_distance_constraint.json deleted file mode 100644 index 68a7e119..00000000 --- a/tests/optf-has/has/data/plan_with_short_distance_constraint.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name":"onap template with short distance constraint", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":25.395968, - "customer_long":-51.135344, - "physical_location":"DLLSTX233", - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - "distance-vg":{ - "type":"distance_to_location", - "demands":[ - "vG" - ], - "properties":{ - "distance":"< 1 km", - "location":"customer_loc" - } - } - }, - "optimization":{ - "minimize": { - "sum": [ - { - "distance_between": [ - "customer_loc", - "vG" - ] - }, - { - "distance_between": [ - "customer_loc", - "vG" - ] - } - ] - } - } - } -} diff --git a/tests/optf-has/has/data/plan_with_vim_fit.json b/tests/optf-has/has/data/plan_with_vim_fit.json deleted file mode 100644 index 00a59912..00000000 --- a/tests/optf-has/has/data/plan_with_vim_fit.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "name":"vCPE-Sanity1", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - "constraint_vg_customer":{ - "type":"distance_to_location", - "demands":[ - "vG" - ], - "properties":{ - "distance":"< 100 km", - "location":"customer_loc" - } - }, - "check_cloud_capacity":{ - "type":"vim_fit", - "demands":[ - "vG" - ], - "properties":{ - "controller":"multicloud", - "request":{ - "vCPU":10, - "Memory":{ - "quantity":{ - "get_param":"REQUIRED_MEM" - }, - "unit":"GB" - }, - "Storage":{ - "quantity":{ - "get_param":"REQUIRED_DISK" - }, - "unit":"GB" - } - } - } - } - }, - "optimization":{ - "minimize":{ - "sum":[ - { - "distance_between":[ - "customer_loc", - "vG" - ] - }, - { - "distance_between":[ - "customer_loc", - "vG" - ] - } - ] - } - } - }, - "timeout":5, - "limit":3 -} diff --git a/tests/optf-has/has/data/plan_with_wrong_distance_constraint.json b/tests/optf-has/has/data/plan_with_wrong_distance_constraint.json deleted file mode 100644 index 9f25c2df..00000000 --- a/tests/optf-has/has/data/plan_with_wrong_distance_constraint.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name":"onap template with wrong distance constraint", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "physical_location":"DLLSTX233", - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - "distance-vg":{ - "demands":[ - "vG" - ], - "properties":{ - "distance":"< 1 km", - "location":"customer_loc" - } - } - }, - "optimization":{ - "minimize": { - "sum": [ - { - "distance_between": [ - "customer_loc", - "vG" - ] - }, - { - "distance_between": [ - "customer_loc", - "vG" - ] - } - ] - } - } - } -} diff --git a/tests/optf-has/has/data/plan_with_wrong_version.json b/tests/optf-has/has/data/plan_with_wrong_version.json deleted file mode 100644 index c0618bfb..00000000 --- a/tests/optf-has/has/data/plan_with_wrong_version.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name":"onap template with wrong version", - "template":{ - "homing_template_version":"xxxx-yy-zz", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "physical_location":"DLLSTX233", - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "demands":{ - "vG":[ - { - "inventory_provider":"aai", - "inventory_type":"cloud" - } - ] - }, - "constraints":{ - - }, - "optimization":{ - - } - } -} - diff --git a/tests/optf-has/has/data/plan_without_demand_section.json b/tests/optf-has/has/data/plan_without_demand_section.json deleted file mode 100644 index fe5d2fa6..00000000 --- a/tests/optf-has/has/data/plan_without_demand_section.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name":"onap template without demand section", - "template":{ - "homing_template_version":"2017-10-10", - "parameters":{ - "service_name":"Residential vCPE", - "service_id":"vcpe_service_id", - "customer_lat":45.395968, - "customer_long":-71.135344, - "physical_location":"DLLSTX233", - "REQUIRED_MEM":4, - "REQUIRED_DISK":100, - "pnf_id":"some_pnf_id" - }, - "locations":{ - "customer_loc":{ - "latitude":{ - "get_param":"customer_lat" - }, - "longitude":{ - "get_param":"customer_long" - } - } - }, - "constraints":{ - - }, - "optimization":{ - - } - } -} - diff --git a/tests/optf-has/has/optf_has_test.robot b/tests/optf-has/has/optf_has_test.robot deleted file mode 100644 index 9185fcea..00000000 --- a/tests/optf-has/has/optf_has_test.robot +++ /dev/null @@ -1,692 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary -Library json - -*** Variables *** -${MESSAGE} {"ping": "ok"} -${BASIC} Basic -${Music_AUTHVALUE} Y29uZHVjdG9yOmMwbmR1Y3Qwcg== -${HAS_AUTHVALUE} YWRtaW4xOnBsYW4uMTU= -${Music_Auth} ${BASIC} ${Music_AUTHVALUE} -${HAS_Auth} ${BASIC} ${HAS_AUTHVALUE} -${RESP_STATUS} "error" -${RESP_MESSAGE_WRONG_VERSION} "conductor_template_version must be one of: 2016-11-01" -${RESP_MESSAGE_WITHOUT_DEMANDS} Undefined Demand - -#global variables -${generatedPlanId} -${generatedAID} -${resultStatus} - -*** Test Cases *** -Check Cassandra Docker Container - [Documentation] It checks cassandra 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} music-db - -Check Zookeeper Docker Container - [Documentation] It checks zookeeper 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} music-zk - -Check Tomcat Docker Container - [Documentation] It checks tomcat 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} music-tomcat - -Check Music War Docker Container - [Documentation] It checks music.war 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} music-war - -Get Music Version - [Documentation] It sends a REST GET request to retrieve the Music.war version - Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request musicaas /MUSIC/rest/v2/version 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 - -Check ConductorApi Docker Container - [Documentation] It checks conductor-api 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} cond-api - -Check ConductorController Docker Container - [Documentation] It checks conductor-controller 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} cond-cont - -Check ConductorSolver Docker Container - [Documentation] It checks conductor-solver 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} cond-solv - -Check ConductorReservation Docker Container - [Documentation] It checks conductor-reservation 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} cond-resv - -Check ConductorData Docker Container - [Documentation] It checks conductor-data 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} cond-data - -Get Root Url - [Documentation] It sends a REST GET request to root url - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond / 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 - Sleep 10s Wait For 10 seconds - -Conductor AddHealthcheck Row Into Music - [Documentation] It sends a REST PUT request to Music to inject healthcheck plan - Create Session musicaas ${MUSIC_HOSTNAME}:${MUSIC_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}healthcheck.json - &{headers}= Create Dictionary ns=conductor Authorization=${Music_Auth} userId=conductor password=c0nduct0r Content-Type=application/json Accept=application/json - ${resp}= Put Request musicaas /MUSIC/rest/v2/keyspaces/conductor/tables/plans/rows?id=healthcheck data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - Should Be Equal As Integers ${resp.status_code} 200 - Sleep 5s Wait Injection effectiveness - -Healthcheck - [Documentation] It sends a REST GET request to healthcheck url - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/healthcheck 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 - -SendPlanWithWrongVersion - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_wrong_version.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 10s Wait Plan Resolution - -GetPlanWithWrongVersion - [Documentation] It sends a REST GET request to capture error - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal error ${resultStatus} - -SendPlanWithoutDemandSection - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_without_demand_section.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 10s Wait Plan Resolution - -GetPlanWithoutDemandSection - [Documentation] It sends a REST GET request to capture error - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal error ${resultStatus} - -SendPlanWithWrongConstraint - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_wrong_distance_constraint.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 10s Wait Plan Resolution - -GetPlanWithWrongConstraint - [Documentation] It sends a REST GET request to capture error - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal error ${resultStatus} - - -SendPlanWithLatiAndLongi - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_lati_and_longi.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithLatiAndLongi - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - -SendPlanWithShortDistanceConstraint - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_short_distance_constraint.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithShortDistanceConstraint - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal not found ${resultStatus} - -SendPlanWithVimFit - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_vim_fit.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithVimFit - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - -SendPlanWithHpa - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithHpa - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - -SendPlanWithHpaSimple - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_simple.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithHpaSimple - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - -SendPlanWithHpaMandatory - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_requirements_mandatory.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithHpaMandatory - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - -SendPlanWithHpaOptionals - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_requirements_optionals.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithHpaOptionals - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - -SendPlanWithHpaUnmatched - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_unmatched.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithHpaUnmatched - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal not found ${resultStatus} - -# HPA Score Multi objective Optimization -SendPlanWithHpaScoreMultiObj - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_score_multi_objective.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithHpaScoreMultiObj - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - ${vim-id}= Convert To String ${response_json['plans'][0]['recommendations'][0]['vG']['candidate']['vim-id']} - # ${hpa_score}= Convert To String ${response_json['plans'][0]['recommendations']['vG']['hpa_score']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - Should Be Equal HPA-cloud_cloud-region-1 ${vim-id} - -# NSI selection template -SendPlanWithNsiSelection - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_reuse.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithNsiSelection - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - ${instance_name}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['instance_name']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - Should Be Equal nsi_test_0211 ${instance_name} - -SendPlanWithNsiSelectionSliceProfile - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_create.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithNsiSelectionSliceProfile - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - ${candidate_type}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['inventory_type']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - Should Be Equal slice_profiles ${candidate_type} - -SendPlanWithNoNsi - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_nonsi.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithNoNsi - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - ${candidate_type}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['inventory_type']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - Should Be Equal slice_profiles ${candidate_type} - -SendPlanWithNssiSelection - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}nssi_selection_template.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithNssiSelection - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - ${instance_name}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC_core']['candidate']['instance_name']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal done ${resultStatus} - Should Be Equal nssi_test_0211 ${instance_name} - -SendPlanWithNssiSelectionUnmatched - [Documentation] It sends a POST request to conductor - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - ${data}= Get Binary File ${CURDIR}${/}data${/}nssi_selection_template_unmatched.json - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - ${response_json} json.loads ${resp.content} - ${generatedPlanId}= Convert To String ${response_json['id']} - Set Global Variable ${generatedPlanId} - Log To Console generatedPlanId = ${generatedPlanId} - Should Be Equal As Integers ${resp.status_code} 201 - Sleep 60s Wait Plan Resolution - -GetPlanWithNssiSelectionUnmatched - [Documentation] It sends a REST GET request to capture recommendations - Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} - &{headers}= Create Dictionary Authorization=${HAS_Auth} Content-Type=application/json Accept=application/json - ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - ${response_json} json.loads ${resp.content} - ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} - Set Global Variable ${resultStatus} - Log To Console resultStatus = ${resultStatus} - Log To Console body = ${resp.text} - Should Be Equal As Integers ${resp.status_code} 200 - Should Be Equal not found ${resultStatus} - - -*** Keywords *** - - diff --git a/tests/optf-osdf/osdf/__init__.robot b/tests/optf-osdf/osdf/__init__.robot deleted file mode 100644 index fb654d7b..00000000 --- a/tests/optf-osdf/osdf/__init__.robot +++ /dev/null @@ -1,4 +0,0 @@ -*** Settings *** -Documentation Integration - Suite 1 - - diff --git a/tests/optf-osdf/osdf/data/pci-opt-request.json b/tests/optf-osdf/osdf/data/pci-opt-request.json deleted file mode 100644 index 7ec9ab5f..00000000 --- a/tests/optf-osdf/osdf/data/pci-opt-request.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "requestInfo": { - "transactionId": "xxx-xxx-xxxx", - "requestId": "yyy-yyy-yyyy", - "callbackUrl": "https://wiki.onap.org:5000/callbackUrl/", - "sourceId": "SO", - "requestType": "create", - "numSolutions": 1, - "optimizers": [ - "placement" - ], - "timeout": 600 - }, - "cellInfo": { - "networkId": "1000", - "cellIdList": [ - "cell0" - ] - } -} \ No newline at end of file diff --git a/tests/optf-osdf/osdf/data/placement_request.json b/tests/optf-osdf/osdf/data/placement_request.json deleted file mode 100644 index d9b16ca5..00000000 --- a/tests/optf-osdf/osdf/data/placement_request.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "requestInfo": { - "transactionId": "xxx-xxx-xxxx", - "requestId": "yyy-yyy-yyyy", - "callbackUrl": "https://wiki.onap.org:5000/callbackUrl/", - "sourceId": "SO", - "requestType": "create", - "numSolutions": 1, - "optimizers": ["placement"], - "timeout": 600 - }, - "placementInfo": { - "requestParameters": { "customerLatitude": 32.89748, "customerLongitude": -97.040443, "customerName": "xyz" }, - "subscriberInfo": {"globalSubscriberId": "xxx-xx-xxx", "subscriberName": "subscriber_x"}, - "placementDemands": [ - { - "resourceModuleName": "vGMuxInfra", - "serviceResourceId": "vGMuxInfra-xx", - "tenantId": "vGMuxInfra-tenant", - "resourceModelInfo": { - "modelInvariantId": "vGMuxInfra-modelInvariantId", - "modelVersionId": "vGMuxInfra-versionId", - "modelName": "vGMuxInfra-model", - "modelType": "resource", - "modelVersion": "1.0", - "modelCustomizationName": "vGMuxInfra-customeModelName" - } - }, - { - "resourceModuleName": "vG", - "serviceResourceId": "71d563e8-e714-4393-8f99-cc480144a05e", - "tenantId": "vG-tenant", - "resourceModelInfo": { - "modelInvariantId": "vG-modelInvariantId", - "modelVersionId": "vG-versionId", - "modelName": "vG-model", - "modelType": "resource", - "modelVersion": "1.0", - "modelCustomizationName": "vG-customeModelName" - }, - "existingCandidates": [ - { - "identifierType": "serviceInstanceId", - "cloudOwner": "", - "identifiers": ["gjhd-098-fhd-987"] - } - ], - "excludedCandidates": [ - { - "identifierType": "serviceInstanceId", - "cloudOwner": "", - "identifiers": ["gjhd-098-fhd-987"] - }, - { - "identifierType": "vimId", - "cloudOwner": "vmware", - "identifiers": ["NYMDT67"] - } - ], - "requiredCandidates": [ - { - "identifierType": "vimId", - "cloudOwner": "amazon", - "identifiers": ["TXAUS219"] - } - ] - } - ] - }, - "serviceInfo": { - "serviceInstanceId": "d61b2543-5914-4b8f-8e81-81e38575b8ec", - "serviceName": "vCPE", - "modelInfo": { - "modelInvariantId": "vCPE-invariantId", - "modelVersionId": "vCPE-versionId", - "modelName": "vCPE-model", - "modelType": "service", - "modelVersion": "1.0", - "modelCustomizationName": "vCPE-customeModelName" - } - }, - "licenseInfo": { - "licenseDemands": [ - { - "resourceModuleName": "vGMuxInfra", - "serviceResourceId": "vGMuxInfra-xx", - "resourceModelInfo": { - "modelInvariantId": "vGMuxInfra-modelInvariantId", - "modelVersionId": "vGMuxInfra-versionId", - "modelName": "vGMuxInfra-model", - "modelType": "resource", - "modelVersion": "1.0", - "modelCustomizationName": "vGMuxInfra-customeModelName" - }, - "existingLicenses": { - "entitlementPoolUUID": ["87257b49-9602-4ca1-9817-094e52bc873b", "43257b49-9602-4fe5-9337-094e52bc9435"], - "licenseKeyGroupUUID": ["87257b49-9602-4ca1-9817-094e52bc873b", "43257b49-9602-4fe5-9337-094e52bc9435"] - } - } - ] - } -} \ No newline at end of file diff --git a/tests/optf-osdf/osdf/optf_osdf_setup.robot b/tests/optf-osdf/osdf/optf_osdf_setup.robot deleted file mode 100644 index fdf7f3e3..00000000 --- a/tests/optf-osdf/osdf/optf_osdf_setup.robot +++ /dev/null @@ -1,12 +0,0 @@ -*** Settings *** -Documentation Suite description -Resource ./resources/common-keywords.robot - -*** Test Cases *** -Check OSDF_SIM Docker Container - [Documentation] It checks osdf_simulator docker container is running - Verify Docker RC Status osdf_sim - -Check OSDF Docker Container - [Documentation] It checks optf-osdf docker container is running - Verify Docker RC Status optf-osdf \ No newline at end of file diff --git a/tests/optf-osdf/osdf/optf_osdf_test.robot b/tests/optf-osdf/osdf/optf_osdf_test.robot deleted file mode 100644 index 79a5750e..00000000 --- a/tests/optf-osdf/osdf/optf_osdf_test.robot +++ /dev/null @@ -1,48 +0,0 @@ -*** Settings *** -Library json -Library OperatingSystem -Resource ./resources/common-keywords.robot - -Suite Teardown Delete All Sessions - -*** Variables *** -${osdf_host} ${OSDF_HOSTNAME}:${OSDF_PORT} -&{placement_auth} = username=test password=testpwd -&{wrong_authorization} = username=test password=test -&{pci_auth}= username=pci_test password=pci_testpwd - -*** Test Cases *** -Healthcheck - [Documentation] It sends a REST GET request to healthcheck url - ${resp}= Http Get ${osdf_host} /api/oof/v1/healthcheck - Should Be Equal As Integers ${resp.status_code} 200 - -SendPlacementWithInvalidAuth - [Documentation] It sends a POST request to osdf fail authentication - ${data}= Get Binary File ${CURDIR}${/}data${/}placement_request.json - ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/placement data=${data} auth=${wrong_authorization} - ${response_json} json.loads ${resp.content} - Should Be Equal Unauthorized, check username and password ${response_json['serviceException']['text']} - Should Be Equal As Integers ${resp.status_code} 401 - -SendPlacementWithValidAuth - [Documentation] It sends a POST request to osdf with correct authentication - ${data}= Get Binary File ${CURDIR}${/}data${/}placement_request.json - ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/placement data=${data} auth=${placement_auth} - ${response_json} json.loads ${resp.content} - Should Be Equal As Integers ${resp.status_code} 202 - Should Be Equal accepted ${response_json['requestStatus']} - -SendPCIOptimizationWithAuth - [Documentation] It sends a POST request PCI Optimization service - - ${data}= Get Binary File ${CURDIR}${/}data${/}pci-opt-request.json - ${resp}= Http Post host=${osdf_host} restUrl=/api/oof/v1/pci data=${data} auth=${pci_auth} - ${response_json} json.loads ${resp.content} - Should Be Equal As Integers ${resp.status_code} 202 - Should Be Equal accepted ${response_json['requestStatus']} - - - - - diff --git a/tests/optf-osdf/osdf/resources/common-keywords.robot b/tests/optf-osdf/osdf/resources/common-keywords.robot deleted file mode 100644 index ea45f09d..00000000 --- a/tests/optf-osdf/osdf/resources/common-keywords.robot +++ /dev/null @@ -1,50 +0,0 @@ -*** Settings *** -Documentation Suite description -Library OperatingSystem -Library RequestsLibrary -Library json -Library RequestsLibrary -*** Variables *** -&{headers}= Content-Type=application/json Accept=application/json -*** Keywords *** -Verify Docker RC Status - [Documentation] Method to verify whether docker instance is up and running - [Arguments] ${process_name} - ${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} ${process_name} - -Http Get - [Documentation] Wrapper for Http GET - [Arguments] ${host} ${restUrl} - Create Session optf-osdf ${host} - ${resp}= Get Request optf-osdf ${restUrl} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - [Return] ${resp} - -Http Post - [Documentation] Wrapper for Http POST - [Arguments] ${host} ${restUrl} ${auth} ${data} - ${pci_auth}= Create List ${auth['username']} ${auth['password']} - Create Session optf-osdf ${host} headers=${headers} auth=${pci_auth} - ${resp}= Post Request optf-osdf ${restUrl} data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - [Return] ${resp} - -Http Put - [Documentation] Wrapper for Http PUT - [Arguments] ${host} ${restUrl} ${auth} ${data} - ${pci_auth}= Create List ${auth['username']} ${auth['password']} - Create Session optf-osdf ${host} headers=${headers} auth=${pci_auth} - ${resp}= Put Request optf-osdf ${restUrl} data=${data} headers=${headers} - Log To Console ********************* - Log To Console response = ${resp} - Log To Console body = ${resp.text} - [Return] ${resp} \ No newline at end of file diff --git a/tests/policy/apex-pdp/apex-pdp-test.robot b/tests/policy/apex-pdp/apex-pdp-test.robot deleted file mode 100644 index 9fdbc12e..00000000 --- a/tests/policy/apex-pdp/apex-pdp-test.robot +++ /dev/null @@ -1,58 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - -*** Test Cases *** - -Healthcheck - [Documentation] Runs Apex PDP Health check - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${APEX_IP}:6969 - ${session}= Create Session policy https://${APEX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/apex-pdp/v1/healthcheck headers=${headers} - Log Received response from policy1 ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -ExecuteApexPolicy - Wait Until Keyword Succeeds 2 min 5 sec CreatePolicy - Wait Until Keyword Succeeds 2 min 5 sec DeployPolicy - Wait Until Keyword Succeeds 4 min 10 sec RunEventOnApexEngine - -*** Keywords *** - -CreatePolicy - [Documentation] Create a new Apex policy - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policies.native.Apex.tosca.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies data=${postjson} headers=${headers} - Log Received response from policy4 ${resp.text} - ${postjsonobject} To Json ${postjson} - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${resp.json()} tosca_definitions_version - Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version - -DeployPolicy - [Documentation] Deploy the policy in apex-pdp engine - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/pdp_update.json - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers} - Log Received response from policy5 ${resp.text} - ${postjsonobject} To Json ${postjson} - Should Be Equal As Strings ${resp.status_code} 200 - -RunEventOnApexEngine - Create Session apexSession http://${APEX_IP}:23324 max_retries=1 - ${data}= Get Binary File ${CURDIR}${/}data${/}event.json - &{headers}= Create Dictionary Content-Type=application/json Accept=application/json - ${resp}= Put Request apexSession /apex/FirstConsumer/EventIn data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 diff --git a/tests/policy/apex-pdp/data/event.json b/tests/policy/apex-pdp/data/event.json deleted file mode 100644 index 9dbf2790..00000000 --- a/tests/policy/apex-pdp/data/event.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "nameSpace": "org.onap.policy.apex.sample.events", - "name": "Event0000", - "version": "0.0.1", - "source": "REST_0", - "target": "apex", - "TestSlogan": "Test slogan for External Event0", - "TestMatchCase": 3, - "TestTimestamp": 1536363522018, - "TestTemperature": 9080.866 -} diff --git a/tests/policy/apex-pdp/data/onap.policies.native.Apex.tosca.json b/tests/policy/apex-pdp/data/onap.policies.native.Apex.tosca.json deleted file mode 100644 index d90ae08d..00000000 --- a/tests/policy/apex-pdp/data/onap.policies.native.Apex.tosca.json +++ /dev/null @@ -1,7436 +0,0 @@ -{ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "topology_template": { - "policies": [ - { - "onap.policies.native.apex.Sampledomain": { - "type": "onap.policies.native.Apex", - "type_version": "1.0.0", - "version": "1.0.0", - "name": "onap.policies.native.apex.Sampledomain", - "properties": { - "engineServiceParameters": { - "name": "MyApexEngine", - "version": "0.0.1", - "id": 45, - "instanceCount": 4, - "deploymentPort": 12561, - "policy_type_impl": { - "apexPolicyModel": { - "key": { - "name": "SamplePolicyModelJAVASCRIPT", - "version": "0.0.1" - }, - "keyInformation": { - "key": { - "name": "KeyInformation", - "version": "0.0.1" - }, - "keyInfoMap": { - "entry": [ - { - "key": { - "name": "Context", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Context", - "version": "0.0.1" - }, - "UUID": "ca36bfd8-6042-3633-8c85-89c66507c3bf", - "description": "Generated description for concept referred to by key \"Context:0.0.1\"" - } - }, - { - "key": { - "name": "Event0000", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0000", - "version": "0.0.1" - }, - "UUID": "465a81cc-885f-3a4d-bc4e-1508da92b236", - "description": "Generated description for concept referred to by key \"Event0000:0.0.1\"" - } - }, - { - "key": { - "name": "Event0001", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0001", - "version": "0.0.1" - }, - "UUID": "36b2d570-fff7-3a4b-bab2-6bf492f5129a", - "description": "Generated description for concept referred to by key \"Event0001:0.0.1\"" - } - }, - { - "key": { - "name": "Event0002", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0002", - "version": "0.0.1" - }, - "UUID": "ff6160a7-fb5e-379c-a6d2-2cd28053eacf", - "description": "Generated description for concept referred to by key \"Event0002:0.0.1\"" - } - }, - { - "key": { - "name": "Event0003", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0003", - "version": "0.0.1" - }, - "UUID": "5899e216-2abf-3781-abc4-2c257b92721e", - "description": "Generated description for concept referred to by key \"Event0003:0.0.1\"" - } - }, - { - "key": { - "name": "Event0004", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0004", - "version": "0.0.1" - }, - "UUID": "7c2692a7-4587-3d09-abf9-d96b339a316f", - "description": "Generated description for concept referred to by key \"Event0004:0.0.1\"" - } - }, - { - "key": { - "name": "Event0100", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0100", - "version": "0.0.1" - }, - "UUID": "b696048c-c0b0-34c1-8dbe-32ab6c8bc0c7", - "description": "Generated description for concept referred to by key \"Event0100:0.0.1\"" - } - }, - { - "key": { - "name": "Event0101", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0101", - "version": "0.0.1" - }, - "UUID": "edbfa868-2ab2-30fd-8078-4c7f67ca6122", - "description": "Generated description for concept referred to by key \"Event0101:0.0.1\"" - } - }, - { - "key": { - "name": "Event0102", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0102", - "version": "0.0.1" - }, - "UUID": "6b6ad2ff-ef63-3f7b-aabb-fba44f8de9d4", - "description": "Generated description for concept referred to by key \"Event0102:0.0.1\"" - } - }, - { - "key": { - "name": "Event0103", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0103", - "version": "0.0.1" - }, - "UUID": "c2550912-10d9-3000-8826-377288cd6cb1", - "description": "Generated description for concept referred to by key \"Event0103:0.0.1\"" - } - }, - { - "key": { - "name": "Event0104", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0104", - "version": "0.0.1" - }, - "UUID": "f6d75b71-c8a7-3337-a121-88d68c389f5a", - "description": "Generated description for concept referred to by key \"Event0104:0.0.1\"" - } - }, - { - "key": { - "name": "Events", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Events", - "version": "0.0.1" - }, - "UUID": "0215644c-4531-375c-8335-d558b4de8c03", - "description": "Generated description for concept referred to by key \"Events:0.0.1\"" - } - }, - { - "key": { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - "UUID": "976a79e7-5c80-3c03-9503-da3f41fec395", - "description": "Generated description for concept referred to by key \"ExternalContextAlbum:0.0.1\"" - } - }, - { - "key": { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - "UUID": "c95e9e5f-d2c7-3ac7-a205-ea3574530cb7", - "description": "Generated description for concept referred to by key \"GlobalContextAlbum:0.0.1\"" - } - }, - { - "key": { - "name": "KeyInformation", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "KeyInformation", - "version": "0.0.1" - }, - "UUID": "1ff2f905-685c-3caf-95bc-0bbc90345888", - "description": "Generated description for concept referred to by key \"KeyInformation:0.0.1\"" - } - }, - { - "key": { - "name": "Policies", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policies", - "version": "0.0.1" - }, - "UUID": "f54c3b2b-be76-31c4-adfc-87c494c06808", - "description": "Generated description for concept referred to by key \"Policies:0.0.1\"" - } - }, - { - "key": { - "name": "Policy0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy0", - "version": "0.0.1" - }, - "UUID": "3410e939-30ca-32c4-a2d8-c30b6fee6eec", - "description": "Generated description for concept referred to by key \"Policy0:0.0.1\"" - } - }, - { - "key": { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - "UUID": "e27564c4-3cbf-3db2-9bf3-83ae80a2f907", - "description": "Generated description for concept referred to by key \"Policy0ContextAlbum:0.0.1\"" - } - }, - { - "key": { - "name": "Policy1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy1", - "version": "0.0.1" - }, - "UUID": "d0b2b585-f344-33b8-af9e-250e7f4cfbce", - "description": "Generated description for concept referred to by key \"Policy1:0.0.1\"" - } - }, - { - "key": { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - }, - "UUID": "815d74ae-6fc0-3221-87b9-2bb1dfdfa7f0", - "description": "Generated description for concept referred to by key \"Policy1ContextAlbum:0.0.1\"" - } - }, - { - "key": { - "name": "SamplePolicyModelJAVASCRIPT", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "SamplePolicyModelJAVASCRIPT", - "version": "0.0.1" - }, - "UUID": "bc8ee312-81ce-3c4a-92d5-4a73b8077148", - "description": "Generated description for concept referred to by key \"SamplePolicyModelJAVASCRIPT:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "UUID": "0589ff20-adcc-3ce5-95fe-8d7978ed54ed", - "description": "Generated description for concept referred to by key \"Task_Act0:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "UUID": "095b126d-ca8b-32c9-ad52-d744e817a79c", - "description": "Generated description for concept referred to by key \"Task_Act1:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "UUID": "3d786b4c-d9ee-3367-ab71-c67271a4ea2f", - "description": "Generated description for concept referred to by key \"Task_Act2:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "UUID": "9231753e-20c5-3436-982f-9100340cc570", - "description": "Generated description for concept referred to by key \"Task_Act3:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "UUID": "502383d3-483f-3a56-a426-2f0406674c8d", - "description": "Generated description for concept referred to by key \"Task_Decide0:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "UUID": "16598106-41c8-3b5a-99c6-5fcf6d1a5ddf", - "description": "Generated description for concept referred to by key \"Task_Decide1:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "UUID": "ad3a89f5-e369-3c66-b22c-669f7b3653b8", - "description": "Generated description for concept referred to by key \"Task_Decide2:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "UUID": "56815939-1164-3867-9ed1-0a27ff8aafb3", - "description": "Generated description for concept referred to by key \"Task_Decide3:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "UUID": "0db0c566-ecd7-3e27-9865-4b82c893abdb", - "description": "Generated description for concept referred to by key \"Task_Establish0:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "UUID": "6944a4c1-6201-317c-8d7e-eaa7f2ee0ea0", - "description": "Generated description for concept referred to by key \"Task_Establish1:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "UUID": "0f766ea9-11cd-3e7d-a8c8-28c8dee6a85a", - "description": "Generated description for concept referred to by key \"Task_Establish2:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "UUID": "c3237a38-cc6d-3418-b1e1-0dc8b4bdcc66", - "description": "Generated description for concept referred to by key \"Task_Establish3:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "UUID": "051bcfd5-cf73-3c89-8ee7-ea6e005ec059", - "description": "Generated description for concept referred to by key \"Task_Match0:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "UUID": "3754fe19-98f2-34a1-9f45-db31052208d8", - "description": "Generated description for concept referred to by key \"Task_Match1:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "UUID": "8c200709-a180-3c8b-916f-275ff49ce194", - "description": "Generated description for concept referred to by key \"Task_Match2:0.0.1\"" - } - }, - { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "UUID": "a1a879c6-4510-33b0-bbd0-ad6256189a37", - "description": "Generated description for concept referred to by key \"Task_Match3:0.0.1\"" - } - }, - { - "key": { - "name": "Tasks", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Tasks", - "version": "0.0.1" - }, - "UUID": "a7fab96b-ce1c-37ce-bbb2-556b6db524a5", - "description": "Generated description for concept referred to by key \"Tasks:0.0.1\"" - } - }, - { - "key": { - "name": "TestCase", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestCase", - "version": "0.0.1" - }, - "UUID": "0a652886-c88d-3f8c-8994-ae9161e7c963", - "description": "Generated description for concept referred to by key \"TestCase:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem000", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem000", - "version": "0.0.1" - }, - "UUID": "8efba9fa-371e-33df-a7d6-88b0284e7fd0", - "description": "Generated description for concept referred to by key \"TestContextItem000:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem001", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem001", - "version": "0.0.1" - }, - "UUID": "3740077c-a2b3-356b-81dc-5ded2118a951", - "description": "Generated description for concept referred to by key \"TestContextItem001:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem002", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem002", - "version": "0.0.1" - }, - "UUID": "b5c7df95-9af5-322f-9ea8-eb440a2bf926", - "description": "Generated description for concept referred to by key \"TestContextItem002:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem003", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem003", - "version": "0.0.1" - }, - "UUID": "b36f0aa5-0fb9-3e2c-8fa2-fddb7fd05f4b", - "description": "Generated description for concept referred to by key \"TestContextItem003:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem004", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem004", - "version": "0.0.1" - }, - "UUID": "093cda11-eaeb-3a46-a5b6-d5e30c00935b", - "description": "Generated description for concept referred to by key \"TestContextItem004:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem005", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem005", - "version": "0.0.1" - }, - "UUID": "569a758d-ba40-37c0-aebb-7ad138df25ac", - "description": "Generated description for concept referred to by key \"TestContextItem005:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem006", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem006", - "version": "0.0.1" - }, - "UUID": "252818d9-b61f-3962-a905-8865fb00fb04", - "description": "Generated description for concept referred to by key \"TestContextItem006:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem007", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem007", - "version": "0.0.1" - }, - "UUID": "fe1a5f7c-c083-377b-a797-752b01fc6c73", - "description": "Generated description for concept referred to by key \"TestContextItem007:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem008", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem008", - "version": "0.0.1" - }, - "UUID": "aa87d007-d07e-3f67-8c6d-0ebc3d85479d", - "description": "Generated description for concept referred to by key \"TestContextItem008:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem009", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem009", - "version": "0.0.1" - }, - "UUID": "126e7a3a-11b6-3f88-9397-c21d8819f859", - "description": "Generated description for concept referred to by key \"TestContextItem009:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem00A", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00A", - "version": "0.0.1" - }, - "UUID": "0e0e3dec-e03d-3379-a87b-1ecd4aa3d8cc", - "description": "Generated description for concept referred to by key \"TestContextItem00A:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem00B", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00B", - "version": "0.0.1" - }, - "UUID": "dbdc98df-3ff4-360c-b8d3-a7a836ac3de6", - "description": "Generated description for concept referred to by key \"TestContextItem00B:0.0.1\"" - } - }, - { - "key": { - "name": "TestContextItem00C", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00C", - "version": "0.0.1" - }, - "UUID": "32a2f355-77f3-3b25-ace6-7a9c5763a5ad", - "description": "Generated description for concept referred to by key \"TestContextItem00C:0.0.1\"" - } - }, - { - "key": { - "name": "TestDatatypes", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestDatatypes", - "version": "0.0.1" - }, - "UUID": "3f95472c-973e-30e2-95f1-bf00cbef909a", - "description": "Generated description for concept referred to by key \"TestDatatypes:0.0.1\"" - } - }, - { - "key": { - "name": "TestExternalContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestExternalContextItem", - "version": "0.0.1" - }, - "UUID": "610dbbd4-9149-3b3c-9af4-819056f0e169", - "description": "Generated description for concept referred to by key \"TestExternalContextItem:0.0.1\"" - } - }, - { - "key": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - }, - "UUID": "07fa8f68-55f1-3fd0-81c1-749a379753a7", - "description": "Generated description for concept referred to by key \"TestGlobalContextItem:0.0.1\"" - } - }, - { - "key": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - }, - "UUID": "d9c93cd1-539e-35c5-aaec-bb711ceb1251", - "description": "Generated description for concept referred to by key \"TestPolicyContextItem:0.0.1\"" - } - }, - { - "key": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "UUID": "683fe492-7eae-3ac7-9924-bb7850208d05", - "description": "Generated description for concept referred to by key \"TestSlogan:0.0.1\"" - } - }, - { - "key": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "UUID": "bba25b6f-e3cd-3060-9022-4ef3a79f8eb0", - "description": "Generated description for concept referred to by key \"TestTemperature:0.0.1\"" - } - }, - { - "key": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "UUID": "97b73937-c344-33c0-924c-4d26b6449564", - "description": "Generated description for concept referred to by key \"TestTimestamp:0.0.1\"" - } - } - ] - } - }, - "policies": { - "key": { - "name": "Policies", - "version": "0.0.1" - }, - "policyMap": { - "entry": [ - { - "key": { - "name": "Policy0", - "version": "0.0.1" - }, - "value": { - "policyKey": { - "name": "Policy0", - "version": "0.0.1" - }, - "template": "MEDA", - "state": { - "entry": [ - { - "key": "Act", - "value": { - "stateKey": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Act" - }, - "trigger": { - "name": "Event0003", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Act_NULL", - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - }, - "outgoingEvent": { - "name": "Event0004", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "NULL", - "parentKeyVersion": "0.0.0", - "parentLocalName": "NULL", - "localName": "NULL" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.subject.defaultTaskKey.copyTo(executor.selectedTask)\n\ntrue;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act0_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act1_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act2_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act3_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - } - ] - } - } - }, - { - "key": "Decide", - "value": { - "stateKey": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Decide" - }, - "trigger": { - "name": "Event0002", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Decide_Act", - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - }, - "outgoingEvent": { - "name": "Event0003", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Act" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.subject.defaultTaskKey.copyTo(executor.selectedTask)\n\ntrue;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide0_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide1_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide2_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide3_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - } - ] - } - } - }, - { - "key": "Establish", - "value": { - "stateKey": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Establish" - }, - "trigger": { - "name": "Event0001", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Establish_Decide", - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - }, - "outgoingEvent": { - "name": "Event0002", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Decide" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.subject.defaultTaskKey.copyTo(executor.selectedTask)\n\ntrue;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish0_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish1_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish2_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish3_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - } - ] - } - } - }, - { - "key": "Match", - "value": { - "stateKey": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Match" - }, - "trigger": { - "name": "Event0000", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Match_Establish", - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - }, - "outgoingEvent": { - "name": "Event0001", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Establish" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.subject.defaultTaskKey.copyTo(executor.selectedTask)\n\ntrue;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match0_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match1_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match2_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match3_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - } - ] - } - } - } - ] - }, - "firstState": "Match" - } - }, - { - "key": { - "name": "Policy1", - "version": "0.0.1" - }, - "value": { - "policyKey": { - "name": "Policy1", - "version": "0.0.1" - }, - "template": "MEDA", - "state": { - "entry": [ - { - "key": "Act", - "value": { - "stateKey": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Act" - }, - "trigger": { - "name": "Event0103", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Act_NULL", - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - }, - "outgoingEvent": { - "name": "Event0104", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "NULL", - "parentKeyVersion": "0.0.0", - "parentLocalName": "NULL", - "localName": "NULL" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.subject.defaultTaskKey.copyTo(executor.selectedTask)\n\ntrue;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act0_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act1_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act2_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - }, - { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Task_Act3_DIRECT_Act_NULL" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Act", - "localName": "Act_NULL" - } - } - } - ] - } - } - }, - { - "key": "Decide", - "value": { - "stateKey": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Decide" - }, - "trigger": { - "name": "Event0102", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Decide_Act", - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - }, - "outgoingEvent": { - "name": "Event0103", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Act" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.subject.defaultTaskKey.copyTo(executor.selectedTask)\n\ntrue;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide0_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide1_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide2_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - }, - { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Task_Decide3_DIRECT_Decide_Act" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Decide", - "localName": "Decide_Act" - } - } - } - ] - } - } - }, - { - "key": "Establish", - "value": { - "stateKey": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Establish" - }, - "trigger": { - "name": "Event0101", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Establish_Decide", - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - }, - "outgoingEvent": { - "name": "Event0102", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Decide" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.subject.defaultTaskKey.copyTo(executor.selectedTask)\n\ntrue;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish0_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish1_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish2_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - }, - { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Task_Establish3_DIRECT_Establish_Decide" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Establish", - "localName": "Establish_Decide" - } - } - } - ] - } - } - }, - { - "key": "Match", - "value": { - "stateKey": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Match" - }, - "trigger": { - "name": "Event0100", - "version": "0.0.1" - }, - "stateOutputs": { - "entry": [ - { - "key": "Match_Establish", - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - }, - "outgoingEvent": { - "name": "Event0101", - "version": "0.0.1" - }, - "nextState": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Establish" - } - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskSelectionLogic": { - "key": "TaskSelectionLigic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.subject.defaultTaskKey.copyTo(executor.selectedTask)\n\ntrue;" - }, - "stateFinalizerLogicMap": { - "entry": [] - }, - "defaultTask": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "taskReferences": { - "entry": [ - { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match0_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match1_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match2_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - }, - { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "value": { - "key": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Task_Match3_DIRECT_Match_Establish" - }, - "outputType": "DIRECT", - "output": { - "parentKeyName": "Policy1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "Match", - "localName": "Match_Establish" - } - } - } - ] - } - } - } - ] - }, - "firstState": "Match" - } - } - ] - } - }, - "tasks": { - "key": { - "name": "Tasks", - "version": "0.0.1" - }, - "taskMap": { - "entry": [ - { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act0", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Act0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Act0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - }, - { - "key": "Parameter2", - "value": { - "key": { - "parentKeyName": "Task_Act0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter2" - }, - "defaultValue": "DefaultValue2" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestActCaseSelected\", new caseSelectedType(2));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestActStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act1", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Act1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Act1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestActCaseSelected\", new caseSelectedType(3));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestActStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act2", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Act2", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestActCaseSelected\", new caseSelectedType(0));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestActStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Act3", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Act3", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestActCaseSelected\", new caseSelectedType(1));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestActStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide0", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Decide0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Decide0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - }, - { - "key": "Parameter2", - "value": { - "key": { - "parentKeyName": "Task_Decide0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter2" - }, - "defaultValue": "DefaultValue2" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestDecideCaseSelected\", new caseSelectedType(2));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestDecideStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide1", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Decide1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Decide1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestDecideCaseSelected\", new caseSelectedType(3));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestDecideStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide2", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Decide2", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestDecideCaseSelected\", new caseSelectedType(0));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestDecideStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Decide3", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Decide3", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestDecideCaseSelected\", new caseSelectedType(1));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestDecideStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish0", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Establish0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Establish0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - }, - { - "key": "Parameter2", - "value": { - "key": { - "parentKeyName": "Task_Establish0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter2" - }, - "defaultValue": "DefaultValue2" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestEstablishCaseSelected\", new caseSelectedType(2));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestEstablishStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish1", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Establish1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Establish1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestEstablishCaseSelected\", new caseSelectedType(3));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestEstablishStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish2", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Establish2", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestEstablishCaseSelected\", new caseSelectedType(0));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestEstablishStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Establish3", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Establish3", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestEstablishCaseSelected\", new caseSelectedType(1));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestEstablishStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match0", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Match0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Match0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - }, - { - "key": "Parameter2", - "value": { - "key": { - "parentKeyName": "Task_Match0", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter2" - }, - "defaultValue": "DefaultValue2" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestMatchCaseSelected\", new caseSelectedType(2));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestMatchStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match1", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Match1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - }, - { - "key": "Parameter1", - "value": { - "key": { - "parentKeyName": "Task_Match1", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter1" - }, - "defaultValue": "DefaultValue1" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestMatchCaseSelected\", new caseSelectedType(3));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestMatchStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match2", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Match2", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestMatchCaseSelected\", new caseSelectedType(0));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestMatchStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - }, - { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Task_Match3", - "version": "0.0.1" - }, - "inputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - }, - "taskParameters": { - "entry": [ - { - "key": "Parameter0", - "value": { - "key": { - "parentKeyName": "Task_Match3", - "parentKeyVersion": "0.0.1", - "parentLocalName": "NULL", - "localName": "Parameter0" - }, - "defaultValue": "DefaultValue0" - } - } - ] - }, - "contextAlbumReference": [ - { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - { - "name": "GlobalContextAlbum", - "version": "0.0.1" - } - ], - "taskLogic": { - "key": "_TaskLogic", - "logicFlavour": "JAVASCRIPT", - "logic": "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nexecutor.logger.debug(executor.subject.id);\nvar gc = executor.getContextAlbum(\"GlobalContextAlbum\");\nexecutor.logger.debug(gc.name);\nexecutor.logger.debug(executor.inFields);\n\nvar caseSelectedType = java.lang.Byte;\nexecutor.outFields.put(\"TestMatchCaseSelected\", new caseSelectedType(1));\n\nvar JavaDate = java.util.Date;\ntimeNow = new JavaDate();\nexecutor.outFields.put(\"TestMatchStateTime\", timeNow.getTime());\nexecutor.logger.debug(executor.eo);\n\ntrue;" - } - } - } - ] - } - }, - "events": { - "key": { - "name": "Events", - "version": "0.0.1" - }, - "eventMap": { - "entry": [ - { - "key": { - "name": "Event0000", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0000", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Outside", - "target": "Match", - "parameter": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0001", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0001", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Match", - "target": "Establish", - "parameter": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0002", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0002", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Establish", - "target": "Decide", - "parameter": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0003", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0003", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Decide", - "target": "Act", - "parameter": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0004", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0004", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Act", - "target": "Outside", - "parameter": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0100", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0100", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Outside", - "target": "Match", - "parameter": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0101", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0101", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Match", - "target": "Establish", - "parameter": { - "entry": [ - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0102", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0102", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Establish", - "target": "Decide", - "parameter": { - "entry": [ - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0103", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0103", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Decide", - "target": "Act", - "parameter": { - "entry": [ - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - }, - { - "key": { - "name": "Event0104", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Event0104", - "version": "0.0.1" - }, - "nameSpace": "org.onap.policy.apex.sample.events", - "source": "Act", - "target": "Outside", - "parameter": { - "entry": [ - { - "key": "TestActCaseSelected", - "value": { - "key": "TestActCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestActStateTime", - "value": { - "key": "TestActStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideCaseSelected", - "value": { - "key": "TestDecideCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestDecideStateTime", - "value": { - "key": "TestDecideStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishCaseSelected", - "value": { - "key": "TestEstablishCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestEstablishStateTime", - "value": { - "key": "TestEstablishStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCase", - "value": { - "key": "TestMatchCase", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchCaseSelected", - "value": { - "key": "TestMatchCaseSelected", - "fieldSchemaKey": { - "name": "TestCase", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestMatchStateTime", - "value": { - "key": "TestMatchStateTime", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestSlogan", - "value": { - "key": "TestSlogan", - "fieldSchemaKey": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTemperature", - "value": { - "key": "TestTemperature", - "fieldSchemaKey": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "optional": false - } - }, - { - "key": "TestTimestamp", - "value": { - "key": "TestTimestamp", - "fieldSchemaKey": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "optional": false - } - } - ] - } - } - } - ] - } - }, - "albums": { - "key": { - "name": "Context", - "version": "0.0.1" - }, - "albums": { - "entry": [ - { - "key": { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "ExternalContextAlbum", - "version": "0.0.1" - }, - "scope": "EXTERNAL", - "isWritable": false, - "itemSchema": { - "name": "TestExternalContextItem", - "version": "0.0.1" - } - } - }, - { - "key": { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "GlobalContextAlbum", - "version": "0.0.1" - }, - "scope": "GLOBAL", - "isWritable": true, - "itemSchema": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - } - } - }, - { - "key": { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy0ContextAlbum", - "version": "0.0.1" - }, - "scope": "APPLICATION", - "isWritable": true, - "itemSchema": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - } - } - }, - { - "key": { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "Policy1ContextAlbum", - "version": "0.0.1" - }, - "scope": "APPLICATION", - "isWritable": true, - "itemSchema": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - } - } - } - ] - } - }, - "schemas": { - "key": { - "name": "TestDatatypes", - "version": "0.0.1" - }, - "schemas": { - "entry": [ - { - "key": { - "name": "TestCase", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestCase", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "java.lang.Byte" - } - }, - { - "key": { - "name": "TestContextItem000", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem000", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem000" - } - }, - { - "key": { - "name": "TestContextItem001", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem001", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem001" - } - }, - { - "key": { - "name": "TestContextItem002", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem002", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem002" - } - }, - { - "key": { - "name": "TestContextItem003", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem003", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem003" - } - }, - { - "key": { - "name": "TestContextItem004", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem004", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem004" - } - }, - { - "key": { - "name": "TestContextItem005", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem005", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem005" - } - }, - { - "key": { - "name": "TestContextItem006", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem006", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem006" - } - }, - { - "key": { - "name": "TestContextItem007", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem007", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem007" - } - }, - { - "key": { - "name": "TestContextItem008", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem008", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem008" - } - }, - { - "key": { - "name": "TestContextItem009", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem009", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem009" - } - }, - { - "key": { - "name": "TestContextItem00A", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00A", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem00A" - } - }, - { - "key": { - "name": "TestContextItem00B", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00B", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem00B" - } - }, - { - "key": { - "name": "TestContextItem00C", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestContextItem00C", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestContextItem00C" - } - }, - { - "key": { - "name": "TestExternalContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestExternalContextItem", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestExternalContextItem" - } - }, - { - "key": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestGlobalContextItem", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestGlobalContextItem" - } - }, - { - "key": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestPolicyContextItem", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "org.onap.policy.apex.context.test.concepts.TestPolicyContextItem" - } - }, - { - "key": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestSlogan", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "java.lang.String" - } - }, - { - "key": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestTemperature", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "java.lang.Double" - } - }, - { - "key": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "value": { - "key": { - "name": "TestTimestamp", - "version": "0.0.1" - }, - "schemaFlavour": "Java", - "schemaDefinition": "java.lang.Long" - } - } - ] - } - } - } - }, - "engineParameters": { - "executorParameters": { - "JAVASCRIPT": { - "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters" - } - } - } - }, - "eventInputParameters": { - "FirstConsumer": { - "carrierTechnologyParameters": { - "carrierTechnology": "RESTSERVER", - "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restserver.RestServerCarrierTechnologyParameters", - "parameters": { - "standalone": true, - "host": "0.0.0.0", - "port": 23324 - } - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousMode": true, - "synchronousPeer": "FirstProducer", - "synchronousTimeout": 2000 - } - }, - "eventOutputParameters": { - "FirstProducer": { - "carrierTechnologyParameters": { - "carrierTechnology": "RESTSERVER", - "parameterClassName": "org.onap.policy.apex.plugins.event.carrier.restserver.RestServerCarrierTechnologyParameters" - }, - "eventProtocolParameters": { - "eventProtocol": "JSON" - }, - "synchronousMode": true, - "synchronousPeer": "FirstConsumer", - "synchronousTimeout": 2000 - } - } - } - } - } - ] - } -} diff --git a/tests/policy/apex-pdp/data/pdp_update.json b/tests/policy/apex-pdp/data/pdp_update.json deleted file mode 100644 index 51c3573d..00000000 --- a/tests/policy/apex-pdp/data/pdp_update.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "groups": [ - { - "name": "defaultGroup", - "deploymentSubgroups": [ - { - "pdpType": "apex", - "action": "POST", - "policies": [{ - "name": "onap.policies.native.apex.Sampledomain", - "version": "1.0.0" - }] - } - ] - } - ] -} diff --git a/tests/policy/api/api-test.robot b/tests/policy/api/api-test.robot deleted file mode 100644 index 2f5c6972..00000000 --- a/tests/policy/api/api-test.robot +++ /dev/null @@ -1,204 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - -*** Test Cases *** -Healthcheck - [Documentation] Runs Policy Api Health check - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -Statistics - [Documentation] Runs Policy Api Statistics - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/api/v1/statistics headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -RetrievePolicyTypes - [Documentation] Gets Policy Types - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/api/v1/policytypes headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['version']} 1.0.0 - -CreateTCAPolicyTypeV1 - [Documentation] Create TCA Policy Type Version 1. Trying to create an existing policy type with any change and same version should cause error. - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.tcagen2.v1.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 406 - -CreateTCAPolicyTypeV2 - [Documentation] Create TCA Policy Type Version 2 - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.tcagen2.v2.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${postjsonobject} To Json ${postjson} - Dictionary Should Contain Key ${resp.json()} tosca_definitions_version - Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version - -RetrieveMonitoringPolicyTypes - [Documentation] Retrieve Monitoring related Policy Types - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/api/v1/policytypes/onap.policies.Monitoring headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - List Should Contain Value ${resp.json()['policy_types']} onap.policies.Monitoring - - -CreateNewMonitoringPolicyV1 - [Documentation] Create a new Monitoring TCA policy version 1 - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - ${postjsonobject} To Json ${postjson} - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} onap.restart.tca - Dictionary Should Contain Key ${postjsonobject['topology_template']['policies'][0]} onap.restart.tca - -SimpleCreateNewMonitoringPolicyV1 - [Documentation] Create a new Monitoring TCA policiy version 1 using simple endpoint. Trying to create an existing policy with any change and same version should cause error. - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.v1_2.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policies data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 406 - -SimpleCreateNewMonitoringPolicyV2 - [Documentation] Create a new Monitoring TCA policiy version 2 using simple endpoint - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.v2.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policies data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - ${postjsonobject} To Json ${postjson} - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} onap.restart.tca - Dictionary Should Contain Key ${postjsonobject['topology_template']['policies'][0]} onap.restart.tca - -RetrievePoliciesOfType - [Documentation] Retrieve all Policies Created for a specific Policy Type - ${auth}= Create List healthcheck zb!XztG34 - ${expjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies headers=${headers} - Log Received response from policy ${resp.text} - ${expjsonobject} To Json ${expjson} - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} onap.restart.tca - Dictionary Should Contain Key ${expjsonobject['topology_template']['policies'][0]} onap.restart.tca - -RetrieveAllPolicies - [Documentation] Retrieve all Policies - ${auth}= Create List healthcheck zb!XztG34 - ${expjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/api/v1/policies headers=${headers} - Log Received response from policy ${resp.text} - ${expjsonobject} To Json ${expjson} - Should Be Equal As Strings ${resp.status_code} 200 - Should Contain ${expjsonobject['topology_template']['policies'][0]} onap.restart.tca - -RetrieveSpecificPolicy - [Documentation] Retrieve a specific Policy named 'onap.restart.tca' and version '1.0.0' - ${auth}= Create List healthcheck zb!XztG34 - ${expjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/api/v1/policies/onap.restart.tca/versions/1.0.0/ headers=${headers} - Log Received response from policy ${resp.text} - ${expjsonobject} To Json ${expjson} - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} onap.restart.tca - Dictionary Should Contain Key ${expjsonobject['topology_template']['policies'][0]} onap.restart.tca - -DeleteSpecificPolicy - [Documentation] Delete a specific Policy named 'onap.restart.tca' and version '1.0.0' - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policies/onap.restart.tca/versions/1.0.0 headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${resp}= Delete Request policy /policy/api/v1/policies/onap.restart.tca/versions/1.0.0 headers=${headers} - Should Be Equal As Strings ${resp.status_code} 404 - -DeleteSpecificPolicyV2 - [Documentation] Delete the Monitoring Policy Version 2 of the TCA Policy Type - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers} - Should Be Equal As Strings ${resp.status_code} 404 - -DeleteSpecificPolicyTypeV1 - [Documentation] Delete the TCA Policy Type Version 1 - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0 headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0 headers=${headers} - Should Be Equal As Strings ${resp.status_code} 404 - -DeleteSpecificPolicyTypeV2 - [Documentation] Delete the TCA Policy Type Version 2 - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 headers=${headers} - Should Be Equal As Strings ${resp.status_code} 404 diff --git a/tests/policy/api/data/onap.policy.monitoring.tcagen2.v1.json b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v1.json deleted file mode 100644 index a2e2ddc9..00000000 --- a/tests/policy/api/data/onap.policy.monitoring.tcagen2.v1.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "policy_types": { - "onap.policies.Monitoring": { - "derived_from": "tosca.policies.Root", - "version": "1.0.0", - "description": "a base policy type for all policies that governs monitoring provisioning" - }, - "onap.policies.monitoring.tcagen2": { - "derived_from": "onap.policies.Monitoring", - "version": "1.0.0", - "properties": { - "tca.policy": { - "type": "onap.datatypes.monitoring.tca_policy", - "description": "TCA Policy JSON" - } - } - } - }, - "data_types": { - "onap.datatypes.monitoring.metricsPerEventName": { - "derived_from": "tosca.datatypes.Root", - "properties": { - "controlLoopSchemaType": { - "type": "string", - "required": true, - "description": "Specifies Control Loop Schema Type for the event Name e.g. VNF, VM", - "constraints": [ - { - "valid_values": [ - "VM", - "VNF" - ] - } - ] - }, - "eventName": { - "type": "string", - "required": true, - "description": "Event name to which thresholds need to be applied" - }, - "policyName": { - "type": "string", - "required": true, - "description": "TCA Policy Scope Name" - }, - "policyScope": { - "type": "string", - "required": true, - "description": "TCA Policy Scope" - }, - "policyVersion": { - "type": "string", - "required": true, - "description": "TCA Policy Scope Version" - }, - "thresholds": { - "type": "list", - "required": true, - "description": "Thresholds associated with eventName", - "entry_schema": { - "type": "onap.datatypes.monitoring.thresholds" - } - } - } - }, - "onap.datatypes.monitoring.tca_policy": { - "derived_from": "tosca.datatypes.Root", - "properties": { - "domain": { - "type": "string", - "required": true, - "description": "Domain name to which TCA needs to be applied", - "default": "measurementsForVfScaling", - "constraints": [ - { - "equal": "measurementsForVfScaling" - } - ] - }, - "metricsPerEventName": { - "type": "list", - "required": true, - "description": "Contains eventName and threshold details that need to be applied to given eventName", - "entry_schema": { - "type": "onap.datatypes.monitoring.metricsPerEventName" - } - } - } - }, - "onap.datatypes.monitoring.thresholds": { - "derived_from": "tosca.datatypes.Root", - "properties": { - "closedLoopControlName": { - "type": "string", - "required": true, - "description": "Closed Loop Control Name associated with the threshold" - }, - "closedLoopEventStatus": { - "type": "string", - "required": true, - "description": "Closed Loop Event Status of the threshold", - "constraints": [ - { - "valid_values": [ - "ONSET", - "ABATED" - ] - } - ] - }, - "direction": { - "type": "string", - "required": true, - "description": "Direction of the threshold", - "constraints": [ - { - "valid_values": [ - "LESS", - "LESS_OR_EQUAL", - "GREATER", - "GREATER_OR_EQUAL", - "EQUAL" - ] - } - ] - }, - "fieldPath": { - "type": "string", - "required": true, - "description": "Json field Path as per CEF message which needs to be analyzed for TCA", - "constraints": [ - { - "valid_values": [ - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage", - "$.event.measurementsForVfScalingFields.meanRequestLatency", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed", - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value" - ] - } - ] - }, - "severity": { - "type": "string", - "required": true, - "description": "Threshold Event Severity", - "constraints": [ - { - "valid_values": [ - "CRITICAL", - "MAJOR", - "MINOR", - "WARNING", - "NORMAL" - ] - } - ] - }, - "thresholdValue": { - "type": "integer", - "required": true, - "description": "Threshold value for the field Path inside CEF message" - }, - "version": { - "type": "string", - "required": true, - "description": "Version number associated with the threshold" - } - } - } - } -} diff --git a/tests/policy/api/data/onap.policy.monitoring.tcagen2.v2.json b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v2.json deleted file mode 100644 index d86749ef..00000000 --- a/tests/policy/api/data/onap.policy.monitoring.tcagen2.v2.json +++ /dev/null @@ -1,206 +0,0 @@ -{ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "policy_types": { - "onap.policies.monitoring.tcagen2": { - "derived_from": "onap.policies.Monitoring", - "version": "2.0.0", - "properties": { - "tca.policy": { - "type": "onap.datatypes.monitoring.tca_policy", - "description": "TCA Policy JSON" - } - } - } - }, - "data_types": { - "onap.datatypes.monitoring.metricsPerEventName": { - "derived_from": "tosca.datatypes.Root", - "properties": { - "controlLoopSchemaType": { - "type": "string", - "required": true, - "description": "Specifies Control Loop Schema Type for the event Name e.g. VNF, VM", - "constraints": [ - { - "valid_values": [ - "VM", - "VNF" - ] - } - ] - }, - "eventName": { - "type": "string", - "required": true, - "description": "Event name to which thresholds need to be applied" - }, - "policyName": { - "type": "string", - "required": true, - "description": "TCA Policy Scope Name" - }, - "policyScope": { - "type": "string", - "required": true, - "description": "TCA Policy Scope" - }, - "policyVersion": { - "type": "string", - "required": true, - "description": "TCA Policy Scope Version" - }, - "thresholds": { - "type": "list", - "required": true, - "description": "Thresholds associated with eventName", - "entry_schema": { - "type": "onap.datatypes.monitoring.thresholds" - } - } - } - }, - "onap.datatypes.monitoring.tca_policy": { - "derived_from": "tosca.datatypes.Root", - "properties": { - "domain": { - "type": "string", - "required": true, - "description": "Domain name to which TCA needs to be applied", - "default": "measurementsForVfScaling", - "constraints": [ - { - "equal": "measurementsForVfScaling" - } - ] - }, - "metricsPerEventName": { - "type": "list", - "required": true, - "description": "Contains eventName and threshold details that need to be applied to given eventName", - "entry_schema": { - "type": "onap.datatypes.monitoring.metricsPerEventName" - } - } - } - }, - "onap.datatypes.monitoring.thresholds": { - "derived_from": "tosca.datatypes.Root", - "properties": { - "closedLoopControlName": { - "type": "string", - "required": true, - "description": "Closed Loop Control Name associated with the threshold" - }, - "closedLoopEventStatus": { - "type": "string", - "required": true, - "description": "Closed Loop Event Status of the threshold", - "constraints": [ - { - "valid_values": [ - "ONSET", - "ABATED" - ] - } - ] - }, - "direction": { - "type": "string", - "required": true, - "description": "Direction of the threshold", - "constraints": [ - { - "valid_values": [ - "LESS", - "LESS_OR_EQUAL", - "GREATER", - "GREATER_OR_EQUAL", - "EQUAL" - ] - } - ] - }, - "fieldPath": { - "type": "string", - "required": true, - "description": "Json field Path as per CEF message which needs to be analyzed for TCA", - "constraints": [ - { - "valid_values": [ - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait", - "$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage", - "$.event.measurementsForVfScalingFields.meanRequestLatency", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree", - "$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed", - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value" - ] - } - ] - }, - "severity": { - "type": "string", - "required": true, - "description": "Threshold Event Severity", - "constraints": [ - { - "valid_values": [ - "CRITICAL", - "MAJOR", - "MINOR", - "WARNING", - "NORMAL" - ] - } - ] - }, - "thresholdValue": { - "type": "integer", - "required": true, - "description": "Threshold value for the field Path inside CEF message" - }, - "version": { - "type": "string", - "required": true, - "description": "Version number associated with the threshold" - } - } - } - } -} diff --git a/tests/policy/distribution/data/event.json b/tests/policy/distribution/data/event.json deleted file mode 100644 index 9dbf2790..00000000 --- a/tests/policy/distribution/data/event.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "nameSpace": "org.onap.policy.apex.sample.events", - "name": "Event0000", - "version": "0.0.1", - "source": "REST_0", - "target": "apex", - "TestSlogan": "Test slogan for External Event0", - "TestMatchCase": 3, - "TestTimestamp": 1536363522018, - "TestTemperature": 9080.866 -} diff --git a/tests/policy/distribution/distribution-test.robot b/tests/policy/distribution/distribution-test.robot deleted file mode 100644 index 2b1c6d64..00000000 --- a/tests/policy/distribution/distribution-test.robot +++ /dev/null @@ -1,45 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - -*** Test Cases *** - -Healthcheck - [Documentation] Runs Policy Distribution Health check - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_DISTRIBUTION_IP}:6969 - ${session}= Create Session policy https://${POLICY_DISTRIBUTION_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /healthcheck headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -Statistics - [Documentation] Runs Policy Distribution Statistics - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_DISTRIBUTION_IP}:6969 - ${session}= Create Session policy https://${POLICY_DISTRIBUTION_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /statistics headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -InvokeDistributionAndRunEventOnEngine - Wait Until Keyword Succeeds 5 min 30 sec InvokeDistributionUsingFile And RunEventOnApexEngine - -*** Keywords *** - -InvokeDistributionUsingFile And RunEventOnApexEngine - Copy File ${SCRIPT_DIR}/config/distribution/csar/csar_temp.csar ${SCRIPT_DIR}/config/distribution/csar/temp.csar - Move File ${SCRIPT_DIR}/config/distribution/csar/temp.csar ${SCRIPT_DIR}/config/distribution/temp/sample_csar_with_apex_policy.csar - Sleep 20 seconds "Waiting for the Policy Distribution to call Policy API and PAP" - Create Session apexSession http://${APEX_IP}:23324 max_retries=1 - ${data}= Get Binary File ${CURDIR}${/}data${/}event.json - &{headers}= Create Dictionary Content-Type=application/json Accept=application/json - ${resp}= Put Request apexSession /apex/FirstConsumer/EventIn data=${data} headers=${headers} - Should Be Equal As Strings ${resp.status_code} 200 - Remove Files ${SCRIPT_DIR}/config/distribution/temp/sample_csar_with_apex_policy.csar diff --git a/tests/policy/drools-applications/drools-applications-test.robot b/tests/policy/drools-applications/drools-applications-test.robot deleted file mode 100644 index 0b73ccf8..00000000 --- a/tests/policy/drools-applications/drools-applications-test.robot +++ /dev/null @@ -1,275 +0,0 @@ -*** Settings *** -Library Collections -Library String -Library RequestsLibrary -Library OperatingSystem -Library Process -Library json - -*** Test Cases *** -Alive - [Documentation] Runs Policy PDP Alive Check - ${auth}= Create List demo@people.osaaf.org demo123456! - Log Creating session https://${DROOLS_IP}:9696 - ${session}= Create Session policy https://${DROOLS_IP}:9696 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdp/engine headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['alive']} True - -Healthcheck - [Documentation] Runs Policy PDP-D Health check - ${auth}= Create List demo@people.osaaf.org demo123456! - Log Creating session https://${DROOLS_IP}:6969/healthcheck - ${session}= Create Session policy https://${DROOLS_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /healthcheck headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['healthy']} True - -Controller - [Documentation] Checks controller is up - ${auth}= Create List demo@people.osaaf.org demo123456! - Log Creating session https://${DROOLS_IP}:9696 - ${session}= Create Session policy https://${DROOLS_IP}:9696 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdp/engine/controllers/usecases/drools/facts headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['usecases']} 0 - -MakeTopics - [Documentation] Creates the Policy topics - ${result}= Run Process ${SCR2}/make_topic.sh POLICY-PDP-PAP - Should Be Equal As Integers ${result.rc} 0 - ${result}= Run Process ${SCR2}/make_topic.sh POLICY-CL-MGT - Should Be Equal As Integers ${result.rc} 0 - -CreateVcpeXacmlPolicy - [Documentation] Create VCPE Policy for Xacml - ${auth}= Create List healthcheck zb!XztG34 - ${postyaml}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.yaml - Log Creating session https://${API_IP}:6969 - ${session}= Create Session policy https://${API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml - ${resp}= Post Request policy /policy/api/v1/policies data=${postyaml} headers=${headers} - Log Received response from api ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -CreateVcpeDroolsPolicy - [Documentation] Create VCPE Policy for Drools - ${auth}= Create List healthcheck zb!XztG34 - ${postyaml}= Get file ${DATA}/vCPE.policy.operational.input.tosca.yaml - Log Creating session https://${API_IP}:6969 - ${session}= Create Session policy https://${API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml - ${resp}= Post Request policy /policy/api/v1/policies data=${postyaml} headers=${headers} - Log Received response from api ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -CreateVdnsXacmlPolicy - [Documentation] Create VDNS Policy for Xacml - ${auth}= Create List healthcheck zb!XztG34 - ${postyaml}= Get file ${DATA}/vDNS.policy.monitoring.input.tosca.yaml - Log Creating session https://${API_IP}:6969 - ${session}= Create Session policy https://${API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml - ${resp}= Post Request policy /policy/api/v1/policies data=${postyaml} headers=${headers} - Log Received response from api ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -CreateVdnsDroolsPolicy - [Documentation] Create VDNS Policy for Drools - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${DATA}/vDNS.policy.operational.input.tosca.json - Log Creating session https://${API_IP}:6969 - ${session}= Create Session policy https://${API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policies data=${postjson} headers=${headers} - Log Received response from api ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -CreateVfwXacmlPolicy - [Documentation] Create VFW Policy for Xacml - ${auth}= Create List healthcheck zb!XztG34 - ${postyaml}= Get file ${DATA}/vFirewall.policy.monitoring.input.tosca.yaml - Log Creating session https://${API_IP}:6969 - ${session}= Create Session policy https://${API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml - ${resp}= Post Request policy /policy/api/v1/policies data=${postyaml} headers=${headers} - Log Received response from api ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -CreateVfwDroolsPolicy - [Documentation] Create VFW Policy for Drools - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${DATA}/vFirewall.policy.operational.input.tosca.json - Log Creating session https://${API_IP}:6969 - ${session}= Create Session policy https://${API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policies data=${postjson} headers=${headers} - Log Received response from api ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -DeployXacmlPolicies - [Documentation] Deploys the Policies to Xacml - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${PAP_IP}:6969 - ${postjson}= Get file ${SCR2}/deploy.xacml.policies.json - ${session}= Create Session policy https://${PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers} - Log Received response from pap ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP - ... responseTo xacml ACTIVE restart - Log Received status ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} onap.restart.tca - Should Contain ${result.stdout} onap.scaleout.tca - Should Contain ${result.stdout} onap.vfirewall.tca - -DeployDroolsPolicies - [Documentation] Deploys the Policies to Drools - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${PAP_IP}:6969 - ${postjson}= Get file ${SCR2}/deploy.drools.policies.json - ${session}= Create Session policy https://${PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers} - Log Received response from pap ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP - ... responseTo drools ACTIVE - Log Received status ${result.stdout} - Sleep 3s - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} operational.restart - Should Contain ${result.stdout} operational.scaleout - Should Contain ${result.stdout} operational.modifyconfig - -VcpeExecute - [Documentation] Executes VCPE Policy - ${result}= Run Process ${SCR2}/onset.sh ${SCR2}/vcpeOnset.json - Should Be Equal As Integers ${result.rc} 0 - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} ACTIVE - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} Sending guard query for APPC Restart - Should Be Equal As Integers ${result.rc} 0 - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} Guard result for APPC Restart is Permit - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} actor=APPC,operation=Restart - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION: SUCCESS - Should Contain ${result.stdout} actor=APPC,operation=Restart - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} FINAL: SUCCESS - Should Contain ${result.stdout} APPC - Should Contain ${result.stdout} Restart - -VdnsExecute - [Documentation] Executes VDNS Policy - ${result}= Run Process ${SCR2}/onset.sh ${SCR2}/vdnsOnset.json - Should Be Equal As Integers ${result.rc} 0 - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} ACTIVE - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} Sending guard query for SO VF Module Create - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} Guard result for SO VF Module Create is Permit - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} actor=SO,operation=VF Module Create - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION: SUCCESS - Should Contain ${result.stdout} actor=SO,operation=VF Module Create - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} FINAL: SUCCESS - Should Contain ${result.stdout} SO - Should Contain ${result.stdout} VF Module Create - -VfwExecute - [Documentation] Executes VFW Policy - ${result}= Run Process ${SCR2}/onset.sh ${SCR2}/vfwOnset.json - Should Be Equal As Integers ${result.rc} 0 - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} ACTIVE - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} Sending guard query for APPC ModifyConfig - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} Guard result for APPC ModifyConfig is Permit - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION - Should Contain ${result.stdout} actor=APPC,operation=ModifyConfig - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} OPERATION: SUCCESS - Should Contain ${result.stdout} actor=APPC,operation=ModifyConfig - ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT - ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a - Log Received notification ${result.stdout} - Should Be Equal As Integers ${result.rc} 0 - Should Contain ${result.stdout} FINAL: SUCCESS - Should Contain ${result.stdout} APPC - Should Contain ${result.stdout} ModifyConfig diff --git a/tests/policy/drools-pdp/drools-pdp-test.robot b/tests/policy/drools-pdp/drools-pdp-test.robot deleted file mode 100644 index cf4d3cea..00000000 --- a/tests/policy/drools-pdp/drools-pdp-test.robot +++ /dev/null @@ -1,17 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - -*** Test Cases *** -Alive - [Documentation] Runs Policy PDP Alive Check - ${auth}= Create List demo@people.osaaf.org demo123456! - Log Creating session https://${POLICY_DROOLS_IP}:9696 - ${session}= Create Session policy https://${POLICY_DROOLS_IP}:9696 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdp/engine headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['alive']} True diff --git a/tests/policy/pap/data/create.group.request.json b/tests/policy/pap/data/create.group.request.json deleted file mode 100644 index 1b63563f..00000000 --- a/tests/policy/pap/data/create.group.request.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "groups": [ - { - "name": "create.group.request", - "pdpGroupState": "PASSIVE", - "properties": { - "hello": "world" - }, - "pdpSubgroups": [ - { - "pdpType": "pdpTypeA", - "desiredInstanceCount": 2, - "properties": {}, - "supportedPolicyTypes": [ - { - "name": "onap.policies.monitoring.tcagen2", - "version": "1.0.0" - } - ], - "policies": [] - }, - { - "pdpType": "pdpTypeB", - "desiredInstanceCount": 1, - "properties": {}, - "supportedPolicyTypes": [ - { - "name": "onap.policies.monitoring.tcagen2", - "version": "1.0.0" - } - ], - "policies": [] - } - ] - } - ] -} diff --git a/tests/policy/pap/data/deploy.group.request.json b/tests/policy/pap/data/deploy.group.request.json deleted file mode 100644 index 7f3694de..00000000 --- a/tests/policy/pap/data/deploy.group.request.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "groups": [ - { - "name": "create.group.request", - "deploymentSubgroups": [ - { - "pdpType": "pdpTypeA", - "action": "POST", - "policies": [ - { - "name": "onap.restart.tca", - "version": "1.0.0" - } - ] - } - ] - } - ] -} diff --git a/tests/policy/pap/pap-test.robot b/tests/policy/pap/pap-test.robot deleted file mode 100644 index 3e8bc211..00000000 --- a/tests/policy/pap/pap-test.robot +++ /dev/null @@ -1,137 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json - -*** Test Cases *** -LoadPolicy - [Documentation] Loads prerequisite Policy via API - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json - ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers} - Log Received response from API ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -Healthcheck - [Documentation] Runs Policy PAP Health check - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -Statistics - [Documentation] Runs Policy PAP Statistics - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pap/v1/statistics headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -CreatePdpGroups - [Documentation] Runs Policy PAP Create PDP Groups - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${postjson}= Get file ${CURDIR}/data/create.group.request.json - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pap/v1/pdps/groups/batch data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -ActivatePdpGroup - [Documentation] Runs Policy PAP Change PDP Group State to ACTIVE - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Put Request policy /policy/pap/v1/pdps/groups/create.group.request?state=ACTIVE headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -QueryPdpGroups - [Documentation] Runs Policy PAP Query PDP Groups - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['groups'][0]['name']} create.group.request - Should Be Equal As Strings ${resp.json()['groups'][0]['pdpGroupState']} ACTIVE - Should Be Equal As Strings ${resp.json()['groups'][1]['name']} defaultGroup - -DeployPdpGroups - [Documentation] Runs Policy PAP Deploy Policies to PDP Groups - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${postjson}= Get file ${CURDIR}/data/deploy.group.request.json - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -UndeployPolicy - [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/onap.restart.tca headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -QueryPdpGroupsAfterUndeploy - [Documentation] Runs Policy PAP Query PDP Groups after Undeploy - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['groups'][0]['name']} create.group.request - Should Be Equal As Strings ${resp.json()['groups'][0]['pdpSubgroups'][0]['policies']} [] - -DeactivatePdpGroup - [Documentation] Runs Policy PAP Change PDP Group State to PASSIVE - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Put Request policy /policy/pap/v1/pdps/groups/create.group.request?state=PASSIVE headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -DeletePdpGroups - [Documentation] Runs Policy PAP Delete PDP Groups - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/pap/v1/pdps/groups/create.group.request headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -QueryPdpGroupsAfterDelete - [Documentation] Runs Policy PAP Query PDP Groups after Delete - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['groups'][0]['name']} defaultGroup diff --git a/tests/policy/xacml-pdp/data/onap.policy.guard.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.guard.decision.request.json deleted file mode 100644 index ee90feaa..00000000 --- a/tests/policy/xacml-pdp/data/onap.policy.guard.decision.request.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ONAPName": "Guard", - "ONAPComponent": "Guard-component", - "ONAPInstance": "Guard-component-instance", - "requestId": "unique-request-guard-1", - "action": "guard", - "resource": { - "guard": { - "actor": "APPC", - "operation": "ModifyConfig", - "target": "f17face5-69cb-4c88-9e0b-7426db7edddd", - "requestId": "c7c6a4aa-bb61-4a15-b831-ba1472dd4a65", - "clname": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a" - } - } -} diff --git a/tests/policy/xacml-pdp/data/onap.policy.monitoring.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.monitoring.decision.request.json deleted file mode 100644 index f79f4eb6..00000000 --- a/tests/policy/xacml-pdp/data/onap.policy.monitoring.decision.request.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ONAPName": "DCAE", - "ONAPComponent": "PolicyHandler", - "ONAPInstance": "622431a4-9dea-4eae-b443-3b2164639c64", - "action": "configure", - "resource": { - "policy-id": "onap.restart.tca" - } -} \ No newline at end of file diff --git a/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json deleted file mode 100644 index 3833a241..00000000 --- a/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ONAPName": "SDNC", - "ONAPComponent": "SDNC-component", - "ONAPInstance": "SDNC-component-instance", - "requestId": "unique-request-sdnc-1", - "action": "naming", - "resource": { - "nfRole": [], - "naming-type": [], - "property-name": [], - "policy-type": ["onap.policies.Naming"] - } -} diff --git a/tests/policy/xacml-pdp/data/onap.policy.optimization.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.optimization.decision.request.json deleted file mode 100644 index d997099c..00000000 --- a/tests/policy/xacml-pdp/data/onap.policy.optimization.decision.request.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "ONAPName": "OOF", - "ONAPComponent": "OOF-component", - "ONAPInstance": "OOF-component-instance", - "context" : { - "subscriberName": [] - }, - "action": "optimize", - "resource": { - "scope": [], - "services": [], - "resources": [], - "geography": [] - } -} diff --git a/tests/policy/xacml-pdp/data/vCPE.policy.input.tosca.deploy.json b/tests/policy/xacml-pdp/data/vCPE.policy.input.tosca.deploy.json deleted file mode 100644 index 7ace047b..00000000 --- a/tests/policy/xacml-pdp/data/vCPE.policy.input.tosca.deploy.json +++ /dev/null @@ -1,5 +0,0 @@ -{"policies":[ - {"policy-id":"onap.restart.tca"}, - {"policy-id":"OSDF_CASABLANCA.Affinity_Default"} - ] -} diff --git a/tests/policy/xacml-pdp/xacml-pdp-test.robot b/tests/policy/xacml-pdp/xacml-pdp-test.robot deleted file mode 100644 index 150c97e6..00000000 --- a/tests/policy/xacml-pdp/xacml-pdp-test.robot +++ /dev/null @@ -1,217 +0,0 @@ -*** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library Process -Library json - -*** Test Cases *** -Healthcheck - [Documentation] Runs Policy Xacml PDP Health check - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdpx/v1/healthcheck headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -Statistics - [Documentation] Runs Policy Xacml PDP Statistics - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdpx/v1/statistics headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - -MakeTopics - [Documentation] Creates the Policy topics - ${result}= Run Process ${SCR_DMAAP}/make_topic.sh POLICY-PDP-PAP - Should Be Equal As Integers ${result.rc} 0 - -ExecuteXacmlPolicy - Wait Until Keyword Succeeds 0 min 15 sec CreateMonitorPolicy - Wait Until Keyword Succeeds 0 min 15 sec CreateOptimizationPolicy - Wait Until Keyword Succeeds 0 min 15 sec GetDefaultDecision - Wait Until Keyword Succeeds 0 min 15 sec DeployPolicies - Wait Until Keyword Succeeds 0 min 15 sec GetAbbreviatedDecisionResult - Wait Until Keyword Succeeds 0 min 15 sec GetMonitoringDecision - Wait Until Keyword Succeeds 0 min 15 sec GetNamingDecision - Wait Until Keyword Succeeds 0 min 15 sec GetOptimizationDecision - -*** Keywords *** - -CreateMonitorPolicy - [Documentation] Create a Monitoring policy - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${DATA2}/vCPE.policy.monitoring.input.tosca.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers} - Log Received response from policy4 ${resp.text} - ${postjsonobject} To Json ${postjson} - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${resp.json()} tosca_definitions_version - Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version - -CreateOptimizationPolicy - [Documentation] Create an Optimization policy - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${DATA2}/vCPE.policies.optimization.input.tosca.json - Log Creating session https://${POLICY_API_IP}:6969 - ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.optimization.resource.AffinityPolicy/versions/1.0.0/policies data=${postjson} headers=${headers} - Log Received response from policy4 ${resp.text} - ${postjsonobject} To Json ${postjson} - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${resp.json()} tosca_definitions_version - Dictionary Should Contain Key ${postjsonobject} tosca_definitions_version - -DeployPolicies - [Documentation] Runs Policy PAP to deploy a policy - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/vCPE.policy.input.tosca.deploy.json - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pap/v1/pdps/policies data=${postjson} headers=${headers} - Log Received response from policy5 ${resp.text} - ${postjsonobject} To Json ${postjson} - Should Be Equal As Strings ${resp.status_code} 200 - ${result}= Run Process ${SCR_DMAAP}/wait_topic.sh POLICY-PDP-PAP - ... responseTo xacml ACTIVE onap.restart.tca - -GetStatisticsAfterDeployed - [Documentation] Runs Policy Xacml PDP Statistics after policy is deployed - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdpx/v1/statistics headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - Should Be Equal As Strings ${resp.json()['totalPoliciesCount'] 1 - -GetDefaultDecision - [Documentation] Get Default Decision with no policies in Xacml PDP - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.guard.decision.request.json - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${params}= Create Dictionary abbrev=true - ${resp}= Post Request policy /policy/pdpx/v1/decision params=${params} data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - ${status}= Get From Dictionary ${resp.json()} status - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${status} Permit - -GetAbbreviatedDecisionResult - [Documentation] Get Decision with abbreviated results from Policy Xacml PDP - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.decision.request.json - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${params}= Create Dictionary abbrev=true - ${resp}= Post Request policy /policy/pdpx/v1/decision params=${params} data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - ${policy}= Get From Dictionary ${resp.json()['policies']} onap.restart.tca - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${policy} type - Dictionary Should Contain Key ${policy} metadata - Dictionary Should Not Contain Key ${policy} type_version - Dictionary Should Not Contain Key ${policy} properties - Dictionary Should Not Contain Key ${policy} name - Dictionary Should Not Contain Key ${policy} version - -GetMonitoringDecision - [Documentation] Get Decision from Monitoring Policy Xacml PDP - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.decision.request.json - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pdpx/v1/decision data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - ${policy}= Get From Dictionary ${resp.json()['policies']} onap.restart.tca - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${policy} type - Dictionary Should Contain Key ${policy} metadata - Dictionary Should Contain Key ${policy} type_version - Dictionary Should Contain Key ${policy} properties - Dictionary Should Contain Key ${policy} name - Dictionary Should Contain Key ${policy} version - -GetNamingDecision - [Documentation] Get Decision from Naming Policy Xacml PDP - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.naming.decision.request.json - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pdpx/v1/decision data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - ${policy}= Get From Dictionary ${resp.json()['policies']} SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${policy} type - Dictionary Should Contain Key ${policy} type_version - Dictionary Should Contain Key ${policy} properties - Dictionary Should Contain Key ${policy} name - -GetOptimizationDecision - [Documentation] Get Decision from Optimization Policy Xacml PDP - ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.optimization.decision.request.json - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/pdpx/v1/decision data=${postjson} headers=${headers} - Log Received response from policy ${resp.text} - ${policy}= Get From Dictionary ${resp.json()['policies']} OSDF_CASABLANCA.Affinity_Default - Should Be Equal As Strings ${resp.status_code} 200 - Dictionary Should Contain Key ${policy} type - Dictionary Should Contain Key ${policy} type_version - Dictionary Should Contain Key ${policy} properties - Dictionary Should Contain Key ${policy} name - -GetStatisticsAfterDecision - [Documentation] Runs Policy Xacml PDP Statistics after Decision request - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdpx/v1/statistics headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - Should Be Equal As Strings ${resp.json()['totalDecisionsCount'] 1 - -UndeployMonitorPolicy - [Documentation] Runs Policy PAP to undeploy a policy - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PAP_IP}:6969 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/onap.restart.tca headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - -GetStatisticsAfterUndeploy - [Documentation] Runs Policy Xacml PDP Statistics after policy is undeployed - ${auth}= Create List healthcheck zb!XztG34 - Log Creating session https://${POLICY_PDPX_IP}:6969 - ${session}= Create Session policy https://${POLICY_PDPX_IP}:6969 auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdpx/v1/statistics headers=${headers} - Log Received response from policy ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['code']} 200 - Should Be Equal As Strings ${resp.json()['totalPoliciesCount'] 0 diff --git a/tests/sdc/sdc-helm-validator/assets/charts/correct-apiVersion-v2.tgz b/tests/sdc/sdc-helm-validator/assets/charts/correct-apiVersion-v2.tgz new file mode 100644 index 00000000..a1a99bab Binary files /dev/null and b/tests/sdc/sdc-helm-validator/assets/charts/correct-apiVersion-v2.tgz differ diff --git a/tests/sdc/sdc-helm-validator/assets/charts/one-lint-one-render-error-apiVersion-v2.tgz b/tests/sdc/sdc-helm-validator/assets/charts/one-lint-one-render-error-apiVersion-v2.tgz new file mode 100644 index 00000000..874dd3c0 Binary files /dev/null and b/tests/sdc/sdc-helm-validator/assets/charts/one-lint-one-render-error-apiVersion-v2.tgz differ diff --git a/tests/sdc/sdc-helm-validator/assets/charts/one-lint-warning-apiVersion-v2.tgz b/tests/sdc/sdc-helm-validator/assets/charts/one-lint-warning-apiVersion-v2.tgz new file mode 100644 index 00000000..51f4dd1d Binary files /dev/null and b/tests/sdc/sdc-helm-validator/assets/charts/one-lint-warning-apiVersion-v2.tgz differ diff --git a/tests/sdc/sdc-helm-validator/sdc-helm-validator.robot b/tests/sdc/sdc-helm-validator/sdc-helm-validator.robot new file mode 100644 index 00000000..b4051051 --- /dev/null +++ b/tests/sdc/sdc-helm-validator/sdc-helm-validator.robot @@ -0,0 +1,274 @@ +*** Settings *** +Documentation Testing SDC Helm Validator +Suite Setup Create Validator Session +Library RequestsLibrary +Library OperatingSystem +Library Collections + +*** Variables *** +${VALIDATOR_URL} http://${VALIDATOR} +${VERSIONS_ENDPOINT} /versions +${VALIDATE_ENDPOINT} /validate + +${CHARTS_PATH} %{WORKSPACE}/tests/sdc/sdc-helm-validator/assets/charts/ + +${CHART_CORRECT_V2} /correct-apiVersion-v2.tgz +${CHART_LINT_WARNING_V2} /one-lint-warning-apiVersion-v2.tgz +${CHART_LINT_RENDER_ERROR_V2} /one-lint-one-render-error-apiVersion-v2.tgz +${CHART_INCORRECT} /incorrect-chart.tgz + +${REQ_KEY_VERSION_DESIRED} versionDesired +${REQ_KEY_IS_LINTED} isLinted +${REQ_KEY_IS_STRICT_LINTED} isStrictLinted +${REQ_KEY_FILE} file + +${RESP_KEY_VERSIONS} versions +${RESP_KEY_VERSION_USED} versionUsed +${RESP_KEY_DEPLOYABLE} deployable +${RESP_KEY_VALID} valid +${RESP_KEY_RENDER_ERRORS} renderErrors +${RESP_KEY_LINT_ERROR} lintError +${RESP_KEY_LINT_WARNING} lintWarning + + +*** Test Cases *** + +Verify That Sdc Helm Validator Correctly Responds With Supported Versions Array + [Tags] VERSIONS_ENDPOINT + [Documentation] Verify that validator correctly responds with supported helm versions array. + ... Send GET request to ask for supported versions array. + ... Should reply with JSON containing an array of Helm versions that are supported by the validator. + [Timeout] 5 minute + + ${resp}= GET On Session ${VALIDATOR_SESSION} ${VERSIONS_ENDPOINT} + Status Should Be 200 ${resp} + + @{versions}= Get From Dictionary ${resp.json()} ${RESP_KEY_VERSIONS} + Should Not Be Empty ${versions} + + FOR ${version} IN @{versions} + Should Match Regexp ${version} \\d+\.\\d+\.\\d+ + END + +Verify That Sdc Helm Validator Correctly Responds For Correct Chart Validation Request With Default Version + [Tags] VALIDATE_ENDPOINT DEPLOYABLE + [Documentation] Verify that validator correctly responds for correct chart validation request with default version. + ... Send POST request to validate correct chart. Input: Helm chart with api version v2, no additional data. + ... Should reply with JSON containing the following information: used version = 3.x.x, deployable = true, render errors = [] + [Timeout] 5 minute + + ${other_data}= Create Dictionary + ${resp}= Send Post Request ${CHART_CORRECT_V2} ${other_data} + + Status Should Be 200 ${resp} + + Dictionary Should Not Contain Key ${resp.json()} ${RESP_KEY_LINT_ERROR} + Dictionary Should Not Contain Key ${resp.json()} ${RESP_KEY_LINT_WARNING} + Dictionary Should Not Contain Key ${resp.json()} ${RESP_KEY_VALID} + + ${version}= Get By Key ${resp.json()} ${RESP_KEY_VERSION_USED} + Should Start With ${version} 3. + + ${isDeployable}= Get By Key ${resp.json()} ${RESP_KEY_DEPLOYABLE} + Should Be True ${isDeployable} + + ${errors}= Get By Key ${resp.json()} ${RESP_KEY_RENDER_ERRORS} + Should Be Empty ${errors} + +Verify That Sdc Helm Validator Correctly Responds For Correct Chart Validation Request With Given V3 Version + [Tags] VALIDATE_ENDPOINT DEPLOYABLE + [Documentation] Verify that validator correctly responds for correct chart validation request with given v3 version. + ... Send POST request to validate correct chart. Input: Helm chart with api version v2, desired version = v3. + ... Should reply with JSON containing the following information: used version = 3.x.x, deployable = true, render errors = []. + [Timeout] 5 minute + + ${other_data}= Create Dictionary ${REQ_KEY_VERSION_DESIRED}=v3 + ${resp}= Send Post Request ${CHART_CORRECT_V2} ${other_data} + + Status Should Be 200 ${resp} + + ${version}= Get By Key ${resp.json()} ${RESP_KEY_VERSION_USED} + Should Start With ${version} 3. + + ${isDeployable}= Get By Key ${resp.json()} ${RESP_KEY_DEPLOYABLE} + Should Be True ${isDeployable} + + ${errors}= Get By Key ${resp.json()} ${RESP_KEY_RENDER_ERRORS} + Should Be Empty ${errors} + +Verify That Sdc Helm Validator Responds With Error For Chart Validation Request With Invalid Version + [Tags] VALIDATE_ENDPOINT ERROR + [Documentation] Verify that validator responds with error and 400 status code for validation request with invalid version. + ... Send POST request with correct chart but not supported Helm version. Input: Correct helm chart, desired version = v10. + ... Should reply with JSON containing error message with information regarding not supported Helm version. Response code should be 400. + [Timeout] 5 minute + + ${chart_path} Catenate SEPARATOR= ${CHARTS_PATH} ${CHART_CORRECT_V2} + ${files}= Create Multi Part ${chart_path} + ${other_data}= Create Dictionary ${REQ_KEY_VERSION_DESIRED}=v10 + ${resp}= Post Request ${VALIDATOR_SESSION} ${VALIDATE_ENDPOINT} files=${files} data=${other_data} + + Should Be Equal As Strings ${resp.status_code} 400 + Should Be Equal As Strings ${resp.text} {"message":"Version: 10 is not supported"} + +Verify That Sdc Helm Validator Correctly Responds For Correct Chart Validation Request With Random Supported Version + [Tags] VERSIONS_ENDPOINT VALIDATE_ENDPOINT + [Documentation] Verify that validator correctly responds for correct chart validation request with random supported version. + ... Send GET request to ask for supported versions array. + ... Should reply with JSON containing an array of Helm versions that are supported by the validator. + ... Select random version from the returned array. + ... Send POST request with correct chart and randomly chosen supported Helm version. Input: Correct helm chart, desired version = [randomly selected]. + ... Response code should be 200. + [Timeout] 5 minute + + ${resp}= GET On Session ${VALIDATOR_SESSION} ${VERSIONS_ENDPOINT} + ${versions}= Get From Dictionary ${resp.json()} ${RESP_KEY_VERSIONS} + ${list_size}= Get length ${versions} + ${random_index}= Evaluate random.randint(0, ${list_size}-1) + ${version}= Get From List ${versions} ${random_index} + Status Should Be 200 ${resp} + + ${other_data}= Create Dictionary ${REQ_KEY_VERSION_DESIRED}=${version} + ${resp}= Send Post Request ${CHART_CORRECT_V2} ${other_data} + Status Should Be 200 ${resp} + +Verify That Sdc Helm Validator Correctly Responds For Correct Chart Validation Request With Lint + [Tags] VALIDATE_ENDPOINT LINT DEPLOYABLE VALID + [Documentation] Verify that validator correctly responds for correct chart validation request with lint. + ... Send POST request to validate correct chart and lint. Input: Helm chart with api version v2, linted = true. + ... Should reply with JSON containing the following information: deployable = true, valid = true, render errors = [], lint errors = [], lint warnings = []. + ... Status code should be 200. + [Timeout] 5 minute + + ${other_data}= Create Dictionary ${REQ_KEY_IS_LINTED}=true + ${resp}= Send Post Request ${CHART_CORRECT_V2} ${other_data} + Status Should Be 200 ${resp} + + ${isDeployable}= Get By Key ${resp.json()} ${RESP_KEY_DEPLOYABLE} + Should Be True ${isDeployable} + + ${isValid}= Get By Key ${resp.json()} ${RESP_KEY_VALID} + Should Be True ${isValid} + + ${renderErrors}= Get By Key ${resp.json()} ${RESP_KEY_RENDER_ERRORS} + Should Be Empty ${renderErrors} + + ${lintErrors}= Get By Key ${resp.json()} ${RESP_KEY_LINT_ERROR} + Should Be Empty ${lintErrors} + + ${lintWarnings}= Get By Key ${resp.json()} ${RESP_KEY_LINT_WARNING} + Should Be Empty ${lintWarnings} + +Verify That Sdc Helm Validator Correctly Responds For Chart Validation Request With Lint Warnings + [Tags] VALIDATE_ENDPOINT LINT DEPLOYABLE VALID + [Documentation] Verify that validator correctly responds for chart validation request with lint warnings. + ... Send POST request to validate chart and lint. Input: Helm chart that should cause lint warning, linted = true. + ... Should reply with JSON containing the following information: deployable = true, valid = true, render errors = [], lint warning = [not empty] + ... Status code should be 200. + [Timeout] 5 minute + + ${other_data}= Create Dictionary ${REQ_KEY_IS_LINTED}=true + ${resp}= Send Post Request ${CHART_LINT_WARNING_V2} ${other_data} + Status Should Be 200 ${resp} + + ${isDeployable}= Get By Key ${resp.json()} ${RESP_KEY_DEPLOYABLE} + Should Be True ${isDeployable} + + ${isValid}= Get By Key ${resp.json()} ${RESP_KEY_VALID} + Should Be True ${isValid} + + ${renderErrors}= Get By Key ${resp.json()} ${RESP_KEY_RENDER_ERRORS} + Should Be Empty ${renderErrors} + + ${lintErrors}= Get By Key ${resp.json()} ${RESP_KEY_LINT_ERROR} + Should Be Empty ${lintErrors} + + @{lintWarnings}= Get By Key ${resp.json()} ${RESP_KEY_LINT_WARNING} + Should Not Be Empty @{lintWarnings} + Should Contain @{lintWarnings} [WARNING] templates/: directory not found + +Verify That Sdc Helm Validator Correctly Responds For Chart Validation Request With Lint Strict Checking + [Tags] VALIDATE_ENDPOINT STRICT_LINT DEPLOYABLE NON_VALID + [Documentation] Verify that validator correctly responds for chart validation request with lint strict checking. + ... Send POST request to validate chart and strictly lint. Input: Helm chart that should cause lint warning, linted = true, strict linted = true. + ... Should reply with JSON containing the following information: deployable = true, valid = false, render errors = [], lint warning = [not empty]. + ... Status code should be 200. + [Timeout] 5 minute + + ${other_data}= Create Dictionary ${REQ_KEY_IS_LINTED}=true ${REQ_KEY_IS_STRICT_LINTED}=true + ${resp}= Send Post Request ${CHART_LINT_WARNING_V2} ${other_data} + Status Should Be 200 ${resp} + + ${isDeployable}= Get By Key ${resp.json()} ${RESP_KEY_DEPLOYABLE} + Should Be True ${isDeployable} + + ${isValid}= Get By Key ${resp.json()} ${RESP_KEY_VALID} + Should Not Be True ${isValid} There should be a lint warning, which in strict mode on should make the chart invalid + + ${renderErrors}= Get By Key ${resp.json()} ${RESP_KEY_RENDER_ERRORS} + Should Be Empty ${renderErrors} + + ${lintErrors}= Get By Key ${resp.json()} ${RESP_KEY_LINT_ERROR} + Should Be Empty ${lintErrors} + + ${lintWarnings}= Get By Key ${resp.json()} ${RESP_KEY_LINT_WARNING} + Should Not Be Empty ${lintWarnings} + Should Contain @{lintWarnings} [WARNING] templates/: directory not found + +Verify That Sdc Helm Validator Correctly Responds For Chart Validation Request With Lint And Render Errors + [Tags] VALIDATE_ENDPOINT STRICT_LINT NON_DEPLOYABLE NON_VALID + [Documentation] Verify that validator correctly responds for chart validation request with lint and render errors. + ... Send POST request to validate chart and strictly lint. Input: Helm chart that should cause lint and render errors, linted = true, strict linted = true. + ... Should reply with JSON containing the following information: deployable = false, valid = false, render errors = [not empty], lint errors = [not empty], lint warnings = []. + ... Status code should be 200. + [Timeout] 5 minute + + ${other_data}= Create Dictionary ${REQ_KEY_IS_LINTED}=true ${REQ_KEY_IS_STRICT_LINTED}=true + ${resp}= Send Post Request ${CHART_LINT_RENDER_ERROR_V2} ${other_data} + Status Should Be 200 ${resp} + + ${isDeployable}= Get By Key ${resp.json()} ${RESP_KEY_DEPLOYABLE} + Should Not Be True ${isDeployable} There should be render errors which should make the chart not deployable + + ${isValid}= Get By Key ${resp.json()} ${RESP_KEY_VALID} + Should Not Be True ${isValid} There should be lint errors which should make the chart invalid + + @{renderErrors}= Get By Key ${resp.json()} ${RESP_KEY_RENDER_ERRORS} + Should Not Be Empty @{renderErrors} + Should Contain @{renderErrors} Error: template: mychartname/templates/test.yaml:2:18: executing "mychartname/templates/test.yaml" at <.Values.image.repository>: nil pointer evaluating interface {}.repository + + @{lintErrors}= Get By Key ${resp.json()} ${RESP_KEY_LINT_ERROR} + Should Not Be Empty @{lintErrors} + Should Contain @{lintErrors} [ERROR] templates/: template: mychartname/templates/test.yaml:2:18: executing "mychartname/templates/test.yaml" at <.Values.image.repository>: nil pointer evaluating interface {}.repository + + ${lintWarnings}= Get By Key ${resp.json()} ${RESP_KEY_LINT_WARNING} + Should Be Empty ${lintWarnings} + +*** Keywords *** + +Create Validator Session + Create Session validator_session ${VALIDATOR_URL} + Set Suite Variable ${VALIDATOR_SESSION} validator_session + +Send Post Request + [Arguments] ${chart_name} ${data_dictionary} + ${chart_path} Catenate SEPARATOR= ${CHARTS_PATH} ${chart_name} + ${files}= Create Multi Part ${chart_path} + + ${resp}= POST On Session ${VALIDATOR_SESSION} ${VALIDATE_ENDPOINT} files=${files} data=${data_dictionary} + [Return] ${resp} + +Create Multi Part + [Arguments] ${path} + ${data}= Get Binary File ${path} + ${files}= Create Dictionary + ${fileDir} ${fileName}= Split Path ${path} + ${partData}= Create List ${fileName} ${data} + Set To Dictionary ${files} ${REQ_KEY_FILE}=${partData} + [Return] ${files} + +Get By Key + [Arguments] ${dict} ${key} + Dictionary Should Contain Key ${dict} ${key} + ${value}= Get From Dictionary ${dict} ${key} + [Return] ${value} diff --git a/tests/sdnc/healthcheck/test1.robot b/tests/sdnc/healthcheck/test1.robot index c002a189..85783a79 100644 --- a/tests/sdnc/healthcheck/test1.robot +++ b/tests/sdnc/healthcheck/test1.robot @@ -6,9 +6,8 @@ Library json Library String *** Variables *** -${SDN_APIDOCS_URI} /apidoc/apis +${SDN_APIDOCS_URI} /apidoc/openapi3/18/apis/single ${SDN_HEALTHCHECK_OPERATION_PATH} /operations/SLI-API:healthcheck -${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} /operations/VNF-API:preload-vnf-topology-operation *** Test Cases *** @@ -26,19 +25,3 @@ Check SLI-API ${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers} Log ${resp.text} Should Contain ${resp.text} SLI-API - -Check VNF-API - Create Session sdnc http://localhost:8282 - &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json - ${resp}= Get Request sdnc ${SDN_APIDOCS_URI} headers=${headers} - Log ${resp.text} - Should Contain ${resp.text} VNF-API - -Test Preload - Create Session sdnc http://localhost:8282/restconf - ${data}= Get File ${CURDIR}${/}data${/}preload.json - &{headers}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json - ${resp}= Post Request sdnc ${PRELOAD_VNF_TOPOLOGY_OPERATION_PATH} data=${data} headers=${headers} - Log ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['output']['response-code']} 200 diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot b/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot index 52cc5d2f..3ea61649 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot @@ -55,8 +55,6 @@ Send Get Request And Validate TLS Connection Response &{headers1}= Create Dictionary Authorization=Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ== Content-Type=application/json Accept=application/json ${resp1}= Get Request sdnc_restconf ${PNFSIM_MOUNT_PATH} headers=${headers1} Should Be Equal As Strings ${resp1.status_code} ${resp_code} - Should Contain ${resp1.content} netconf-id - Should Contain ${resp1.content} netconf-param Send Delete Request And Validate PNF Mount Deleted [Documentation] Send request to passed url and validate received response diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-properties.robot b/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-properties.robot index 131a52f9..2f2d6f5a 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-properties.robot +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-properties.robot @@ -28,10 +28,10 @@ ${SDNC_NETWORK_TOPOLOGY} /config/network-topology:network-topolo ${MOUNT_PATH} %{WORKSPACE}/tests/sdnc/sdnc_netconf_tls_post_deploy/cert-data ${SDNC_CSR_FILE} %{WORKSPACE}/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env ${SDNC_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo -${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/mynetconf:netconflist +${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/PNFDemo/yang-ext:mount/turing-machine:turing-machine # Netconf-Pnp-Simulator ${NETCONF_PNP_SIM_CONTAINER_NAME} %{NETCONF_PNP_SIM_CONTAINER_NAME} ${NETCONF_PNP_SIM_CSR_FILE} %{WORKSPACE}/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/netconf_pnp_simulator_csr.env ${CONF_SCRIPT} %{WORKSPACE}/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config.sh -${CONF_TLS_SCRIPT} %{WORKSPACE}/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config_tls.sh \ No newline at end of file +${CONF_TLS_SCRIPT} %{WORKSPACE}/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config_tls.sh diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/sdnc_post_deploy_cert_check.robot b/tests/sdnc/sdnc_netconf_tls_post_deploy/sdnc_post_deploy_cert_check.robot index c2b35e12..4d935974 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/sdnc_post_deploy_cert_check.robot +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/sdnc_post_deploy_cert_check.robot @@ -9,52 +9,19 @@ Suite Setup Create sessions *** Test Cases *** -Health Check AAF CertService - [Tags] AAF-CERT-SERVICE - [Documentation] Service is Up and Running - Run health check - -Reload AAF CertService Configuration - [Tags] AAF-CERT-SERVICE - [Documentation] Configuration is Reloaded - Send Get Request And Validate Response /reload 200 - -Check AAF CertService Container Is Ready - [Tags] AAF-CERT-SERVICE - [Documentation] Send Request to /ready Endpoint and Expect 200 - Send Get Request And Validate Response /ready 200 - Check SDNC Keystore For Netopeer2 Certificates [Tags] SDNC-NETOPEER2-CERT-DEPLOYMENT [Documentation] Checking Keystore after SDNC istallation Send Get Request And Validate Response Sdnc ${SDNC_KEYSTORE_CONFIG_PATH} 200 + Check SDNC And PNF TLS Connection Over Netopeer2 Certificates [Tags] SDNC-PNF-TLS-CONNECTION-CHECK - [Documentation] Checking PNF Mount after SDNC Installation + [Documentation] Checking PNF Mount after SDNC Installation Send Get Request And Validate TLS Connection Response ${SDNC_MOUNT_PATH} 200 Check PNF Delete And Remove Netopeer2 Certificates From Keystore [Tags] SDNC-PNF-MOUNT-DELETE-CLEAR-KEYSTORE [Documentation] Checking PNF Mount Delete from SDNC - Send Delete Request And Validate PNF Mount Deleted ${SDNC_MOUNT_PATH} 200 - -Check AAF-CertService Successfully Creates Certificates for SDNC - [Tags] AAF-CERT-SERVICE-SDNC - [Documentation] Run with SDNC CSR and Expected Exit Code 0 - Run Cert Service Client And Validate JKS File Creation And Client Exit Code ${SDNC_CSR_FILE} ${SDNC_CONTAINER_NAME} 0 - -Check SDNC-ODL Certificates Installation In Keystore And Truststore - [Tags] SDNC-ODL-CERTIFICATE-KEYSTORE-VALIDATE - [Documentation] Validate Certificates Got Installed in SDNC-ODL Keystore - Send Get Request And Validate Response Sdnc ${SDNC_KEYSTORE_CONFIG_PATH} 200 - -Check AAF-CertService Successfully Creates Certificates for Netconf-Pnp-Simulator - [Tags] AAF-CERT-SERVICE-NETCONF_PNP_SIMULATOR - [Documentation] Run with NETCONF-PNP-SIMULATOR CSR and Expect Exit Code 0 - Run Cert Service Client And Validate JKS File Creation And Client Exit Code ${NETCONF_PNP_SIM_CSR_FILE} ${NETCONF_PNP_SIM_CONTAINER_NAME} 0 + Send Delete Request And Validate PNF Mount Deleted ${SDNC_MOUNT_PATH} 200 -Check SDNC-ODL Netconf-Pnp-Simulatore TLS Connection Establishment - [Tags] SDNC-ODL-NETCONF-PNP_SIMULATION-TLS-CONNECTION - [Documentation] Validate SDNC-ODL and Netconf-Pnp-Simulation TLS Connection Establishment - Send Get Request And Validate TLS Connection Response ${SDNC_MOUNT_PATH} 200 \ No newline at end of file diff --git a/tests/so/etsi/data/createNetworkServiceRequest.json b/tests/so/etsi/data/createNetworkServiceRequest.json new file mode 100644 index 00000000..6980068e --- /dev/null +++ b/tests/so/etsi/data/createNetworkServiceRequest.json @@ -0,0 +1 @@ +{"nsdId": "9bb8c882-44a1-4b67-a12c-5a998e18d6ba", "nsName": "demo", "nsDescription": "demo"} diff --git a/tests/so/etsi/data/distributeServiceTemplate.json b/tests/so/etsi/data/distributeServiceTemplate.json index 47a9f21b..6c64d5c2 100644 --- a/tests/so/etsi/data/distributeServiceTemplate.json +++ b/tests/so/etsi/data/distributeServiceTemplate.json @@ -1,102 +1,52 @@ { - "distributionID": "cfe30d6c-eb67-4ffb-ba98-4b654162223a", - "serviceName": "manualDistributionTestService", - "serviceVersion": "1.0", - "serviceUUID": "28d4acf3-4791-4998-8d06-1cdf6d1767a9", - "serviceDescription": "Test", - "serviceInvariantUUID": "0ddc448d-5513-44bc-8b02-5759d84600d5", - "resources": [ - { - "resourceInstanceName": "manualDistributionTestVNF 0", - "resourceCustomizationUUID": "82ad3aa0-edc6-410c-a217-655fb064323f", - "resourceName": "manualDistributionTestVNF", - "resourceVersion": "1.0", - "resoucreType": "VF", - "resourceUUID": "e8e39dc4-4761-4da7-aedf-7d1fd3637772", - "resourceInvariantUUID": "0a0b9979-863d-4b7e-b7f4-d27725a182b3", - "category": "Application L4+", - "subcategory": "Media Servers", - "artifacts": [ + "distributionID": "f0d0e9e2-10aa-4f66-a0cc-cf5ecb386b42", + "serviceName": "EtsiServiceCSIT3", + "serviceVersion": "1.0", + "serviceUUID": "fdea6501-dabd-4428-b52c-623336a3b403", + "serviceDescription": "test", + "serviceInvariantUUID": "10b3d278-e262-44ca-a0c0-4e663c2d7562", + "resources": [ { - "artifactName": "manualdistributiontestvnf0_modules.json", - "artifactType": "VF_MODULES_METADATA", - "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/manualdistributiontestvnf0_modules.json", - "artifactChecksum": "NTc0NDlkNzdmYzVmMDM3ZjMxMTE2NDBmYWJiMDM1NzY\u003d", - "artifactDescription": "Auto-generated VF Modules information artifact", - "artifactTimeout": 120, - "artifactVersion": "1", - "artifactUUID": "a10f397a-6546-4a27-843f-25821955ef3e", - "relatedArtifactsInfo": [] - }, - { - "artifactName": "base_ves_med1.yaml", - "artifactType": "HEAT", - "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.yaml", - "artifactChecksum": "YTAwNTQ3NjczY2Y5MmUwZjUzZTY1ZjNhNTA0NGQyMDY\u003d", - "artifactDescription": "created from csar", - "artifactTimeout": 120, - "artifactVersion": "2", - "artifactUUID": "e216d9da-18c4-460f-8b2b-d7f8dd9e9295", - "generatedArtifact": { - "artifactName": "base_ves_med1.env", - "artifactType": "HEAT_ENV", - "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env", - "artifactChecksum": "Mjg5YTVhNTlmYTdjYTFlYjYxMDlhODYzNmJhZGJiZGE\u003d", - "artifactDescription": "Auto-generated HEAT Environment deployment artifact", - "artifactTimeout": 120, - "artifactVersion": "2", - "artifactUUID": "6243747f-e794-4519-82b2-6399846f1951", - "generatedFromUUID": "e216d9da-18c4-460f-8b2b-d7f8dd9e9295" - }, - "relatedArtifactsInfo": [] - }, - { - "artifactName": "base_ves_med1.env", - "artifactType": "HEAT_ENV", - "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/base_ves_med1.env", - "artifactChecksum": "Mjg5YTVhNTlmYTdjYTFlYjYxMDlhODYzNmJhZGJiZGE\u003d", - "artifactDescription": "Auto-generated HEAT Environment deployment artifact", - "artifactTimeout": 120, - "artifactVersion": "2", - "artifactUUID": "6243747f-e794-4519-82b2-6399846f1951", - "relatedArtifactsInfo": [] - }, + "resourceInstanceName": "EtsiVnfCSIT3 0", + "resourceCustomizationUUID": "3341825c-837c-4e84-8a82-cc69033ca92f", + "resourceName": "EtsiVnfCSIT3", + "resourceVersion": "1.0", + "resourceUUID": "bb7ff27f-d609-4d02-9926-2f4c5eb89316", + "resourceInvariantUUID": "037f7b1b-5c62-44c1-b806-f92fe8970171", + "category": "Generic", + "subcategory": "Network Service", + "artifacts": [], + "artifactsImpl": [], + "resourceType": "VF" + } + ], + "serviceArtifacts": [ { - "artifactName": "TOSCA.meta", - "artifactType": "OTHER", - "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/TOSCA.meta", - "artifactChecksum": "NWE2ODcyOWY0NGI2MzEyOGViYjUxNTEwMjU5OWRhZmI\u003d", - "artifactDescription": "created from csar", - "artifactTimeout": 120, - "artifactVersion": "1", - "artifactUUID": "6c64d38b-186f-4339-9a76-a266c40f40ec", - "relatedArtifactsInfo": [] - }, + "artifactName": "service-Etsiservicecsit3-csar.csar", + "artifactType": "TOSCA_CSAR", + "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Etsiservicecsit3/1.0/artifacts/service-Etsiservicecsit3-csar.csar", + "artifactChecksum": "NDcwMjRmZjg3MWYwY2FmMTAxN2RlZWEzMWE2OTU2ZjA=", + "artifactDescription": "TOSCA definition package ofthe asset", + "artifactTimeout": 0, + "artifactVersion": "1", + "artifactUUID": "587a89d9-ca2d-41b7-929e-de191fd4bf29", + "relatedArtifacts": [] + } + ], + "workloadContext": "Production", + "resourcesImpl": [ { - "artifactName": "descriptor.yaml", - "artifactType": "OTHER", - "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/resourceInstances/manualdistributiontestvnf0/artifacts/descriptor.yaml", - "artifactChecksum": "YWZkNTg2ZGMzZjRhZjgxNzNkODJiNjgwZmRlZjlmNDE\u003d", - "artifactDescription": "created from csar", - "artifactTimeout": 120, - "artifactVersion": "1", - "artifactUUID": "4bd0cdf6-0b12-4d19-b3d8-6dbc34fe397e", - "relatedArtifactsInfo": [] + "resourceInstanceName": "EtsiVnfCSIT3 0", + "resourceCustomizationUUID": "3341825c-837c-4e84-8a82-cc69033ca92f", + "resourceName": "EtsiVnfCSIT3", + "resourceVersion": "1.0", + "resourceUUID": "bb7ff27f-d609-4d02-9926-2f4c5eb89316", + "resourceInvariantUUID": "037f7b1b-5c62-44c1-b806-f92fe8970171", + "category": "Generic", + "subcategory": "Network Service", + "artifacts": [], + "artifactsImpl": [], + "resourceType": "VF" } - ] - } - ], - "serviceArtifacts": [ - { - "artifactName": "service-Manualdistributiontestservice-csar.csar", - "artifactType": "TOSCA_CSAR", - "artifactURL": "/unzipped_sdc_csar/v1/catalog/services/Manualdistributiontestservice/1.0/artifacts/service-Manualdistributiontestservice-csar.csar", - "artifactChecksum": "YWYxNmUxNTlhMmE3MjA1NGVhNTBhYTdkMmU0OTZjNzM\u003d", - "artifactDescription": "TOSCA definition package of the asset", - "artifactTimeout": 0, - "artifactVersion": "1", - "artifactUUID": "e6e8c36a-b939-4845-995a-41c50be890a0" - } - ], - "workloadContext": "Production" + ] } diff --git a/tests/so/etsi/data/instantiateNetworkServiceRequest.json b/tests/so/etsi/data/instantiateNetworkServiceRequest.json new file mode 100644 index 00000000..44a5d436 --- /dev/null +++ b/tests/so/etsi/data/instantiateNetworkServiceRequest.json @@ -0,0 +1,14 @@ +{ + "nsFlavourId": "default", + "locationConstraints": [{ + "vnfProfileId": "b1bb0ce7-2222-4fa7-95ed-4840d70a1177" + }], + "additionalParamsForVnf": [{ + "vnfProfileId": "b1bb0ce7-2222-4fa7-95ed-4840d70a1177", + "vnfInstanceName": "etsiNsVnfCsit1", + "vnfInstanceDescription": "test", + "additionalParams": { + "vim_id": "CloudOwner_EtsiCloudRegion_693c7729b2364a26a3ca602e6f66187d" + } + }] +} diff --git a/tests/so/etsi/data/networkServicePackageOnboardRequest.json b/tests/so/etsi/data/networkServicePackageOnboardRequest.json new file mode 100644 index 00000000..f6ffeb2e --- /dev/null +++ b/tests/so/etsi/data/networkServicePackageOnboardRequest.json @@ -0,0 +1 @@ +{"csarId": "9bb8c882-44a1-4b67-a12c-5a998e18d6ba"} diff --git a/tests/so/etsi/data/responses/expectedArtifacts/image b/tests/so/etsi/data/responses/expectedArtifacts/image new file mode 100644 index 00000000..f31d15df --- /dev/null +++ b/tests/so/etsi/data/responses/expectedArtifacts/image @@ -0,0 +1 @@ +ubuntu_16.04 diff --git a/tests/so/etsi/data/responses/expectedVnfPackage.json b/tests/so/etsi/data/responses/expectedVnfPackage.json new file mode 100644 index 00000000..c97865ee --- /dev/null +++ b/tests/so/etsi/data/responses/expectedVnfPackage.json @@ -0,0 +1,22 @@ +{ + "id": "73522444-e8e9-49c1-be29-d355800aa349", + "vnfdId": "b1bb0ce7-2222-4fa7-95ed-4840d70a1177", + "vnfProductName": "", + "vnfSoftwareVersion": "", + "vnfdVersion": "1.0", + "checksum": {}, + "softwareImages": [], + "onboardingState": "ONBOARDED", + "operationalState": "ENABLED", + "_links": { + "self": { + "href": "http://so-etsi-sol003-adapter.onap:9092/so/vnfm-adapter/v1/vnfpkgm/v1/vnf_packages/73522444-e8e9-49c1-be29-d355800aa349" + }, + "vnfd": { + "href": "http://so-etsi-sol003-adapter.onap:9092/so/vnfm-adapter/v1/vnfpkgm/v1/vnf_packages/73522444-e8e9-49c1-be29-d355800aa349/vnfd" + }, + "packageContent": { + "href": "http://so-etsi-sol003-adapter.onap:9092/so/vnfm-adapter/v1/vnfpkgm/v1/vnf_packages/73522444-e8e9-49c1-be29-d355800aa349/package_content" + } + } +} diff --git a/tests/so/etsi/data/responses/expectedVnfPackageContent.csar b/tests/so/etsi/data/responses/expectedVnfPackageContent.csar new file mode 100644 index 00000000..c6b97c05 Binary files /dev/null and b/tests/so/etsi/data/responses/expectedVnfPackageContent.csar differ diff --git a/tests/so/etsi/data/responses/expectedVnfd/MainServiceTemplate.yaml b/tests/so/etsi/data/responses/expectedVnfd/MainServiceTemplate.yaml new file mode 100644 index 00000000..68213419 --- /dev/null +++ b/tests/so/etsi/data/responses/expectedVnfd/MainServiceTemplate.yaml @@ -0,0 +1,358 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 +metadata: + template_name: vCPE_vgw + template_version: "1.0" + template_author: onap + VNFD_SCHEMA_VERSION: "2.5.1+1" + descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177 +description: vCPE_vgw + +imports: + - onap_dm.yaml + +topology_template: + #substitution_mappings: + # node_type: onap.vcpe_vgw + # requirements: + # virtual_link: [ Cp_vgw_public, virtual_link ] # expose as external CP + # virtual_link: [ Cp_vgw_onap_private, virtual_link ] # expose as external CP + + inputs: + vcpe_image_name: + type: string + description: image name for vcpe in openstack glance + default: ubuntu_16.04 + public_net_id: + type: string + description: public network id used during onap installation + default: external + onap_private_net_id: + type: string + description: onap OAM network id + default: oam_onap + onap_private_net_cidr: + type: string + description: oanp OAM network cidr + default: 10.0.0.0/16 + mux_gw_private_net_id: + type: string + description: Private network that connects vGMUX to vGWs + default: zdfw1muxgw01_private + mux_gw_private_net_cidr: + type: string + description: he CIDR of the vGMUX private network + default: 10.5.0.0/24 + cpe_public_net_id: + type: string + description: cpe public net name + default: zdfw1cpe01_public + cpe_public_net_cidr: + type: string + description: cpe public net cidr + default: 10.2.0.0/24 + vgw_private_ip_0: + type: string + description: Private IP address that is assigned to the vGW to communicate with vGMUX + default: 10.5.0.21 + vgw_private_ip_1: + type: string + description: Private IP address that is assigned to the vGW to communicate with ONAP components + default: 10.0.101.30 + vgw_private_ip_2: + type: string + description: Private IP address that is assigned to the vGW to communicate with vCPE public network + default: 10.2.0.3 + vgw_name_0: + type: string + description: Name of the vGW + default: zdcpe1cpe01gw01 + dcae_collector_ip: + type: string + description: dcae collector ip + default: 10.0.4.102 + dcae_collector_port: + type: string + description: dcae collector port + default: "8080" + pub_key: + type: string + description: ssh public key + default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGx6SKrAuCz1V8KGevZueksLdWoPWJP6z3r29Z7TmPVEOjM+7PIPeSs2BVRx3rnHZBAlasMrZ+fJBS25ts9vfC+ItezQah/hr9vrkmwxCR54Lb84poW+sToPeF6i5eZY7W+jWJfLaFSFx9d2vp4zes/fOlT3NvYCXbn/3QdryQoGl7VFI8oemZypVcikZXElJeeKgAVdSwnrzuqtO/tmbXcAeSbYvVjki8ywYcsWMVMYWUWhh+1BAB6kXnTsIWqzrq0Pfvy+81WDwtiqsqmd93HY8hE0scBrXFBZzQS/AYfIFBlEuFNdLczchntjbZ0n7dmDXk8zHtCZYNk7kwb8k/ + nexus_artifact_repo: + type: string + description: Root URL for the Nexus repository for Maven artifacts + default: https://nexus.onap.org + demo_artifacts_version: + type: string + description: artifacts version used in demo vnfs + default: 1.2.0 + install_script_version: + type: string + description: install script version number + default: 1.2.0-SNAPSHOT + cloud_env: + type: string + description: cloud environment(openstack or rackspace) + default: openstack + mux_ip_addr: + type: string + description: IP address of vGMUX + default: 10.5.0.20 + vg_vgmux_tunnel_vni: + type: string + description: vni value of vG-vGMUX vxlan tunnel + default: "100" + vnf_id: + type: string + description: The VNF ID is provided by ONAP + default: vCPE_Infrastructure_GW_demo_app + vf_module_id: + type: string + description: The vCPE Module ID is provided by ONAP + default: vCPE_Customer_GW + + node_templates: + LLU_VNF: + type: tosca.nodes.nfv.VNF + properties: + descriptor_id: b1bb0ce7-2222-4fa7-95ed-4840d70a1177 + provider: onap + product_name: vcpe_vgw + software_version: '1.0' + descriptor_version: '1.0' + flavour_id: simple + flavour_description: simple + vnfm_info: ['gvnfm'] + + #onap public net +# VL_public: +# type: tosca.nodes.nfv.VnfVirtualLink +# properties: +# connectivity_type: +# layer_protocols: [ipv4] +# vl_profile: +# max_bitrate_requirements: +# root: 10000000 +# leaf: 10000000 +# min_bitrate_requirements: +# root: 10000000 +# leaf: 10000000 +# virtual_link_protocol_data: +# - associated_layer_protocol: ipv4 +# l3_protocol_data: +# ip_version: ipv4 +# name: { get_input: public_net_id } +# +# #onap oam net +# VL_onap_private: +# type: tosca.nodes.nfv.VnfVirtualLink +# properties: +# connectivity_type: +# layer_protocols: [ipv4] +# vl_profile: +# max_bitrate_requirements: +# root: 10000000 +# leaf: 10000000 +# min_bitrate_requirements: +# root: 10000000 +# leaf: 10000000 +# virtual_link_protocol_data: +# - associated_layer_protocol: ipv4 +# l3_protocol_data: +# ip_version: ipv4 +# name: { get_input: onap_private_net_id } +# cidr: { get_input: onap_private_net_cidr } + + #Private network that connects vGMUX to vGWs + VL_mux_gw_private_net: + type: tosca.nodes.nfv.VnfVirtualLink + properties: + connectivity_type: + layer_protocols: [ipv4] + vl_profile: + max_bitrate_requirements: + root: 10000000 + leaf: 10000000 + min_bitrate_requirements: + root: 10000000 + leaf: 10000000 + virtual_link_protocol_data: + - associated_layer_protocol: ipv4 + l3_protocol_data: + name: { get_input: mux_gw_private_net_id } + ip_version: ipv4 + cidr: { get_input: mux_gw_private_net_cidr } + dhcp_enabled: false + + #cpe public network + VL_cpe_public: + type: tosca.nodes.nfv.VnfVirtualLink + properties: + connectivity_type: + layer_protocols: [ipv4] + vl_profile: + max_bitrate_requirements: + root: 10000000 + leaf: 10000000 + min_bitrate_requirements: + root: 10000000 + leaf: 10000000 + virtual_link_protocol_data: + - associated_layer_protocol: ipv4 + l3_protocol_data: + name: { get_input: cpe_public_net_id } + ip_version: ipv4 + cidr: { get_input: cpe_public_net_cidr } + dhcp_enabled: false + + # vgw related + Cp_vgw_public: + type: tosca.nodes.nfv.VduCp + properties: + layer_protocols: [ipv4] + trunk_mode: false + protocol: + - associated_layer_protocol: ipv4 + address_data: + - address_type: ip_address + l3_address_data: + ip_address_assignment: false + floating_ip_activated: false + requirements: + - virtual_binding: VDU_vgw_0 + #- virtual_link: VL_public + + Cp_vgw_onap_private: + type: tosca.nodes.nfv.VduCp + properties: + layer_protocols: [ipv4] + trunk_mode: false + protocol: + - associated_layer_protocol: ipv4 + address_data: + - address_type: ip_address + l3_address_data: + ip_address_assignment: false + floating_ip_activated: false + fixed_ip_address: + - { get_input: vgw_private_ip_1 } + requirements: + - virtual_binding: VDU_vgw_0 + #- virtual_link: VL_onap_private + + Cp_vgw_mux_gw_private_net: + type: tosca.nodes.nfv.VduCp + properties: + layer_protocols: [ipv4] + trunk_mode: false + protocol: + - associated_layer_protocol: ipv4 + address_data: + - address_type: ip_address + l3_address_data: + ip_address_assignment: false + floating_ip_activated: false + fixed_ip_address: + - { get_input: vgw_private_ip_0 } + virtual_network_interface_requirements: + - name: dpdk support + support_mandatory: true + network_interface_requirements: + dataProcessingAccelerationLibrary: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "DPDK"}' + requirements: + - virtual_binding: VDU_vgw_0 + - virtual_link: VL_mux_gw_private_net + + Cp_vgw_cpe_public: + type: tosca.nodes.nfv.VduCp + properties: + layer_protocols: [ipv4] + trunk_mode: false + protocol: + - associated_layer_protocol: ipv4 + address_data: + - address_type: ip_address + l3_address_data: + ip_address_assignment: false + floating_ip_activated: false + fixed_ip_address: + - { get_input: vgw_private_ip_2 } + requirements: + - virtual_binding: VDU_vgw_0 + - virtual_link: VL_cpe_public + + VDU_vgw_0: + type: tosca.nodes.nfv.Vdu.Compute + properties: + name: { get_input: vgw_name_0 } + description: vgw + vdu_profile: + min_number_of_instances: 1 + max_number_of_instances: 1 + watchdog: none + inject_files: # TODO SDC BUG + source_path: ../Artifacts/Deployment/OTHER/authorized_keys #SSH authorized_keys + dest_path: /home/ubuntu/.ssh/authorized_keys + meta_data: + vnf_id: { get_input: vnf_id } + vf_module_id: { get_input: vf_module_id } + mux_gw_private_net_ipaddr: { get_input: vgw_private_ip_0 } + oam_ipaddr: { get_input: vgw_private_ip_1 } + oam_cidr: { get_input: onap_private_net_cidr } + cpe_public_net_cidr: { get_input: cpe_public_net_cidr } + mux_gw_private_net_cidr: { get_input: mux_gw_private_net_cidr } + mux_ip_addr: { get_input: mux_ip_addr } + vg_vgmux_tunnel_vni: { get_input: vg_vgmux_tunnel_vni } + install_script_version: { get_input: install_script_version } + cloud_env: { get_input: cloud_env } + nexus_artifact_repo: { get_input: nexus_artifact_repo } + boot_data: | + #!/bin/bash + METADATA=`curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json` + apt-get -y install jq + + get_metadata () { + echo $METADATA | jq -r ".meta.$1" + } + + # Create configuration files + mkdir /opt/config + echo "$(get_metadata oam_ipaddr)" > /opt/config/oam_ipaddr.txt + echo "$(get_metadata oam_cidr)" > /opt/config/oam_cidr.txt + echo "$(get_metadata cpe_public_net_cidr)" > /opt/config/cpe_public_net_cidr.txt + echo "$(get_metadata mux_gw_private_net_ipaddr)" > /opt/config/mux_gw_private_net_ipaddr.txt + echo "$(get_metadata mux_gw_private_net_cidr)" > /opt/config/mux_gw_private_net_cidr.txt + echo "$(get_metadata install_script_version)" > /opt/config/install_script_version.txt + echo "$(get_metadata cloud_env)" > /opt/config/cloud_env.txt + echo "$(get_metadata mux_ip_addr)" > /opt/config/mux_ip_addr.txt + echo "$(get_metadata vg_vgmux_tunnel_vni)" > /opt/config/vg_vgmux_tunnel_vni.txt + echo "$(get_metadata nexus_artifact_repo)" > /opt/config/nexus_artifact_repo.txt + + # Download and run install script + apt-get -y install unzip + INSTALL_SCRIPT_VERSION=$(get_metadata install_script_version) + NEXUS_ARTIFACT_REPO=$(get_metadata nexus_artifact_repo) + if [[ "${INSTALL_SCRIPT_VERSION}" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi + curl -k -L "${NEXUS_ARTIFACT_REPO}/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vcpe&a=vcpe-scripts&e=zip&v=${INSTALL_SCRIPT_VERSION}" -o /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip + unzip -j /opt/vcpe-scripts-${INSTALL_SCRIPT_VERSION}.zip -d /opt v_gw_install.sh + cd /opt + chmod +x v_gw_install.sh + ./v_gw_install.sh + capabilities: + virtual_compute: + properties: + virtual_memory: + virtual_mem_size: 4096 MB + vdu_mem_requirements: + memoryPageSize: '{"schemaVersion": "0", "schemaSelector": "", "hardwarePlatform": "generic", "mandatory": "true", "configurationValue": "2 MB"}' + numberOfPages: '{"schemaVersion": "0","schemaSelector": "","hardwarePlatform": "generic","mandatory": "true", "configurationValue": "1024"}' + virtual_cpu: + num_virtual_cpu: 2 + cpu_architecture: generic + virtual_local_storage: + - size_of_storage: 40 GB + artifacts: + sw_image: #TODO need to put glance image name here + #file: { get_input: vcpe_image_name } + file: ../Artifacts/Deployment/OTHER/image + type: tosca.artifacts.nfv.SwImage diff --git a/tests/so/etsi/data/responses/expectedVnfd/onap_dm.yaml b/tests/so/etsi/data/responses/expectedVnfd/onap_dm.yaml new file mode 100644 index 00000000..80d1153d --- /dev/null +++ b/tests/so/etsi/data/responses/expectedVnfd/onap_dm.yaml @@ -0,0 +1,1695 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 +artifact_types: + tosca.artifacts.nfv.SwImage: + derived_from: tosca.artifacts.Deployment.Image + description: describes the software image which is directly loaded on the virtualisation container realizing of the VDU or is to be loaded on a virtual + tosca.artifacts.Implementation.nfv.Mistral: + derived_from: tosca.artifacts.Implementation + description: artifacts for Mistral workflows + mime_type: application/x-yaml + file_ext: [ yaml ] + +capability_types: + tosca.capabilities.nfv.VirtualStorage: + derived_from: tosca.capabilities.Root + description: Describes the attachment capabilities related to Vdu.Storage + tosca.capabilities.nfv.VirtualCompute: + derived_from: tosca.capabilities.Node + description: Describes the capabilities related to virtual compute resources + properties: + logical_node: + type: map + description: Describes the Logical Node requirements + required: false + entry_schema: + type: tosca.datatypes.nfv.LogicalNodeData + requested_additional_capabilities: + type: map + description: Describes additional capability for a particular VDU + required: false + entry_schema: + type: tosca.datatypes.nfv.RequestedAdditionalCapability + compute_requirements: + type: map + required: false + entry_schema: + type: string + virtual_memory: + type: tosca.datatypes.nfv.VirtualMemory + description: Describes virtual memory of the virtualized compute + required: true + virtual_cpu: + type: tosca.datatypes.nfv.VirtualCpu + description: Describes virtual CPU(s) of the virtualized compute + required: true + virtual_local_storage: + type: list + description: A list of virtual system disks created and destroyed as part of the VM lifecycle + required: false + entry_schema: + type: tosca.datatypes.nfv.VirtualBlockStorageData + description: virtual system disk definition + tosca.capabilities.nfv.VirtualBindable: + derived_from: tosca.capabilities.Node + description: Indicates that the node that includes it can be pointed by a tosca.relationships.nfv.VirtualBindsTo relationship type which is used to model the VduHasCpd association + tosca.capabilities.nfv.VirtualLinkable: + derived_from: tosca.capabilities.Root + description: A node type that includes the VirtualLinkable capability indicates that it can be pointed by tosca.relationships.nfv.VirtualLinksTo relationship type + tosca.capabilities.nfv.ExtVirtualLinkable: + derived_from: tosca.capabilities.Root + tosca.capabilities.nfv.Forwarder: + derived_from: tosca.capabilities.Root + tosca.capabilities.nfv.ext.GuestOs: + derived_from: tosca.capabilities.Root + tosca.capabilities.nfv.ext.ImageFile: + derived_from: tosca.capabilities.Root + tosca.capabilities.nfv.ext.LocalAttachment: + derived_from: tosca.capabilities.Root + tosca.capabilities.nfv.ext.Compute.Container.Architecture: + derived_from: tosca.capabilities.Root + properties: + num_cpus: + type: string + required: false + flavor_extra_specs: + type: map + required: false + entry_schema: + type: string + mem_size: + type: string + required: false + +data_types: + tosca.datatypes.nfv.VnfcAdditionalConfigurableProperties: + derived_from: tosca.datatypes.Root + description: VnfcAdditionalConfigurableProperties type is an empty base type for deriving data types for describing additional configurable properties for a given VNFC. + # below description properties added as optional, since atleast one property required to define a dataType in SDC + properties: + description: + type: string + required: false + tosca.datatypes.nfv.VnfcConfigurableProperties: + derived_from: tosca.datatypes.Root + description: Defines the configurable properties of a VNFC + properties: + additional_vnfc_configurable_properties: + type: tosca.datatypes.nfv.VnfcAdditionalConfigurableProperties + description: Describes additional configuration for VNFC that can be modified using the ModifyVnfInfo operation + required: false + # derived types are expected to introduce + # additional_vnfc_configurable_properties with its type derived from + # tosca.datatypes.nfv.VnfcAdditionalConfigurableProperties + tosca.datatypes.nfv.RequestedAdditionalCapability: + derived_from: tosca.datatypes.Root + description: describes requested additional capability for a particular VDU + properties: + requested_additional_capability_name: + type: string + description: Identifies a requested additional capability for the VDU. + required: true + support_mandatory: + type: boolean + description: Indicates whether the requested additional capability is mandatory for successful operation. + required: true + min_requested_additional_capability_version: + type: string + description: Identifies the minimum version of the requested additional capability. + required: false + preferred_requested_additional_capability_version: + type: string + description: Identifies the preferred version of the requested additional capability. + required: false + target_performance_parameters: + type: map + description: Identifies specific attributes, dependent on the requested additional capability type. + required: true + entry_schema: + type: string + tosca.datatypes.nfv.VirtualMemory: + derived_from: tosca.datatypes.Root + description: supports the specification of requirements related to virtual memory of a virtual compute resource + properties: + virtual_mem_size: + type: scalar-unit.size + description: Amount of virtual memory. + required: true + virtual_mem_oversubscription_policy: + type: string + description: The memory core oversubscription policy in terms of virtual memory to physical memory on the platform. + required: false + vdu_mem_requirements: + type: map + description: The hardware platform specific VDU memory requirements. A map of strings that contains a set of key-value pairs that describes hardware platform specific VDU memory requirements. + required: false + entry_schema: + type: string + numa_enabled: + type: boolean + description: It specifies the memory allocation to be cognisant of the relevant process/core allocation. + required: false + default: false + tosca.datatypes.nfv.VirtualCpuPinning: + derived_from: tosca.datatypes.Root + description: Supports the specification of requirements related to the virtual CPU pinning configuration of a virtual compute resource + properties: + virtual_cpu_pinning_policy: + type: string + description: 'Indicates the policy for CPU pinning. The policy can take values of "static" or "dynamic". In case of "dynamic" the allocation of virtual CPU cores to logical CPU cores is decided by the VIM. (e.g.: SMT (Simultaneous Multi-Threading) requirements). In case of "static" the allocation is requested to be according to the virtual_cpu_pinning_rule.' + required: false + constraints: + - valid_values: [ static, dynamic ] + virtual_cpu_pinning_rule: + type: list + description: Provides the list of rules for allocating virtual CPU cores to logical CPU cores/threads + required: false + entry_schema: + type: string + tosca.datatypes.nfv.VirtualCpu: + derived_from: tosca.datatypes.Root + description: Supports the specification of requirements related to virtual CPU(s) of a virtual compute resource + properties: + cpu_architecture: + type: string + description: CPU architecture type. Examples are x86, ARM + required: false + num_virtual_cpu: + type: integer + description: Number of virtual CPUs + required: true + constraints: + - greater_than: 0 + virtual_cpu_clock: + type: scalar-unit.frequency + description: Minimum virtual CPU clock rate + required: false + virtual_cpu_oversubscription_policy: + type: string + description: CPU core oversubscription policy e.g. the relation of virtual CPU cores to physical CPU cores/threads. + required: false + vdu_cpu_requirements: + type: map + description: The hardware platform specific VDU CPU requirements. A map of strings that contains a set of key-value pairs describing VDU CPU specific hardware platform requirements. + required: false + entry_schema: + type: string + virtual_cpu_pinning: + type: tosca.datatypes.nfv.VirtualCpuPinning + description: The virtual CPU pinning configuration for the virtualised compute resource. + required: false + tosca.datatypes.nfv.LogicalNodeData: + derived_from: tosca.datatypes.Root + description: Describes compute, memory and I/O requirements associated with a particular VDU. + properties: + logical_node_requirements: + type: map + description: The logical node-level compute, memory and I/O requirements. A map of strings that contains a set of key-value pairs that describes hardware platform specific deployment requirements, including the number of CPU cores on this logical node, a memory configuration specific to a logical node or a requirement related to the association of an I/O device with the logical node. + required: false + entry_schema: + type: string + tosca.datatypes.nfv.VirtualNetworkInterfaceRequirements: + derived_from: tosca.datatypes.Root + description: Describes requirements on a virtual network interface + properties: + name: + type: string + description: Provides a human readable name for the requirement. + required: false + description: + type: string + description: Provides a human readable description of the requirement. + required: false + support_mandatory: + type: boolean + description: Indicates whether fulfilling the constraint is mandatory (TRUE) for successful operation or desirable (FALSE). + required: true + network_interface_requirements: + type: map + description: The network interface requirements. A map of strings that contain a set of key-value pairs that describes the hardware platform specific network interface deployment requirements. + required: true + entry_schema: + type: string + nic_io_requirements: + type: tosca.datatypes.nfv.LogicalNodeData + description: references (couples) the CP with any logical node I/O requirements (for network devices) that may have been created. Linking these attributes is necessary so that so that I/O requirements that need to be articulated at the logical node level can be associated with the network interface requirements associated with the CP. + required: false + + tosca.datatypes.nfv.injectFile: #used for vCPE usecase + derived_from: tosca.datatypes.Root + properties: + source_path: + type: string + required: true + dest_path: + type: string + required: true + tosca.datatypes.nfv.L2AddressData: + derived_from: tosca.datatypes.Root + description: Describes the information on the MAC addresses to be assigned to a connection point. + properties: + mac_address_assignment: + type: boolean + description: Specifies if the address assignment is the responsibility of management and orchestration function or not. If it is set to True, it is the management and orchestration function responsibility + required: true + tosca.datatypes.nfv.L3AddressData: + derived_from: tosca.datatypes.Root + description: Provides information about Layer 3 level addressing scheme and parameters applicable to a CP + properties: + ip_address_assignment: + type: boolean + description: Specifies if the address assignment is the responsibility of management and orchestration function or not. If it is set to True, it is the management and orchestration function responsibility + required: true + floating_ip_activated: + type: boolean + description: Specifies if the floating IP scheme is activated on the Connection Point or not + required: true + ip_address_type: + type: string + description: Defines address type. The address type should be aligned with the address type supported by the layer_protocols properties of the parent VnfExtCp + required: false + constraints: + - valid_values: [ ipv4, ipv6 ] + number_of_ip_address: + type: integer + description: Minimum number of IP addresses to be assigned + required: false + constraints: + - greater_than: 0 + fixed_ip_address: #Introduced from Beijing release, only used for vCPE usecase + type: list + entry_schema: + type: string + required: false + tosca.datatypes.nfv.AddressData: + derived_from: tosca.datatypes.Root + description: Describes information about the addressing scheme and parameters applicable to a CP + properties: + address_type: + type: string + description: Describes the type of the address to be assigned to a connection point. The content type shall be aligned with the address type supported by the layerProtocol property of the connection point + required: true + constraints: + - valid_values: [ mac_address, ip_address ] + l2_address_data: + type: tosca.datatypes.nfv.L2AddressData + description: Provides the information on the MAC addresses to be assigned to a connection point. + required: false + l3_address_data: + type: tosca.datatypes.nfv.L3AddressData + description: Provides the information on the IP addresses to be assigned to a connection point + required: false + tosca.datatypes.nfv.ConnectivityType: + derived_from: tosca.datatypes.Root + description: describes additional connectivity information of a virtualLink + properties: + layer_protocols: + type: list + description: Identifies the protocol a virtualLink gives access to (ethernet, mpls, odu2, ipv4, ipv6, pseudo-wire).The top layer protocol of the virtualLink protocol stack shall always be provided. The lower layer protocols may be included when there are specific requirements on these layers. + required: true + entry_schema: + type: string + constraints: + - valid_values: [ ethernet, mpls, odu2, ipv4, ipv6, pseudo-wire ] + flow_pattern: + type: string + description: Identifies the flow pattern of the connectivity + required: false + constraints: + - valid_values: [ line, tree, mesh ] + tosca.datatypes.nfv.VlFlavour: + derived_from: tosca.datatypes.Root + properties: + flavourId: + type: string + tosca.datatypes.nfv.ext.AddressPairs: + properties: + ip: + type: string + required: false + mac: + type: string + required: false + tosca.datatypes.nfv.ext.FloatingIP: + properties: + external_network: + type: string + required: false + ip_address: + type: string + required: false + tosca.datatypes.nfv.ext.LocationInfo: + properties: + availability_zone: + type: string + required: false + vimid: + type: integer + required: false + tenant: + type: string + required: false + tosca.datatypes.nfv.ext.HostRouteInfo: + properties: + destination: + type: string + required: false + nexthop: + type: string + required: false + tosca.datatypes.nfv.ext.InjectData: + properties: + file_name: + type: string + required: false + file_data: + type: string + required: false + tosca.datatypes.nfv.ext.zte.WatchDog: + properties: + enable_delay: + type: integer + required: false + action: + type: string + required: false + tosca.datatypes.nfv.ext.LocalAffinityOrAntiAffinityRule: + properties: + scope: + type: string + required: false + affinity_antiaffinity: + type: string + required: false + tosca.datatypes.nfv.VduProfile: + derived_from: tosca.datatypes.Root + description: describes additional instantiation data for a given Vdu.Compute used in a specific deployment flavour. + properties: + min_number_of_instances: + type: integer + description: Minimum number of instances of the VNFC based on this Vdu.Compute that is permitted to exist for a particular VNF deployment flavour. + required: true + constraints: + - greater_or_equal: 0 + max_number_of_instances: + type: integer + description: Maximum number of instances of the VNFC based on this Vdu.Compute that is permitted to exist for a particular VNF deployment flavour. + required: true + constraints: + - greater_or_equal: 0 + watchdog: #Introduced from Beijing release, only used for vCPE usecase, outside the scope of SOL001 v2.5.1 + type: string + required: true + vmBootUpTimeOut: #Introduced from Beijing release, only used for vCPE usecase, outside the scope of SOL001 v2.5.1 + type: integer + required: false + tosca.datatypes.nfv.LinkBitrateRequirements: + derived_from: tosca.datatypes.Root + description: describes the requirements in terms of bitrate for a virtual link + properties: + root: + type: integer # in bits per second + description: Specifies the throughput requirement in bits per second of the link (e.g. bitrate of E-Line, root bitrate of E-Tree, aggregate capacity of E-LAN). + required: true + constraints: + - greater_or_equal: 0 + leaf: + type: integer # in bits per second + description: Specifies the throughput requirement in bits per second of leaf connections to the link when applicable to the connectivity type (e.g. for E-Tree and E LAN branches). + required: false + constraints: + - greater_or_equal: 0 + tosca.datatypes.nfv.Qos: + derived_from: tosca.datatypes.Root + description: describes QoS data for a given VL used in a VNF deployment flavour + properties: + latency: + type: scalar-unit.time #Number [ms] + description: Specifies the maximum latency + required: true + constraints: + - greater_than: 0 s + packet_delay_variation: + type: scalar-unit.time #Number [ms] + description: Specifies the maximum jitter + required: true + constraints: + - greater_or_equal: 0 s + packet_loss_ratio: + type: float #Number [0 ..1] + description: Specifies the maximum packet loss ratio + required: false + constraints: + - in_range: [ 0.0, 1.0 ] + tosca.datatypes.nfv.IpAllocationPool: + derived_from: tosca.datatypes.Root + description: Specifies a range of IP addresses + properties: + start_ip_address: + type: string + description: The IP address to be used as the first one in a pool of addresses derived from the cidr block full IP range + required: true + end_ip_address: + type: string + description: The IP address to be used as the last one in a pool of addresses derived from the cidr block full IP range + required: true + tosca.datatypes.nfv.L2ProtocolData: + derived_from: tosca.datatypes.Root + description: describes L2 protocol data for a given virtual link used in a specific VNF deployment flavour. + properties: + name: + type: string + description: Identifies the network name associated with this L2 protocol. + required: false + network_type: + type: string + description: Specifies the network type for this L2 protocol.The value may be overridden at run-time. + required: false + constraints: + - valid_values: [ flat, vlan, vxlan, gre ] + vlan_transparent: + type: boolean + description: Specifies whether to support VLAN transparency for this L2 protocol or not. + required: false + default: false + mtu: + type: integer + description: Specifies the maximum transmission unit (MTU) value for this L2 protocol. + required: false + constraints: + - greater_than: 0 + segmentation_id: #Introduced from Beijing release, only used for vCPE usecase, outside the scope of SOL001 v2.5.1 + type: integer + required: false + physical_network: #Introduced from Beijing release, only used for vCPE usecase, outside the scope of SOL001 v2.5.1 + type: string + required: false + tosca.datatypes.nfv.L3ProtocolData: + derived_from: tosca.datatypes.Root + description: describes L3 protocol data for a given virtual link used in a specific VNF deployment flavour. + properties: + name: + type: string + description: Identifies the network name associated with this L3 protocol. + required: false + ip_version: + type: string + description: Specifies IP version of this L3 protocol.The value of the ip_version property shall be consistent with the value of the layer_protocol in the connectivity_type property of the virtual link node. + required: true + constraints: + - valid_values: [ ipv4, ipv6 ] + cidr: + type: string + description: Specifies the CIDR (Classless Inter-Domain Routing) of this L3 protocol. The value may be overridden at run-time. + required: true + ip_allocation_pools: + type: list + description: Specifies the allocation pools with start and end IP addresses for this L3 protocol. The value may be overridden at run-time. + required: false + entry_schema: + type: tosca.datatypes.nfv.IpAllocationPool + gateway_ip: + type: string + description: Specifies the gateway IP address for this L3 protocol. The value may be overridden at run-time. + required: false + dhcp_enabled: + type: boolean + description: Indicates whether DHCP (Dynamic Host Configuration Protocol) is enabled or disabled for this L3 protocol. The value may be overridden at run-time. + required: false + ipv6_address_mode: + type: string + description: Specifies IPv6 address mode. May be present when the value of the ipVersion attribute is "ipv6" and shall be absent otherwise. The value may be overridden at run-time. + required: false + constraints: + - valid_values: [ slaac, dhcpv6-stateful, dhcpv6-stateless ] + tosca.datatypes.nfv.VirtualLinkProtocolData: + derived_from: tosca.datatypes.Root + description: describes one protocol layer and associated protocol data for a given virtual link used in a specific VNF deployment flavour + properties: + associated_layer_protocol: + type: string + description: Identifies one of the protocols a virtualLink gives access to (ethernet, mpls, odu2, ipv4, ipv6, pseudo-wire) as specified by the connectivity_type property. + required: true + constraints: + - valid_values: [ ethernet, mpls, odu2, ipv4, ipv6, pseudo-wire ] + l2_protocol_data: + type: tosca.datatypes.nfv.L2ProtocolData + description: Specifies the L2 protocol data for a virtual link. Shall be present when the associatedLayerProtocol attribute indicates a L2 protocol and shall be absent otherwise. + required: false + l3_protocol_data: + type: tosca.datatypes.nfv.L3ProtocolData + description: Specifies the L3 protocol data for this virtual link. Shall be present when the associatedLayerProtocol attribute indicates a L3 protocol and shall be absent otherwise. + required: false + + tosca.datatypes.nfv.VlProfile: + derived_from: tosca.datatypes.Root + description: Describes additional instantiation data for a given VL used in a specific VNF deployment flavour. + properties: + max_bitrate_requirements: + type: tosca.datatypes.nfv.LinkBitrateRequirements + description: Specifies the maximum bitrate requirements for a VL instantiated according to this profile. + required: true + min_bitrate_requirements: + type: tosca.datatypes.nfv.LinkBitrateRequirements + description: Specifies the minimum bitrate requirements for a VL instantiated according to this profile. + required: true + qos: + type: tosca.datatypes.nfv.Qos + description: Specifies the QoS requirements of a VL instantiated according to this profile. + required: false + virtual_link_protocol_data: + type: list + description: Specifies the protocol data for a virtual link. + required: false + entry_schema: + type: tosca.datatypes.nfv.VirtualLinkProtocolData + tosca.datatypes.nfv.VduLevel: + derived_from: tosca.datatypes.Root + description: Indicates for a given Vdu.Compute in a given level the number of instances to deploy + properties: + number_of_instances: + type: integer + description: Number of instances of VNFC based on this VDU to deploy for this level. + required: true + constraints: + - greater_or_equal: 0 + tosca.datatypes.nfv.ScaleInfo: + derived_from: tosca.datatypes.Root + description: Indicates for a given scaleAspect the corresponding scaleLevel + properties: + scale_level: + type: integer + description: The scale level for a particular aspect + required: true + constraints: + - greater_or_equal: 0 + tosca.datatypes.nfv.ScalingAspect: + derived_from: tosca.datatypes.Root + properties: + name: + type: string + required: true + description: + type: string + required: true + max_scale_level: + type: integer # positiveInteger + required: true + constraints: + - greater_or_equal: 0 + step_deltas: + type: list + required: false + entry_schema: + type: string # Identifier + tosca.datatypes.nfv.InstantiationLevel: + derived_from: tosca.datatypes.Root + description: Describes the scale level for each aspect that corresponds to a given level of resources to be instantiated within a deployment flavour in term of the number VNFC instances + properties: + description: + type: string + description: Human readable description of the level + required: true + scale_info: + type: map # key: aspectId + description: Represents for each aspect the scale level that corresponds to this instantiation level. scale_info shall be present if the VNF supports scaling. + required: false + entry_schema: + type: tosca.datatypes.nfv.ScaleInfo + tosca.datatypes.nfv.VnfInstantiateOperationConfiguration: + derived_from: tosca.datatypes.Root + description: represents information that affect the invocation of the InstantiateVnf operation. + properties: + description: + type: string + required: false + tosca.datatypes.nfv.VnfScaleOperationConfiguration: + derived_from: tosca.datatypes.Root + description: Represents information that affect the invocation of the ScaleVnf operation + properties: + scaling_by_more_than_one_step_supported: + type: boolean + description: Signals whether passing a value larger than one in the numScalingSteps parameter of the ScaleVnf operation is supported by this VNF. + required: false + default: false + tosca.datatypes.nfv.VnfScaleToLevelOperationConfiguration: + derived_from: tosca.datatypes.Root + description: represents information that affect the invocation of the ScaleVnfToLevel operation + properties: + arbitrary_target_levels_supported: + type: boolean + description: Signals whether scaling according to the parameter "scaleInfo" is supported by this VNF + required: true + tosca.datatypes.nfv.VnfHealOperationConfiguration: + derived_from: tosca.datatypes.Root + description: represents information that affect the invocation of the HealVnf operation + properties: + causes: + type: list + description: Supported "cause" parameter values + required: false + entry_schema: + type: string + tosca.datatypes.nfv.VnfTerminateOperationConfiguration: + derived_from: tosca.datatypes.Root + description: represents information that affect the invocation of the TerminateVnf + properties: + min_graceful_termination_timeout: + type: scalar-unit.time # For TOSCA V1.2 use type as scalar-unit.time instead of integer + description: Minimum timeout value for graceful termination of a VNF instance + required: true + max_recommended_graceful_termination_timeout: + type: scalar-unit.time # For TOSCA V1.2 use type as scalar-unit.time instead of integer + description: Maximum recommended timeout value that can be needed to gracefully terminate a VNF instance of a particular type under certain conditions, such as maximum load condition. This is provided by VNF provider as information for the operator facilitating the selection of optimal timeout value. This value is not used as constraint + required: false + tosca.datatypes.nfv.VnfOperateOperationConfiguration: + derived_from: tosca.datatypes.Root + description: represents information that affect the invocation of the OperateVnf operation + properties: + min_graceful_stop_timeout: + type: scalar-unit.time + description: Minimum timeout value for graceful stop of a VNF instance + required: true + max_recommended_graceful_stop_timeout: + type: scalar-unit.time + description: Maximum recommended timeout value that can be needed to gracefully stop a VNF instance of a particular type under certain conditions, such as maximum load condition. This is provided by VNF provider as information for the operator facilitating the selection of optimal timeout value. This value is not used as constraint + required: false + tosca.datatypes.nfv.VnfChangeFlavourOperationConfiguration: + derived_from: tosca.datatypes.Root + description: represents information that affect the invocation of the ChangeVnfFlavour operation + properties: + description: + type: string + required: false + tosca.datatypes.nfv.VnfProfile: + derived_from: tosca.datatypes.Root + description: describes a profile for instantiating VNFs of a particular NS DF according to a specific VNFD and VNF DF. + properties: + instantiation_level: + type: string + description: Identifier of the instantiation level of the VNF DF to be used for instantiation. If not present, the default instantiation level as declared in the VNFD shall be used. + required: false + min_number_of_instances: + type: integer + description: Minimum number of instances of the VNF based on this VNFD that is permitted to exist for this VnfProfile. + required: true + constraints: + - greater_or_equal: 0 + max_number_of_instances: + type: integer + description: Maximum number of instances of the VNF based on this VNFD that is permitted to exist for this VnfProfile. + required: true + constraints: + - greater_or_equal: 0 + tosca.datatypes.nfv.UriAuthority: + derived_from: tosca.datatypes.Root + description: information that corresponds to the authority component of a URI as specified in IETF RFC 3986 [8] + properties: + user_info: + type: string # shall comply with IETF RFC 3986 + description: user_info field of the authority component of a URI + required: false + host: + type: string # shall comply with IETF RFC 3986 + description: host field of the authority component of a URI + required: false + port: + type: string # shall comply with IETF RFC 3986 + description: port field of the authority component of a URI + required: false + tosca.datatypes.nfv.UriComponents: + derived_from: tosca.datatypes.Root + description: information used to build a URI that complies with IETF RFC 3986 [8]. + properties: + scheme: + type: string # shall comply with IETF RFC3986 + description: scheme component of a URI. + required: true + authority: + type: tosca.datatypes.nfv.UriAuthority + description: Authority component of a URI + required: false + path: + type: string # shall comply with IETF RFC 3986 + description: path component of a URI. + required: false + query: + type: string # shall comply with IETF RFC 3986 + description: query component of a URI. + required: false + fragment: + type: string # shall comply with IETF RFC 3986 + description: fragment component of a URI. + required: false + tosca.datatypes.nfv.InterfaceDetails: + derived_from: tosca.datatypes.Root + description: information used to access an interface exposed by a VNF + properties: + uri_components: + type: tosca.datatypes.nfv.UriComponents + description: Provides components to build a Uniform Ressource Identifier (URI) where to access the interface end point. + required: false + interface_specific_data: + type: map + description: Provides additional details that are specific to the type of interface considered. + required: false + entry_schema: + type: string + tosca.datatypes.nfv.VirtualLinkMonitoringParameter: + derived_from: tosca.datatypes.Root + description: Represents information on virtualised resource related performance metrics applicable to the VNF. + properties: + name: + type: string + description: Human readable name of the monitoring parameter + required: true + performance_metric: + type: string + description: Identifies a performance metric derived from those defined in ETSI GS NFV-IFA 027.The packetOutgoingVirtualLink and packetIncomingVirtualLink metrics shall be obtained by aggregation the PacketOutgoing and PacketIncoming measurements defined in clause 7.1 of GS NFV-IFA 027 of all virtual link ports attached to the virtual link to which the metrics apply. + required: true + constraints: + - valid_values: [ packet_outgoing_virtual_link, packet_incoming_virtual_link ] + collection_period: + type: scalar-unit.time + description: Describes the recommended periodicity at which to collect the performance information. + required: false + constraints: + - greater_than: 0 s + tosca.datatypes.nfv.VnfcMonitoringParameter: + derived_from: tosca.datatypes.Root + description: Represents information on virtualised resource related performance metrics applicable to the VNF. + properties: + name: + type: string + description: Human readable name of the monitoring parameter + required: true + performance_metric: + type: string + description: Identifies the performance metric, according to ETSI GS NFV-IFA 027. + required: true + constraints: + - valid_values: [ v_cpu_usage_mean_vnf, v_cpu_usage_peak_vnf, v_memory_usage_mean_vnf, v_memory_usage_peak_vnf, v_disk_usage_mean_vnf, v_disk_usage_peak_vnf, byte_incoming_vnf_int_cp, byte_outgoing_vnf_int_cp, packet_incoming_vnf_int_cp, packet_outgoing_vnf_int_cp ] + collection_period: + type: scalar-unit.time + description: Describes the recommended periodicity at which to collect the performance information. + required: false + constraints: + - greater_than: 0 s + tosca.datatypes.nfv.VnfChangeExtConnectivityOperationConfiguration: + derived_from: tosca.datatypes.Root + description: represents information that affect the invocation of the ChangeExtVnfConnectivity operation + properties: + description: + type: string + required: false + tosca.datatypes.nfv.VnfMonitoringParameter: + derived_from: tosca.datatypes.Root + description: Represents information on virtualised resource related performance metrics applicable to the VNF. + properties: + name: + type: string + description: Human readable name of the monitoring parameter + required: true + performance_metric: + type: string + description: Identifies the performance metric, according to ETSI GS NFV-IFA 027. + required: true + constraints: + - valid_values: [ v_cpu_usage_mean_vnf, v_cpu_usage_peak_vnf, v_memory_usage_mean_vnf, v_memory_usage_peak_vnf, v_disk_usage_mean_vnf, v_disk_usage_peak_vnf, byte_incoming_vnf_ext_cp, byte_outgoing_vnf_ext_cp, packet_incoming_vnf_ext_cp, packet_outgoing_vnf_ext_cp ] + collection_period: + type: scalar-unit.time + description: Describes the recommended periodicity at which to collect the performance information. + required: false + constraints: + - greater_than: 0 s + tosca.datatypes.nfv.VnfLcmOperationsConfiguration: + derived_from: tosca.datatypes.Root + description: Represents information to configure lifecycle management operations + properties: + instantiate: + type: tosca.datatypes.nfv.VnfInstantiateOperationConfiguration + description: Configuration parameters for the InstantiateVnf operation + required: false + scale: + type: tosca.datatypes.nfv.VnfScaleOperationConfiguration + description: Configuration parameters for the ScaleVnf operation + required: false + scale_to_level: + type: tosca.datatypes.nfv.VnfScaleToLevelOperationConfiguration + description: Configuration parameters for the ScaleVnfToLevel operation + required: false + change_flavour: + type: tosca.datatypes.nfv.VnfChangeFlavourOperationConfiguration + description: Configuration parameters for the changeVnfFlavourOpConfig operation + required: false + heal: + type: tosca.datatypes.nfv.VnfHealOperationConfiguration + description: Configuration parameters for the HealVnf operation + required: false + terminate: + type: tosca.datatypes.nfv.VnfTerminateOperationConfiguration + description: Configuration parameters for the TerminateVnf operation + required: false + operate: + type: tosca.datatypes.nfv.VnfOperateOperationConfiguration + description: Configuration parameters for the OperateVnf operation + required: false + change_ext_connectivity: + type: tosca.datatypes.nfv.VnfChangeExtConnectivityOperationConfiguration + description: Configuration parameters for the changeExtVnfConnectivityOpConfig operation + required: false + tosca.datatypes.nfv.CpProtocolData: + derived_from: tosca.datatypes.Root + description: Describes and associates the protocol layer that a CP uses together with other protocol and connection point information + properties: + associated_layer_protocol: + type: string + required: true + description: One of the values of the property layer_protocols of the CP + constraints: + - valid_values: [ ethernet, mpls, odu2, ipv4, ipv6, pseudo-wire ] + address_data: + type: list + description: Provides information on the addresses to be assigned to the CP + entry_schema: + type: tosca.datatypes.nfv.AddressData + required: false + tosca.datatypes.nfv.VnfAdditionalConfigurableProperties: + derived_from: tosca.datatypes.Root + description: is an empty base type for deriving data types for describing additional configurable properties for a given VNF + # below description properties added as optional, since atleast one property required to define a dataType in SDC + properties: + description: + type: string + required: false + tosca.datatypes.nfv.VnfConfigurableProperties: + derived_from: tosca.datatypes.Root + description: indicates configuration properties for a given VNF (e.g. related to auto scaling and auto healing). + properties: + is_autoscale_enabled: + type: boolean + description: It permits to enable (TRUE)/disable (FALSE) the auto-scaling functionality. If the properties is not present for configuring, then VNF property is not supported + required: false + is_autoheal_enabled: + type: boolean + description: It permits to enable (TRUE)/disable (FALSE) the auto-healing functionality. If the properties is not present for configuring, then VNF property is not supported + required: false + additional_configurable_properties: + description: It provides VNF specific configurable properties that can be modified using the ModifyVnfInfo operation + required: false + type: tosca.datatypes.nfv.VnfAdditionalConfigurableProperties + # derived types are expected to introduce + # additional_configurable_properties with its type derived from + # tosca.datatypes.nfv.VnfAdditionalConfigurableProperties + tosca.datatypes.nfv.VnfInfoModifiableAttributesExtensions: + derived_from: tosca.datatypes.Root + description: is an empty base type for deriving data types for describing VNF-specific extension + # below description properties added as optional, since atleast one property required to define a dataType in SDC + properties: + description: + type: string + required: false + tosca.datatypes.nfv.VnfInfoModifiableAttributesMetadata: + derived_from: tosca.datatypes.Root + description: is an empty base type for deriving data types for describing VNF-specific metadata + # below description properties added as optional, since atleast one property required to define a dataType in SDC + properties: + description: + type: string + required: false + tosca.datatypes.nfv.VnfInfoModifiableAttributes: + derived_from: tosca.datatypes.Root + description: Describes VNF-specific extension and metadata for a given VNF + properties: + extensions: + type: tosca.datatypes.nfv.VnfInfoModifiableAttributesExtensions + description: \"Extension\" properties of VnfInfo that are writeable + required: false + # derived types are expected to introduce + # extensions with its type derived from + # tosca.datatypes.nfv.VnfInfoModifiableAttributesExtensions + metadata: + type: tosca.datatypes.nfv.VnfInfoModifiableAttributesMetadata + description: \"Metadata\" properties of VnfInfo that are writeable + required: false + # derived types are expected to introduce + # metadata with its type derived from + # tosca.datatypes.nfv.VnfInfoModifiableAttributesMetadata + tosca.datatypes.nfv.VirtualLinkBitrateLevel: + derived_from: tosca.datatypes.Root + description: Describes bitrate requirements applicable to the virtual link instantiated from a particicular VnfVirtualLink + properties: + description: + type: string + required: false + bitrate_requirements: + type: tosca.datatypes.nfv.LinkBitrateRequirements + description: Virtual link bitrate requirements for an instantiation level or bitrate delta for a scaling step + required: true + tosca.datatypes.nfv.VnfOperationAdditionalParameters: + derived_from: tosca.datatypes.Root + description: Is an empty base type for deriving data type for describing VNF-specific parameters to be passed when invoking lifecycle management operations + # below description properties added as optional, since atleast one property required to define a dataType in SDC + properties: + description: + type: string + required: false + tosca.datatypes.nfv.VirtualFileStorageData: + derived_from: tosca.datatypes.Root + description: VirtualFileStorageData describes file storage requirements associated with compute resources in a particular VDU + properties: + size_of_storage: + type: scalar-unit.size + description: Size of virtualized storage resource + required: true + file_system_protocol: + type: string + description: The shared file system protocol (e.g. NFS, CIFS) + required: true + tosca.datatypes.nfv.VirtualObjectStorageData: + derived_from: tosca.datatypes.Root + description: VirtualObjectStorageData describes object storage requirements associated with compute resources in a particular VDU + properties: + max_size_of_storage: + type: scalar-unit.size + description: Maximum size of virtualized storage resource + required: false + tosca.datatypes.nfv.VirtualBlockStorageData: + derived_from: tosca.datatypes.Root + description: VirtualBlockStorageData describes block storage requirements associated with compute resources in a particular VDU, either as a local disk or as virtual attached storage + properties: + size_of_storage: + type: scalar-unit.size + description: Size of virtualised storage resource + required: true + vdu_storage_requirements: + type: map + description: The hardware platform specific storage requirements. A map of strings that contains a set of key-value pairs that represents the hardware platform specific storage deployment requirements. + required: false + entry_schema: + type: string + rdma_enabled: + type: boolean + description: Indicates if the storage support RDMA + required: false + default: false + tosca.datatypes.nfv.SwImageData: + derived_from: tosca.datatypes.Root + description: describes information related to a software image artifact + properties: # in SOL001 v0.8.0: "properties or metadata:" + name: + type: string + description: Name of this software image + required: true + version: + type: string + description: Version of this software image + required: true + checksum: + type: string + description: Checksum of the software image file + required: true + container_format: + type: string + description: The container format describes the container file format in which software image is provided + required: true + constraints: + - valid_values: [ aki, ami, ari, bare, docker, ova, ovf ] + disk_format: + type: string + description: The disk format of a software image is the format of the underlying disk image + required: true + constraints: + - valid_values: [ aki, ami, ari, iso, qcow2, raw, vdi, vhd, vhdx, vmdk ] + min_disk: + type: scalar-unit.size # Number + description: The minimal disk size requirement for this software image + required: true + min_ram: + type: scalar-unit.size # Number + description: The minimal RAM requirement for this software image + required: false + size: + type: scalar-unit.size # Number + description: The size of this software image + required: true + operating_system: + type: string + description: Identifies the operating system used in the software image + required: false + supported_virtualisation_environments: + type: list + description: Identifies the virtualisation environments (e.g. hypervisor) compatible with this software image + required: false + entry_schema: + type: string + +interface_types: + tosca.interfaces.nfv.Vnflcm: + #derived_from: tosca.interfaces.Root + #description: This interface encompasses a set of TOSCA operations corresponding to the VNF LCM operations defined in ETSI GS NFV-IFA 007 as well as to preamble and postamble procedures to the execution of the VNF LCM operations. + instantiate: + description: Invoked upon receipt of an Instantiate VNF request + # inputs: + # additional_parameters: + # type: tosca.datatypes.nfv.VnfOperationAdditionalParameters + # required: false + # derived types are expected to introduce additional_parameters with + # its type derived from + # tosca.datatypes.nfv.VnfOperationAdditionalParameters + instantiate_start: + description: Invoked before instantiate + instantiate_end: + description: Invoked after instantiate + terminate: + description: Invoked upon receipt Terminate VNF request + # inputs: + # additional_parameters: + # type: tosca.datatypes.nfv.VnfOperationAdditionalParameters + # required: false + # derived types are expected to introduce additional_parameters with + # its type derived from + # tosca.datatypes.nfv.VnfOperationAdditionalParameters + terminate_start: + description: Invoked before terminate + terminate_end: + description: Invoked after terminate + modify_information: + description: Invoked upon receipt of a Modify VNF Information request + modify_information_start: + description: Invoked before modify_information + modify_information_end: + description: Invoked after modify_information + change_flavour: + description: Invoked upon receipt of a Change VNF Flavour request + # inputs: + # additional_parameters: + # type: tosca.datatypes.nfv.VnfOperationAdditionalParameters + # required: false + # derived types are expected to introduce additional_parameters with + # its type derived from + # tosca.datatypes.nfv.VnfOperationAdditionalParameters + change_flavour_start: + description: Invoked before change_flavour + change_flavour_end: + description: Invoked after change_flavour + change_external_connectivity: + description: Invoked upon receipt of a Change External VNF Connectivity request + # inputs: + # additional_parameters: + # type: tosca.datatypes.nfv.VnfOperationAdditionalParameters + # required: false + # derived types are expected to introduce additional_parameters with + # its type derived from + # tosca.datatypes.nfv.VnfOperationAdditionalParameters + change_external_connectivity_start: + description: Invoked before change_external_connectivity + change_external_connectivity_end: + description: Invoked after change_external_connectivity + operate: + description: Invoked upon receipt of an Operate VNF request + # inputs: + # additional_parameters: + # type: tosca.datatypes.nfv.VnfOperationAdditionalParameters + # required: false + # derived types are expected to introduce additional_parameters with + # its type derived from + # tosca.datatypes.nfv.VnfOperationAdditionalParameters + operate_start: + description: Invoked before operate + operate_end: + description: Invoked after operate + heal: + description: Invoked upon receipt of a Heal VNF request + # inputs: + # additional_parameters: + # type: tosca.datatypes.nfv.VnfOperationAdditionalParameters + # required: false + # derived types are expected to introduce additional_parameters with + # its type derived from + # tosca.datatypes.nfv.VnfOperationAdditionalParameters + heal_start: + description: Invoked before heal + heal_end: + description: Invoked after heal + scale: + description: Invoked upon receipt of a Scale VNF request + # inputs: + # additional_parameters: + # type: tosca.datatypes.nfv.VnfOperationAdditionalParameters + # required: false + # derived types are expected to introduce additional_parameters with + # its type derived from + # tosca.datatypes.nfv.VnfOperationAdditionalParameters + scale_start: + description: Invoked before scale + scale_end: + description: Invoked after scale + scale_to_level: + description: Invoked upon receipt of a Scale VNF to Level request + # inputs: + # additional_parameters: + # type: tosca.datatypes.nfv.VnfOperationAdditionalParameters + # required: false + # derived types are expected to introduce additional_parameters with + # its type derived from + # tosca.datatypes.nfv.VnfOperationAdditionalParameters + scale_to_level_start: + description: Invoked before scale_to_level + scale_to_level_end: + description: Invoked after scale_to_level + +node_types: + tosca.nodes.nfv.Vdu.Compute: + derived_from: tosca.nodes.Root + description: Describes the virtual compute part of a VDU which is a construct supporting the description of the deployment and operational behavior of a VNFC + properties: + name: + type: string + description: Human readable name of the VDU + required: true + description: + type: string + description: Human readable description of the VDU + required: true + boot_order: + type: list # explicit index (boot index) not necessary, contrary to IFA011 + description: References a node template name from which a valid boot device is created + required: false + entry_schema: + type: string + nfvi_constraints: + type: list + description: Describes constraints on the NFVI for the VNFC instance(s) created from this VDU + required: false + entry_schema: + type: string + monitoring_parameters: + type: list + description: Describes monitoring parameters applicable to a VNFC instantiated from this VDU + required: false + entry_schema: + type: tosca.datatypes.nfv.VnfcMonitoringParameter + #configurable_properties: + #type: tosca.datatypes.nfv.VnfcConfigurableProperties + #required: false + # derived types are expected to introduce + # configurable_properties with its type derived from + # tosca.datatypes.nfv.VnfcConfigurableProperties + vdu_profile: + type: tosca.datatypes.nfv.VduProfile + description: Defines additional instantiation data for the VDU.Compute node + required: true + sw_image_data: + type: tosca.datatypes.nfv.SwImageData + description: Defines information related to a SwImage artifact used by this Vdu.Compute node + required: false # property is required when the node template has an associated artifact of type tosca.artifacts.nfv.SwImage and not required otherwise + boot_data: + type: string + description: Contains a string or a URL to a file contained in the VNF package used to customize a virtualised compute resource at boot time. The bootData may contain variable parts that are replaced by deployment specific values before being sent to the VIM. + required: false + inject_files: #Introduced from Beijing release, used for vCPE usecase, outside the scope of SOL001 v2.5.1 + type: tosca.datatypes.nfv.injectFile + required: false #Aligned with ONAP R2 IM. it should be false. + meta_data: #Introduced from Beijing release, used for metadata attached to the VM or container, outside the scope of SOL001 v2.5.1 + type: map + entry_schema: + type: string + required: false + capabilities: + virtual_compute: + type: tosca.capabilities.nfv.VirtualCompute + occurrences: [ 1, 1 ] + virtual_binding: + type: tosca.capabilities.nfv.VirtualBindable + occurrences: [ 1, UNBOUNDED ] + requirements: + - virtual_storage: + capability: tosca.capabilities.nfv.VirtualStorage + relationship: tosca.relationships.nfv.AttachesTo + occurrences: [ 0, UNBOUNDED ] + tosca.nodes.nfv.Vdu.VirtualBlockStorage: + derived_from: tosca.nodes.Root + description: This node type describes the specifications of requirements related to virtual block storage resources + properties: + virtual_block_storage_data: + type: tosca.datatypes.nfv.VirtualBlockStorageData + description: Describes the block storage characteristics. + required: true + sw_image_data: + type: tosca.datatypes.nfv.SwImageData + description: Defines information related to a SwImage artifact used by this Vdu.Compute node. + required: false # property is required when the node template has an associated artifact of type tosca.artifacts.nfv.SwImage and not required otherwise + capabilities: + virtual_storage: + type: tosca.capabilities.nfv.VirtualStorage + description: Defines the capabilities of virtual_storage. + tosca.nodes.nfv.Vdu.VirtualFileStorage: + derived_from: tosca.nodes.Root + description: This node type describes the specifications of requirements related to virtual file storage resources + properties: + virtual_file_storage_data: + type: tosca.datatypes.nfv.VirtualFileStorageData + description: Describes the file storage characteristics. + required: true + capabilities: + virtual_storage: + type: tosca.capabilities.nfv.VirtualStorage + description: Defines the capabilities of virtual_storage. + requirements: + - virtual_link: + capability: tosca.capabilities.nfv.VirtualLinkable + relationship: tosca.relationships.nfv.VirtualLinksTo + #description: Describes the requirements for linking to virtual link + tosca.nodes.nfv.Vdu.VirtualObjectStorage: + derived_from: tosca.nodes.Root + description: This node type describes the specifications of requirements related to virtual object storage resources + properties: + virtual_object_storage_data: + type: tosca.datatypes.nfv.VirtualObjectStorageData + description: Describes the object storage characteristics. + required: true + capabilities: + virtual_storage: + type: tosca.capabilities.nfv.VirtualStorage + description: Defines the capabilities of virtual_storage. + tosca.nodes.nfv.Cp: + derived_from: tosca.nodes.Root + description: Provides information regarding the purpose of the connection point + properties: + layer_protocols: + type: list + description: Identifies which protocol the connection point uses for connectivity purposes + required: true + entry_schema: + type: string + constraints: + - valid_values: [ ethernet, mpls, odu2, ipv4, ipv6, pseudo-wire ] + role: #Name in ETSI NFV IFA011 v0.7.3: cpRole + type: string + description: Identifies the role of the port in the context of the traffic flow patterns in the VNF or parent NS + required: false + constraints: + - valid_values: [ root, leaf ] + description: + type: string + description: Provides human-readable information on the purpose of the connection point + required: false + protocol: + type: list + description: Provides information on the addresses to be assigned to the connection point(s) instantiated from this Connection Point Descriptor + required: false + entry_schema: + type: tosca.datatypes.nfv.CpProtocolData + trunk_mode: + type: boolean + description: Provides information about whether the CP instantiated from this Cp is in Trunk mode (802.1Q or other), When operating in "trunk mode", the Cp is capable of carrying traffic for several VLANs. Absence of this property implies that trunkMode is not configured for the Cp i.e. It is equivalent to boolean value "false". + required: false + allowed_address_data: # #Introduced from Beijing release, align with resource IM, outside the scope of SOL001 v2.5.1 + type: tosca.datatypes.nfv.AddressData # In the IM, it is a array, but here it is not a array. TBD. + required: false + tosca.nodes.nfv.VduCp: + derived_from: tosca.nodes.nfv.Cp + description: describes network connectivity between a VNFC instance based on this VDU and an internal VL + properties: + bitrate_requirement: + type: integer # in bits per second + description: Bitrate requirement in bit per second on this connection point + required: false + constraints: + - greater_or_equal: 0 + virtual_network_interface_requirements: + type: list + description: Specifies requirements on a virtual network interface realising the CPs instantiated from this CPD + required: false + entry_schema: + type: tosca.datatypes.nfv.VirtualNetworkInterfaceRequirements + order: + type: integer + description: The order of the NIC on the compute instance (e.g.eth2) + required: false + constraints: + - greater_or_equal: 0 + vnic_type: + type: string + description: Describes the type of the virtual network interface realizing the CPs instantiated from this CPD + required: false + constraints: + - valid_values: [ direct, normal, virtio, direct-physical ] + vnic_name: # Introduced from Beijing release, aligned with ONAP resource IM, outside the scope of SOL001 v2.5.1 + type: string + required: false + requirements: + - virtual_link: + capability: tosca.capabilities.nfv.VirtualLinkable + relationship: tosca.relationships.nfv.VirtualLinksTo + - virtual_binding: + capability: tosca.capabilities.nfv.VirtualBindable + relationship: tosca.relationships.nfv.VirtualBindsTo + node: tosca.nodes.nfv.Vdu.Compute + tosca.nodes.nfv.VnfVirtualLink: + derived_from: tosca.nodes.Root + description: Describes the information about an internal VNF VL + properties: + connectivity_type: + type: tosca.datatypes.nfv.ConnectivityType + description: Specifies the protocol exposed by the VL and the flow pattern supported by the VL + required: true + description: + type: string + description: Provides human-readable information on the purpose of the VL + required: false + test_access: + type: list + description: Test access facilities available on the VL + required: false + entry_schema: + type: string + constraints: + - valid_values: [ passive_monitoring, active_loopback ] + vl_profile: + type: tosca.datatypes.nfv.VlProfile + description: Defines additional data for the VL + required: true + monitoring_parameters: + type: list + description: Describes monitoring parameters applicable to the VL + required: false + entry_schema: + type: tosca.datatypes.nfv.VirtualLinkMonitoringParameter + capabilities: + virtual_linkable: + type: tosca.capabilities.nfv.VirtualLinkable + tosca.nodes.nfv.VNF: + derived_from: tosca.nodes.Root + description: The generic abstract type from which all VNF specific abstract node types shall be derived to form, together with other node types, the TOSCA service template(s) representing the VNFD + properties: + descriptor_id: # instead of vnfd_id + type: string # GUID + description: Globally unique identifier of the VNFD + required: true + descriptor_version: # instead of vnfd_version + type: string + description: Identifies the version of the VNFD + required: true + provider: # instead of vnf_provider + type: string + description: Provider of the VNF and of the VNFD + required: true + product_name: # instead of vnf_product_name + type: string + description: Human readable name for the VNF Product + required: true + software_version: # instead of vnf_software_version + type: string + description: Software version of the VNF + required: true + product_info_name: # instead of vnf_product_info_name + type: string + description: Human readable name for the VNF Product + required: false + product_info_description: # instead of vnf_product_info_description + type: string + description: Human readable description of the VNF Product + required: false + vnfm_info: + type: list + required: true + description: Identifies VNFM(s) compatible with the VNF + entry_schema: + type: string + localization_languages: + type: list + description: Information about localization languages of the VNF + required: false + entry_schema: + type: string #IETF RFC 5646 string + default_localization_language: + type: string #IETF RFC 5646 string + description: Default localization language that is instantiated if no information about selected localization language is available + required: false + #configurable_properties: + #type: tosca.datatypes.nfv.VnfConfigurableProperties + #description: Describes the configurable properties of the VNF + #required: false + # derived types are expected to introduce configurable_properties + # with its type derived from + # tosca.datatypes.nfv.VnfConfigurableProperties + #modifiable_attributes: + #type: tosca.datatypes.nfv.VnfInfoModifiableAttributes + #description: Describes the modifiable attributes of the VNF + #required: false + # derived types are expected to introduce modifiable_attributes + # with its type derived from + # tosca.datatypes.nfv.VnfInfoModifiableAttributes + lcm_operations_configuration: + type: tosca.datatypes.nfv.VnfLcmOperationsConfiguration + description: Describes the configuration parameters for the VNF LCM operations + required: false + monitoring_parameters: + type: list + entry_schema: + type: tosca.datatypes.nfv.VnfMonitoringParameter + description: Describes monitoring parameters applicable to the VNF. + required: false + flavour_id: + type: string + description: Identifier of the Deployment Flavour within the VNFD + required: true + flavour_description: + type: string + description: Human readable description of the DF + required: true + #vnf_profile: + # type: tosca.datatypes.nfv.VnfProfile + # description: Describes a profile for instantiating VNFs of a particular NS DF according to a specific VNFD and VNF DF + # required: false + requirements: + - virtual_link: + capability: tosca.capabilities.nfv.VirtualLinkable + relationship: tosca.relationships.nfv.VirtualLinksTo + occurrences: [ 0, 1 ] + interfaces: + Vnflcm: + type: tosca.interfaces.nfv.Vnflcm + tosca.nodes.nfv.VnfExtCp: + derived_from: tosca.nodes.nfv.Cp + description: Describes a logical external connection point, exposed by the VNF enabling connection with an external Virtual Link + properties: + virtual_network_interface_requirements: + type: list + description: The actual virtual NIC requirements that is been assigned when instantiating the connection point + required: false + entry_schema: + type: tosca.datatypes.nfv.VirtualNetworkInterfaceRequirements + requirements: + - external_virtual_link: + capability: tosca.capabilities.nfv.VirtualLinkable + relationship: tosca.relationships.nfv.VirtualLinksTo + - internal_virtual_link: #name in ETSI NFV IFA011 v0.7.3: intVirtualLinkDesc + capability: tosca.capabilities.nfv.VirtualLinkable + relationship: tosca.relationships.nfv.VirtualLinksTo + +relationship_types: + tosca.relationships.nfv.VirtualBindsTo: + derived_from: tosca.relationships.DependsOn + description: Represents an association relationship between Vdu.Compute and VduCp node types + valid_target_types: [ tosca.capabilities.nfv.VirtualBindable ] + tosca.relationships.nfv.VirtualLinksTo: + derived_from: tosca.relationships.DependsOn + description: Represents an association relationship between the VduCp and VnfVirtualLink node types + valid_target_types: [ tosca.capabilities.nfv.VirtualLinkable ] + tosca.relationships.nfv.AttachesTo: + derived_from: tosca.relationships.Root + description: Represents an association relationship between the Vdu.Compute and one of the node types, Vdu.VirtualBlockStorage, Vdu.VirtualObjectStorage or Vdu.VirtualFileStorage + valid_target_types: [ tosca.capabilities.nfv.VirtualStorage ] + +group_types: + tosca.groups.nfv.PlacementGroup: + derived_from: tosca.groups.Root + description: PlacementGroup is used for describing the affinity or anti-affinity relationship applicable between the virtualization containers to be created based on different VDUs, or between internal VLs to be created based on different VnfVirtualLinkDesc(s) + properties: + description: + type: string + description: Human readable description of the group + required: true + members: [ tosca.nodes.nfv.Vdu.Compute, tosca.nodes.nfv.VnfVirtualLink ] + +policy_types: + tosca.policies.nfv.InstantiationLevels: + derived_from: tosca.policies.Root + description: The InstantiationLevels type is a policy type representing all the instantiation levels of resources to be instantiated within a deployment flavour and including default instantiation level in term of the number of VNFC instances to be created as defined in ETSI GS NFV-IFA 011 [1]. + properties: + levels: + type: map # key: levelId + description: Describes the various levels of resources that can be used to instantiate the VNF using this flavour. + required: true + entry_schema: + type: tosca.datatypes.nfv.InstantiationLevel + default_level: + type: string # levelId + description: The default instantiation level for this flavour. + required: false # required if multiple entries in levels + tosca.policies.nfv.VduInstantiationLevels: + derived_from: tosca.policies.Root + description: The VduInstantiationLevels type is a policy type representing all the instantiation levels of resources to be instantiated within a deployment flavour in term of the number of VNFC instances to be created from each vdu.Compute. as defined in ETSI GS NFV-IFA 011 [1] + properties: + levels: + type: map # key: levelId + description: Describes the Vdu.Compute levels of resources that can be used to instantiate the VNF using this flavour + required: true + entry_schema: + type: tosca.datatypes.nfv.VduLevel + targets: [ tosca.nodes.nfv.Vdu.Compute ] + tosca.policies.nfv.VirtualLinkInstantiationLevels: + derived_from: tosca.policies.Root + description: The VirtualLinkInstantiationLevels type is a policy type representing all the instantiation levels of virtual link resources to be instantiated within a deployment flavour as defined in ETSI GS NFV-IFA 011 [1]. + properties: + levels: + type: map # key: levelId + description: Describes the virtual link levels of resources that can be used to instantiate the VNF using this flavour. + required: true + entry_schema: + type: tosca.datatypes.nfv.VirtualLinkBitrateLevel + targets: [ tosca.nodes.nfv.VnfVirtualLink ] + tosca.policies.nfv.ScalingAspects: + derived_from: tosca.policies.Root + description: The ScalingAspects type is a policy type representing the scaling aspects used for horizontal scaling as defined in ETSI GS NFV-IFA 011 [1]. + properties: + aspects: + type: map # key: aspectId + description: Describe maximum scale level for total number of scaling steps that can be applied to a particular aspect + required: true + entry_schema: + type: tosca.datatypes.nfv.ScalingAspect + tosca.policies.nfv.VduScalingAspectDeltas: + derived_from: tosca.policies.Root + description: The VduScalingAspectDeltas type is a policy type representing the Vdu.Compute detail of an aspect deltas used for horizontal scaling, as defined in ETSI GS NFV-IFA 011 [1]. + properties: + aspect: + type: string + description: Represents the scaling aspect to which this policy applies + required: true + deltas: + type: map # key: scalingDeltaId + description: Describes the Vdu.Compute scaling deltas to be applied for every scaling steps of a particular aspect. + required: true + entry_schema: + type: tosca.datatypes.nfv.VduLevel + targets: [ tosca.nodes.nfv.Vdu.Compute ] + tosca.policies.nfv.VirtualLinkBitrateScalingAspectDeltas: + derived_from: tosca.policies.Root + description: The VirtualLinkBitrateScalingAspectDeltas type is a policy type representing the VnfVirtualLink detail of an aspect deltas used for horizontal scaling, as defined in ETSI GS NFV-IFA 011 [1]. + properties: + aspect: + type: string + description: Represents the scaling aspect to which this policy applies. + required: true + deltas: + type: map # key: scalingDeltaId + description: Describes the VnfVirtualLink scaling deltas to be applied for every scaling steps of a particular aspect. + required: true + entry_schema: + type: tosca.datatypes.nfv.VirtualLinkBitrateLevel + targets: [ tosca.nodes.nfv.VnfVirtualLink ] + tosca.policies.nfv.VduInitialDelta: + derived_from: tosca.policies.Root + description: The VduInitialDelta type is a policy type representing the Vdu.Compute detail of an initial delta used for horizontal scaling, as defined in ETSI GS NFV-IFA 011 [1]. + properties: + initial_delta: + type: tosca.datatypes.nfv.VduLevel + description: Represents the initial minimum size of the VNF. + required: true + targets: [ tosca.nodes.nfv.Vdu.Compute ] + tosca.policies.nfv.VirtualLinkBitrateInitialDelta: + derived_from: tosca.policies.Root + description: The VirtualLinkBitrateInitialDelta type is a policy type representing the VnfVirtualLink detail of an initial deltas used for horizontal scaling, as defined in ETSI GS NFV-IFA 011 [1]. + properties: + initial_delta: + type: tosca.datatypes.nfv.VirtualLinkBitrateLevel + description: Represents the initial minimum size of the VNF. + required: true + targets: [ tosca.nodes.nfv.VnfVirtualLink ] + # tosca.policies.nfv.AffinityRule: + # derived_from: tosca.policies.Placement + # description: The AffinityRule describes the affinity rules applicable for the defined targets + # properties: + # scope: + # type: string + # description: scope of the rule is an NFVI_node, an NFVI_PoP, etc. + # required: true + # constraints: + # - valid_values: [ nfvi_node, zone, zone_group, nfvi_pop ] + # targets: [ tosca.nodes.nfv.Vdu.Compute, tosca.nodes.nfv.VnfVirtualLink, tosca.groups.nfv.PlacementGroup ] + # + # tosca.policies.nfv.AntiAffinityRule: + # derived_from: tosca.policies.Placement + # description: The AntiAffinityRule describes the anti-affinity rules applicable for the defined targets + # properties: + # scope: + # type: string + # description: scope of the rule is an NFVI_node, an NFVI_PoP, etc. + # required: true + # constraints: + # - valid_values: [ nfvi_node, zone, zone_group, nfvi_pop ] + # targets: [ tosca.nodes.nfv.Vdu.Compute, tosca.nodes.nfv.VnfVirtualLink, tosca.groups.nfv.PlacementGroup ] + tosca.policies.nfv.SecurityGroupRule: + derived_from: tosca.policies.Root + description: The SecurityGroupRule type is a policy type specified the matching criteria for the ingress and/or egress traffic to/from visited connection points as defined in ETSI GS NFV-IFA 011 [1]. + properties: + description: + type: string + description: Human readable description of the security group rule. + required: false + direction: + type: string + description: The direction in which the security group rule is applied. The direction of 'ingress' or 'egress' is specified against the associated CP. I.e., 'ingress' means the packets entering a CP, while 'egress' means the packets sent out of a CP. + required: false + constraints: + - valid_values: [ ingress, egress ] + default: ingress + ether_type: + type: string + description: Indicates the protocol carried over the Ethernet layer. + required: false + constraints: + - valid_values: [ ipv4, ipv6 ] + default: ipv4 + protocol: + type: string + description: Indicates the protocol carried over the IP layer. Permitted values include any protocol defined in the IANA protocol registry, e.g. TCP, UDP, ICMP, etc. + required: false + constraints: + - valid_values: [ hopopt, icmp, igmp, ggp, ipv4, st, tcp, cbt, egp, igp, bbn_rcc_mon, nvp_ii, pup, argus, emcon, xnet, chaos, udp, mux, dcn_meas, hmp, prm, xns_idp, trunk_1, trunk_2, leaf_1, leaf_2, rdp, irtp, iso_tp4, netblt, mfe_nsp, merit_inp, dccp, 3pc, idpr, xtp, ddp, idpr_cmtp, tp++, il, ipv6, sdrp, ipv6_route, ipv6_frag, idrp, rsvp, gre, dsr, bna, esp, ah, i_nlsp, swipe, narp, mobile, tlsp, skip, ipv6_icmp, ipv6_no_nxt, ipv6_opts, cftp, sat_expak, kryptolan, rvd, ippc, sat_mon, visa, ipcv, cpnx, cphb, wsn, pvp, br_sat_mon, sun_nd, wb_mon, wb_expak, iso_ip, vmtp, secure_vmtp, vines, ttp, iptm, nsfnet_igp, dgp, tcf, eigrp, ospfigp, sprite_rpc, larp, mtp, ax.25, ipip, micp, scc_sp, etherip, encap, gmtp, ifmp, pnni, pim, aris, scps, qnx, a/n, ip_comp, snp, compaq_peer, ipx_in_ip, vrrp, pgm, l2tp, ddx, iatp, stp, srp, uti, smp, sm, ptp, isis, fire, crtp, crudp, sscopmce, iplt, sps, pipe, sctp, fc, rsvp_e2e_ignore, mobility, udp_lite, mpls_in_ip, manet, hip, shim6, wesp, rohc ] + default: tcp + port_range_min: + type: integer + description: Indicates minimum port number in the range that is matched by the security group rule. If a value is provided at design-time, this value may be overridden at run-time based on other deployment requirements or constraints. + required: false + constraints: + - greater_or_equal: 0 + - less_or_equal: 65535 + default: 0 + port_range_max: + type: integer + description: Indicates maximum port number in the range that is matched by the security group rule. If a value is provided at design-time, this value may be overridden at run-time based on other deployment requirements or constraints. + required: false + constraints: + - greater_or_equal: 0 + - less_or_equal: 65535 + default: 65535 + targets: [ tosca.nodes.nfv.VduCp, tosca.nodes.nfv.VnfExtCp ] + tosca.policies.nfv.SupportedVnfInterface: + derived_from: tosca.policies.Root + description: this policy type represents interfaces produced by a VNF, the details to access them and the applicable connection points to use to access these interfaces + properties: + interface_name: + type: string + description: Identifies an interface produced by the VNF. + required: true + constraints: + - valid_values: [ vnf_indicator, vnf_configuration ] + details: + type: tosca.datatypes.nfv.InterfaceDetails + description: Provide additional data to access the interface endpoint + required: false + targets: [ tosca.nodes.nfv.VnfExtCp, tosca.nodes.nfv.VduCp ] diff --git a/tests/so/etsi/data/serviceDeleteRequest.json b/tests/so/etsi/data/serviceDeleteRequest.json index 257b0673..4fd43e44 100644 --- a/tests/so/etsi/data/serviceDeleteRequest.json +++ b/tests/so/etsi/data/serviceDeleteRequest.json @@ -2,9 +2,9 @@ "requestDetails": { "modelInfo": { "modelType": "service", - "modelInvariantId": "0ddc448d-5513-44bc-8b02-5759d84600d5", - "modelVersionId": "28d4acf3-4791-4998-8d06-1cdf6d1767a9", - "modelName": "manualDistributionTestService", + "modelInvariantId": "10b3d278-e262-44ca-a0c0-4e663c2d7562", + "modelVersionId": "fdea6501-dabd-4428-b52c-623336a3b403", + "modelName": "EtsiServiceCSIT3", "modelVersion": "1.0" }, "requestInfo": { @@ -16,4 +16,4 @@ "aLaCarte": true } } -} \ No newline at end of file +} diff --git a/tests/so/etsi/data/serviceInstantiationRequest.json b/tests/so/etsi/data/serviceInstantiationRequest.json index 054a2ffe..8520c0d8 100644 --- a/tests/so/etsi/data/serviceInstantiationRequest.json +++ b/tests/so/etsi/data/serviceInstantiationRequest.json @@ -1,33 +1,33 @@ { - "requestDetails": { - "requestInfo": { - "instanceName": "CsitEtsiInstance", - "source": "VID", - "suppressRollback": false, - "requestorId": "demo" - }, - "modelInfo": { - "modelType": "service", - "modelInvariantId": "0ddc448d-5513-44bc-8b02-5759d84600d5", - "modelVersionId": "28d4acf3-4791-4998-8d06-1cdf6d1767a9", - "modelName": "manualDistributionTestService", - "modelVersion": "1.0" - }, - "requestParameters": { - "userParams": [], - "testApi": "GR_API", - "subscriptionServiceType": "vCPE", - "aLaCarte": true - }, - "subscriberInfo": { - "globalSubscriberId": "DemoCustomer" - }, - "project": { - "projectName": "etsiCsitProject" - }, - "owningEntity": { - "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a", - "owningEntityName": "OE-Demonstration" - } + "requestDetails": { + "requestInfo": { + "instanceName": "CsitEtsiInstance", + "source": "VID", + "suppressRollback": false, + "requestorId": "demo" + }, + "modelInfo": { + "modelType": "service", + "modelInvariantId": "10b3d278-e262-44ca-a0c0-4e663c2d7562", + "modelVersionId": "fdea6501-dabd-4428-b52c-623336a3b403", + "modelName": "EtsiServiceCSIT3", + "modelVersion": "1.0" + }, + "requestParameters": { + "userParams": [], + "testApi": "GR_API", + "subscriptionServiceType": "vCPE", + "aLaCarte": true + }, + "subscriberInfo": { + "globalSubscriberId": "DemoCustomer" + }, + "project": { + "projectName": "etsiCsitProject" + }, + "owningEntity": { + "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a", + "owningEntityName": "OE-Demonstration" } + } } diff --git a/tests/so/etsi/data/subscriptionRequest.json b/tests/so/etsi/data/subscriptionRequest.json new file mode 100644 index 00000000..c54bf3c2 --- /dev/null +++ b/tests/so/etsi/data/subscriptionRequest.json @@ -0,0 +1,23 @@ +{ + "filter": { + "notificationTypes": [ + "VnfPackageOnboardingNotification", + "VnfPackageChangeNotification" + ], + "vnfdId": [ + "b1bb0ce7-2222-4fa7-95ed-4840d70a1177" + ], + "operationalState": ["ENABLED", "DISABLED"] + }, + "callbackUri": "http://so-vnfm-simulator:9093/vnfpkgm/v1/notification", + "authentication": { + "authType": [ + "OAUTH2_CLIENT_CREDENTIALS" + ], + "paramsOauth2ClientCredentials": { + "clientId": "vnfm", + "clientPassword": "password1$", + "tokenEndpoint": "http://so-vnfm-simulator:9093/oauth/token?grant_type=client_credentials" + } + } +} diff --git a/tests/so/etsi/data/vnfDeleteRequest.json b/tests/so/etsi/data/vnfDeleteRequest.json index 08862ea8..32728669 100644 --- a/tests/so/etsi/data/vnfDeleteRequest.json +++ b/tests/so/etsi/data/vnfDeleteRequest.json @@ -2,11 +2,11 @@ "requestDetails": { "modelInfo": { "modelType": "vnf", - "modelInvariantId": "b0f14066-2b65-40d2-b5a4-c8f2116fb5fc", - "modelVersionId": "84b9649a-4eb9-4967-9abe-e8702f55518b", - "modelName": "Sol004Zip3VSP", - "modelCustomizationName": "Sol004Zip3VSP 0", - "modelCustomizationId": "ff0860ac-fa9a-4fff-956b-80eeb7a330bc", + "modelInvariantId": "037f7b1b-5c62-44c1-b806-f92fe8970171", + "modelVersionId": "73522444-e8e9-49c1-be29-d355800aa349", + "modelName": "EtsiVnfCSIT3", + "modelCustomizationName": "EtsiVnfCSIT3 0", + "modelCustomizationId": "3341825c-837c-4e84-8a82-cc69033ca92f", "modelVersion": "1.0" }, "requestInfo": { @@ -22,4 +22,4 @@ "tenantId": "693c7729b2364a26a3ca602e6f66187d" } } -} \ No newline at end of file +} diff --git a/tests/so/etsi/data/vnfInstantiationRequest.json b/tests/so/etsi/data/vnfInstantiationRequest.json index a4cc5c90..03a143b0 100644 --- a/tests/so/etsi/data/vnfInstantiationRequest.json +++ b/tests/so/etsi/data/vnfInstantiationRequest.json @@ -1,49 +1,47 @@ { - "requestDetails": { - "requestInfo": { - "instanceName": "CsitEtsiVnfInstance", - "source": "VID", - "suppressRollback": false, - "requestorId": "demo", - "productFamilyId": "f13844f4-dbf8-4d0e-a979-45204f3ddb4e" - }, - "modelInfo": { - "modelType": "vnf", - "modelInvariantId": "0a0b9979-863d-4b7e-b7f4-d27725a182b3", - "modelVersionId": "8f43a8c9-c677-462a-ae36-8ddb5990a60d", - "modelName": "manualDistributionTestVNF", - "modelVersion": "1.0", - "modelCustomizationId": "82ad3aa0-edc6-410c-a217-655fb064323f", - "modelCustomizationName": "manualDistributionTestVNF 0" - }, - "requestParameters": { - "userParams": [], - "testApi": "GR_API" - }, - "cloudConfiguration": { - "lcpCloudRegionId": "EtsiCloudRegion", - "cloudOwner": "CloudOwner", - "tenantId": "693c7729b2364a26a3ca602e6f66187d" - }, - "lineOfBusiness": { - "lineOfBusinessName": "EtsiCsitLineOfBusiness" - }, - "platform": { - "platformName": "EtsiCsitPlatform" - }, - "relatedInstanceList": [ - { - "relatedInstance": { - "instanceId": "", - "modelInfo": { - "modelType": "service", - "modelName": "Sol004Zip4Service", - "modelInvariantId": "0ddc448d-5513-44bc-8b02-5759d84600d5", - "modelVersion": "1.0", - "modelVersionId": "99d59273-4450-4034-9141-027f0c1a807a" - } - } - } - ] - } -} \ No newline at end of file + "requestDetails": { + "requestInfo": { + "instanceName": "CsitEtsiVnfInstance", + "source": "VID", + "suppressRollback": false, + "requestorId": "demo", + "productFamilyId": "f13844f4-dbf8-4d0e-a979-45204f3ddb4e" + }, + "modelInfo": { + "modelType": "vnf", + "modelInvariantId": "037f7b1b-5c62-44c1-b806-f92fe8970171", + "modelVersionId": "73522444-e8e9-49c1-be29-d355800aa349", + "modelName": "EtsiVnfCSIT3", + "modelVersion": "1.0", + "modelCustomizationId": "3341825c-837c-4e84-8a82-cc69033ca92f", + "modelCustomizationName": "EtsiVnfCSIT3 0" + }, + "requestParameters": { + "userParams": [], + "testApi": "GR_API" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "EtsiCloudRegion", + "cloudOwner": "CloudOwner", + "tenantId": "693c7729b2364a26a3ca602e6f66187d" + }, + "lineOfBusiness": { + "lineOfBusinessName": "EtsiCsitLineOfBusiness" + }, + "platform": { + "platformName": "EtsiCsitPlatform" + }, + "relatedInstanceList": [{ + "relatedInstance": { + "instanceId": "", + "modelInfo": { + "modelType": "service", + "modelName": "EtsiServiceCSIT3", + "modelInvariantId": "10b3d278-e262-44ca-a0c0-4e663c2d7562", + "modelVersion": "1.0", + "modelVersionId": "fdea6501-dabd-4428-b52c-623336a3b403" + } + } + }] + } +} diff --git a/tests/so/etsi/data/vnfPackageOnboardRequest.json b/tests/so/etsi/data/vnfPackageOnboardRequest.json new file mode 100644 index 00000000..08b7e05c --- /dev/null +++ b/tests/so/etsi/data/vnfPackageOnboardRequest.json @@ -0,0 +1 @@ +{"csarId": "73522444-e8e9-49c1-be29-d355800aa349"} diff --git a/tests/so/etsi/etsi_nfvo_ns_lcm_tests.robot b/tests/so/etsi/etsi_nfvo_ns_lcm_tests.robot new file mode 100644 index 00000000..23995d93 --- /dev/null +++ b/tests/so/etsi/etsi_nfvo_ns_lcm_tests.robot @@ -0,0 +1,76 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library ArchiveLibrary + +*** Variables *** +${NFVO_NS_LCM_BASE_URL}= /so/so-etsi-nfvo-ns-lcm/v1/api/nslcm/v1 +${BASIC_AUTH}= Basic c28tZXRzaS1uZnZvLW5zLWxjbTpwYXNzd29yZDEk + +Documentation Test cases for ETSI NFVO NS Lifecycle Management Operations +... Create and Delete tests are synchronous +... Instantiate and Terminate tests are asynchronous, test status checked through request to NS_LCM_OP_OCCs endpoint +... Note, relies on: +... -Network Service package being onboarded in etsi_package_onboarding_tests + +*** Test Cases *** + +Invoke Create Network Service + Create Session etsi_nfvo_ns_lcm_session http://${REPO_IP}:9095 + ${data}= Get Binary File ${CURDIR}${/}data${/}createNetworkServiceRequest.json + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json HTTP_GLOBALCUSTOMERID=DemoCustomer + ${create_network_service_request}= POST On Session etsi_nfvo_ns_lcm_session ${NFVO_NS_LCM_BASE_URL}/ns_instances data=${data} headers=${headers} + log to console ${create_network_service_request.content} + ${create_network_service_json_response}= Evaluate json.loads(r"""${create_network_service_request.content}""", strict=False) json + ${request_Id}= Set Variable ${create_network_service_json_response}[id] + SET GLOBAL VARIABLE ${request_Id} + + Should Be Equal As Strings '${create_network_service_request.status_code}' '201' + +Invoke Instantiate Network Service + Run Keyword If "${request_Id}"!="${EMPTY}" Log to Console Network Service ID :${request_Id} + ... ELSE Fail \nInvalid Network Service ID :${request_Id} received + Create Session etsi_nfvo_ns_lcm_session http://${REPO_IP}:9095 + ${data}= Get Binary File ${CURDIR}${/}data${/}instantiateNetworkServiceRequest.json + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + ${instantiate_network_service_request}= POST On Session etsi_nfvo_ns_lcm_session ${NFVO_NS_LCM_BASE_URL}/ns_instances/${request_Id}/instantiate data=${data} headers=${headers} + Run Keyword If '${instantiate_network_service_request.status_code}' == '202' log to console \nexecuted with expected result + ... ELSE Fail \nInstantiate Network Service Request Received Response: ${instantiate_network_service_request.status_code} + log to console \n${instantiate_network_service_request.content} + + Wait Until Keyword Succeeds 3 min 5 secs Get NS LCM OP OCCs + +Invoke Terminate Network Service + Run Keyword If "${actual_request_state}"=="COMPLETED" Log to Console NS LCM OP OCCs State: ${actual_request_state} + ... ELSE Fail \nTerminate Network Service Failed to Start. Instantiate Network Service Request State: ${actual_request_state} + Create Session etsi_nfvo_ns_lcm_session http://${REPO_IP}:9095 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + ${terminate_network_service_request}= POST On Session etsi_nfvo_ns_lcm_session ${NFVO_NS_LCM_BASE_URL}/ns_instances/${request_Id}/terminate headers=${headers} + Run Keyword If '${terminate_network_service_request.status_code}' == '202' log to console \nexecuted with expected result + ... ELSE Fail \nTerminate Network Service Request Received Response: ${terminate_network_service_request.status_code} + log to console \n${terminate_network_service_request.content} + + Wait Until Keyword Succeeds 3 min 5 secs Get NS LCM OP OCCs + +Invoke Delete Network Service + Run Keyword If "${actual_request_state}"=="COMPLETED" Log to Console NS LCM OP OCCs State: ${actual_request_state} + ... ELSE Fail \nDelete Network Service Failed to Start. Invalid Previous Request State Received: ${actual_request_state} + Create Session etsi_nfvo_ns_lcm_session http://${REPO_IP}:9095 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + ${delete_network_service_request}= DELETE On Session etsi_nfvo_ns_lcm_session ${NFVO_NS_LCM_BASE_URL}/ns_instances/${request_Id} headers=${headers} + log to console \n${delete_network_service_request.content} + + Should Be Equal As Strings '${delete_network_service_request.status_code}' '204' + +*** Keywords *** + +Get NS LCM OP OCCs + ${ns_lcm_status_request}= GET On Session etsi_nfvo_ns_lcm_session ${NFVO_NS_LCM_BASE_URL}/ns_lcm_op_occs/${request_Id} + log to console \n${ns_lcm_status_request.content} + ${ns_lcm_request_json_response}= Evaluate json.loads(r"""${ns_lcm_status_request.content}""", strict=False) json + ${actual_request_state}= SET VARIABLE ${ns_lcm_request_json_response}[operationState] + SET GLOBAL VARIABLE ${actual_request_state} + Should Be Equal As Strings ${ns_lcm_status_request.status_code} 200 + Should Be Equal As Strings ${actual_request_state} COMPLETED diff --git a/tests/so/etsi/etsi_package_onboarding_tests.robot b/tests/so/etsi/etsi_package_onboarding_tests.robot new file mode 100644 index 00000000..5b8a9013 --- /dev/null +++ b/tests/so/etsi/etsi_package_onboarding_tests.robot @@ -0,0 +1,73 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Documentation Test cases for onboarding a VNF and Network Service package and distributing the VNF Package +... Note: onboarded VNF package is used in later VNF tests including: +... -etsi_vnf_lcm_tests.robot +... -etsi_vnf_package_management_tests.robot +... -etsi_vnf_notification_tests.robot +... Note: onboarded Network Service package is used in later test: +... -etsi_nfvo_ns_lcm_tests.robot + +*** Variables *** +${SLEEP_INTERVAL_SEC}= 5 +${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 48 # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry. + +*** Test Cases *** +OnBoard VNF Package In Etsi Catalog + Create Session etsi_catalog_session http://${REPO_IP}:8806 + ${data}= Get Binary File ${CURDIR}${/}data${/}vnfPackageOnboardRequest.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post On Session etsi_catalog_session /api/catalog/v1/vnfpackages data=${data} headers=${headers} + Run Keyword If '${resp.status_code}' == '202' log to console \nexecuted with expected result + Should Be Equal As Strings '${resp.status_code}' '202' + log to console ${resp.content} + ${onboarding_job_json_response}= Evaluate json.loads(r"""${resp.content}""", strict=False) json + ${job_ID}= Set Variable ${onboarding_job_json_response}[jobId] + Should Not Be Empty ${job_ID} + ${actual_job_status}= Set Variable "" + + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${onboarding_job_status_request}= Get On Session etsi_catalog_session /api/catalog/v1/jobs/${job_ID} + Run Keyword If '${onboarding_job_status_request.status_code}' == '200' log to console \nexecuted with expected result + log to console ${onboarding_job_status_request.content} + + ${onboarding_job_status_json_response}= Evaluate json.loads(r"""${onboarding_job_status_request.content}""", strict=False) json + + ${actual_job_status}= Set Variable "" + + ${response_descriptor_exists}= Run Keyword And Return Status Get From Dictionary ${onboarding_job_status_json_response} responseDescriptor + ${status_exists}= Run Keyword And Return Status Get From Dictionary ${onboarding_job_status_json_response}[responseDescriptor] status + + ${actual_job_status}= Set Variable If ${response_descriptor_exists} == True and ${status_exists} == True + ... ${onboarding_job_status_json_response}[responseDescriptor][status] + + Log To Console Received actual repsonse status:${actual_job_status} + Run Keyword If '${actual_job_status}' == 'finished' or '${actual_job_status}' == 'error' or '${actual_job_status}' == 'timeout' Exit For Loop + log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds + SLEEP ${SLEEP_INTERVAL_SEC} + END + Log To Console final repsonse status received: ${actual_job_status} + Run Keyword If '${actual_job_status}' == 'finished' log to console \nexecuted with expected result + Should Be Equal As Strings '${actual_job_status}' 'finished' + +Onboard Network Service Package In Etsi Catalog + Create Session etsi_catalog_session http://${REPO_IP}:8806 + ${data}= Get Binary File ${CURDIR}${/}data${/}networkServicePackageOnboardRequest.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= POST On Session etsi_catalog_session /api/catalog/v1/nspackages data=${data} headers=${headers} + log to console ${resp.content} + + Run Keyword If '${resp.status_code}' == '202' log to console \nexecuted with expected result + Should Be Equal As Strings '${resp.status_code}' '202' + + +Distribute Service Template + Create Session sdc_controller_session http://${REPO_IP}:8085 + ${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate.json + &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test-zip/unzipped/ Content-Type=application/json Accept=application/json + ${resp}= Post On Session 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' diff --git a/tests/so/etsi/etsi_tests.robot b/tests/so/etsi/etsi_vnf_lcm_tests.robot similarity index 82% rename from tests/so/etsi/etsi_tests.robot rename to tests/so/etsi/etsi_vnf_lcm_tests.robot index 6aebd137..e7b291cb 100644 --- a/tests/so/etsi/etsi_tests.robot +++ b/tests/so/etsi/etsi_vnf_lcm_tests.robot @@ -3,25 +3,20 @@ Library Collections Library RequestsLibrary Library OperatingSystem Library json +Documentation Test cases for VNF lifecycle management operations +... Note, relies on: +... -package being onboarded in etsi_package_onboarding_tests *** Variables *** ${SLEEP_INTERVAL_SEC}= 5 ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 48 # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry. *** Test Cases *** -Distribute Service Template - Create Session sdc_controller_session http://${REPO_IP}:8085 - ${data}= Get Binary File ${CURDIR}${/}data${/}distributeServiceTemplate.json - &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/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' - Invoke Service Instantiation Create Session api_handler_session http://${REPO_IP}:8080 ${data}= Get Binary File ${CURDIR}${/}data${/}serviceInstantiationRequest.json &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json - ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances data=${data} headers=${headers} + ${service_instantiation_request}= Post On Session api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances 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 @@ -31,7 +26,7 @@ Invoke Service Instantiation ${actual_request_state}= Set Variable "" FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + ${orchestration_status_request}= Get On Session api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result log to console ${orchestration_status_request.content} ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json @@ -56,7 +51,7 @@ Invoke VNF Instantiation set to dictionary ${vnf_instantiate_request_json}[requestDetails][relatedInstanceList][0][relatedInstance] instanceId=${service_instance_Id} ${vnf_instantiate_request_string}= evaluate json.dumps(${vnf_instantiate_request_json}) json &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json - ${vnf_instantiate_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id}/vnfs data=${vnf_instantiate_request_string} headers=${headers} + ${vnf_instantiate_request}= Post On Session api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id}/vnfs data=${vnf_instantiate_request_string} headers=${headers} Run Keyword If '${vnf_instantiate_request.status_code}' == '200' log to console \nexecuted with expected result ${vnf_instantiate_json_response}= Evaluate json.loads(r"""${vnf_instantiate_request.content}""") json ${request_ID}= Set Variable ${vnf_instantiate_json_response}[requestReferences][requestId] @@ -65,7 +60,7 @@ Invoke VNF Instantiation SET GLOBAL VARIABLE ${vnf_instance_Id} FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + ${orchestration_status_request}= Get On Session api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result Log To Console ${orchestration_status_request.content} ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json @@ -89,14 +84,14 @@ Delete VNF Instance Create Session api_handler_session http://${REPO_IP}:8080 ${data}= Get Binary File ${CURDIR}${/}data${/}vnfDeleteRequest.json &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json - ${vnf_delete_request}= Delete Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id}/vnfs/${vnf_instance_Id} data=${data} headers=${headers} + ${vnf_delete_request}= Delete On Session api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id}/vnfs/${vnf_instance_Id} data=${data} headers=${headers} ${vnf_delete_json_response}= Evaluate json.loads(r"""${vnf_delete_request.content}""") json Log to Console ${vnf_delete_json_response} ${request_ID}= Set Variable ${vnf_delete_json_response}[requestReferences][requestId] ${actual_request_state}= Set Variable "" FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + ${orchestration_status_request}= Get On Session api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result Log To Console ${orchestration_status_request.content} ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""") json @@ -118,14 +113,14 @@ Delete Service Instance Create Session api_handler_session http://${REPO_IP}:8080 ${data}= Get Binary File ${CURDIR}${/}data${/}serviceDeleteRequest.json &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json - ${service_delete_request}= Delete Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id} data=${data} headers=${headers} + ${service_delete_request}= Delete On Session api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances/${service_instance_Id} data=${data} headers=${headers} ${service_delete_json_response}= Evaluate json.loads(r"""${service_delete_request.content}""") json Log to Console ${service_delete_json_response} ${request_ID}= Set Variable ${service_delete_json_response}[requestReferences][requestId] ${actual_request_state}= Set Variable "" FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + ${orchestration_status_request}= Get On Session api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result Log To Console ${orchestration_status_request.content} ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""") json diff --git a/tests/so/etsi/etsi_vnf_notification_tests.robot b/tests/so/etsi/etsi_vnf_notification_tests.robot new file mode 100644 index 00000000..0c3d5bc9 --- /dev/null +++ b/tests/so/etsi/etsi_vnf_notification_tests.robot @@ -0,0 +1,49 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Documentation Test cases for VNF package subscription notifications and subscription cleanup +... Test include checking that VNF package notification was received and deleting the subscription +... Note, relies on: +... -subscription being created in etsi_vnf_subscription_tests and +... -package being onboarded in etsi_package_onboarding_tests + +*** Variables *** +${SLEEP_INTERVAL_SEC}= 5 +${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 48 # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry. +${PACKAGE_MANAGEMENT_BASE_URL}= /so/vnfm-adapter/v1/vnfpkgm/v1 +${BASIC_AUTH}= Basic dm5mbTpwYXNzd29yZDEk +${VNF_PACKAGE_ID}= 73522444-e8e9-49c1-be29-d355800aa349 + +*** Test Cases *** +VNF Package Onboarding Notification Received By Subscriber + &{headers}= Create Dictionary Authorization=Bearer ${ACCESS_TOKEN} Content-Type=application/json Accept=application/json + Log To Console \nChecking If VNF Package Notification was received for vnfPkgId: ${VNF_PACKAGE_ID} + ${response}= Get On Session vnfm_simulator_session /vnfpkgm/v1/notification-cache-test/${VNF_PACKAGE_ID} headers=${headers} + Log To Console \nResponse:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Log To Console \nResponse Content:\n${response.content} + ${json_response}= Evaluate json.loads(r"""${response.content}""", strict=False) json + Dictionary Should Contain Key ${json_response} id + Dictionary Should Contain Key ${json_response} notificationType + Should be Equal As Strings VnfPackageOnboardingNotification ${json_response}[notificationType] + Dictionary Should Contain Key ${json_response} subscriptionId + Dictionary Should Contain Key ${json_response} timeStamp + Dictionary Should Contain Key ${json_response} vnfPkgId + Should Be Equal As Strings ${VNF_PACKAGE_ID} ${json_response}[vnfPkgId] + Dictionary Should Contain Key ${json_response} vnfdId + Dictionary Should Contain Key ${json_response} _links + Log To Console \nexecuted with expected result + +Delete Subscription By SubscriptionId + Create Session so_vnfm_adapter_session http://${REPO_IP}:9092 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + Log To Console \nDeleting Subscription with subscriptionId: ${SUBSCRIPTION_ID} from so-vnfm-adapter + ${response}= Delete On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/subscriptions/${SUBSCRIPTION_ID} headers=${headers} + Log To Console \nResponse:${response} + Run Keyword If '${response.status_code}' == '204' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '204' + + diff --git a/tests/so/etsi/etsi_vnf_package_management_tests.robot b/tests/so/etsi/etsi_vnf_package_management_tests.robot new file mode 100644 index 00000000..000148f8 --- /dev/null +++ b/tests/so/etsi/etsi_vnf_package_management_tests.robot @@ -0,0 +1,153 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library ArchiveLibrary +Documentation Test cases for VNF package management operations including get packages, package, content and artifacts +... Note, relies on: +... -package being onboarded in etsi_package_onboarding_tests + +*** Variables *** +${VNF_PACKAGE_ID}= 73522444-e8e9-49c1-be29-d355800aa349 +${PACKAGE_MANAGEMENT_BASE_URL}= /so/vnfm-adapter/v1/vnfpkgm/v1 +${BASIC_AUTH}= Basic dm5mbTpwYXNzd29yZDEk +${TEST_DIR}= CSIT_ETSI_TEMP + +*** Test Cases *** +Get VNF Packages + Create Session so_vnfm_adapter_session http://${REPO_IP}:9092 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + Log To Console \nGetting VNF Packages from so-vnfm-adapter + ${response}= Get On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/vnf_packages headers=${headers} + Log To Console \nResponse:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Log To Console \nResponse Content:\n${response.content} + ${json_response} Evaluate json.loads(r"""${response.content}""", strict=False) json + ${vnf_package_id}= Set Variable ${json_response}[0][id] + Should Be Equal As Strings '${vnf_package_id}' '${VNF_PACKAGE_ID}' + ${expected}= Get File ${CURDIR}${/}data${/}responses${/}expectedVnfPackage.json + ${expected}= Evaluate json.loads(r"""${expected}""", strict=False) json + Should Be Equal ${json_response[0]} ${expected} + Log To Console \nexecuted with expected result + +Get VNF Package By VNF Package Id + Create Session so_vnfm_adapter_session http://${REPO_IP}:9092 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + Log To Console \nGetting VNF Package with id ${VNF_PACKAGE_ID} from so-vnfm-adapter + ${response}= Get On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/vnf_packages/${VNF_PACKAGE_ID} headers=${headers} + Log To Console \nResponse:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Log To Console \nResponse:\n${response.content} + ${json_response} Evaluate json.loads(r"""${response.content}""", strict=False) json + ${vnf_package_id}= Set Variable ${json_response}[id] + Should Be Equal As Strings '${vnf_package_id}' '${VNF_PACKAGE_ID}' + ${expected}= Get File ${CURDIR}${/}data${/}responses${/}expectedVnfPackage.json + ${expected}= Evaluate json.loads(r"""${expected}""", strict=False) json + Should Be Equal ${json_response} ${expected} + Log To Console \nexecuted with expected result + +Get VNF Package Content + Create Session so_vnfm_adapter_session http://${REPO_IP}:9092 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/zip + Log to Console \nGetting Vnf Package Content from Vnf Package with id ${vnf_package_id} from so-vnfm-adapter + ${response}= Get On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/vnf_packages/${vnf_package_id}/package_content headers=${headers} + Log To Console Response:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Create Directory ${TEMPDIR}${/}${TEST_DIR} + Empty Directory ${TEMPDIR}${/}${TEST_DIR} + Create Binary File ${TEMPDIR}${/}${TEST_DIR}${/}actualVnfPackageContent.csar ${response.content} + Should Be Equal File Size ${TEMPDIR}${/}${TEST_DIR}${/}actualVnfPackageContent.csar ${CURDIR}${/}data${/}responses${/}expectedVnfPackageContent.csar + Extract Zip File ${TEMPDIR}${/}${TEST_DIR}${/}actualVnfPackageContent.csar ${TEMPDIR}${/}${TEST_DIR}/actualContent + Extract Zip File ${CURDIR}${/}data${/}responses${/}expectedVnfPackageContent.csar ${TEMPDIR}${/}${TEST_DIR}${/}expectedContent + Should Contain Same Content ${TEMPDIR}${/}${TEST_DIR}${/}actualContent ${TEMPDIR}${/}${TEST_DIR}${/}expectedContent + File Should Exist ${TEMPDIR}${/}${TEST_DIR}${/}actualContent${/}Definitions${/}MainServiceTemplate.yaml + File Should Exist ${TEMPDIR}${/}${TEST_DIR}${/}actualContent${/}Definitions${/}onap_dm.yaml + File Should Exist ${TEMPDIR}${/}${TEST_DIR}${/}actualContent${/}TOSCA-Metadata${/}TOSCA.meta + ${expectedMainServiceTemplate}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}expectedContent${/}Definitions${/}MainServiceTemplate.yaml + ${actualMainServiceTemplate}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}actualContent${/}Definitions${/}MainServiceTemplate.yaml + Should Be Equal As Strings ${expectedMainServiceTemplate} ${actualMainServiceTemplate} + ${expectedOnapDm}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}expectedContent${/}Definitions${/}onap_dm.yaml + ${actualOnapDm}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}actualContent${/}Definitions${/}onap_dm.yaml + Should Be Equal As Strings ${expectedOnapDm} ${actualOnapDm} + ${expectedToscaMeta}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}expectedContent${/}TOSCA-Metadata${/}TOSCA.meta + ${actualToscaMeta}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}actualContent${/}TOSCA-Metadata${/}TOSCA.meta + Should Be Equal As Strings ${expectedOnapDm} ${actualOnapDm} + Remove Directory ${TEMPDIR}${/}${TEST_DIR} recursive=True + Log To Console \nexecuted with expected result + +Get VNF Package VNFD + Create Session so_vnfm_adapter_session http://${REPO_IP}:9092 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/zip + Log to Console \nGetting Vnfd from Vnf Package with id ${vnf_package_id} from so-vnfm-adapter + ${response}= Get On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/vnf_packages/${vnf_package_id}/vnfd headers=${headers} + Log To Console Response:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Create Directory ${TEMPDIR}${/}${TEST_DIR} + Empty Directory ${TEMPDIR}${/}${TEST_DIR} + Create Binary File ${TEMPDIR}${/}${TEST_DIR}${/}actualVnfd.zip ${response.content} + Extract Zip File ${TEMPDIR}${/}${TEST_DIR}${/}actualVnfd.zip ${TEMPDIR}${/}${TEST_DIR} + File Should Exist ${TEMPDIR}${/}${TEST_DIR}${/}MainServiceTemplate.yaml + File Should Exist ${TEMPDIR}${/}${TEST_DIR}${/}onap_dm.yaml + ${expectedMainServiceTemplate}= Get Binary File ${CURDIR}${/}data${/}responses${/}expectedVnfd${/}MainServiceTemplate.yaml + ${actualMainServiceTemplate}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}MainServiceTemplate.yaml + Should Be Equal As Strings ${expectedMainServiceTemplate} ${actualMainServiceTemplate} + ${expectedOnapDm}= Get Binary File ${CURDIR}${/}data${/}responses${/}expectedVnfd${/}onap_dm.yaml + ${actualOnapDm}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}onap_dm.yaml + Should Be Equal As Strings ${expectedOnapDm} ${actualOnapDm} + Remove Directory ${TEMPDIR}${/}${TEST_DIR} recursive=True + Log To Console \nexecuted with expected result + +Get A VNF Package Artifact + ${artifactPath}= Convert To String image + Create Session so_vnfm_adapter_session http://${REPO_IP}:9092 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/octet-stream + Log to Console \nGetting ${artifactPath} artifact from Vnf Package with id ${vnf_package_id} from so-vnfm-adapter + ${response}= Get On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/vnf_packages/${vnf_package_id}/artifacts/${artifactPath} headers=${headers} + Log To Console Response:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Create Directory ${TEMPDIR}${/}${TEST_DIR} + Empty Directory ${TEMPDIR}${/}${TEST_DIR} + Create Binary File ${TEMPDIR}${/}${TEST_DIR}${/}${artifactPath} ${response.content} + ${expectedArtifact}= Get Binary File ${CURDIR}${/}data${/}responses${/}expectedArtifacts${/}${artifactPath} + ${actualArtifact}= Get Binary File ${TEMPDIR}${/}${TEST_DIR}${/}${artifactPath} + Should Be Equal As Strings ${expectedArtifact} ${actualArtifact} + Remove Directory ${TEMPDIR}${/}${TEST_DIR} recursive=True + Log To Console \nexecuted with expected result + +*** Keywords *** +Should Be Equal File Size + [Arguments] ${file1} ${file2} + Log To Console \nComparing file sizes between ${file1} and ${file2} + ${file1size}= Get File Size ${file1} + ${file2size}= Get File Size ${file2} + Should Be Equal ${file1size} ${file2size} + Log To Console Files are the same size + +Should Contain Same Content + [Arguments] ${dir1} ${dir2} + Log To Console \nComparing directory contents between: + Log To Console Directory 1: ${dir1} + Log To Console Directory 2: ${dir2} + @{dir1files}= List Files In Directory ${dir1} + Log To Console Files in directory 1: @{dir1files} + @{dir2files}= List Files In Directory ${dir2} + Log To Console Files in directory 2: @{dir2files} + Lists Should Be Equal ${dir1files} ${dir2files} + FOR ${file} IN @{dir1files} + Should Be Equal File Size ${dir1}${/}${file} ${dir2}${/}${file} + END + @{dir1directories}= List Directories In Directory ${dir1} + Log To Console Directories in directory 1: ${dir1directories} + @{dir2directories}= List Directories In Directory ${dir2} + Log To Console Directories in directory 2: ${dir2directories} + Lists Should Be Equal ${dir1directories} ${dir2directories} + FOR ${directory} IN @{dir1directories} + Should Contain Same Content ${dir1}${/}${directory} ${dir2}${/}${directory} + END + Log To Console executed with expected result diff --git a/tests/so/etsi/etsi_vnf_subscription_tests.robot b/tests/so/etsi/etsi_vnf_subscription_tests.robot new file mode 100644 index 00000000..34913f0a --- /dev/null +++ b/tests/so/etsi/etsi_vnf_subscription_tests.robot @@ -0,0 +1,92 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Documentation Test cases that tests subscription functionality for VNF package onboarding/change notifications +... Tests include subscribing for notifications, and querying that the subscriptions have been created +... Note: creates ACCESS_TOKEN and SUBSCRIPTION_ID variables used in later etsi_vnf_notification_tests + +*** Variables *** +${SLEEP_INTERVAL_SEC}= 5 +${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}= 48 # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry. +${PACKAGE_MANAGEMENT_BASE_URL}= /so/vnfm-adapter/v1/vnfpkgm/v1 +${BASIC_AUTH}= Basic dm5mbTpwYXNzd29yZDEk +${ACCESS_TOKEN}= "" +${SUBSCRIPTION_ID}= "" + +*** Test Cases *** +Subscribe for Notifications + Create Session vnfm_simulator_session http://${REPO_IP}:9093 + &{headers1}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + Log To Console \nGetting Access Token + ${response}= Post On Session vnfm_simulator_session url=/oauth/token?grant_type=client_credentials headers=${headers1} + Log To Console \nResponse:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Log To Console \nResponse Content:\n${response.content} + ${json_response} Evaluate json.loads(r"""${response.content}""", strict=False) json + Set Global Variable ${ACCESS_TOKEN} ${json_response}[access_token] + ${data}= Get Binary File ${CURDIR}${/}data${/}subscriptionRequest.json + &{headers2}= Create Dictionary Authorization=Bearer ${ACCESS_TOKEN} Content-Type=application/json Accept=application/json + Log To Console \nSubscribing For VNF Package Notifications + ${response2}= Post On Session vnfm_simulator_session /vnfpkgm/v1/subscribe data=${data} headers=${headers2} + Log To Console \nResponse:\n${response2} + Log To Console \nResponse Content:\n${response2.content} + Run Keyword If '${response2.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response2.status_code}' '200' + ${json_response2}= Evaluate json.loads(r"""${response2.content}""", strict=False) json + Dictionary Should Contain Key ${json_response2} id + Set Global Variable ${SUBSCRIPTION_ID} ${json_response2}[id] + Log To Console \nid: ${SUBSCRIPTION_ID} + Dictionary Should Contain Key ${json_response2} filter + ${filter}= Set Variable ${json_response2}[filter] + Dictionary Should Contain Key ${filter} notificationTypes + Dictionary Should Contain Key ${filter} vnfdId + Dictionary Should Contain Key ${filter} operationalState + Dictionary Should Contain Key ${json_response2} callbackUri + Dictionary Should Contain Key ${json_response2} _links + Log To Console \nexecuted with expected result + +Get Subscriptions + Create Session so_vnfm_adapter_session http://${REPO_IP}:9092 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + Log To Console \nGetting Subscriptions from so-vnfm-adapter + ${response}= Get On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/subscriptions headers=${headers} + Log To Console \nResponse:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Log To Console \nResponse Content:\n${response.content} + ${json_response} Evaluate json.loads(r"""${response.content}""", strict=False) json + ${subscription}= Set Variable ${json_response}[0] + Dictionary Should Contain Key ${subscription} id + ${sub_id}= Set Variable ${subscription}[id] + Should Be Equal As Strings '${sub_id}' '${SUBSCRIPTION_ID}' + Dictionary Should Contain Key ${subscription} filter + ${filter}= Set Variable ${subscription}[filter] + Dictionary Should Contain Key ${filter} notificationTypes + Dictionary Should Contain Key ${filter} vnfdId + Dictionary Should Contain Key ${filter} operationalState + Dictionary Should Contain Key ${subscription} callbackUri + Log To Console \nexecuted with expected result + +Get Subscription By Subscription Id + Create Session so_vnfm_adapter_session http://${REPO_IP}:9092 + &{headers}= Create Dictionary Authorization=${BASIC_AUTH} Content-Type=application/json Accept=application/json + Log To Console \nGetting Subscription with id ${SUBSCRIPTION_ID} from so-vnfm-adapter + ${response}= Get On Session so_vnfm_adapter_session ${PACKAGE_MANAGEMENT_BASE_URL}/subscriptions/${SUBSCRIPTION_ID} headers=${headers} + Log To Console \nResponse:${response} + Run Keyword If '${response.status_code}' == '200' Log To Console \nexecuted with expected result + Should Be Equal As Strings '${response.status_code}' '200' + Log To Console \nResponse Content:\n${response.content} + ${json_response} Evaluate json.loads(r"""${response.content}""", strict=False) json + Dictionary Should Contain Key ${json_response} id + ${sub_id}= Set Variable ${json_response}[id] + Should Be Equal As Strings '${sub_id}' '${SUBSCRIPTION_ID}' + Dictionary Should Contain Key ${json_response} filter + ${filter}= Set Variable ${json_response}[filter] + Dictionary Should Contain Key ${filter} notificationTypes + Dictionary Should Contain Key ${filter} vnfdId + Dictionary Should Contain Key ${filter} operationalState + Dictionary Should Contain Key ${json_response} callbackUri + Log To Console \nexecuted with expected result diff --git a/tests/so/sanity-check/data/macroflow.json b/tests/so/sanity-check/data/macroflow.json new file mode 100644 index 00000000..87f782a4 --- /dev/null +++ b/tests/so/sanity-check/data/macroflow.json @@ -0,0 +1,161 @@ +{ + "requestDetails": { + "requestInfo": { + "suppressRollback": false, + "productFamilyId": "1234", + "requestorId": "demo", + "instanceName": "CsitEtsiInstance", + "source": "VID" + }, + "modelInfo": { + "modelType": "service", + "modelInvariantId": "b9202a74-4c16-4245-83ad-1cd53c813214", + "modelVersionId": "6f2c7614-571c-4482-aa2c-5eac0308aa16", + "modelName": "vfw_k8s_demo_CNF", + "modelVersion": "1.0" + }, + "cloudConfiguration": { + "tenantId": "693c7729b2364a26a3ca602e6f66187d", + "cloudOwner": "CloudOwner", + "lcpCloudRegionId": "EtsiCloudRegion" + }, + "subscriberInfo": { + "globalSubscriberId": "DemoCustomer" + }, + "requestParameters": { + "subscriptionServiceType": "vCPE", + "userParams": [{ + "Homing_Solution": "none" + }, { + "service": { + "instanceParams": [], + "instanceName": "CsitEtsiInstance", + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelName": "VF_vfw_k8s_demo_CNF", + "modelVersionId": "daeb6a5c-3a8a-40b0-a575-8cca71dd0b7c", + "modelInvariantUuid": "517403c8-fab8-4cfe-9bc5-d94f5e34b257", + "modelVersion": "1.0", + "modelCustomizationId": "8b8b67bd-01a4-42f7-b0fc-1d3a0f2765fd", + "modelInstanceName": "VF_vfw_k8s_demo_CNF 0" + }, + "cloudConfiguration": { + "tenantId": "693c7729b2364a26a3ca602e6f66187d", + "cloudOwner": "CloudOwner", + "lcpCloudRegionId": "EtsiCloudRegion" + }, + "platform": { + "platformName": "test" + }, + "lineOfBusiness": { + "lineOfBusinessName": "LOB-Demonstration" + }, + "productFamilyId": "1234", + "instanceName": "VF_frankfurt_vfw_k8s_demo_final", + "instanceParams": [{ + "sdnc_model_name": "vFW_CNF_CDS", + "sdnc_model_version": "1.0.45", + "sdnc_artifact_name": "vnf" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelName": "VfVfwK8sDemoCnf..base_template..module-0", + "modelVersionId": "86224a10-c17e-42c9-9809-f3c31ba1b781", + "modelInvariantUuid": "2bc34946-d57d-4053-9e9f-d60587c9aa12", + "modelVersion": "1", + "modelCustomizationId": "905ffa63-7011-4cbe-943c-237f303b4e9f" + }, + "instanceName": "vf_frankfurt_vfw_k8s_demo_final0..VfFrankfurtVfwK8sDemoFinal..base_template..module-0", + "instanceParams": [{ + "k8s-rb-profile-name": "vfw-cnf-cds-base-profile", + "k8s-rb-profile-namespace": "test-vfw1", + "sdnc_model_name": "vFW_CNF_CDS", + "sdnc_model_version": "1.0.45", + "vf_module_label": "base_template" + } + ] + }, + { + "modelInfo": { + "modelName": "VfVfwK8sDemoCnf..vsn..module-1", + "modelVersionId": "3c50323b-5f8c-4b31-938f-8e996a2e0001", + "modelInvariantUuid": "11e50367-a4c9-4203-a838-518446ec816a", + "modelVersion": "1", + "modelCustomizationId": "1812807a-9f6b-42e4-b78c-814c3fea5a4c" + }, + "instanceName": "vf_frankfurt_vfw_k8s_demo_final0..VfFrankfurtVfwK8sDemoFinal..vsn..module-1", + "instanceParams": [{ + "k8s-rb-profile-name": "vfw-cnf-cds-base-profile", + "k8s-rb-profile-namespace": "vfirewall", + "sdnc_model_name": "vFW_CNF_CDS", + "sdnc_model_version": "7.0.0", + "vf_module_label": "vsn" + } + ] + }, + { + "modelInfo": { + "modelName": "VfVfwK8sDemoCnf..vpkg..module-2", + "modelVersionId": "104e8b4e-d404-4a5b-9beb-f92a217fd6ee", + "modelInvariantUuid": "1782dcdb-2a4c-4665-8d04-be6b989fea8e", + "modelVersion": "1", + "modelCustomizationId": "02fb0319-f37d-4e8b-9009-263fffdb2549" + }, + "instanceName": "vf_frankfurt_vfw_k8s_demo_final0..VfFrankfurtVfwK8sDemoFinal..vpkg..module-2", + "instanceParams": [{ + "k8s-rb-profile-name": "vfw-cnf-cds-base-profile", + "k8s-rb-profile-namespace": "vfirewall", + "sdnc_model_name": "vFW_CNF_CDS", + "sdnc_model_version": "7.0.0", + "vf_module_label": "vpkg" + } + ] + }, + { + "modelInfo": { + "modelName": "VfVfwK8sDemoCnf..vfw..module-3", + "modelVersionId": "a5f678db-2e5f-47be-8fab-1540bc7482d8", + "modelInvariantUuid": "c0869243-7667-4434-b9cc-84791f07a13a", + "modelVersion": "1", + "modelCustomizationId": "f144c7c8-da93-4e06-ba93-d26e69eba509" + }, + "instanceName": "vf_frankfurt_vfw_k8s_demo_final0..VfFrankfurtVfwK8sDemoFinal..vfw..module-3", + "instanceParams": [{ + "k8s-rb-profile-name": "vfw-cnf-cds-base-profile", + "k8s-rb-profile-namespace": "vfirewall", + "sdnc_model_name": "vFW_CNF_CDS", + "sdnc_model_version": "7.0.0", + "vf_module_label": "vfw" + } + ] + } + + ] + } + ] + }, + "modelInfo": { + "modelVersion": "1.0", + "modelVersionId": "6f2c7614-571c-4482-aa2c-5eac0308aa16", + "modelInvariantId": "b9202a74-4c16-4245-83ad-1cd53c813214", + "modelName": "vfw_k8s_demo_CNF", + "modelType": "service" + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "etsiCsitProject" + }, + "owningEntity": { + "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a", + "owningEntityName": "OE-Demonstration" + } + } +} diff --git a/tests/so/sanity-check/data/serviceBasicVfCnfnotification.json b/tests/so/sanity-check/data/serviceBasicVfCnfnotification.json new file mode 100644 index 00000000..02485e18 --- /dev/null +++ b/tests/so/sanity-check/data/serviceBasicVfCnfnotification.json @@ -0,0 +1,294 @@ +{ + "distributionID": "2d6c5aa8-b644-4f30-a632-5577801ef959", + "serviceName": "vfw_k8s_demo_CNF", + "serviceVersion": "1.0", + "serviceUUID": "6f2c7614-571c-4482-aa2c-5eac0308aa16", + "serviceDescription": "service", + "serviceInvariantUUID": "b9202a74-4c16-4245-83ad-1cd53c813214", + "resources": [ + { + "resourceInstanceName": "VF_vfw_k8s_demo_CNF 0", + "resourceName": "VF_vfw_k8s_demo_CNF", + "resourceVersion": "1.0", + "resoucreType": "VF", + "resourceUUID": "daeb6a5c-3a8a-40b0-a575-8cca71dd0b7c", + "resourceInvariantUUID": "517403c8-fab8-4cfe-9bc5-d94f5e34b257", + "resourceCustomizationUUID": "8b8b67bd-01a4-42f7-b0fc-1d3a0f2765fd", + "category": "Generic", + "subcategory": "Abstract", + "artifacts": [{ + "artifactName": "vf_vfw_k8s_demo_cnf0_modules.json", + "artifactType": "VF_MODULES_METADATA", + "artifactURL": "/unzipped_sdc_csar/vf_vfw_k8s_demo_cnf0_modules.json", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "86224a10-c17e-42c9-9809-f3c31ba1b781", + "artifactVersion": "1" + }, +{ + "artifactName": "vf_vfw_k8s_demo_cnf1_modules.json", + "artifactType": "VF_MODULES_METADATA", + "artifactURL": "/unzipped_sdc_csar/vf_vfw_k8s_demo_cnf0_modules.json", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "3c50323b-5f8c-4b31-938f-8e996a2e0001", + "artifactVersion": "1" + }, + +{ + "artifactName": "base_template.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/base_template.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "ede4c2de-133f-49e3-9daa-8c56b65b5c6b", + "artifactVersion": "1" + }, +{ + "artifactName": "base_template_cloudtech_k8s_charts.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/base_template_cloudtech_k8s_charts.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "6833f47d-e91b-4887-8b55-f68ef25bccf3", + "artifactVersion": "1" + }, + +{ + "artifactName": "base_template.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/base_template.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "7f1dbc99-849e-4af8-bdcb-6c214f939428", + "artifactVersion": "1" + }, +{ + "artifactName": "base_template_cloudtech_k8s_charts.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/base_template_cloudtech_k8s_charts.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "71607418-af27-4712-8e0c-cfe992b95a38", + "artifactVersion": "1" + }, +{ + "artifactName": "vfw.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/vfw.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "406fe9df-aa4c-42c1-8f83-c7ac11169fd4", + "artifactVersion": "1" + }, +{ + "artifactName": "vfw_cloudtech_k8s_charts.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/vfw_cloudtech_k8s_charts.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "33f7aab2-3324-4523-b37a-625b0cf77dfe", + "artifactVersion": "1" + }, +{ + "artifactName": "vpkg_cloudtech_k8s_charts.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/vpkg_cloudtech_k8s_charts.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "8ab17b5a-3fbd-4142-a75f-c55ffd4c5af5", + "artifactVersion": "1" + }, +{ + "artifactName": "vsn.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/vsn.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "e17c1e60-f7da-4767-9a0e-02c8ff9c0f2e", + "artifactVersion": "1" + }, +{ + "artifactName": "vsn_cloudtech_k8s_charts.env", + "artifactType": "HEAT_ENV", + "artifactURL": "/unzipped_sdc_csar/vsn_cloudtech_k8s_charts.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "989dbc01-2fa5-463b-abaa-cf73996ea12b", + "artifactVersion": "1" + }, +{ + "artifactName": "base_template_cloudtech_k8s_charts.tgz", + "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT", + "artifactURL": "/unzipped_sdc_csar/base_template_cloudtech_k8s_charts.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "406fe9df-aa4c-42c1-8f83-c7ac11169fd4", + "artifactVersion": "1" + }, +{ + "artifactName": "vfw_cloudtech_k8s_charts.tgz", + "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT", + "artifactURL": "/unzipped_sdc_csar/vfw_cloudtech_k8s_charts.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "6833f47d-e91b-4887-8b55-f68ef25bccf3", + "artifactVersion": "1" + }, +{ + "artifactName": "vpkg_cloudtech_k8s_charts.tgz", + "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT", + "artifactURL": "/unzipped_sdc_csar/vpkg_cloudtech_k8s_charts.env", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "406fe9df-aa4c-42c1-8f83-c7ac11169fd4", + "artifactVersion": "1" + }, +{ + "artifactName": "vsn_cloudtech_k8s_charts.tgz", + "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT", + "artifactURL": "/unzipped_sdc_csar/vsn_cloudtech_k8s_charts.tgz", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "8ab17b5a-3fbd-4142-a75f-c55ffd4c5af5", + "artifactVersion": "1" + } + +, +{ + "artifactName": "vsn_cloudtech_k8s_charts.tgz", + "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT", + "artifactURL": "/unzipped_sdc_csar/vsn_cloudtech_k8s_charts.tgz", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "aaeee885-5821-4e08-8da6-0bb3b74f24e9", + "artifactVersion": "1" + }, +{ + "artifactName": "vsn_cloudtech_k8s_charts.tgz", + "artifactType": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT", + "artifactURL": "/unzipped_sdc_csar/vsn_cloudtech_k8s_charts.tgz", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "b4510b34-e39c-4239-bacc-7dd2f3c2a418", + "artifactVersion": "1" + } + +, +{ + "artifactName": "base_template.yaml", + "artifactType": "HEAT", + "artifactURL": "/unzipped_sdc_csar/base_template.yaml", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "33f7aab2-3324-4523-b37a-625b0cf77dfe", + "artifactVersion": "1" + } + +, +{ + "artifactName": "vfw.yaml", + "artifactType": "HEAT", + "artifactURL": "/unzipped_sdc_csar/vfw.yaml", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "6833f47d-e91b-4887-8b55-f68ef25bccf3", + "artifactVersion": "1" + } + +, +{ + "artifactName": "vpkg.yaml", + "artifactType": "HEAT", + "artifactURL": "/unzipped_sdc_csar/vpkg.yaml", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "42b80d18-69ec-4233-8844-f0df6ebb6e3d", + "artifactVersion": "1" + } +, +{ + "artifactName": "vsn.yaml", + "artifactType": "HEAT", + "artifactURL": "/unzipped_sdc_csar/vsn.yaml", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "406fe9df-aa4c-42c1-8f83-c7ac11169fd4", + "artifactVersion": "1" + } + +, +{ + "artifactName": "vendor-license-model.xml", + "artifactType": "VENDOR_LICENSE", + "artifactURL": "/unzipped_sdc_csar/vendor-license-model.xml", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "6e1dbc99-849e-4af8-bdcb-6c214f939491", + "artifactVersion": "1" + } + +, +{ + "artifactName": "vf-license-model.xml", + "artifactType": "VF_LICENSE", + "artifactURL": "/unzipped_sdc_csar/vf-license-model.xml", + "artifactChecksum": "MDJkYjNmNjEzM2Y1ZDgzNzZiZWUxMjZkMzA3YzkwZDI\u003d", + "artifactDescription": "Auto-generated VF Modules information artifact", + "artifactTimeout": 120, + "artifactUUID": "ede4c2de-133f-49e3-9daa-8c56b65b5c6b", + "artifactVersion": "1" + } + +] + } + + + ], + "serviceArtifacts": [ + { + "artifactName": "service-VfwK8sDemoCnf-template.yml", + "artifactType": "TOSCA_TEMPLATE", + "artifactURL": "/unzipped_sdc_csar/service-VfwK8sDemoCnf-template.yml", + "artifactChecksum": "NTUzMDU5YzM3MTk4OGNiNjQ2OGRlMWY2YjU3MjE2YjM\u003d", + "artifactDescription": "TOSCA representation of the asset", + "artifactTimeout": 0, + "artifactUUID": "6f2c7614-571c-4482-aa2c-5eac0308aa16", + "artifactVersion": "1" + }, + { + "artifactName": "service-VfwK8sDemoCnf-csar.csar", + "artifactType": "TOSCA_CSAR", + "artifactURL": "/unzipped_sdc_csar/service-VfwK8sDemoCnf-csar.csar", + "artifactChecksum": "ZTRhOGI0M2UxN2ZhYjQ0ODI5ZDZhZTExZTFkMGU3N2Y\u003d", + "artifactDescription": "TOSCA definition package of the asset", + "artifactTimeout": 0, + "artifactUUID": "6f2c7614-571c-4482-aa2c-5eac0308aa16", + "artifactVersion": "1" + } + ], + "workloadContext": "Production" +} + diff --git a/tests/so/sanity-check/macroflow.robot b/tests/so/sanity-check/macroflow.robot new file mode 100644 index 00000000..cd3a5b55 --- /dev/null +++ b/tests/so/sanity-check/macroflow.robot @@ -0,0 +1,29 @@ +*** Settings *** +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json + +*** Variables *** +${SLEEP_INTERVAL_SEC}= 60 + +*** Test Cases *** +Distribute Service Template + Create Session sdc_controller_session http://${REPO_IP}:8085 + ${data}= Get Binary File ${CURDIR}${/}data${/}serviceBasicVfCnfnotification.json + &{headers}= Create Dictionary Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ= resource-location=/distribution-test-zip/unzipped/ Content-Type=application/json Accept=application/json + ${resp}= Post Request sdc_controller_session /test/treatNotification/v1 data=${data} headers=${headers} + Log To Console Received status code: ${resp.status_code} + Run Keyword If '${resp.status_code}' == '200' log to console \nexecuted with expected result + Should Be Equal As Strings '${resp.status_code}' '200' + + +Macroflow + Create Session api_handler_session http://${REPO_IP}:8080 + ${data}= Get Binary File ${CURDIR}${/}data${/}macroflow.json + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${service_instantiation_request}= Post Request api_handler_session /onap/so/infra/serviceInstantiation/v7/serviceInstances data=${data} headers=${headers} + Log To Console Received status code: ${service_instantiation_request.status_code} + Run Keyword If '${service_instantiation_request.status_code}' == '202' log to console \nexecuted with expected result + Should Be Equal As Strings '${service_instantiation_request.status_code}' '202' + SLEEP ${SLEEP_INTERVAL_SEC}s diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot deleted file mode 100644 index 660c5f64..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/BulkpmE2E.robot +++ /dev/null @@ -1,125 +0,0 @@ -*** Settings *** -Documentation Testing E2E VES,Dmaap,DFC,DR with File Ready event feed from xNF -Library RequestsLibrary -Library OperatingSystem -Library Collections -Library Process -Resource resources/bulkpm_keywords.robot -Library resources/JsonValidatorLibrary.py -Library resources/xNFLibrary.py - - -*** Variables *** -${VESC_URL} http://%{VESC_IP}:%{VESC_PORT} -${GLOBAL_APPLICATION_ID} robot-ves -${VES_ANY_EVENT_PATH} /eventListener/v7 -${HEADER_STRING} content-type=application/json -${EVENT_DATA_FILE} %{WORKSPACE}/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json - -${TARGETURL_TOPICS} http://${DMAAP_MR_IP}:3904/topics -${TARGETURL_SUBSCR} http://${DMAAP_MR_IP}:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12?timeout=1000 -${CLI_EXEC_CLI} curl -k https://${DR_PROV_IP}:8443/internal/prov -${CLI_EXEC_CLI_FILECONSUMER} docker exec fileconsumer-node /bin/sh -c "ls /opt/app/subscriber/delivery | grep .xml" -${CLI_EXEC_CLI_DFC_LOG} docker exec dcaegen2-datafile-collector /bin/sh -c "cat /var/log/ONAP/application.log" > %{WORKSPACE}/archives/dfc_docker.log -${CLI_EXEC_CLI_DFC_LOG_GREP} grep "Datafile file published" %{WORKSPACE}/archives/dfc_docker.log -${CLI_EXEC_CLI_FILECONSUMER_CP} docker cp fileconsumer-node:/opt/app/subscriber/delivery/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE} -${CLI_EXEC_RENAME_METADATA} mv %{WORKSPACE}/A20181002.0000-1000-0015-1000_5G.xml.M %{WORKSPACE}/archives/metadata.json -${CLI_EXEC_CLI_PMMAPPER_LOG} docker exec dcaegen2-pm-mapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > %{WORKSPACE}/archives/pmmapper_docker.log -${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} grep "XML validation successful" %{WORKSPACE}/archives/pmmapper_docker.log -${CLI_EXEC_CLI_PMMAPPER_LOG_GREP_VES} grep "Successfully published VES events to messagerouter" %{WORKSPACE}/archives/pmmapper_docker.log -${metadataSchemaPath} %{WORKSPACE}/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json -${metadataJsonPath} %{WORKSPACE}/archives/metadata.json - -*** Test Cases *** - -Send VES File Ready Event to VES Collector - [Tags] Bulk_PM_E2E_01 - [Documentation] Send VES File Ready Event - ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} - ${headers}= Create Header From String ${HEADER_STRING} - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 15s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} - Sleep 5s - Log Receive HTTP Status code ${resp.status_code} - Should Be Equal As Strings ${resp.status_code} 202 - -Check VES Notification Topic is existing in Message Router - [Tags] Bulk_PM_E2E_02 - [Documentation] Get the VES Notification topic on message router - [Timeout] 1 minute - Sleep 10s - ${resp}= GetCall ${TARGETURL_TOPICS} - log ${TARGETURL_TOPICS} - log 'JSON Response Code :'${resp} - ${topics}= Evaluate $resp.json().get('topics') - log ${topics} - ${ListLength}= Get Length ${topics} - log ${ListLength} - List Should Contain Value ${topics} unauthenticated.VES_NOTIFICATION_OUTPUT - -Verify Data File Collector successfully publishes the PM XML file to the Data Router - [Tags] Bulk_PM_E2E_03 - [Documentation] Check that DFC publishes the PM XML to the Data Router - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_DFC_LOG} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_DFC_LOG_GREP} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} Datafile file published - - -Verify Default Feed And File Consumer Subscription On Datarouter - [Tags] Bulk_PM_E2E_04 - [Documentation] Verify Default Feed And File Consumer Subscription On Datarouter - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} https://dmaap-dr-prov/publish/1 - Should Contain ${cli_cmd_output.stdout} http://datarouter-subscriber:7070 - - -Verify Fileconsumer Receive PM file from Data Router - [Tags] Bulk_PM_E2E_05 - [Documentation] Check PM XML file exists on the File Consumer Simulator - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} A20181002.0000-1000-0015-1000_5G.xml - -Verify File Consumer Receive valid metadata from Data Router - [Tags] Bulk_PM_E2E_06 - [Documentation] Check PM XML file is delivered to the FileConsumer Simulator with valid metadata - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} A20181002.0000-1000-0015-1000_5G.xml.M - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_FILECONSUMER_CP} shell=yes - ${cli_cmd_output}= Run Process ${CLI_EXEC_RENAME_METADATA} shell=yes - ${validation_result}= Validate ${metadataSchemaPath} ${metadataJsonPath} - Should Be Equal As Strings ${validation_result} 0 - -Verify PM-Mapper successfully receives uncompressed the PM XML file - [Tags] Bulk_PM_E2E_07 - [Documentation] Check that PM-Mapper receives the uncompressed PM XML file - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} XML validation successful - -Verify PM-Mapper successfully publishes VES event the Message Router - [Tags] Bulk_PM_E2E_08 - [Documentation] Check that PM-Mapper publishes VES onto the Message Router - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - ${cli_cmd_output}= Run Process ${CLI_EXEC_CLI_PMMAPPER_LOG_GREP_VES} shell=yes - Should Contain ${cli_cmd_output.stdout} Successfully published VES events to messagerouter \ No newline at end of file diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot deleted file mode 100644 index 7114fd44..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -*** Settings *** -Documentation 5G Bulk PM E2E Testcases diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json b/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json deleted file mode 100644 index 02f092df..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/json_events/FileExistNotification.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "event": { - "commonEventHeader": { - "version": "4.0.1", - "vesEventListenerVersion": "7.0.1", - "domain": "notification", - "eventName": "Noti_RnNode-Ericsson_FileReady", - "eventId": "FileReady_1797490e-10ae-4d48-9ea7-3d7d790b25e1", - "lastEpochMicrosec": 8745745764578, - "priority": "Normal", - "reportingEntityName": "otenb5309", - "sequence": 0, - "sourceName": "oteNB5309", - "startEpochMicrosec": 8745745764578, - "timeZoneOffset": "UTC+05.30" - }, - "notificationFields": { - "changeIdentifier": "PM_MEAS_FILES", - "changeType": "FileReady", - "notificationFieldsVersion": "2.0", - "arrayOfNamedHashMap": [ - { "name": "A20181002.0000-1000-0015-1000_5G.xml.gz", - "hashMap":{ - "location": "sftp://admin:admin@sftp:22/A20181002.0000-1000-0015-1000_5G.xml.gz", - "compression": "gzip", - "fileFormatType": "org.3GPP.32.435#measCollec", - "fileFormatVersion": "V10" - } - } - ] - } -} -} \ No newline at end of file diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json b/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json deleted file mode 100644 index a41b3544..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/assets/metadata.schema.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema", - "$id": "metadata.schema.json", - "title": "DataRouter PM File Metadata", - "description": "Metadata for 3GPP PM files that are placed on the DMaaP Data Router by the Data File Collector (VES 7.1)", - "type": "object", - - "properties": { - "productName": { - "description": "from the FileReady event eventName", - "type": "string" - }, - - "vendorName": { - "description": "from the FileReady event eventName", - "type": "string" - }, - - "lastEpochMicrosec": { - "description": "the latest unix epoch time associated with the FileReady event", - "type": "string" - }, - - "sourceName": { - "description": "the name of the entity experiencing the event", - "type": "string" - }, - - "startEpochMicrosec": { - "description": "the earliest unix epoch time associated with the FileReady event", - "type": "string" - }, - - "timeZoneOffset": { - "description": "the timezone offset from UTC", - "type": "string", - "pattern": "^(?:(?:[a-zA-Z]{3})[+-](?:[01][0-9]|2[0-3]).[0-5][0-9])$" - }, - - "location": { - "description": "follows the format ://://, the IP address is the node ip address, the port of the protocol server", - "type": "string" - }, - - "compression": { - "description": "specifies if the file is compressed", - "type": "string", - "enum": [ "gzip" ] - }, - - "fileFormatType": { - "description": "the file format", - "type": "string" - }, - - "fileFormatVersion": { - "description": "the version of the file format", - "type": "string" - } - }, - - "required": [ - "productName", - "vendorName", - "lastEpochMicrosec", - "sourceName", - "startEpochMicrosec", - "timeZoneOffset", - "location", - "compression", - "fileFormatType", - "fileFormatVersion" - ] -} diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py deleted file mode 100644 index ed376ff2..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/JsonValidatorLibrary.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- - -import logging - -from jsonschema import validate, ValidationError, SchemaError -from simplejson import load - - -class JsonValidatorLibrary(object): - - def __init__(self): - pass - - @staticmethod - def validate(schema_path, json_path): - logging.info("Schema path: " + schema_path) - logging.info("JSON path: " + json_path) - schema = None - data = None - try: - schema = load(open(schema_path, 'r')) - data = load(open(json_path, 'r')) - except (IOError, ValueError, OSError) as e: - logging.error(e.message) - return 1 - - try: - validate(data, schema) - except (ValidationError, SchemaError) as e: - logging.error(e.message) - return 1 - - # logger.log("JSON validation successful") - print("JSON validation successful") - return 0 - - -if __name__ == '__main__': - lib = JsonValidatorLibrary() -# sys.exit(JsonValidatorLibrary().validate(sys.argv[1], sys.argv[2])) diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot deleted file mode 100644 index 9ef56c83..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot +++ /dev/null @@ -1,39 +0,0 @@ - *** Settings *** -Documentation The main interface for interacting with VES. It handles low level stuff like managing the http request library and VES required fields -Library RequestsLibrary -Library ../resources/xNFLibrary.py -Library ../resources/JsonValidatorLibrary.py -Library OperatingSystem -Library Collections -Library requests -Library Collections -Library String - -*** Variables *** - -*** Keywords *** - -Get Event Data From File - [Arguments] ${jsonfile} - ${data}= OperatingSystem.Get File ${jsonfile} - #Should Not Be_Equal ${data} None - [return] ${data} - -Publish Event To VES Collector - [Documentation] Send an event to VES Collector - [Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} - Log Creating session ${url} - ${session}= Create Session dcaegen2-d1 ${url} - ${resp}= Post Request dcaegen2-d1 ${evtpath} data=${evtdata} headers=${httpheaders} - #Log Received response from dcae ${resp.json()} - [return] ${resp} -PostCall - [Arguments] ${url} ${data} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests - [Return] ${resp} - -GetCall - [Arguments] ${url} - ${resp}= Evaluate requests.get('${url}') requests - [Return] ${resp} diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py deleted file mode 100644 index b70d8095..00000000 --- a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/xNFLibrary.py +++ /dev/null @@ -1,30 +0,0 @@ -''' -Created on Aug 18, 2017 - -@author: sw6830 -''' -import time -import uuid - -from robot.api import logger - - -class xNFLibrary(object): - - def __init__(self): - pass - - @staticmethod - def create_header_from_string(dict_str): - logger.info("Enter create_header_from_string: dictStr") - return dict(u.split("=") for u in dict_str.split(",")) - - @staticmethod - def Generate_UUID(self): - """generate a uuid""" - return uuid.uuid4() - - -if __name__ == '__main__': - lib = xNFLibrary() - time.sleep(100000) diff --git a/tests/usecases-config-over-netconf/config-over-netconf/config_over_netconf.robot b/tests/usecases-config-over-netconf/config-over-netconf/config_over_netconf.robot index 21c03c6f..e7d923f8 100644 --- a/tests/usecases-config-over-netconf/config-over-netconf/config_over_netconf.robot +++ b/tests/usecases-config-over-netconf/config-over-netconf/config_over_netconf.robot @@ -9,7 +9,7 @@ Library String ${SDNC_KEYSTORE_CONFIG_PATH} /config/netconf-keystore:keystore ${SDNC_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/pnf-simulator ${PNFSIM_MOUNT_PATH} /config/network-topology:network-topology/topology/topology-netconf/node/pnf-simulator/yang-ext:mount/mynetconf:netconflist -${BP_UPLOAD_URL} /api/v1/execution-service/upload +${BP_UPLOAD_URL} /api/v1/blueprint-model/publish ${BP_PROCESS_URL} /api/v1/execution-service/process ${BP_ARCHIVE_PATH} ${CURDIR}/data/blueprint_archive.zip diff --git a/tests/usecases-config-over-netconf/config-over-netconf/data/blueprint_archive.zip b/tests/usecases-config-over-netconf/config-over-netconf/data/blueprint_archive.zip index ac346554..642c85f5 100644 Binary files a/tests/usecases-config-over-netconf/config-over-netconf/data/blueprint_archive.zip and b/tests/usecases-config-over-netconf/config-over-netconf/data/blueprint_archive.zip differ 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 4edc9ded..055d7dec 100644 Binary files a/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip and b/tests/usecases-pnf-sw-upgrade/pnf-sw-upgrade/data/blueprint_archive.zip 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 00000000..e5b3d890 --- /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 00000000..efe94b42 --- /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 00000000..d7a6b57f --- /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 d3762a0b..1bb2d714 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 @@ Library String *** 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 @@ Distribute Service Template ${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 @@ Get pnf workflow ${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 @@ Get pnf workflow ${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 @@ Test AAI-update for target software version verify 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 00000000..1b258558 Binary files /dev/null and b/tests/vnfsdk-refrepo/csar/invalid_with_security.csar differ diff --git a/tests/vnfsdk-refrepo/csar_validation_tests.robot b/tests/vnfsdk-refrepo/csar_validation_tests.robot index 9994d567..9097c1a9 100644 --- a/tests/vnfsdk-refrepo/csar_validation_tests.robot +++ b/tests/vnfsdk-refrepo/csar_validation_tests.robot @@ -18,13 +18,60 @@ Validate correct, no security CSAR # 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 e46eba6f..f240a5fa 100644 --- a/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot +++ b/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot @@ -3,10 +3,22 @@ ${base_url}= http://${REFREPO_IP}:8702/onapapi/vnfsdk-marketplace/v1 ${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"}}] +${execute_no_security_csar_validation}= [{"scenario": "onap-vtp","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-vtp","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_invalid_with_security}","pnf":"true"}}] +${execute_security_csar_validation_selected_rules}= [{"scenario": "onap-vtp","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"}}] -${execute_invalid_pm_dictionary_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}] +${execute_invalid_pm_dictionary_r130206_validation}= [{"scenario": "onap-vtp","testSuiteName": "validation","testCaseName": "csar-validate-r130206","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}] +${execute_invalid_pm_dictionary_validation}= [{"scenario": "onap-vtp","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}]