ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | |
| 7 | *** Test Cases *** |
Jim Hahn | 1ebe7ec | 2020-04-02 13:32:01 -0400 | [diff] [blame] | 8 | LoadPolicy |
| 9 | [Documentation] Loads prerequisite Policy via API |
| 10 | ${auth}= Create List healthcheck zb!XztG34 |
| 11 | Log Creating session https://${POLICY_API_IP}:6969 |
| 12 | ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} |
| 13 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Jim Hahn | 09148c8 | 2020-09-02 11:16:16 -0400 | [diff] [blame] | 14 | ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json |
Pamela Dragosh | bd5f1dc | 2020-08-19 16:18:52 -0400 | [diff] [blame] | 15 | ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers} |
Jim Hahn | 1ebe7ec | 2020-04-02 13:32:01 -0400 | [diff] [blame] | 16 | Log Received response from API ${resp.text} |
| 17 | Should Be Equal As Strings ${resp.status_code} 200 |
| 18 | |
ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 19 | Healthcheck |
| 20 | [Documentation] Runs Policy PAP Health check |
| 21 | ${auth}= Create List healthcheck zb!XztG34 |
| 22 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 23 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 24 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
ramverma | 55c1fcf | 2019-02-22 14:08:15 +0000 | [diff] [blame] | 25 | ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers} |
ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 26 | Log Received response from policy ${resp.text} |
| 27 | Should Be Equal As Strings ${resp.status_code} 200 |
| 28 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 29 | |
| 30 | Statistics |
| 31 | [Documentation] Runs Policy PAP Statistics |
| 32 | ${auth}= Create List healthcheck zb!XztG34 |
| 33 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 34 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 35 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
ramverma | 55c1fcf | 2019-02-22 14:08:15 +0000 | [diff] [blame] | 36 | ${resp}= Get Request policy /policy/pap/v1/statistics headers=${headers} |
ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 37 | Log Received response from policy ${resp.text} |
| 38 | Should Be Equal As Strings ${resp.status_code} 200 |
| 39 | Should Be Equal As Strings ${resp.json()['code']} 200 |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 40 | |
| 41 | CreatePdpGroups |
| 42 | [Documentation] Runs Policy PAP Create PDP Groups |
| 43 | ${auth}= Create List healthcheck zb!XztG34 |
| 44 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 45 | ${postjson}= Get file ${CURDIR}/data/create.group.request.json |
| 46 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 47 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Jim Hahn | 25721ec | 2019-12-09 09:56:39 -0500 | [diff] [blame] | 48 | ${resp}= Post Request policy /policy/pap/v1/pdps/groups/batch data=${postjson} headers=${headers} |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 49 | Log Received response from policy ${resp.text} |
| 50 | Should Be Equal As Strings ${resp.status_code} 200 |
| 51 | |
| 52 | ActivatePdpGroup |
| 53 | [Documentation] Runs Policy PAP Change PDP Group State to ACTIVE |
| 54 | ${auth}= Create List healthcheck zb!XztG34 |
| 55 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 56 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 57 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 58 | ${resp}= Put Request policy /policy/pap/v1/pdps/groups/create.group.request?state=ACTIVE headers=${headers} |
| 59 | Log Received response from policy ${resp.text} |
| 60 | Should Be Equal As Strings ${resp.status_code} 200 |
| 61 | |
| 62 | QueryPdpGroups |
| 63 | [Documentation] Runs Policy PAP Query PDP Groups |
| 64 | ${auth}= Create List healthcheck zb!XztG34 |
| 65 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 66 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 67 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 68 | ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} |
| 69 | Log Received response from policy ${resp.text} |
| 70 | Should Be Equal As Strings ${resp.status_code} 200 |
ramverma | bf884ba | 2019-05-02 17:02:22 +0000 | [diff] [blame] | 71 | Should Be Equal As Strings ${resp.json()['groups'][0]['name']} create.group.request |
| 72 | Should Be Equal As Strings ${resp.json()['groups'][0]['pdpGroupState']} ACTIVE |
| 73 | Should Be Equal As Strings ${resp.json()['groups'][1]['name']} defaultGroup |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 74 | |
Jim Hahn | 25721ec | 2019-12-09 09:56:39 -0500 | [diff] [blame] | 75 | DeployPdpGroups |
| 76 | [Documentation] Runs Policy PAP Deploy Policies to PDP Groups |
| 77 | ${auth}= Create List healthcheck zb!XztG34 |
| 78 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 79 | ${postjson}= Get file ${CURDIR}/data/deploy.group.request.json |
| 80 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 81 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 82 | ${resp}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers} |
| 83 | Log Received response from policy ${resp.text} |
| 84 | Should Be Equal As Strings ${resp.status_code} 200 |
| 85 | |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 86 | UndeployPolicy |
| 87 | [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups |
| 88 | ${auth}= Create List healthcheck zb!XztG34 |
| 89 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 90 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 91 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 92 | ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/onap.restart.tca headers=${headers} |
| 93 | Log Received response from policy ${resp.text} |
| 94 | Should Be Equal As Strings ${resp.status_code} 200 |
| 95 | |
| 96 | QueryPdpGroupsAfterUndeploy |
| 97 | [Documentation] Runs Policy PAP Query PDP Groups after Undeploy |
| 98 | ${auth}= Create List healthcheck zb!XztG34 |
| 99 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 100 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 101 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 102 | ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} |
| 103 | Log Received response from policy ${resp.text} |
| 104 | Should Be Equal As Strings ${resp.status_code} 200 |
ramverma | bf884ba | 2019-05-02 17:02:22 +0000 | [diff] [blame] | 105 | Should Be Equal As Strings ${resp.json()['groups'][0]['name']} create.group.request |
| 106 | Should Be Equal As Strings ${resp.json()['groups'][0]['pdpSubgroups'][0]['policies']} [] |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 107 | |
| 108 | DeactivatePdpGroup |
| 109 | [Documentation] Runs Policy PAP Change PDP Group State to PASSIVE |
| 110 | ${auth}= Create List healthcheck zb!XztG34 |
| 111 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 112 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 113 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 114 | ${resp}= Put Request policy /policy/pap/v1/pdps/groups/create.group.request?state=PASSIVE headers=${headers} |
| 115 | Log Received response from policy ${resp.text} |
| 116 | Should Be Equal As Strings ${resp.status_code} 200 |
| 117 | |
| 118 | DeletePdpGroups |
| 119 | [Documentation] Runs Policy PAP Delete PDP Groups |
| 120 | ${auth}= Create List healthcheck zb!XztG34 |
| 121 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 122 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 123 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 124 | ${resp}= Delete Request policy /policy/pap/v1/pdps/groups/create.group.request headers=${headers} |
| 125 | Log Received response from policy ${resp.text} |
| 126 | Should Be Equal As Strings ${resp.status_code} 200 |
| 127 | |
| 128 | QueryPdpGroupsAfterDelete |
| 129 | [Documentation] Runs Policy PAP Query PDP Groups after Delete |
| 130 | ${auth}= Create List healthcheck zb!XztG34 |
| 131 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 132 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 133 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 134 | ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} |
| 135 | Log Received response from policy ${resp.text} |
| 136 | Should Be Equal As Strings ${resp.status_code} 200 |
ramverma | bf884ba | 2019-05-02 17:02:22 +0000 | [diff] [blame] | 137 | Should Be Equal As Strings ${resp.json()['groups'][0]['name']} defaultGroup |