diff options
author | ramverma <ram.krishna.verma@est.tech> | 2019-05-29 10:54:01 +0000 |
---|---|---|
committer | ramverma <ram.krishna.verma@est.tech> | 2019-05-29 10:54:01 +0000 |
commit | fb4643501d7182b3be5d6715ea0ed8966155f9f2 (patch) | |
tree | c1ceb86564a5db81da5d5136290911047b599205 /testsuites/stability/src/main/resources | |
parent | 211741a49ada8da49a0bd6205c9c5ecf6ecd5e6b (diff) |
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 <ram.krishna.verma@est.tech>
Diffstat (limited to 'testsuites/stability/src/main/resources')
10 files changed, 1194 insertions, 160 deletions
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 @@ <collectionProp name="Arguments.arguments"> <elementProp name="PAP_HOST" elementType="Argument"> <stringProp name="Argument.name">PAP_HOST</stringProp> - <stringProp name="Argument.value">${__P(host,10.12.6.164)}</stringProp> + <stringProp name="Argument.value">10.2.0.43</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> - <elementProp name="DURATION" elementType="Argument"> - <stringProp name="Argument.name">DURATION</stringProp> - <stringProp name="Argument.value">${__P(duration, 5)}</stringProp> + <elementProp name="PAP_PORT" elementType="Argument"> + <stringProp name="Argument.name">PAP_PORT</stringProp> + <stringProp name="Argument.value">6969</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> - <elementProp name="USERS" elementType="Argument"> - <stringProp name="Argument.name">USERS</stringProp> - <stringProp name="Argument.value">${__P(users, 1)}</stringProp> + <elementProp name="API_HOST" elementType="Argument"> + <stringProp name="Argument.name">API_HOST</stringProp> + <stringProp name="Argument.value">10.2.0.41</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> - <elementProp name="PORT" elementType="Argument"> - <stringProp name="Argument.name">PORT</stringProp> - <stringProp name="Argument.value">${__P(port, 6969)}</stringProp> + <elementProp name="API_PORT" elementType="Argument"> + <stringProp name="Argument.name">API_PORT</stringProp> + <stringProp name="Argument.value">6969</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -52,17 +53,489 @@ <stringProp name="TestPlan.user_define_classpath"></stringProp> </TestPlan> <hashTree> - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Health Check PAP" enabled="true"> - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> + <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true"> + <collectionProp name="AuthManager.auth_list"> + <elementProp name="" elementType="Authorization"> + <stringProp name="Authorization.url">https://${PAP_HOST}:6969/policy/pap/v1</stringProp> + <stringProp name="Authorization.username">healthcheck</stringProp> + <stringProp name="Authorization.password">zb!XztG34</stringProp> + <stringProp name="Authorization.domain"></stringProp> + <stringProp name="Authorization.realm"></stringProp> + </elementProp> + <elementProp name="" elementType="Authorization"> + <stringProp name="Authorization.url">https://${API_HOST}:6969/policy/api/v1</stringProp> + <stringProp name="Authorization.username">healthcheck</stringProp> + <stringProp name="Authorization.password">zb!XztG34</stringProp> + <stringProp name="Authorization.domain"></stringProp> + <stringProp name="Authorization.realm"></stringProp> + </elementProp> + </collectionProp> + <boolProp name="AuthManager.clearEachIteration">true</boolProp> + </AuthManager> + <hashTree/> + <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> + <collectionProp name="HeaderManager.headers"> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Accept</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + <elementProp name="" elementType="Header"> + <stringProp name="Header.name">Content-Type</stringProp> + <stringProp name="Header.value">application/json</stringProp> + </elementProp> + </collectionProp> + </HeaderManager> + <hashTree/> + <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="setUp Thread Group" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">stoptest</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + </elementProp> + <stringProp name="ThreadGroup.num_threads">1</stringProp> + <stringProp name="ThreadGroup.ramp_time">1</stringProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"></stringProp> + <stringProp name="ThreadGroup.delay"></stringProp> + </SetupThreadGroup> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Policy Type" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "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"
 + }
 + }
 + }
 + }
 + ]
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${API_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">policy/api/v1/policytypes</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Create Policy" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "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
 + }
 + }
 + }
 + }
 + }
 + }
 + ]
 + }
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${API_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/policy/api/v1/policytypes/onap.policies.controlloop.operational.Apex/versions/1.0.0/policies</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + </hashTree> + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="PAP Test Flow" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">stoptest</stringProp> <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> <boolProp name="LoopController.continue_forever">false</boolProp> - <intProp name="LoopController.loops">-1</intProp> + <stringProp name="LoopController.loops">1</stringProp> </elementProp> - <stringProp name="ThreadGroup.num_threads">${USERS}</stringProp> + <stringProp name="ThreadGroup.num_threads">1</stringProp> <stringProp name="ThreadGroup.ramp_time">1</stringProp> - <boolProp name="ThreadGroup.scheduler">true</boolProp> - <stringProp name="ThreadGroup.duration">${DURATION}</stringProp> - <stringProp name="ThreadGroup.delay">1</stringProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"></stringProp> + <stringProp name="ThreadGroup.delay"></stringProp> </ThreadGroup> <hashTree> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Health" enabled="true"> @@ -70,10 +543,10 @@ <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp> - <stringProp name="HTTPSampler.port">6969</stringProp> + <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp> <stringProp name="HTTPSampler.protocol">https</stringProp> <stringProp name="HTTPSampler.contentEncoding"></stringProp> - <stringProp name="HTTPSampler.path">healthcheck</stringProp> + <stringProp name="HTTPSampler.path">/policy/pap/v1/healthcheck</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -117,92 +590,15 @@ if (prev.getResponseCode() == '200') { </JSR223Assertion> <hashTree/> </hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> - <hashTree/> - <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true"> - <collectionProp name="AuthManager.auth_list"> - <elementProp name="" elementType="Authorization"> - <stringProp name="Authorization.url">https://${PAP_HOST}:6969/healthcheck</stringProp> - <stringProp name="Authorization.username">healthcheck</stringProp> - <stringProp name="Authorization.password">zb!XztG34</stringProp> - <stringProp name="Authorization.domain"></stringProp> - <stringProp name="Authorization.realm"></stringProp> - </elementProp> - </collectionProp> - <boolProp name="AuthManager.clearEachIteration">true</boolProp> - </AuthManager> - <hashTree/> - <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> - <boolProp name="ResultCollector.error_logging">false</boolProp> - <objProp> - <name>saveConfig</name> - <value class="SampleSaveConfiguration"> - <time>true</time> - <latency>true</latency> - <timestamp>true</timestamp> - <success>true</success> - <label>true</label> - <code>true</code> - <message>true</message> - <threadName>true</threadName> - <dataType>true</dataType> - <encoding>false</encoding> - <assertions>true</assertions> - <subresults>true</subresults> - <responseData>false</responseData> - <samplerData>false</samplerData> - <xml>false</xml> - <fieldNames>true</fieldNames> - <responseHeaders>false</responseHeaders> - <requestHeaders>false</requestHeaders> - <responseDataOnError>false</responseDataOnError> - <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> - <assertionsResultsToSave>0</assertionsResultsToSave> - <bytes>true</bytes> - <sentBytes>true</sentBytes> - <url>true</url> - <threadCounts>true</threadCounts> - <idleTime>true</idleTime> - <connectTime>true</connectTime> - </value> - </objProp> - <stringProp name="filename"></stringProp> - </ResultCollector> - <hashTree/> - </hashTree> - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Statistics Check PAP" enabled="true"> - <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> - <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> - <boolProp name="LoopController.continue_forever">false</boolProp> - <intProp name="LoopController.loops">-1</intProp> - </elementProp> - <stringProp name="ThreadGroup.num_threads">${USERS}</stringProp> - <stringProp name="ThreadGroup.ramp_time">1</stringProp> - <boolProp name="ThreadGroup.scheduler">true</boolProp> - <stringProp name="ThreadGroup.duration">${DURATION}</stringProp> - <stringProp name="ThreadGroup.delay">1</stringProp> - </ThreadGroup> - <hashTree> - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Statistics PAP" enabled="true"> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check Statistics" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> <collectionProp name="Arguments.arguments"/> </elementProp> <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp> - <stringProp name="HTTPSampler.port">6969</stringProp> + <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp> <stringProp name="HTTPSampler.protocol">https</stringProp> <stringProp name="HTTPSampler.contentEncoding"></stringProp> - <stringProp name="HTTPSampler.path">statistics</stringProp> + <stringProp name="HTTPSampler.path">policy/pap/v1/statistics</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp> @@ -211,7 +607,7 @@ if (prev.getResponseCode() == '200') { <stringProp name="HTTPSampler.embedded_url_re"></stringProp> <stringProp name="HTTPSampler.connect_timeout"></stringProp> <stringProp name="HTTPSampler.response_timeout"></stringProp> - <stringProp name="TestPlan.comments">Basic Health Check</stringProp> + <stringProp name="TestPlan.comments">Check Statistics</stringProp> </HTTPSamplerProxy> <hashTree> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> @@ -248,70 +644,442 @@ if (prev.getResponseCode() == '200') { </JSR223Assertion> <hashTree/> </hashTree> - <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true"> - <collectionProp name="HeaderManager.headers"> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Accept</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - <elementProp name="" elementType="Header"> - <stringProp name="Header.name">Content-Type</stringProp> - <stringProp name="Header.value">application/json</stringProp> - </elementProp> - </collectionProp> - </HeaderManager> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Change State to ACTIVE" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/groups/defaultGroup?state=ACTIVE</stringProp> + <stringProp name="HTTPSampler.method">PUT</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">200</stringProp> + </ConstantTimer> <hashTree/> - <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true"> - <collectionProp name="AuthManager.auth_list"> - <elementProp name="" elementType="Authorization"> - <stringProp name="Authorization.url">https://${PAP_HOST}:6969/statistics</stringProp> - <stringProp name="Authorization.username">healthcheck</stringProp> - <stringProp name="Authorization.password">zb!XztG34</stringProp> - <stringProp name="Authorization.domain"></stringProp> - <stringProp name="Authorization.realm"></stringProp> - </elementProp> - </collectionProp> - <boolProp name="AuthManager.clearEachIteration">true</boolProp> - </AuthManager> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check PdpGroup Query" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/policy/pap/v1/pdps</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + <stringProp name="TestPlan.comments">Check PdpGroup Query</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true"> + <stringProp name="scriptLanguage">groovy</stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="script">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'; +} +</stringProp> + </JSR223Assertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Deploy Policy" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{
 + "policies" : [
 + {
 + "policy-id": "onap.policies.controlloop.operational.apex.Sampledomain",
 + "policy-version": 1
 + }
 + ]
 +}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">500</stringProp> + </ConstantTimer> + <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Undeploy Policy" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/policies/onap.policies.controlloop.operational.apex.Sampledomain</stringProp> + <stringProp name="HTTPSampler.method">DELETE</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">500</stringProp> + </ConstantTimer> <hashTree/> - <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> - <boolProp name="ResultCollector.error_logging">false</boolProp> - <objProp> - <name>saveConfig</name> - <value class="SampleSaveConfiguration"> - <time>true</time> - <latency>true</latency> - <timestamp>true</timestamp> - <success>true</success> - <label>true</label> - <code>true</code> - <message>true</message> - <threadName>true</threadName> - <dataType>true</dataType> - <encoding>false</encoding> - <assertions>true</assertions> - <subresults>true</subresults> - <responseData>false</responseData> - <samplerData>false</samplerData> - <xml>false</xml> - <fieldNames>true</fieldNames> - <responseHeaders>false</responseHeaders> - <requestHeaders>false</requestHeaders> - <responseDataOnError>false</responseDataOnError> - <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> - <assertionsResultsToSave>0</assertionsResultsToSave> - <bytes>true</bytes> - <sentBytes>true</sentBytes> - <url>true</url> - <threadCounts>true</threadCounts> - <idleTime>true</idleTime> - <connectTime>true</connectTime> - </value> - </objProp> - <stringProp name="filename"></stringProp> - </ResultCollector> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Change State to PASSIVE" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">policy/pap/v1/pdps/groups/defaultGroup?state=PASSIVE</stringProp> + <stringProp name="HTTPSampler.method">PUT</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true"> + <stringProp name="ConstantTimer.delay">200</stringProp> + </ConstantTimer> <hashTree/> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Check PdpGroup Query" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${PAP_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/policy/pap/v1/pdps</stringProp> + <stringProp name="HTTPSampler.method">GET</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + <stringProp name="TestPlan.comments">Check PdpGroup Query</stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="JSR223 Assertion" enabled="true"> + <stringProp name="scriptLanguage">groovy</stringProp> + <stringProp name="parameters"></stringProp> + <stringProp name="filename"></stringProp> + <stringProp name="cacheKey">true</stringProp> + <stringProp name="script">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'; +} +</stringProp> + </JSR223Assertion> + <hashTree/> + </hashTree> + </hashTree> + <PostThreadGroup guiclass="PostThreadGroupGui" testclass="PostThreadGroup" testname="tearDown Thread Group" enabled="true"> + <stringProp name="ThreadGroup.on_sample_error">stoptest</stringProp> + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true"> + <boolProp name="LoopController.continue_forever">false</boolProp> + <stringProp name="LoopController.loops">1</stringProp> + </elementProp> + <stringProp name="ThreadGroup.num_threads">1</stringProp> + <stringProp name="ThreadGroup.ramp_time">1</stringProp> + <boolProp name="ThreadGroup.scheduler">false</boolProp> + <stringProp name="ThreadGroup.duration"></stringProp> + <stringProp name="ThreadGroup.delay"></stringProp> + </PostThreadGroup> + <hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete Policy" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${API_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/policy/api/v1/policytypes/onap.policies.controlloop.operational.Apex/versions/1.0.0/policies/onap.policies.controlloop.operational.apex.Sampledomain/versions/1.0.0</stringProp> + <stringProp name="HTTPSampler.method">DELETE</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Delete Policy Type" enabled="true"> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true"> + <collectionProp name="Arguments.arguments"/> + </elementProp> + <stringProp name="HTTPSampler.domain">${API_HOST}</stringProp> + <stringProp name="HTTPSampler.port">${API_PORT}</stringProp> + <stringProp name="HTTPSampler.protocol">https</stringProp> + <stringProp name="HTTPSampler.contentEncoding"></stringProp> + <stringProp name="HTTPSampler.path">/policy/api/v1/policytypes/onap.policies.controlloop.operational.Apex/versions/1.0.0</stringProp> + <stringProp name="HTTPSampler.method">DELETE</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"></stringProp> + <stringProp name="HTTPSampler.connect_timeout"></stringProp> + <stringProp name="HTTPSampler.response_timeout"></stringProp> + </HTTPSamplerProxy> + <hashTree> + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> + <collectionProp name="Asserion.test_strings"> + <stringProp name="49586">200</stringProp> + </collectionProp> + <stringProp name="Assertion.custom_message"></stringProp> + <stringProp name="Assertion.test_field">Assertion.response_code</stringProp> + <boolProp name="Assertion.assume_success">false</boolProp> + <intProp name="Assertion.test_type">1</intProp> + </ResponseAssertion> + <hashTree/> + </hashTree> </hashTree> + <ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <url>true</url> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename">C:\Users\eramkve\Desktop\stability.log</stringProp> + </ResultCollector> + <hashTree/> + <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <url>true</url> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename">C:\Users\eramkve\Desktop\stability.log</stringProp> + </ResultCollector> + <hashTree/> + <ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="View Results in Table" enabled="true"> + <boolProp name="ResultCollector.error_logging">false</boolProp> + <objProp> + <name>saveConfig</name> + <value class="SampleSaveConfiguration"> + <time>true</time> + <latency>true</latency> + <timestamp>true</timestamp> + <success>true</success> + <label>true</label> + <code>true</code> + <message>true</message> + <threadName>true</threadName> + <dataType>true</dataType> + <encoding>false</encoding> + <assertions>true</assertions> + <subresults>true</subresults> + <responseData>false</responseData> + <samplerData>false</samplerData> + <xml>false</xml> + <fieldNames>true</fieldNames> + <responseHeaders>false</responseHeaders> + <requestHeaders>false</requestHeaders> + <responseDataOnError>false</responseDataOnError> + <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage> + <assertionsResultsToSave>0</assertionsResultsToSave> + <bytes>true</bytes> + <sentBytes>true</sentBytes> + <url>true</url> + <threadCounts>true</threadCounts> + <idleTime>true</idleTime> + <connectTime>true</connectTime> + </value> + </objProp> + <stringProp name="filename">C:\Users\eramkve\Desktop\stability.log</stringProp> + </ResultCollector> + <hashTree/> </hashTree> </hashTree> </jmeterTestPlan> |