From 555f2fd3c8321bbad9dbfc21f01982a50a1cd555 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Mon, 18 Oct 2021 17:26:44 +0100 Subject: Updating Distribution S3P configuration. - fixing the scripts and jmx files after stability long run failures. Issue-ID: POLICY-3654 Change-Id: I0ff0bf625f226f1b71664c1817cef65fbd5cf5a6 Signed-off-by: adheli.tavares --- .../src/main/resources/testplans/README.perf.md | 17 +- .../src/main/resources/testplans/addcsars.sh | 9 +- .../main/resources/testplans/clearuppolicies.sh | 8 +- .../src/main/resources/testplans/performance.jmx | 375 +++++++++------------ .../src/main/resources/testplans/removecsars.sh | 9 +- .../src/main/resources/testplans/run_test.sh | 2 +- 6 files changed, 181 insertions(+), 239 deletions(-) (limited to 'testsuites/performance') diff --git a/testsuites/performance/src/main/resources/testplans/README.perf.md b/testsuites/performance/src/main/resources/testplans/README.perf.md index cbde3d76..653a05aa 100644 --- a/testsuites/performance/src/main/resources/testplans/README.perf.md +++ b/testsuites/performance/src/main/resources/testplans/README.perf.md @@ -1,26 +1,19 @@ Performance Test for Policy Distribution ## Steps to Run performance test 1. Download Apache JMeter -Download JMeter 5.0 from https://jmeter.apache.org/download_jmeter.cgi, and extracted it locally. +Download JMeter 5.x.x from https://jmeter.apache.org/download_jmeter.cgi, and extracted it locally. 2. Run the setup-components script found within simulator setup in the stability test folder. This will launch MariaDB, PDPSimulator, PAP, Policy-API and DMaaP Simulator as docker containers. -3. Launch the policy distribution service by running the setup-distribution script found within distributionsetup +3. Launch the policy distribution service by running the start script found within setup folder in the stability test folder. -If you are running all of the components locally you will need to edit the port that distribution starts on as it is -currently 6969 which conflicts with the policy API port. -This will launch policy-distribution as a docker container and takes 2 arguments, PAP IP and API IP. -If you are running locally these will be 127.0.0.1. If on a VM enter the VM IP. -``` -setup-distribution.sh 127.0.0.1 127.0.0.1 -``` -4. Run the JMeter performance test +4. Run the JMeter performance test from testplans folder. ``` -rm -f performance.log; /bin/jmeter.sh -t performance.jmx -n -Jhost= -Jduration=100 -l performance.log +./run_test.sh ``` -Search for 'get policy failed' in the performance.log file to see if there is any errors found during the performance test. +Search for 'get policy failed' in the log file to see if there is any errors found during the performance test. ## JMeter properties We can configure the following properties when running the JMeter performance test for policy distribution diff --git a/testsuites/performance/src/main/resources/testplans/addcsars.sh b/testsuites/performance/src/main/resources/testplans/addcsars.sh index e446a67b..6b386e2f 100755 --- a/testsuites/performance/src/main/resources/testplans/addcsars.sh +++ b/testsuites/performance/src/main/resources/testplans/addcsars.sh @@ -1,5 +1,5 @@ # ============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. @@ -16,11 +16,6 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= -# the directory of the script -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -echo "${DIR}" - if [ $# -le 1 ] then echo "Usage ./addcsars.sh \$TESTCSARSLOCATION \$TARGETDIRECTORY" @@ -32,4 +27,4 @@ TARGETDIRECTORY=$2 for file in "$TESTCSARSLOCATION"/* do cp "$file" "$TARGETDIRECTORY" -done \ No newline at end of file +done diff --git a/testsuites/performance/src/main/resources/testplans/clearuppolicies.sh b/testsuites/performance/src/main/resources/testplans/clearuppolicies.sh index d67df1c1..e9b4252a 100755 --- a/testsuites/performance/src/main/resources/testplans/clearuppolicies.sh +++ b/testsuites/performance/src/main/resources/testplans/clearuppolicies.sh @@ -1,5 +1,5 @@ # ============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. @@ -19,7 +19,7 @@ # the directory of the script if [ $# -le 3 ] then - echo "Usage ./addcsars.sh \$POLICY_API_IP \$POLICY_API_PORT \$POLICY_PAP_IP \$POLICY_PAP_PORT" + echo "Usage ./clearuppolicies.sh \$POLICY_API_IP \$POLICY_API_PORT \$POLICY_PAP_IP \$POLICY_PAP_PORT" exit 1 fi POLICY_API_IP=$1 @@ -36,9 +36,9 @@ send_delete_request(){ COUNTER=1 while [ $COUNTER != 11 ] do - send_delete_request https://"$POLICY_PAP_IP":"$POLICY_PAP_PORT"/policy/pap/v1/pdps/policies/\ + send_delete_request http://"$POLICY_PAP_IP":"$POLICY_PAP_PORT"/policy/pap/v1/pdps/policies/\ operational.apex.sampledomain.test$COUNTER - send_delete_request https://"$POLICY_API_IP":"$POLICY_API_PORT"/policy/api/v1/policytypes/operational\ + send_delete_request http://"$POLICY_API_IP":"$POLICY_API_PORT"/policy/api/v1/policytypes/operational\ .apex.sampledomain.test$COUNTER/versions/1.0.0/policies/operational.apex.sampledomain.test$COUNTER/versions/1.0.0 COUNTER=$((COUNTER +1)) done diff --git a/testsuites/performance/src/main/resources/testplans/performance.jmx b/testsuites/performance/src/main/resources/testplans/performance.jmx index 2115cdee..fbc3203b 100644 --- a/testsuites/performance/src/main/resources/testplans/performance.jmx +++ b/testsuites/performance/src/main/resources/testplans/performance.jmx @@ -1,7 +1,7 @@ - + - + false true @@ -10,17 +10,17 @@ PAP_HOST - ${__P(host,10.2.0.110)} + ${__P(paphost,172.19.0.8)} = PAP_PORT - 7000 + 6969 = API_HOST - ${__P(host,10.2.0.110)} + ${__P(apihost,172.19.0.7)} = @@ -30,12 +30,12 @@ DISTRIBUTION_HOST - ${__P(distributionhost,127.0.0.1)} + ${__P(disthost,172.19.0.3)} = DISTRIBUTION_PORT - 7002 + 6969 = @@ -53,6 +53,11 @@ ${__P(watchedfolder, /tmp/policydistribution/distributionmount)} = + + POLICIES_UNDEPLOYED + + = + @@ -69,6 +74,7 @@ true ${DURATION} 1 + true @@ -87,14 +93,14 @@ - https://${PAP_HOST}:${PAP_PORT}/policy/pap/v1 + http://${PAP_HOST}:${PAP_PORT}/policy/pap/v1 healthcheck zb!XztG34 - https://${API_HOST}:${API_PORT}/policy/api/v1 + http://${API_HOST}:${API_PORT}/policy/api/v1 healthcheck zb!XztG34 @@ -109,6 +115,7 @@ true + false @@ -116,7 +123,7 @@ false 0 - ${SCRIPT_DIR}/removecsars.sh + ${SCRIPT_DIR}removecsars.sh @@ -143,7 +150,7 @@ - ${SCRIPT_DIR}/testCsars + ${SCRIPT_DIR}testCsars = @@ -158,202 +165,93 @@ - - - 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 - - - - - - + - + - - 30000 + + 60000 - - - - - ${PAP_HOST} - ${PAP_PORT} - https - - policy/pap/v1/policies/deployed - GET - true - false - true - false - - - - + - - policies - $[*] - -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 - - - - - - - - 10 - - - Assertion.response_data - false - 8 - variable - policies_matchNr - - + + + + + ${PAP_HOST} + ${PAP_PORT} + http + + policy/pap/v1/policies/deployed + GET + true + false + true + false + + + + + + + policies + $[*] + -1 + + + + + 10 + + + Assertion.response_data + false + 8 + variable + policies_matchNr + + + + + + + + ${PAP_HOST} + ${PAP_PORT} + http + + /policy/pap/v1/pdps + GET + true + false + true + false + + + + + + + checkpdppolicies + $.groups[0].pdpSubgroups[0].policies[*] + -1 + + + + + 10 + + + Assertion.response_data + false + 8 + variable + checkpdppolicies_matchNr + + + - - - - - ${PAP_HOST} - ${PAP_PORT} - http - - /policy/pap/v1/pdps - GET - true - false - true - false - - - - - - - checkpdppolicies - $.groups[0].pdpSubgroups[0].policies[*] - -1 - - - - - 10 - - - Assertion.response_data - false - 8 - variable - checkpdppolicies_matchNr - - - - - 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 - - - - - @@ -392,6 +290,67 @@ + + + + vars.put("POLICIES_UNDEPLOYED", "NotSet") + + + false + + + + ${__jexl3("${POLICIES_UNDEPLOYED}"!="[]")} + + + + + + + ${PAP_HOST} + ${PAP_PORT} + http + + /policy/pap/v1/policies/status/ + GET + true + false + true + false + + + + + + + false + POLICIES_UNDEPLOYED + (\W{2}) + $1$ + NotEmpty + 1 + + + + + ${__jexl3("${POLICIES_UNDEPLOYED}"!="[]")} + false + true + + + + 120000 + + + + false + true + false + + + + + @@ -504,7 +463,7 @@ true - Distribution_Performance_Test.log + @@ -519,6 +478,7 @@ true ${DURATION} 1 + true @@ -559,10 +519,15 @@ true + false + + 1000 + + @@ -623,10 +588,6 @@ - - 300 - - false @@ -662,7 +623,7 @@ true - HealthcheckAndStatisticsPerformance.log + diff --git a/testsuites/performance/src/main/resources/testplans/removecsars.sh b/testsuites/performance/src/main/resources/testplans/removecsars.sh index e5528d81..5d9ccf6c 100755 --- a/testsuites/performance/src/main/resources/testplans/removecsars.sh +++ b/testsuites/performance/src/main/resources/testplans/removecsars.sh @@ -1,5 +1,5 @@ # ============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. @@ -16,11 +16,6 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= -# the directory of the script -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -echo "${DIR}" - if [ $# -le 0 ] then echo "Usage ./removecsars.sh \$TARGETDIRECTORY" @@ -29,5 +24,3 @@ fi TARGETDIRECTORY=$1 rm -f "$TARGETDIRECTORY"/*.csar - - diff --git a/testsuites/performance/src/main/resources/testplans/run_test.sh b/testsuites/performance/src/main/resources/testplans/run_test.sh index 44a98d38..7b959587 100755 --- a/testsuites/performance/src/main/resources/testplans/run_test.sh +++ b/testsuites/performance/src/main/resources/testplans/run_test.sh @@ -27,4 +27,4 @@ POLICY_DISTRIBUTION_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{ ${JMETER_HOME}/bin/jmeter -n -t "${DIR}"/performance.jmx -Jduration=14400 \ -Japihost="${POLICY_API_IP}" \ -Jpaphost="${POLICY_PAP_IP}" \ - -Jdisthost="${POLICY_DISTRIBUTION_IP}" + -Jdisthost="${POLICY_DISTRIBUTION_IP}" -l distribution_performance.jtl & -- cgit 1.2.3-korg