From cfe6854e21999cf5fcb1b6ed6586323ce5c389ce Mon Sep 17 00:00:00 2001 From: Ram Krishna Verma Date: Thu, 29 Jul 2021 18:09:58 -0400 Subject: 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 --- csit/pap/tests/pap-test.robot | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'csit/pap') 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 -- cgit 1.2.3-korg