Fix timeout in pap CSIT for auditing undeploys 79/138179/1 montreal
authoradheli.tavares <adheli.tavares@est.tech>
Thu, 30 May 2024 09:17:05 +0000 (10:17 +0100)
committerAdheli Tavares <adheli.tavares@est.tech>
Thu, 20 Jun 2024 08:35:09 +0000 (08:35 +0000)
Issue-ID: POLICY-4494
Change-Id: I04337ad3314770aa9870aa1779161023745699e0
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
(cherry picked from commit 2ac4b6c7e56b0ed3a9fabca1c2123e3b89f27d65)

csit/resources/tests/common-library.robot
csit/resources/tests/pap-test.robot

index 8c27917..e4ec720 100644 (file)
@@ -77,10 +77,10 @@ QueryPdpGroups
 QueryPolicyAudit
     [Arguments]  ${url}  ${expectedstatus}  ${pdpGroup}  ${pdpType}  ${policyName}  ${expectedAction}
     ${policyadmin}=  PolicyAdminAuth
-    ${resp}=  PerformGetRequest  ${POLICY_PAP_IP}  ${url}  ${expectedstatus}  recordCount=2   ${policyadmin}
+    ${resp}=  PerformGetRequest  ${POLICY_PAP_IP}  ${url}  ${expectedstatus}  recordCount=4   ${policyadmin}
     Log  Received response from queryPolicyAudit ${resp.text}
     FOR    ${responseEntry}    IN    @{resp.json()}
-    Exit For Loop IF      '${responseEntry['policy']['name']}'=='${policyName}'
+    Exit For Loop IF      '${responseEntry['policy']['name']}'=='${policyName}' and '${responseEntry['action']}'=='${expectedAction}'
     END
     Should Be Equal As Strings    ${responseEntry['pdpGroup']}  ${pdpGroup}
     Should Be Equal As Strings    ${responseEntry['pdpType']}  ${pdpType}
index 8232843..4583138 100644 (file)
@@ -12,17 +12,8 @@ GetReq
     ${resp}=  PerformGetRequest  ${POLICY_PAP_IP}  ${url}  200  null  ${auth}
     [return]  ${resp}
 
-ValidateResponseTimeForPap
-    [Arguments]  ${uri}  ${method}
-    [Documentation]  Check if uri response is under the required time for pap metrics
-    ValidateResponseTime  pap-metrics  ${uri}  ${method}  500
-
-ValidateDeploymentTime
-    [Documentation]  Check if deployment of policy is under 2000ms
-    ${resp}=  QueryPrometheus  pap_policy_deployments_seconds_sum{operation="deploy",status="SUCCESS"}/pap_policy_deployments_seconds_count{operation="deploy",status="SUCCESS"}
-    ${rawNumber}=  Evaluate  ${resp['data']['result'][0]['value'][1]}
-    ${actualTime}=   Set Variable  ${rawNumber * ${1000}}
-    Should Be True   ${actualTime} <= ${2000}
+CheckUndeploymentStatus
+    QueryPolicyAudit  /policy/pap/v1/policies/audit  200  testGroup  pdpTypeA  onap.restart.tca  UNDEPLOYMENT
 
 *** Test Cases ***
 LoadPolicy
@@ -113,8 +104,7 @@ QueryPdpGroupsAfterUndeploy
 
 QueryPolicyAuditAfterUnDeploy
     [Documentation]   Verify policy audit record after undeploy
-    Sleep             20 seconds
-    QueryPolicyAudit  /policy/pap/v1/policies/audit  200  testGroup  pdpTypeA  onap.restart.tca  UNDEPLOYMENT
+    Wait Until Keyword Succeeds    2 min    10 sec   CheckUndeploymentStatus
 
 QueryPolicyAuditWithMetadataSetAfterUnDeploy
     [Documentation]  Verify policy audit record after undeploy