blob: 36b593c7cb468caeaf7b492bc3c58ee0a74b6cf8 [file] [log] [blame]
ramverma9e9f7222019-02-11 16:25:44 +00001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7*** Test Cases ***
8Healthcheck
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
ramverma55c1fcf2019-02-22 14:08:15 +000014 ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers}
ramverma9e9f7222019-02-11 16:25:44 +000015 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
19Statistics
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
ramverma55c1fcf2019-02-22 14:08:15 +000025 ${resp}= Get Request policy /policy/pap/v1/statistics headers=${headers}
ramverma9e9f7222019-02-11 16:25:44 +000026 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 Hahn0a594cf2019-04-19 12:47:01 -040029
30CreatePdpGroups
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
Jim Hahn25721ec2019-12-09 09:56:39 -050037 ${resp}= Post Request policy /policy/pap/v1/pdps/groups/batch data=${postjson} headers=${headers}
Jim Hahn0a594cf2019-04-19 12:47:01 -040038 Log Received response from policy ${resp.text}
39 Should Be Equal As Strings ${resp.status_code} 200
40
41ActivatePdpGroup
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
51QueryPdpGroups
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
ramvermabf884ba2019-05-02 17:02:22 +000060 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 Hahn0a594cf2019-04-19 12:47:01 -040063
Jim Hahn25721ec2019-12-09 09:56:39 -050064DeployPdpGroups
65 [Documentation] Runs Policy PAP Deploy Policies to PDP Groups
66 ${auth}= Create List healthcheck zb!XztG34
67 Log Creating session https://${POLICY_PAP_IP}:6969
68 ${postjson}= Get file ${CURDIR}/data/deploy.group.request.json
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}= Post Request policy /policy/pap/v1/pdps/deployments/batch data=${postjson} headers=${headers}
72 Log Received response from policy ${resp.text}
73 Should Be Equal As Strings ${resp.status_code} 200
74
Jim Hahn0a594cf2019-04-19 12:47:01 -040075UndeployPolicy
76 [Documentation] Runs Policy PAP Undeploy a Policy from PDP Groups
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}= Delete Request policy /policy/pap/v1/pdps/policies/onap.restart.tca headers=${headers}
82 Log Received response from policy ${resp.text}
83 Should Be Equal As Strings ${resp.status_code} 200
84
85QueryPdpGroupsAfterUndeploy
86 [Documentation] Runs Policy PAP Query PDP Groups after Undeploy
87 ${auth}= Create List healthcheck zb!XztG34
88 Log Creating session https://${POLICY_PAP_IP}:6969
89 ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth}
90 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
91 ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers}
92 Log Received response from policy ${resp.text}
93 Should Be Equal As Strings ${resp.status_code} 200
ramvermabf884ba2019-05-02 17:02:22 +000094 Should Be Equal As Strings ${resp.json()['groups'][0]['name']} create.group.request
95 Should Be Equal As Strings ${resp.json()['groups'][0]['pdpSubgroups'][0]['policies']} []
Jim Hahn0a594cf2019-04-19 12:47:01 -040096
97DeactivatePdpGroup
98 [Documentation] Runs Policy PAP Change PDP Group State to PASSIVE
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}= Put Request policy /policy/pap/v1/pdps/groups/create.group.request?state=PASSIVE headers=${headers}
104 Log Received response from policy ${resp.text}
105 Should Be Equal As Strings ${resp.status_code} 200
106
107DeletePdpGroups
108 [Documentation] Runs Policy PAP Delete PDP Groups
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}= Delete Request policy /policy/pap/v1/pdps/groups/create.group.request headers=${headers}
114 Log Received response from policy ${resp.text}
115 Should Be Equal As Strings ${resp.status_code} 200
116
117QueryPdpGroupsAfterDelete
118 [Documentation] Runs Policy PAP Query PDP Groups after Delete
119 ${auth}= Create List healthcheck zb!XztG34
120 Log Creating session https://${POLICY_PAP_IP}:6969
121 ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth}
122 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
123 ${resp}= Get Request policy /policy/pap/v1/pdps headers=${headers}
124 Log Received response from policy ${resp.text}
125 Should Be Equal As Strings ${resp.status_code} 200
ramvermabf884ba2019-05-02 17:02:22 +0000126 Should Be Equal As Strings ${resp.json()['groups'][0]['name']} defaultGroup