From d6c3b88b98960353daa7fbd61fc4e44656ffff63 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Tue, 30 Mar 2021 11:06:03 +0100 Subject: Distribution S3P test Updating scripts and files related to S3P tests. Issue-ID: POLICY-3113 Change-Id: I6c6d50a2f0e6b47deac5e505fb841eebbbbea437 Signed-off-by: adheli.tavares --- .../src/main/resources/testplans/performance.jmx | 26 ++--- .../resources/testplans/testCsars/test_csar_1.csar | Bin 93619 -> 95329 bytes .../testplans/testCsars/test_csar_10.csar | Bin 93618 -> 95330 bytes .../resources/testplans/testCsars/test_csar_2.csar | Bin 93622 -> 95329 bytes .../resources/testplans/testCsars/test_csar_3.csar | Bin 93622 -> 95329 bytes .../resources/testplans/testCsars/test_csar_4.csar | Bin 93622 -> 95329 bytes .../resources/testplans/testCsars/test_csar_5.csar | Bin 93622 -> 95329 bytes .../resources/testplans/testCsars/test_csar_6.csar | Bin 93622 -> 95329 bytes .../resources/testplans/testCsars/test_csar_7.csar | Bin 93622 -> 95329 bytes .../resources/testplans/testCsars/test_csar_8.csar | Bin 93622 -> 95329 bytes .../resources/testplans/testCsars/test_csar_9.csar | Bin 93622 -> 95329 bytes .../distribution/bin/policy-dist.sh | 11 +- .../distributionsetup/distribution/etc/logback.xml | 110 +++++++++++++++++++ .../distributionsetup/setup_distribution.sh | 21 ++-- .../resources/simulatorsetup/setup_components.sh | 19 ++-- .../testplans/sample_csar_with_apex_policy.csar | Bin 93613 -> 95323 bytes .../src/main/resources/testplans/stability.jmx | 122 +++++++++++---------- 17 files changed, 215 insertions(+), 94 deletions(-) create mode 100644 testsuites/stability/src/main/resources/distributionsetup/distribution/etc/logback.xml diff --git a/testsuites/performance/src/main/resources/testplans/performance.jmx b/testsuites/performance/src/main/resources/testplans/performance.jmx index 6fd00bfb..d92fe041 100644 --- a/testsuites/performance/src/main/resources/testplans/performance.jmx +++ b/testsuites/performance/src/main/resources/testplans/performance.jmx @@ -10,7 +10,7 @@ PAP_HOST - ${__P(host,10.2.0.27)} + ${__P(host,10.2.0.110)} = @@ -20,7 +20,7 @@ API_HOST - ${__P(host,10.2.0.27)} + ${__P(host,10.2.0.110)} = @@ -35,12 +35,12 @@ DISTRIBUTION_PORT - 7001 + 7002 = DURATION - ${__P(duration, 259200)} + ${__P(duration, 14400)} = @@ -50,7 +50,7 @@ WATCHED_FOLDER - ${__P(watchedfolder, /tmp/policydistribution/distributionmounts)} + ${__P(watchedfolder, /tmp/policydistribution/distributionmount)} = @@ -87,21 +87,21 @@ - https://${PAP_HOST}:7000/policy/pap/v1 + https://${PAP_HOST}:${PAP_PORT}/policy/pap/v1 healthcheck zb!XztG34 - https://${API_HOST}:6969/policy/api/v1 + https://${API_HOST}:${API_PORT}/policy/api/v1 healthcheck zb!XztG34 - http://127.0.0.1:6969/ + http://${DISTRIBUTION_HOST}:${DISTRIBUTION_PORT}/ healthcheck zb!XztG34 @@ -116,7 +116,7 @@ false 0 - ${SCRIPT_DIR}removecsars.sh + ${SCRIPT_DIR}/removecsars.sh @@ -360,7 +360,7 @@ false 0 - ${SCRIPT_DIR}clearuppolicies.sh + ${SCRIPT_DIR}/clearuppolicies.sh @@ -537,21 +537,21 @@ - https://${PAP_HOST}:7000/policy/pap/v1 + https://${PAP_HOST}:${PAP_PORT}/policy/pap/v1 healthcheck zb!XztG34 - https://${API_HOST}:6969/policy/api/v1 + https://${API_HOST}:${API_PORT}/policy/api/v1 healthcheck zb!XztG34 - http://127.0.0.1:6969/ + http://${DISTRIBUTION_HOST}:${DISTRIBUTION_PORT}/ healthcheck zb!XztG34 diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_1.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_1.csar index 8fbe9e3b..af2f1b7e 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_1.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_1.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_10.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_10.csar index 49d7cbeb..a7efde6a 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_10.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_10.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_2.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_2.csar index d9e49a95..2d753a9f 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_2.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_2.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_3.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_3.csar index 16260a69..7f79af6c 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_3.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_3.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_4.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_4.csar index 228c710d..cf60e614 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_4.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_4.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_5.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_5.csar index 3e9f73cf..a0cde2f6 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_5.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_5.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_6.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_6.csar index 17b9f117..a3a734fb 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_6.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_6.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_7.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_7.csar index 8cbd3583..57cd9536 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_7.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_7.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_8.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_8.csar index d1047b72..0912002f 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_8.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_8.csar differ diff --git a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_9.csar b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_9.csar index 9b777de9..98cd56aa 100644 Binary files a/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_9.csar and b/testsuites/performance/src/main/resources/testplans/testCsars/test_csar_9.csar differ diff --git a/testsuites/stability/src/main/resources/distributionsetup/distribution/bin/policy-dist.sh b/testsuites/stability/src/main/resources/distributionsetup/distribution/bin/policy-dist.sh index 3ba423e0..dc1dd702 100644 --- a/testsuites/stability/src/main/resources/distributionsetup/distribution/bin/policy-dist.sh +++ b/testsuites/stability/src/main/resources/distributionsetup/distribution/bin/policy-dist.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # # ============LICENSE_START======================================================= # Copyright (C) 2020 Ericsson. All rights reserved. -# Modifications Copyright (C) 2019-2020 Nordix Foundation. +# Modifications Copyright (C) 2019-2021 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,19 +32,18 @@ else CONFIG_FILE=${CONFIG_FILE} fi -if [ -z "$CONFIG_FILE" ] - then +if [ -z "$CONFIG_FILE" ]; then CONFIG_FILE="${POLICY_HOME}/etc/defaultConfig.json" fi if [[ -f "${POLICY_HOME}"/etc/mounted/policy-truststore ]]; then echo "overriding policy-truststore" - cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}" + cp -f "${POLICY_HOME}"/etc/mounted/policy-truststore "${TRUSTSTORE}" fi if [[ -f "${POLICY_HOME}"/etc/mounted/policy-keystore ]]; then echo "overriding policy-keystore" - cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}" + cp -f "${POLICY_HOME}"/etc/mounted/policy-keystore "${KEYSTORE}" fi if [[ -f "${POLICY_HOME}"/etc/mounted/logback.xml ]]; then diff --git a/testsuites/stability/src/main/resources/distributionsetup/distribution/etc/logback.xml b/testsuites/stability/src/main/resources/distributionsetup/distribution/etc/logback.xml new file mode 100644 index 00000000..f1fbde3e --- /dev/null +++ b/testsuites/stability/src/main/resources/distributionsetup/distribution/etc/logback.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + ${logDir}/${errorLog}.log + + ${logDir}/${errorLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + WARN + + + ${errorPattern} + + + + + + + + + ${logDir}/${debugLog}.log + + ${logDir}/${debugLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + ${debugPattern} + + + + + + + + + ${logDir}/${networkLog}.log + + ${logDir}/${networkLog}.%d{yyyy-MM-dd}.%i.log.zip + + 50MB + 30 + 10GB + + + ${networkPattern} + + + + + + + + + + + + + + + + + + + + + diff --git a/testsuites/stability/src/main/resources/distributionsetup/setup_distribution.sh b/testsuites/stability/src/main/resources/distributionsetup/setup_distribution.sh index 763f47ed..54bb88a7 100755 --- a/testsuites/stability/src/main/resources/distributionsetup/setup_distribution.sh +++ b/testsuites/stability/src/main/resources/distributionsetup/setup_distribution.sh @@ -1,6 +1,6 @@ #!/bin/bash # ============LICENSE_START======================================================= -# Copyright (c) 2020 Nordix Foundation. +# Copyright (c) 2020-2021 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,18 +18,17 @@ # ============LICENSE_END========================================================= # the directory of the script -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo ${DIR} -if [ "$#" -lt 2 ]; - then - echo "PAP and PolicyAPI IPs should be passed as two parameters. PAP IP goes first." - exit 1 +if [ "$#" -lt 2 ]; then + echo "PAP and PolicyAPI IPs should be passed as two parameters. PAP IP goes first." + exit 1 else - PAP=$1 - echo "PAP IP: ${PAP}" - API=$2 - echo "Policy API IP: $API" + PAP=$1 + echo "PAP IP: ${PAP}" + API=$2 + echo "Policy API IP: $API" fi -docker run -v /tmp/policydistribution/distributionmount:/home/policydistribution --add-host policy-api:${API} --add-host policy-pap:${PAP} -p 6969:6969 -p 9090:9090 --name policy-distribution -v ${DIR}/distribution/bin/policy-dist.sh:/opt/app/policy/distribution/bin/policy-dist.sh -v ${DIR}/distribution/etc/defaultConfig.json:/opt/app/policy/distribution/etc/defaultConfig.json -d --rm nexus3.onap.org:10001/onap/policy-distribution:2.3.1 +docker run -v /tmp/policydistribution/distributionmount:/home/policydistribution --add-host policy-api:${API} --add-host policy-pap:${PAP} -p 6969:6969 -p 9090:9090 --name policy-distribution -v ${DIR}/distribution/bin/policy-dist.sh:/opt/app/policy/distribution/bin/policy-dist.sh -v ${DIR}/distribution/etc/defaultConfig.json:/opt/app/policy/distribution/etc/defaultConfig.json -v ${DIR}/distribution/etc/logback.xml:/opt/app/policy/distribution/etc/logback.xml -d --rm nexus3.onap.org:10001/onap/policy-distribution:2.5.2-SNAPSHOT diff --git a/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh b/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh index c77a3cab..55fea5dd 100755 --- a/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh +++ b/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh @@ -1,6 +1,6 @@ #!/bin/bash # ============LICENSE_START======================================================= -# Copyright (c) 2020 Nordix Foundation. +# Copyright (c) 2020-2021 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,12 +18,15 @@ # ============LICENSE_END========================================================= # the directory of the script -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo ${DIR} +# change to VM IP +POLICY_API_HOST=127.0.0.1 + # 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"` +WORK_DIR=$(mktemp -d -p "$DIR") echo ${WORK_DIR} cd ${WORK_DIR} @@ -47,19 +50,19 @@ 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 +${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 +${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 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 message-router --rm dmaap/simulator:latest sleep 10 docker run --link message-router:message-router -d --rm --name pdp-simulator pdp/simulator:latest -docker run -p 6969:6969 --link mariadb:mariadb --name policy-api -d --rm nexus3.onap.org:10001/onap/policy-api:2.2.3-SNAPSHOT -docker run -p 7000:6969 --link mariadb:mariadb --link message-router:message-router --name policy-pap -d --rm nexus3.onap.org:10001/onap/policy-pap:2.2.2-SNAPSHOT +docker run -p 6969:6969 --link mariadb:mariadb --name policy-api -d --rm nexus3.onap.org:10001/onap/policy-api:2.4.2-SNAPSHOT +docker run -p 7000:6969 --link mariadb:mariadb --link message-router:message-router --name policy-pap --add-host policy-api:${POLICY_API_HOST} -d --rm nexus3.onap.org:10001/onap/policy-pap:2.4.2-SNAPSHOT diff --git a/testsuites/stability/src/main/resources/testplans/sample_csar_with_apex_policy.csar b/testsuites/stability/src/main/resources/testplans/sample_csar_with_apex_policy.csar index 435eaa0f..f1c5fe8a 100644 Binary files a/testsuites/stability/src/main/resources/testplans/sample_csar_with_apex_policy.csar and b/testsuites/stability/src/main/resources/testplans/sample_csar_with_apex_policy.csar differ diff --git a/testsuites/stability/src/main/resources/testplans/stability.jmx b/testsuites/stability/src/main/resources/testplans/stability.jmx index 4ad3c405..d29ffda8 100644 --- a/testsuites/stability/src/main/resources/testplans/stability.jmx +++ b/testsuites/stability/src/main/resources/testplans/stability.jmx @@ -8,11 +8,6 @@ false - - PAP_HOST - ${__P(host,10.2.0.27)} - = - SCRIPT_DIR ${__BeanShell(import org.apache.jmeter.services.FileServer; FileServer.getFileServer().getBaseDir();)}${__BeanShell(File.separator,)} @@ -40,7 +35,17 @@ API_HOST - ${__P(host,10.2.0.27)} + ${__P(host,10.2.0.110)} + = + + + API_PORT + 6969 + = + + + PAP_HOST + ${__P(host,10.2.0.110)} = @@ -48,9 +53,14 @@ 7000 = - - API_PORT - 6969 + + DISTRIBUTION_HOST + ${__P(distributionhost,127.0.0.1)} + = + + + DISTRIBUTION_PORT + 7002 = @@ -93,25 +103,25 @@ - + - https://${PAP_HOST}:7000/policy/pap/v1 + https://${PAP_HOST}:${PAP_PORT}/policy/pap/v1 healthcheck zb!XztG34 - https://${API_HOST}:6969/policy/api/v1 + https://${API_HOST}:${API_PORT}/policy/api/v1 healthcheck zb!XztG34 - http://127.0.0.1:6969/ + http://${DISTRIBUTION_HOST}:${DISTRIBUTION_PORT}/ healthcheck zb!XztG34 @@ -120,29 +130,29 @@ true - - + + false 0 - ${SCRIPT_DIR}removecsar.sh + ${SCRIPT_DIR}/removecsar.sh - + - + - + - + false 0 - ${SCRIPT_DIR}addcsar.sh + ${SCRIPT_DIR}/addcsar.sh @@ -153,7 +163,7 @@ - + @@ -194,7 +204,7 @@ - + CSAR Copied Successfully @@ -204,21 +214,21 @@ false 2 - + 300 - - + + - + - 127.0.0.1 - 6969 + ${DISTRIBUTION_HOST} + ${DISTRIBUTION_PORT} http healthcheck @@ -241,14 +251,14 @@ false 8 - + - + - 127.0.0.1 - 6969 + ${DISTRIBUTION_HOST} + ${DISTRIBUTION_PORT} http statistics @@ -271,14 +281,14 @@ false 8 - + - + - + ${PAP_HOST} ${PAP_PORT} @@ -303,7 +313,7 @@ false false - + false @@ -340,11 +350,11 @@ - + - + ${PAP_HOST} ${PAP_PORT} @@ -363,13 +373,13 @@ $[:2].policy-type - onap.policies.controlloop.operational.Apex + onap.policies.controlloop.operational.common.Apex true false false false - + $[:2].policy-id operational.apex.sampledomain @@ -378,7 +388,7 @@ false false - + false @@ -416,17 +426,17 @@ - + 10000 - + - + - + ${PAP_HOST} ${PAP_PORT} @@ -445,18 +455,18 @@ - 200 + 202 Assertion.response_code false 8 - + - + ${API_HOST} ${API_PORT} @@ -482,14 +492,14 @@ false 8 - + - + - + ${PAP_HOST} ${PAP_PORT} @@ -514,7 +524,7 @@ false false - + @@ -553,7 +563,7 @@ - + false @@ -588,9 +598,9 @@ true - Distribution_Stability_Log + distribution_stability.jtl - + -- cgit 1.2.3-korg