diff options
Diffstat (limited to 'csit/resources/tests/xacml-pdp-slas.robot')
-rw-r--r-- | csit/resources/tests/xacml-pdp-slas.robot | 30 |
1 files changed, 30 insertions, 0 deletions
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} |