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 *** |
| 8 | Healthcheck |
| 9 | [Documentation] Runs Policy PAP Health check |
| 10 | ${auth}= Create List healthcheck zb!XztG34 |
| 11 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 12 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 13 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
ramverma | 55c1fcf | 2019-02-22 14:08:15 +0000 | [diff] [blame] | 14 | ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers} |
ramverma | 9e9f722 | 2019-02-11 16:25:44 +0000 | [diff] [blame] | 15 | Log Received response from policy ${resp.text} |
| 16 | Should Be Equal As Strings ${resp.status_code} 200 |
| 17 | Should Be Equal As Strings ${resp.json()['code']} 200 |
| 18 | |
| 19 | Statistics |
| 20 | [Documentation] Runs Policy PAP Statistics |
| 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/statistics 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 |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 29 | |
| 30 | CreatePdpGroups |
| 31 | [Documentation] Runs Policy PAP Create PDP Groups |
| 32 | ${auth}= Create List healthcheck zb!XztG34 |
| 33 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 34 | ${postjson}= Get file ${CURDIR}/data/create.group.request.json |
| 35 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 36 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 37 | ${resp}= Post Request policy /policy/pap/v1/pdps data=${postjson} headers=${headers} |
| 38 | Log Received response from policy ${resp.text} |
| 39 | Should Be Equal As Strings ${resp.status_code} 200 |
| 40 | |
| 41 | ActivatePdpGroup |
| 42 | [Documentation] Runs Policy PAP Change PDP Group State to ACTIVE |
| 43 | ${auth}= Create List healthcheck zb!XztG34 |
| 44 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 45 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 46 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 47 | ${resp}= Put Request policy /policy/pap/v1/pdps/groups/create.group.request?state=ACTIVE headers=${headers} |
| 48 | Log Received response from policy ${resp.text} |
| 49 | Should Be Equal As Strings ${resp.status_code} 200 |
| 50 | |
| 51 | QueryPdpGroups |
| 52 | [Documentation] Runs Policy PAP Query PDP Groups |
| 53 | ${auth}= Create List healthcheck zb!XztG34 |
| 54 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 55 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 56 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 57 | ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} |
| 58 | Log Received response from policy ${resp.text} |
| 59 | Should Be Equal As Strings ${resp.status_code} 200 |
ramverma | bf884ba | 2019-05-02 17:02:22 +0000 | [diff] [blame] | 60 | Should Be Equal As Strings ${resp.json()['groups'][0]['name']} create.group.request |
| 61 | Should Be Equal As Strings ${resp.json()['groups'][0]['pdpGroupState']} ACTIVE |
| 62 | Should Be Equal As Strings ${resp.json()['groups'][1]['name']} defaultGroup |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 63 | |
| 64 | UndeployPolicy |
| 65 | [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups |
| 66 | ${auth}= Create List healthcheck zb!XztG34 |
| 67 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 68 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 69 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 70 | ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/onap.restart.tca headers=${headers} |
| 71 | Log Received response from policy ${resp.text} |
| 72 | Should Be Equal As Strings ${resp.status_code} 200 |
| 73 | |
| 74 | QueryPdpGroupsAfterUndeploy |
| 75 | [Documentation] Runs Policy PAP Query PDP Groups after Undeploy |
| 76 | ${auth}= Create List healthcheck zb!XztG34 |
| 77 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 78 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 79 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 80 | ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} |
| 81 | Log Received response from policy ${resp.text} |
| 82 | Should Be Equal As Strings ${resp.status_code} 200 |
ramverma | bf884ba | 2019-05-02 17:02:22 +0000 | [diff] [blame] | 83 | Should Be Equal As Strings ${resp.json()['groups'][0]['name']} create.group.request |
| 84 | Should Be Equal As Strings ${resp.json()['groups'][0]['pdpSubgroups'][0]['policies']} [] |
Jim Hahn | 0a594cf | 2019-04-19 12:47:01 -0400 | [diff] [blame] | 85 | |
| 86 | DeactivatePdpGroup |
| 87 | [Documentation] Runs Policy PAP Change PDP Group State to PASSIVE |
| 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}= Put Request policy /policy/pap/v1/pdps/groups/create.group.request?state=PASSIVE headers=${headers} |
| 93 | Log Received response from policy ${resp.text} |
| 94 | Should Be Equal As Strings ${resp.status_code} 200 |
| 95 | |
| 96 | DeletePdpGroups |
| 97 | [Documentation] Runs Policy PAP Delete PDP Groups |
| 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}= Delete Request policy /policy/pap/v1/pdps/groups/create.group.request headers=${headers} |
| 103 | Log Received response from policy ${resp.text} |
| 104 | Should Be Equal As Strings ${resp.status_code} 200 |
| 105 | |
| 106 | QueryPdpGroupsAfterDelete |
| 107 | [Documentation] Runs Policy PAP Query PDP Groups after Delete |
| 108 | ${auth}= Create List healthcheck zb!XztG34 |
| 109 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 110 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 111 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 112 | ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} |
| 113 | Log Received response from policy ${resp.text} |
| 114 | Should Be Equal As Strings ${resp.status_code} 200 |
ramverma | bf884ba | 2019-05-02 17:02:22 +0000 | [diff] [blame] | 115 | Should Be Equal As Strings ${resp.json()['groups'][0]['name']} defaultGroup |