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 |
| 60 | Should Be Equal As Strings ${resp.json()['groups'][0]['name']} controlloop |
| 61 | Should Be Equal As Strings ${resp.json()['groups'][1]['name']} create.group.request |
| 62 | Should Be Equal As Strings ${resp.json()['groups'][1]['pdpGroupState']} ACTIVE |
| 63 | Should Be Equal As Strings ${resp.json()['groups'][2]['name']} monitoring |
| 64 | |
| 65 | UndeployPolicy |
| 66 | [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups |
| 67 | ${auth}= Create List healthcheck zb!XztG34 |
| 68 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 69 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 70 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 71 | ${resp}= Delete Request policy /policy/pap/v1/pdps/policies/onap.restart.tca headers=${headers} |
| 72 | Log Received response from policy ${resp.text} |
| 73 | Should Be Equal As Strings ${resp.status_code} 200 |
| 74 | |
| 75 | QueryPdpGroupsAfterUndeploy |
| 76 | [Documentation] Runs Policy PAP Query PDP Groups after Undeploy |
| 77 | ${auth}= Create List healthcheck zb!XztG34 |
| 78 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 79 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 80 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 81 | ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} |
| 82 | Log Received response from policy ${resp.text} |
| 83 | Should Be Equal As Strings ${resp.status_code} 200 |
| 84 | Should Be Equal As Strings ${resp.json()['groups'][1]['name']} create.group.request |
| 85 | Should Be Equal As Strings ${resp.json()['groups'][1]['pdpSubgroups'][0]['policies']} [] |
| 86 | |
| 87 | DeactivatePdpGroup |
| 88 | [Documentation] Runs Policy PAP Change PDP Group State to PASSIVE |
| 89 | ${auth}= Create List healthcheck zb!XztG34 |
| 90 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 91 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 92 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 93 | ${resp}= Put Request policy /policy/pap/v1/pdps/groups/create.group.request?state=PASSIVE headers=${headers} |
| 94 | Log Received response from policy ${resp.text} |
| 95 | Should Be Equal As Strings ${resp.status_code} 200 |
| 96 | |
| 97 | DeletePdpGroups |
| 98 | [Documentation] Runs Policy PAP Delete PDP Groups |
| 99 | ${auth}= Create List healthcheck zb!XztG34 |
| 100 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 101 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 102 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 103 | ${resp}= Delete Request policy /policy/pap/v1/pdps/groups/create.group.request headers=${headers} |
| 104 | Log Received response from policy ${resp.text} |
| 105 | Should Be Equal As Strings ${resp.status_code} 200 |
| 106 | |
| 107 | QueryPdpGroupsAfterDelete |
| 108 | [Documentation] Runs Policy PAP Query PDP Groups after Delete |
| 109 | ${auth}= Create List healthcheck zb!XztG34 |
| 110 | Log Creating session https://${POLICY_PAP_IP}:6969 |
| 111 | ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth} |
| 112 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 113 | ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers} |
| 114 | Log Received response from policy ${resp.text} |
| 115 | Should Be Equal As Strings ${resp.status_code} 200 |
| 116 | Should Be Equal As Strings ${resp.json()['groups'][0]['name']} controlloop |
| 117 | Should Be Equal As Strings ${resp.json()['groups'][1]['name']} monitoring |