From: Ram Krishna Verma Date: Thu, 29 Jul 2021 22:09:58 +0000 (-0400) Subject: Add policy audit to pap csit X-Git-Tag: 2.3.0~13 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F122980%2F1;p=policy%2Fdocker.git Add policy audit to pap csit Adding policy audit api's to pap csit. However, I see that pap csit file can be refactored and lot of duplications can be removed. Will do it as part of next review. Issue-ID: POLICY-3340 Change-Id: I4334ad957ae70c4bcc9f3aa18d882042ce96d57f Signed-off-by: Ram Krishna Verma --- diff --git a/csit/pap/tests/pap-test.robot b/csit/pap/tests/pap-test.robot index da0908d6..f31f2426 100644 --- a/csit/pap/tests/pap-test.robot +++ b/csit/pap/tests/pap-test.robot @@ -83,6 +83,22 @@ DeployPdpGroups Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 202 +QueryPolicyAuditAfterDeploy + [Documentation] Runs Policy PAP Query Policy Audit after Deploy + ${auth}= Create List healthcheck zb!XztG34 + Log Creating session https://${POLICY_PAP_IP}:6969 + ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= GET On Session policy /policy/pap/v1/policies/audit params=recordCount=1 headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.json()[0]['pdpGroup']} create.group.request + Should Be Equal As Strings ${resp.json()[0]['pdpType']} pdpTypeA + Should Be Equal As Strings ${resp.json()[0]['policy']['name']} onap.restart.tca + Should Be Equal As Strings ${resp.json()[0]['policy']['version']} 1.0.0 + Should Be Equal As Strings ${resp.json()[0]['action']} DEPLOYMENT + Should Be Equal As Strings ${resp.json()[0]['user']} healthcheck + UndeployPolicy [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups ${auth}= Create List healthcheck zb!XztG34 @@ -105,6 +121,22 @@ QueryPdpGroupsAfterUndeploy Should Be Equal As Strings ${resp.json()['groups'][0]['name']} create.group.request Should Be Equal As Strings ${resp.json()['groups'][0]['pdpSubgroups'][0]['policies']} [] +QueryPolicyAuditAfterUnDeploy + [Documentation] Runs Policy PAP Query Policy Audit after Undeploy + ${auth}= Create List healthcheck zb!XztG34 + Log Creating session https://${POLICY_PAP_IP}:6969 + ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= GET On Session policy /policy/pap/v1/policies/audit params=recordCount=1 headers=${headers} + Log Received response from policy ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.json()[0]['pdpGroup']} create.group.request + Should Be Equal As Strings ${resp.json()[0]['pdpType']} pdpTypeA + Should Be Equal As Strings ${resp.json()[0]['policy']['name']} onap.restart.tca + Should Be Equal As Strings ${resp.json()[0]['policy']['version']} 1.0.0 + Should Be Equal As Strings ${resp.json()[0]['action']} UNDEPLOYMENT + Should Be Equal As Strings ${resp.json()[0]['user']} healthcheck + DeactivatePdpGroup [Documentation] Runs Policy PAP Change PDP Group State to PASSIVE ${auth}= Create List healthcheck zb!XztG34