From fb4643501d7182b3be5d6715ea0ed8966155f9f2 Mon Sep 17 00:00:00 2001 From: ramverma Date: Wed, 29 May 2019 10:54:01 +0000 Subject: Update pap stability testsuite 1) Adding test cases to the stability test plan. 2) Adding script & related files for setup of pap for testing 3) Adding script & related files for setup of simulator and dependencies like dmaap simulator, pdp simulator, mariadb & policy/api. Change-Id: Ib7a1e95dee108e9d8757ee18cbf5fb8c2b877274 Issue-ID: POLICY-1799 Signed-off-by: ramverma --- .../papsetup/config/pap/bin/policy-pap.sh | 57 + .../papsetup/config/pap/etc/topic.properties | 23 + .../src/main/resources/papsetup/setup_pap.sh | 23 + .../resources/simulatorsetup/config/db/db.conf | 16 + .../main/resources/simulatorsetup/config/db/db.sh | 22 + .../simulatorsetup/config/pdp/OnapPfConfig.json | 9 + .../simulatorsetup/config/pdp/topic.properties | 22 + .../simulatorsetup/docker-compose-simulator.yml | 30 + .../resources/simulatorsetup/setup_components.sh | 64 ++ .../src/main/resources/testplans/stability.jmx | 1088 +++++++++++++++++--- 10 files changed, 1194 insertions(+), 160 deletions(-) create mode 100644 testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh create mode 100644 testsuites/stability/src/main/resources/papsetup/config/pap/etc/topic.properties create mode 100644 testsuites/stability/src/main/resources/papsetup/setup_pap.sh create mode 100644 testsuites/stability/src/main/resources/simulatorsetup/config/db/db.conf create mode 100644 testsuites/stability/src/main/resources/simulatorsetup/config/db/db.sh create mode 100644 testsuites/stability/src/main/resources/simulatorsetup/config/pdp/OnapPfConfig.json create mode 100644 testsuites/stability/src/main/resources/simulatorsetup/config/pdp/topic.properties create mode 100644 testsuites/stability/src/main/resources/simulatorsetup/docker-compose-simulator.yml create mode 100644 testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh (limited to 'testsuites/stability') diff --git a/testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh b/testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh new file mode 100644 index 00000000..ff4afa1c --- /dev/null +++ b/testsuites/stability/src/main/resources/papsetup/config/pap/bin/policy-pap.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# Copyright (C) 2019 Nordix Foundation. +# Modifications Copyright (C) 2019 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========================================================= +# + +JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/ +POLICY_PAP_HOME=/opt/app/policy/pap +KEYSTORE="${POLICY_HOME}/etc/ssl/policy-keystore" +KEYSTORE_PASSWD="Pol1cy_0nap" +TRUSTSTORE="${POLICY_HOME}/etc/ssl/policy-truststore" +TRUSTSTORE_PASSWD="Pol1cy_0nap" + + +if [ "$#" -ge 1 ]; then + CONFIG_FILE=$1 +else + CONFIG_FILE=${CONFIG_FILE} +fi + +if [ "$#" -ge 2 ]; then + PROP_FILE=$2 +else + PROP_FILE=${PROP_FILE} +fi + +if [ -z "$CONFIG_FILE" ] + then + CONFIG_FILE="$POLICY_PAP_HOME/etc/defaultConfig.json" +fi + +if [ -z "$PROP_FILE" ] + then + PROP_FILE="$POLICY_PAP_HOME/etc/topic.properties" +fi + +echo "Policy pap config file: $CONFIG_FILE" +echo "Policy pap property file: $PROP_FILE" + +$JAVA_HOME/bin/java -cp "$POLICY_PAP_HOME/etc:$POLICY_PAP_HOME/lib/*" -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="$KEYSTORE_PASSWD" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="$TRUSTSTORE_PASSWD" -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=10.2.0.43 org.onap.policy.pap.main.startstop.Main -c $CONFIG_FILE -p $PROP_FILE + diff --git a/testsuites/stability/src/main/resources/papsetup/config/pap/etc/topic.properties b/testsuites/stability/src/main/resources/papsetup/config/pap/etc/topic.properties new file mode 100644 index 00000000..1ecee530 --- /dev/null +++ b/testsuites/stability/src/main/resources/papsetup/config/pap/etc/topic.properties @@ -0,0 +1,23 @@ +# ============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========================================================= + +dmaap.source.topics=POLICY-PDP-PAP +dmaap.sink.topics=POLICY-PDP-PAP + +dmaap.source.topics.POLICY-PDP-PAP.servers= 10.2.0.41:3904 +dmaap.sink.topics.POLICY-PDP-PAP.servers= 10.2.0.41:3904 diff --git a/testsuites/stability/src/main/resources/papsetup/setup_pap.sh b/testsuites/stability/src/main/resources/papsetup/setup_pap.sh new file mode 100644 index 00000000..2e965a5c --- /dev/null +++ b/testsuites/stability/src/main/resources/papsetup/setup_pap.sh @@ -0,0 +1,23 @@ +#!/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========================================================= + +# the directory of the script +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +echo ${DIR} +docker run -p 9090:9090 -p 6969:6969 -v ${DIR}/config/pap/bin/policy-pap.sh:/opt/app/policy/pap/bin/policy-pap.sh -v ${DIR}/config/pap/etc/topic.properties:/opt/app/policy/pap/etc/topic.properties --add-host mariadb:10.2.0.41 --name policy-pap -d --rm nexus3.onap.org:10001/onap/policy-pap:2.0.0-SNAPSHOT-latest diff --git a/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.conf b/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.conf new file mode 100644 index 00000000..4768bfc4 --- /dev/null +++ b/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.conf @@ -0,0 +1,16 @@ +# 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. +MYSQL_ROOT_PASSWORD=secret +MYSQL_USER=policy_user +MYSQL_PASSWORD=policy_user diff --git a/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.sh b/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.sh new file mode 100644 index 00000000..660f2c5a --- /dev/null +++ b/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.sh @@ -0,0 +1,22 @@ +#!/bin/bash -xv +# 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. + +for db in policyadmin +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/testsuites/stability/src/main/resources/simulatorsetup/config/pdp/OnapPfConfig.json b/testsuites/stability/src/main/resources/simulatorsetup/config/pdp/OnapPfConfig.json new file mode 100644 index 00000000..cbb4978b --- /dev/null +++ b/testsuites/stability/src/main/resources/simulatorsetup/config/pdp/OnapPfConfig.json @@ -0,0 +1,9 @@ +{ + "name":"OnapPfParameterGroup", + "pdpStatusParameters":{ + "timeIntervalMs": 120000, + "pdpType":"apex", + "description":"Pdp Heartbeat", + "supportedPolicyTypes":[{"name":"onap.policies.controlloop.operational.Apex","version":"1.0.0"}] + } +} diff --git a/testsuites/stability/src/main/resources/simulatorsetup/config/pdp/topic.properties b/testsuites/stability/src/main/resources/simulatorsetup/config/pdp/topic.properties new file mode 100644 index 00000000..f659a4dd --- /dev/null +++ b/testsuites/stability/src/main/resources/simulatorsetup/config/pdp/topic.properties @@ -0,0 +1,22 @@ +# ============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========================================================= + +dmaap.source.topics=POLICY-PDP-PAP +dmaap.sink.topics=POLICY-PDP-PAP +dmaap.source.topics.POLICY-PDP-PAP.servers= 10.2.0.41:3904 +dmaap.sink.topics.POLICY-PDP-PAP.servers= 10.2.0.41:3904 diff --git a/testsuites/stability/src/main/resources/simulatorsetup/docker-compose-simulator.yml b/testsuites/stability/src/main/resources/simulatorsetup/docker-compose-simulator.yml new file mode 100644 index 00000000..532a798f --- /dev/null +++ b/testsuites/stability/src/main/resources/simulatorsetup/docker-compose-simulator.yml @@ -0,0 +1,30 @@ +# 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. +version: '2' +networks: + default: + driver: bridge +services: + message-router: + image: dmaap/simulator + container_name: dmaap-simulator + hostname: dmaap-simulator + ports: + - "3904:3904" + pdp: + image: pdp/simulator + container_name: pdp-simulator + depends_on: + - message-router + hostname: pdp-simulator diff --git a/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh b/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh new file mode 100644 index 00000000..86de3c1e --- /dev/null +++ b/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh @@ -0,0 +1,64 @@ +#!/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========================================================= + +# the directory of the script +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +echo ${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} + +# check if tmp dir was created +if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then + echo "Could not create temp dir" + exit 1 +fi + +# bring down maven +mkdir maven +cd maven +curl -O http://apache.claz.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz +tar -xzvf apache-maven-3.3.9-bin.tar.gz +ls -l +export PATH=${PATH}:${WORK_DIR}/maven/apache-maven-3.3.9/bin +${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn -v +cd .. + +git clone http://gerrit.onap.org/r/oparent +git clone --depth 1 https://gerrit.onap.org/r/policy/models -b master + +cd models/models-sim/models-sim-dmaap +${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn clean install -DskipTests --settings ${WORK_DIR}/oparent/settings.xml +bash ./src/main/package/docker/docker_build.sh + +cd ../policy-models-sim-pdp +${WORK_DIR}/maven/apache-maven-3.3.9/bin/mvn clean install -DskipTests --settings ${WORK_DIR}/oparent/settings.xml +bash ./src/main/package/docker/docker_build.sh + +cd ${DIR} +rm -rf ${WORK_DIR} + +docker run -p 3306:3306 -v ${DIR}/config/db:/docker-entrypoint-initdb.d --name mariadb --env-file ${DIR}/config/db/db.conf -d --rm mariadb:10.2.14 --lower-case-table-names=1 --wait_timeout=28800 +docker run -p 3904:3904 -d --name dmaap-simulator --rm dmaap/simulator:latest +docker run -v ${DIR}/config/pdp:/opt/app/policy/pdp-sim/etc/config/ -d --name pdp-simulator --rm pdp/simulator:latest +docker run -p 6969:6969 --link mariadb:mariadb --name policy-api -d --rm nexus3.onap.org:10001/onap/policy-api diff --git a/testsuites/stability/src/main/resources/testplans/stability.jmx b/testsuites/stability/src/main/resources/testplans/stability.jmx index 098d8c59..63cfa32c 100644 --- a/testsuites/stability/src/main/resources/testplans/stability.jmx +++ b/testsuites/stability/src/main/resources/testplans/stability.jmx @@ -4,6 +4,7 @@ ONAP Policy PAP ================================================================================ Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + Modifications 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. @@ -29,22 +30,22 @@ PAP_HOST - ${__P(host,10.12.6.164)} + 10.2.0.43 = - - DURATION - ${__P(duration, 5)} + + PAP_PORT + 6969 = - - USERS - ${__P(users, 1)} + + API_HOST + 10.2.0.41 = - - PORT - ${__P(port, 6969)} + + API_PORT + 6969 = @@ -52,17 +53,489 @@ - - continue + + + + https://${PAP_HOST}:6969/policy/pap/v1 + healthcheck + zb!XztG34 + + + + + https://${API_HOST}:6969/policy/api/v1 + healthcheck + zb!XztG34 + + + + + true + + + + + + Accept + application/json + + + Content-Type + application/json + + + + + + stoptest + + false + 1 + + 1 + 1 + false + + + + + + true + + + + false + { + "tosca_definitions_version": "tosca_simple_yaml_1_0_0", + "policy_types": [ + { + "onap.policies.controlloop.operational.Apex": { + "version": "1.0.0", + "description": "Operational Policy for Control Loops using the APEX PDP", + "properties": { + "engine_service": { + "type": "onap.datatypes.policies.controlloop.operational.apex.EngineService", + "description": "APEX Engine Service Parameters" + }, + "inputs": { + "type": "map", + "description": "Inputs for handling events coming into the APEX engine", + "entry_schema": { + "type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler" + } + }, + "outputs": { + "type": "map", + "description": "Outputs for handling events going out of the APEX engine", + "entry_schema": { + "type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler" + } + }, + "environment": { + "type": "list", + "description": "Envioronmental parameters for the APEX engine", + "entry_schema": { + "type": "onap.datatypes.policies.controlloop.operational.apex.Environment" + } + } + } + } + } + ], + "data_types": [ + { + "onap.datatypes.policies.controlloop.operational.apex.EngineService": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "name": { + "type": "string", + "description": "Specifies the engine name", + "required": false, + "default": "ApexEngineService" + }, + "version": { + "type": "string", + "description": "Specifies the engine version in double dotted format", + "required": false, + "default": "1.0.0" + }, + "id": { + "type": "int", + "description": "Specifies the engine id", + "required": true + }, + "instance_count": { + "type": "int", + "description": "Specifies the number of engine threads that should be run", + "required": true + }, + "deployment_port": { + "type": "int", + "description": "Specifies the port to connect to for engine administration", + "required": false, + "default": 1 + }, + "policy_model_file_name": { + "type": "string", + "description": "The name of the file from which to read the APEX policy model", + "required": false, + "default": "" + }, + "policy_type_impl": { + "type": "string", + "description": "The policy type implementation from which to read the APEX policy model", + "required": false, + "default": "" + }, + "periodic_event_period": { + "type": "string", + "description": "The time interval in milliseconds for the periodic scanning event, 0 means \"don't scan\"", + "required": false, + "default": 0 + }, + "engine": { + "type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine", + "description": "The parameters for all engines in the APEX engine service", + "required": true + } + } + } + }, + { + "onap.datatypes.policies.controlloop.operational.apex.EventHandler": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "name": { + "type": "string", + "description": "Specifies the event handler name, if not specified this is set to the key name", + "required": false + }, + "carrier_technology": { + "type": "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology", + "description": "Specifies the carrier technology of the event handler (such as REST/Web Socket/Kafka)", + "required": true + }, + "event_protocol": { + "type": "onap.datatypes.policies.controlloop.operational.apex.EventProtocol", + "description": "Specifies the event protocol of events for the event handler (such as Yaml/JSON/XML/POJO)", + "required": true + }, + "event_name": { + "type": "string", + "description": "Specifies the event name for events on this event handler, if not specified, the event name is read from or written to the event being received or sent", + "required": false + }, + "event_name_filter": { + "type": "string", + "description": "Specifies a filter as a regular expression, events that do not match the filter are dropped, the default is to let all events through", + "required": false + }, + "synchronous_mode": { + "type": "bool", + "description": "Specifies the event handler is syncronous (receive event and send response)", + "required": false, + "default": false + }, + "synchronous_peer": { + "type": "string", + "description": "The peer event handler (output for input or input for output) of this event handler in synchronous mode, this parameter is mandatory if the event handler is in synchronous mode", + "required": false, + "default": "" + }, + "synchronous_timeout": { + "type": "int", + "description": "The timeout in milliseconds for responses to be issued by APEX torequests, this parameter is mandatory if the event handler is in synchronous mode", + "required": false, + "default": "" + }, + "requestor_mode": { + "type": "bool", + "description": "Specifies the event handler is in requestor mode (send event and wait for response mode)", + "required": false, + "default": false + }, + "requestor_peer": { + "type": "string", + "description": "The peer event handler (output for input or input for output) of this event handler in requestor mode, this parameter is mandatory if the event handler is in requestor mode", + "required": false, + "default": "" + }, + "requestor_timeout": { + "type": "int", + "description": "The timeout in milliseconds for wait for responses to requests, this parameter is mandatory if the event handler is in requestor mode", + "required": false, + "default": "" + } + } + } + }, + { + "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "label": { + "type": "string", + "description": "The label (name) of the carrier technology (such as REST, Kafka, WebSocket)", + "required": true + }, + "plugin_parameter_class_name": { + "type": "string", + "description": "The class name of the class that overrides default handling of event input or output for this carrier technology, defaults to the supplied input or output class", + "required": false + } + } + } + }, + { + "onap.datatypes.policies.controlloop.operational.apex.EventProtocol": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "label": { + "type": "string", + "description": "The label (name) of the event protocol (such as Yaml, JSON, XML, or POJO)", + "required": true + }, + "event_protocol_plugin_class": { + "type": "string", + "description": "The class name of the class that overrides default handling of the event protocol for this carrier technology, defaults to the supplied event protocol class", + "required": false + } + } + } + }, + { + "onap.datatypes.policies.controlloop.operational.apex.Environmental": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "name": { + "type": "string", + "description": "The name of the environment variable", + "required": true + }, + "value": { + "type": "string", + "description": "The value of the environment variable", + "required": true + } + } + } + }, + { + "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "context": { + "type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context", + "description": "The properties for handling context in APEX engines, defaults to using Java maps for context", + "required": false + }, + "executors": { + "type": "map", + "description": "The plugins for policy executors used in engines such as javascript, MVEL, Jython", + "required": true, + "entry_schema": { + "description": "The plugin class path for this policy executor", + "type": "string" + } + } + } + } + }, + { + "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "distributor": { + "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin", + "description": "The plugin to be used for distributing context between APEX PDPs at runtime", + "required": false + }, + "schemas": { + "type": "map", + "description": "The plugins for context schemas available in APEX PDPs such as Java and Avro", + "required": false, + "entry_schema": { + "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin" + } + }, + "locking": { + "type": "onap.datatypes.policies.controlloop.operational.apex.plugin", + "description": "The plugin to be used for locking context in and between APEX PDPs at runtime", + "required": false + }, + "persistence": { + "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin", + "description": "The plugin to be used for persisting context for APEX PDPs at runtime", + "required": false + } + } + } + }, + { + "onap.datatypes.policies.controlloop.operational.apex.Plugin": { + "derived_from": "tosca.datatypes.Root", + "properties": { + "name": { + "type": "string", + "description": "The name of the executor such as Javascript, Jython or MVEL", + "required": true + }, + "plugin_class_name": { + "type": "string", + "description": "The class path of the plugin class for this executor" + } + } + } + } + ] +} + = + + + + ${API_HOST} + ${API_PORT} + https + + policy/api/v1/policytypes + POST + true + false + true + false + + + + + + + + 200 + + + Assertion.response_code + false + 1 + + + + + true + + + + false + { + "tosca_definitions_version": "tosca_simple_yaml_1_0_0", + "topology_template": { + "policies": [ + { + "operational.apex.sampledomain": { + "type": "onap.policies.controlloop.operational.Apex", + "typeVersion": "1.0.0", + "name": "onap.policies.controlloop.operational.apex.Sampledomain", + "version": "1.0.0", + "properties": { + "content": { + "engineServiceParameters": { + "name": "MyApexEngine", + "version": "0.0.1", + "id": 45, + "instanceCount": 4, + "deploymentPort": 12561, + "policy_type_impl": { + "policy_impl": "There will be an actual policy impl in production" + }, + "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 + } + } + } + } + } + } + ] + } +} + = + + + + ${API_HOST} + ${API_PORT} + https + + /policy/api/v1/policytypes/onap.policies.controlloop.operational.Apex/versions/1.0.0/policies + POST + true + false + true + false + + + + + + + + 200 + + + Assertion.response_code + false + 1 + + + + + + stoptest false - -1 + 1 - ${USERS} + 1 1 - true - ${DURATION} - 1 + false + + @@ -70,10 +543,10 @@ ${PAP_HOST} - 6969 + ${PAP_PORT} https - healthcheck + /policy/pap/v1/healthcheck GET true false @@ -117,92 +590,15 @@ if (prev.getResponseCode() == '200') { - - - - Accept - application/json - - - Content-Type - application/json - - - - - - - - https://${PAP_HOST}:6969/healthcheck - healthcheck - zb!XztG34 - - - - - true - - - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - true - false - false - false - true - 0 - true - true - true - true - true - true - - - - - - - - continue - - false - -1 - - ${USERS} - 1 - true - ${DURATION} - 1 - - - + ${PAP_HOST} - 6969 + ${PAP_PORT} https - statistics + policy/pap/v1/statistics GET true false @@ -211,7 +607,7 @@ if (prev.getResponseCode() == '200') { - Basic Health Check + Check Statistics @@ -248,70 +644,442 @@ if (prev.getResponseCode() == '200') { - - - - Accept - application/json - - - Content-Type - application/json - - - + + + + + ${PAP_HOST} + ${PAP_PORT} + https + + policy/pap/v1/pdps/groups/defaultGroup?state=ACTIVE + PUT + true + false + true + false + + + + + + + + 200 + + + Assertion.response_code + false + 1 + + + + + 200 + - - - - https://${PAP_HOST}:6969/statistics - healthcheck - zb!XztG34 - - - - - true - + + + + + ${PAP_HOST} + ${PAP_PORT} + https + + /policy/pap/v1/pdps + GET + true + false + true + false + + + + Check PdpGroup Query + + + + + 200 + + + Assertion.response_code + false + 1 + + + + groovy + + + true + import groovy.json.JsonSlurper; + +def res = []; +if (prev.getResponseCode() == '200') { + def jsonSlurper = new JsonSlurper(); + res = jsonSlurper.parseText(prev.getResponseDataAsString()); + + assert res instanceof Map; + assert res.groups.size > 0; + assert res.groups[0].pdpGroupState== 'ACTIVE'; +} + + + + + + true + + + + false + { + "policies" : [ + { + "policy-id": "onap.policies.controlloop.operational.apex.Sampledomain", + "policy-version": 1 + } + ] +} + = + + + + ${PAP_HOST} + ${PAP_PORT} + https + + policy/pap/v1/pdps/policies + POST + true + false + true + false + + + + + + + + 200 + + + Assertion.response_code + false + 1 + + + + + 500 + + + + + + + ${PAP_HOST} + ${PAP_PORT} + https + + policy/pap/v1/pdps/policies/onap.policies.controlloop.operational.apex.Sampledomain + DELETE + true + false + true + false + + + + + + + + 200 + + + Assertion.response_code + false + 1 + + + + + 500 + - - false - - saveConfig - - - true - true - true - - true - true - true - true - false - true - true - false - false - false - true - false - false - false - true - 0 - true - true - true - true - true - true - - - - + + + + + ${PAP_HOST} + ${PAP_PORT} + https + + policy/pap/v1/pdps/groups/defaultGroup?state=PASSIVE + PUT + true + false + true + false + + + + + + + + 200 + + + Assertion.response_code + false + 1 + + + + + 200 + + + + + + ${PAP_HOST} + ${PAP_PORT} + https + + /policy/pap/v1/pdps + GET + true + false + true + false + + + + Check PdpGroup Query + + + + + 200 + + + Assertion.response_code + false + 1 + + + + groovy + + + true + import groovy.json.JsonSlurper; + +def res = []; +if (prev.getResponseCode() == '200') { + def jsonSlurper = new JsonSlurper(); + res = jsonSlurper.parseText(prev.getResponseDataAsString()); + + assert res instanceof Map; + assert res.groups.size > 0; + assert res.groups[0].pdpGroupState== 'PASSIVE'; +} + + + + + + + stoptest + + false + 1 + + 1 + 1 + false + + + + + + + + + ${API_HOST} + ${API_PORT} + https + + /policy/api/v1/policytypes/onap.policies.controlloop.operational.Apex/versions/1.0.0/policies/onap.policies.controlloop.operational.apex.Sampledomain/versions/1.0.0 + DELETE + true + false + true + false + + + + + + + + 200 + + + Assertion.response_code + false + 1 + + + + + + + + ${API_HOST} + ${API_PORT} + https + + /policy/api/v1/policytypes/onap.policies.controlloop.operational.Apex/versions/1.0.0 + DELETE + true + false + true + false + + + + + + + + 200 + + + Assertion.response_code + false + 1 + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + C:\Users\eramkve\Desktop\stability.log + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + C:\Users\eramkve\Desktop\stability.log + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + C:\Users\eramkve\Desktop\stability.log + + -- cgit 1.2.3-korg