summaryrefslogtreecommitdiffstats
path: root/csit/resources
diff options
context:
space:
mode:
Diffstat (limited to 'csit/resources')
-rw-r--r--csit/resources/tests/apex-pdp-common.robot8
-rw-r--r--csit/resources/tests/apex-slas.robot6
-rw-r--r--csit/resources/tests/common-library.robot8
-rw-r--r--csit/resources/tests/drools-applications-slas.robot14
-rw-r--r--csit/resources/tests/xacml-pdp-slas.robot30
5 files changed, 55 insertions, 11 deletions
diff --git a/csit/resources/tests/apex-pdp-common.robot b/csit/resources/tests/apex-pdp-common.robot
index 958f6901..81924604 100644
--- a/csit/resources/tests/apex-pdp-common.robot
+++ b/csit/resources/tests/apex-pdp-common.robot
@@ -31,14 +31,6 @@ CheckLogMessage
${result}= CheckKafkaTopic ${topic} ${status}
Should Contain ${result} ${expectedMsg}
-ValidatePolicyExecution
- [Arguments] ${url} ${executionTime}
- [Documentation] Check that policy execution under X milliseconds
- ${resp}= QueryPrometheus ${url}
- ${rawNumber}= Evaluate ${resp['data']['result'][0]['value'][1]}
- ${actualTime}= Set Variable ${rawNumber * ${1000}}
- Should Be True ${actualTime} <= ${executionTime}
-
ValidateEventExecution
[Arguments] ${eventStartTime} ${eventEndTime} ${eventsNo}
[Documentation] Check that X amount of events were exeuted per second
diff --git a/csit/resources/tests/apex-slas.robot b/csit/resources/tests/apex-slas.robot
index f6e64b89..760bc348 100644
--- a/csit/resources/tests/apex-slas.robot
+++ b/csit/resources/tests/apex-slas.robot
@@ -17,7 +17,7 @@ Healthcheck
Set Suite Variable ${pdpName} ${resp.json()['name']}
ValidatePolicyExecutionAndEventRateLowComplexity
- [Documentation] Validate that a moderate complexity policity can be executed in less than 100ms and minimum 10 events triggered per second
+ [Documentation] Validate that a moderate complexity policy can be executed in less than 100ms and minimum 10 events triggered per second
Set Test Variable ${policyName} onap.policies.apex.pnf.Test
${postjson}= Get File ${CURDIR}/data/${policyName}.json
CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0
@@ -31,7 +31,7 @@ ValidatePolicyExecutionAndEventRateLowComplexity
ValidateEventExecution ${eventStartTime} ${eventEndTime} 10
ValidatePolicyExecutionAndEventRateModerateComplexity
- [Documentation] Validate that a low complexity policity can be executed in less than 1000ms and minimum 1 events triggered per second
+ [Documentation] Validate that a low complexity policy can be executed in less than 1000ms and minimum 1 events triggered per second
Set Test Variable ${policyName} onap.policies.native.apex.Sampledomain
${postjson}= Get File ${CURDIR}/data/${policyName}.json
CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0
@@ -42,7 +42,7 @@ ValidatePolicyExecutionAndEventRateModerateComplexity
ValidateEventExecution ${eventStartTime} ${eventEndTime} 1
ValidatePolicyExecutionAndEventRateHighComplexity
- [Documentation] Validate that a high complexity policity can be executed in less than 5000ms and minimum 0.2 events triggered per second
+ [Documentation] Validate that a high complexity policy can be executed in less than 5000ms and minimum 0.2 events triggered per second
Set Test Variable ${policyName} onap.policies.apex.pnf.metadataSet.Test
${postjson}= Get File ${CURDIR}/data/${policyName}.json
CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0
diff --git a/csit/resources/tests/common-library.robot b/csit/resources/tests/common-library.robot
index 4d69b349..e0b1c0f1 100644
--- a/csit/resources/tests/common-library.robot
+++ b/csit/resources/tests/common-library.robot
@@ -157,3 +157,11 @@ GetKafkaTopic
[Arguments] ${topic}
${resp}= Run Process ${CURDIR}/make_topics.py ${topic} ${KAFKA_IP}
Log ${resp.stdout}
+
+ValidatePolicyExecution
+ [Arguments] ${url} ${executionTime}
+ [Documentation] Check that policy execution under X milliseconds
+ ${resp}= QueryPrometheus ${url}
+ ${rawNumber}= Evaluate ${resp['data']['result'][0]['value'][1]}
+ ${actualTime}= Set Variable ${rawNumber * ${1000}}
+ Should Be True ${actualTime} <= ${executionTime} \ No newline at end of file
diff --git a/csit/resources/tests/drools-applications-slas.robot b/csit/resources/tests/drools-applications-slas.robot
new file mode 100644
index 00000000..a153925d
--- /dev/null
+++ b/csit/resources/tests/drools-applications-slas.robot
@@ -0,0 +1,14 @@
+*** Settings ***
+Library OperatingSystem
+Resource common-library.robot
+
+*** Test Cases ***
+WaitForPrometheusServer
+ [Documentation] Sleep time to wait for Prometheus server to gather all metrics
+ Sleep 1 minute
+
+ValidatePolicyExecutionTimes
+ [Documentation] Validate policy execution times using prometheus metrics
+ ValidatePolicyExecution pdpd_policy_executions_latency_seconds_count{controller="usecases",controlloop="ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",policy="operational.scaleout:1.0.0",status="SUCCESS", instance="policy-drools-apps:9696", job="drools-apps-metrics"} 1000
+ ValidatePolicyExecution pdpd_policy_deployments_total{state="ACTIVE",operation="deploy",status="SUCCESS", instance="policy-drools-apps:9696", job="drools-apps-metrics"} 3000
+
diff --git a/csit/resources/tests/xacml-pdp-slas.robot b/csit/resources/tests/xacml-pdp-slas.robot
new file mode 100644
index 00000000..e3d2d910
--- /dev/null
+++ b/csit/resources/tests/xacml-pdp-slas.robot
@@ -0,0 +1,30 @@
+*** Settings ***
+Library OperatingSystem
+Resource common-library.robot
+
+*** Test Cases ***
+WaitForPrometheusServer
+ [Documentation] Sleep time to wait for Prometheus server to gather all metrics
+ Sleep 1 minute
+
+ValidatePolicyDecisionsGauge
+ [Documentation] Validate policy execution gauge using prometheus metrics
+ ValidatePrometheusMetric pdpx_policy_decisions_created{application="optimization",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1.8E9
+ ValidatePrometheusMetric pdpx_policy_decisions_created{application="guard",status="not_applicable", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1.8E9
+ ValidatePrometheusMetric pdpx_policy_decisions_created{application="monitoring",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1.8E9
+ ValidatePrometheusMetric pdpx_policy_decisions_created{application="naming",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1.8E9
+
+ValidatePolicyDecisionsTotalCounter
+ [Documentation] Validate policy decision counters using prometheus metrics
+ ValidatePrometheusMetric pdpx_policy_decisions_total{application="optimization",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1
+ ValidatePrometheusMetric pdpx_policy_decisions_total{application="guard",status="not_applicable", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1
+ ValidatePrometheusMetric pdpx_policy_decisions_total{application="monitoring",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 2
+ ValidatePrometheusMetric pdpx_policy_decisions_total{application="naming",status="permit", instance="policy-xacml-pdp:6969", job="xacml-pdp-metrics"} 1
+
+*** Keywords ***
+ValidatePrometheusMetric
+ [Arguments] ${url} ${expectedLimit}
+ [Documentation] Check that the policy execution is under X limit
+ ${resp}= QueryPrometheus ${url}
+ ${actualValue}= Evaluate ${resp['data']['result'][0]['value'][1]}
+ Should Be True ${actualValue} <= ${expectedLimit}