summaryrefslogtreecommitdiffstats
path: root/testsuites/stability/src/main/resources/testplans
diff options
context:
space:
mode:
authorsaul.gill <saul.gill@est.tech>2023-10-16 17:21:15 +0100
committersaul.gill <saul.gill@est.tech>2023-10-16 17:21:19 +0100
commitd1d92a580b4e95f02d9fcbd72f8884140d758ca5 (patch)
treef980fdb6d73b1963b87ebcc67bea3c6ee2197deb /testsuites/stability/src/main/resources/testplans
parentf0b1c5bf1662edf6a2a07b79c1ffe7e42e1bb054 (diff)
Add automation for s3p tests
Issue-ID: POLICY-4844 Change-Id: Ia6003d5b492d2731fdd0d17342b4fd1c213c4b91 Signed-off-by: saul.gill <saul.gill@est.tech>
Diffstat (limited to 'testsuites/stability/src/main/resources/testplans')
-rwxr-xr-xtestsuites/stability/src/main/resources/testplans/run_test.sh13
-rw-r--r--testsuites/stability/src/main/resources/testplans/stability.jmx45
2 files changed, 16 insertions, 42 deletions
diff --git a/testsuites/stability/src/main/resources/testplans/run_test.sh b/testsuites/stability/src/main/resources/testplans/run_test.sh
index edef48b6..195f78aa 100755
--- a/testsuites/stability/src/main/resources/testplans/run_test.sh
+++ b/testsuites/stability/src/main/resources/testplans/run_test.sh
@@ -1,6 +1,6 @@
#!/bin/bash
# ============LICENSE_START=======================================================
-# Copyright (c) 2021-2022 Nordix Foundation.
+# Copyright (c) 2021-2023 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,16 +17,23 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+if [ $# -ne 1 ]; then
+ echo "Usage: $0 <duration>"
+ exit 1
+fi
+
+duration="$1"
+
echo "Starting stability test against distribution component..."
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-JMETER_HOME=~/jmeter/apache-jmeter-5.4.1
+JMETER_HOME=~/jmeter/apache-jmeter-5.5
POLICY_API_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' policy-api)
POLICY_PAP_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' policy-pap)
POLICY_DISTRIBUTION_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' policy-distribution)
-${JMETER_HOME}/bin/jmeter -n -t "${DIR}"/stability.jmx -Jduration=259200 \
+${JMETER_HOME}/bin/jmeter -n -t "${DIR}"/stability.jmx -Jduration="${duration}" \
-Japihost="${POLICY_API_IP}" \
-Jpaphost="${POLICY_PAP_IP}" \
-Jdisthost="${POLICY_DISTRIBUTION_IP}" -l distribution_stability.jtl &
diff --git a/testsuites/stability/src/main/resources/testplans/stability.jmx b/testsuites/stability/src/main/resources/testplans/stability.jmx
index 75810c04..9ac51700 100644
--- a/testsuites/stability/src/main/resources/testplans/stability.jmx
+++ b/testsuites/stability/src/main/resources/testplans/stability.jmx
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4.1">
+<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.5" xmlns="http://jakarta.apache.org/jmeter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jakarta.apache.org/jmeter jmeter.xsd">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="stability test plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
@@ -187,7 +187,7 @@
<hashTree/>
</hashTree>
</hashTree>
- <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="HealthCheck/Statistics" enabled="true"/>
+ <GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="HealthCheck" enabled="true"/>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Healthcheck" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
@@ -219,36 +219,6 @@
</ResponseAssertion>
<hashTree/>
</hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="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">${DISTRIBUTION_HOST}</stringProp>
- <stringProp name="HTTPSampler.port">${DISTRIBUTION_PORT}</stringProp>
- <stringProp name="HTTPSampler.protocol">http</stringProp>
- <stringProp name="HTTPSampler.contentEncoding"></stringProp>
- <stringProp name="HTTPSampler.path">statistics</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>
- </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">8</intProp>
- </ResponseAssertion>
- <hashTree/>
- </hashTree>
</hashTree>
<GenericController guiclass="LogicControllerGui" testclass="GenericController" testname="Metrics" enabled="true"/>
<hashTree>
@@ -437,7 +407,7 @@
<stringProp name="HTTPSampler.port">${PAP_PORT}</stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
- <stringProp name="HTTPSampler.path">/policy/pap/v1/policies/status/</stringProp>
+ <stringProp name="HTTPSampler.path">/policy/pap/v1/policies/status</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
@@ -449,13 +419,10 @@
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
- <collectionProp name="Asserion.test_strings">
- <stringProp name="2914">[]</stringProp>
- </collectionProp>
- <stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
- <intProp name="Assertion.test_type">2</intProp>
+ <intProp name="Assertion.test_type">2</intProp> <!-- "Equals" test type -->
+ <stringProp name="Assertion.test_string">[]</stringProp> <!-- Expected response content -->
</ResponseAssertion>
<hashTree/>
</hashTree>
@@ -573,4 +540,4 @@
</hashTree>
</hashTree>
</hashTree>
-</jmeterTestPlan>
+</jmeterTestPlan> \ No newline at end of file