From: Jorge Hernandez Date: Thu, 7 Mar 2019 15:07:49 +0000 (+0000) Subject: Merge "Adds basic stability tests for XACML PDP" X-Git-Tag: 3.0.2-ONAP~33 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=69687b1e5b2b8ba6d1cea2a57e6e6a34ba3130f5;hp=a02659636fbfad2c3cb970d93f35e02a892409e5;p=policy%2Fxacml-pdp.git Merge "Adds basic stability tests for XACML PDP" --- diff --git a/pom.xml b/pom.xml index e912b204..acd78de6 100644 --- a/pom.xml +++ b/pom.xml @@ -52,6 +52,7 @@ main applications packages + testsuites diff --git a/testsuites/pom.xml b/testsuites/pom.xml new file mode 100644 index 00000000..0da7d466 --- /dev/null +++ b/testsuites/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + org.onap.policy.xacml-pdp + policy-xacml-pdp + 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..8fffd9d2 --- /dev/null +++ b/testsuites/stability/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + + org.onap.policy.xacml-pdp + 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..caf0bcb7 --- /dev/null +++ b/testsuites/stability/src/assembly/assembly.xml @@ -0,0 +1,42 @@ + + + stability + + zip + + /policy-xacml-pdp/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..9a3ad6be --- /dev/null +++ b/testsuites/stability/src/main/resources/testplans/stability.jmx @@ -0,0 +1,319 @@ + + + + + + Policy XACML PDP Stability Tests + false + true + false + + + + POLICY_XACML_PDP_HOST + ${__P(host,127.0.0.1)} + = + + + DURATION + ${__P(duration, 5)} + = + + + USERS + ${__P(users, 1)} + = + + + PORT + ${__P(port, 6969)} + = + + + + + + + + continue + + false + -1 + + ${USERS} + 1 + true + ${DURATION} + 1 + + + + + + + ${POLICY_XACML_PDP_HOST} + 6969 + http + + policy/pdpx/v1/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 Xacml PDP"; + assert res.healthy==true; + assert res.message=="alive"; + +} + + + + + + + Accept + application/json + + + Content-Type + application/json + + + + + + + + http://${POLICY_XACML_PDP_HOST}:6969/policy/pdpx/v1/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 + + + + + + + ${POLICY_XACML_PDP_HOST} + 6969 + http + + policy/pdpx/v1/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.totalPoliciesCount == 0; + assert res.permitDecisionsCount == 0; + assert res.denyDecisionsCount == 0; + assert res.indeterminantDecisionsCount == 0; + assert res.notApplicableDecisionsCount == 0; + + + +} + + + + + + + Accept + application/json + + + Content-Type + application/json + + + + + + + + http://${POLICY_XACML_PDP_HOST}:6969/policy/pdpx/v1/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 + + + + + + + + +