From ea53f04fe4c29a1bb4330735fb452dad6f1c9669 Mon Sep 17 00:00:00 2001 From: Bilal A Date: Thu, 21 Feb 2019 11:31:02 -0500 Subject: Adds basic stability tests for Policy PAP Includes 1) Basic health check test 2) Statistics API test Change-Id: I89bd11e1f10a2b6cdd3cf440654f3415f21f9edb Issue-ID: POLICY-1460 Signed-off-by: Bilal A --- testsuites/pom.xml | 32 +++ testsuites/stability/pom.xml | 50 ++++ testsuites/stability/src/assembly/assembly.xml | 42 +++ .../src/main/resources/testplans/stability.jmx | 317 +++++++++++++++++++++ 4 files changed, 441 insertions(+) create mode 100644 testsuites/pom.xml create mode 100644 testsuites/stability/pom.xml create mode 100644 testsuites/stability/src/assembly/assembly.xml create mode 100644 testsuites/stability/src/main/resources/testplans/stability.jmx (limited to 'testsuites') diff --git a/testsuites/pom.xml b/testsuites/pom.xml new file mode 100644 index 00000000..a0cc283b --- /dev/null +++ b/testsuites/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + org.onap.policy.pap + policy-pap + 2.0.0-SNAPSHOT + + testsuites + pom + + stability + + \ No newline at end of file diff --git a/testsuites/stability/pom.xml b/testsuites/stability/pom.xml new file mode 100644 index 00000000..a36224be --- /dev/null +++ b/testsuites/stability/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + org.onap.policy.pap + testsuites + 2.0.0-SNAPSHOT + + stability + + + + org.apache.maven.plugins + maven-assembly-plugin + + + create-distribution + package + + single + + + + src/assembly/assembly.xml + + + + + + + + \ No newline at end of file diff --git a/testsuites/stability/src/assembly/assembly.xml b/testsuites/stability/src/assembly/assembly.xml new file mode 100644 index 00000000..6e4f8205 --- /dev/null +++ b/testsuites/stability/src/assembly/assembly.xml @@ -0,0 +1,42 @@ + + + stability + + zip + + /policy-pap/stability + + + ${project.basedir}/src/main/resources/testplans/ + tests/testplans + + *.jmx + *.sh + + unix + 0644 + true + + + diff --git a/testsuites/stability/src/main/resources/testplans/stability.jmx b/testsuites/stability/src/main/resources/testplans/stability.jmx new file mode 100644 index 00000000..098d8c59 --- /dev/null +++ b/testsuites/stability/src/main/resources/testplans/stability.jmx @@ -0,0 +1,317 @@ + + + + + + Policy PAP Stability Tests + false + true + false + + + + PAP_HOST + ${__P(host,10.12.6.164)} + = + + + DURATION + ${__P(duration, 5)} + = + + + USERS + ${__P(users, 1)} + = + + + PORT + ${__P(port, 6969)} + = + + + + + + + + continue + + false + -1 + + ${USERS} + 1 + true + ${DURATION} + 1 + + + + + + + ${PAP_HOST} + 6969 + https + + healthcheck + GET + true + false + true + false + + + + Basic Health Check + + + + + 200 + + + Assertion.response_code + false + 1 + + + + groovy + + + true + import groovy.json.JsonSlurper; + +def res = []; +if (prev.getResponseCode() == '200') { + def jsonSlurper = new JsonSlurper(); + res = jsonSlurper.parseText(prev.getResponseDataAsString()); + + assert res instanceof Map; + assert res.code == 200; + assert res.name == "Policy PAP"; + assert res.healthy==true; + assert res.message=="alive"; +} + + + + + + + + Accept + application/json + + + Content-Type + application/json + + + + + + + + https://${PAP_HOST}:6969/healthcheck + healthcheck + zb!XztG34 + + + + + true + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + continue + + false + -1 + + ${USERS} + 1 + true + ${DURATION} + 1 + + + + + + + ${PAP_HOST} + 6969 + https + + statistics + GET + true + false + true + false + + + + Basic Health Check + + + + + 200 + + + Assertion.response_code + false + 1 + + + + groovy + + + true + import groovy.json.JsonSlurper; + +def res = []; +if (prev.getResponseCode() == '200') { + def jsonSlurper = new JsonSlurper(); + res = jsonSlurper.parseText(prev.getResponseDataAsString()); + + assert res instanceof Map; + assert res.code == 200; + assert res.totalPdpCount == 0; + assert res.totalPdpGroupCount==0; + assert res.totalPolicyDeployCount==0; + assert res.policyDeploySuccessCount==0; + +} + + + + + + + + Accept + application/json + + + Content-Type + application/json + + + + + + + + https://${PAP_HOST}:6969/statistics + healthcheck + zb!XztG34 + + + + + true + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + + -- cgit 1.2.3-korg