blob: f2dd61da5483a86d42f133c895f4f48bd8f10b83 [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
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
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
64UndeployPolicy
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
74QueryPdpGroupsAfterUndeploy
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
ramvermabf884ba2019-05-02 17:02:22 +000083 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 Hahn0a594cf2019-04-19 12:47:01 -040085
86DeactivatePdpGroup
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
96DeletePdpGroups
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
106QueryPdpGroupsAfterDelete
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
ramvermabf884ba2019-05-02 17:02:22 +0000115 Should Be Equal As Strings ${resp.json()['groups'][0]['name']} defaultGroup