From 67f7bd978865e8cad3cc84c2a4074f6ce02dff3e Mon Sep 17 00:00:00 2001 From: "a.sreekumar" Date: Mon, 14 Feb 2022 13:51:34 +0000 Subject: Fix policy-api CSIT test Change-Id: Idd7fd933f10dabaa203ec498996aa772facddac9 Issue-ID: POLICY-3753 Signed-off-by: a.sreekumar --- csit/api/tests/api-test.robot | 5 +++-- csit/common-library.robot | 7 +++++++ csit/pap/tests/pap-test.robot | 7 ++----- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'csit') diff --git a/csit/api/tests/api-test.robot b/csit/api/tests/api-test.robot index 892bf0e4..80e8afd5 100644 --- a/csit/api/tests/api-test.robot +++ b/csit/api/tests/api-test.robot @@ -14,8 +14,9 @@ Healthcheck Metrics [Documentation] Verify policy-api is exporting prometheus metrics - ${resp}= GetReq /metrics - Should Contain ${resp.text} jvm_threads_current + ${auth}= PolicyAdminAuth + ${resp}= GetMetrics ${POLICY_API_IP} ${auth} + Should Contain ${resp.text} jvm_threads_live_threads Statistics [Documentation] Verify policy api statistics diff --git a/csit/common-library.robot b/csit/common-library.robot index 830d0f63..c2d1de7f 100644 --- a/csit/common-library.robot +++ b/csit/common-library.robot @@ -100,3 +100,10 @@ QueryPolicyStatus Should Be Equal As Strings ${responseEntry['deploy']} True Should Be Equal As Strings ${responseEntry['state']} SUCCESS +GetMetrics + [Arguments] ${hostname} ${auth} + Log Creating session https://${hostname}:6969 + ${session}= Create Session policy https://${hostname}:6969 auth=${auth} + ${resp}= GET On Session policy /metrics expected_status=200 + Log Received response from policy ${resp.text} + [return] ${resp} diff --git a/csit/pap/tests/pap-test.robot b/csit/pap/tests/pap-test.robot index d9713013..a6d5d42d 100644 --- a/csit/pap/tests/pap-test.robot +++ b/csit/pap/tests/pap-test.robot @@ -30,11 +30,8 @@ Consolidated Healthcheck Metrics [Documentation] Verify policy pap is exporting prometheus metrics - Log Creating session https://${POLICY_PAP_IP}:6969 - ${policyadmin}= Create list policyadmin zb!XztG34 - ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${policyadmin} - ${resp}= GET On Session policy url=/metrics expected_status=200 - Log Received response from policy ${resp.text} + ${auth}= PolicyAdminAuth + ${resp}= GetMetrics ${POLICY_PAP_IP} ${auth} Should Contain ${resp.text} jvm_threads_live_threads Statistics -- cgit 1.2.3-korg