2 Library OperatingSystem
3 Library RequestsLibrary
9 ${TARGETURL_NAMESPACE} http://${AAF_IP}:8101/authz/nss/org.openecomp
10 ${TARGETURL_PERMS} http://${AAF_IP}:8101/authz/perms/user/dgl@openecomp.org
11 ${TARGETURL_ROLES} http://${AAF_IP}:8101/authz/roles/user/dgl@openecomp.org
12 ${username} dgl@openecomp.org
13 ${password} ecomp_admin
19 CreateSession aaf http://${AAF_IP}:8101
20 &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json
21 ${resp}= Get Request aaf /authz/nss/org.openecomp headers=&{headers}
22 Should Be Equal As Strings ${resp.status_code} 200
23 log 'JSON Response Code :'${resp.text}
25 View by User Permission
27 CreateSession aaf http://${AAF_IP}:8101
28 &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json
29 ${resp}= Get Request aaf authz/perms/user/dgl@openecomp.org headers=&{headers}
30 Should Be Equal As Strings ${resp.status_code} 200
31 log 'JSON Response Code :'${resp.text}
35 CreateSession aaf http://${AAF_IP}:8101
36 &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json
37 ${resp}= Get Request aaf authz/roles/user/dgl@openecomp.org headers=&{headers}
38 Should Be Equal As Strings ${resp.status_code} 200
39 log 'JSON Response Code :'${resp.text}
41 Cleanup Namespace ( 424 Response - Delete dependencies and try again)
43 CreateSession aaf http://${AAF_IP}:8101
44 &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json
45 ${resp}= Delete Request aaf authz/ns/org.openecomp.dmaapBC headers=&{headers}
46 Should Be Equal As Strings ${resp.status_code} 424
47 log 'JSON Response Code :'${resp.text}
49 Add Data ( Add Admin to Namespace Explicit )
51 CreateSession aaf http://${AAF_IP}:8101
52 &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json
53 ${resp}= Post Request aaf authz/ns/org.openecomp.dmaapBC/admin/alexD@openecomp.org headers=&{headers}
54 Should Be Equal As Strings ${resp.status_code} 403
55 log 'JSON Response Code :'${resp.text}
57 View Explicit Permission
59 CreateSession aaf http://${AAF_IP}:8101
60 &{headers}= Create Dictionary Authorization=Basic ZGdsQG9wZW5lY29tcC5vcmc6ZWNvbXBfYWRtaW4= Content-Type=application/json Accept=application/json
61 ${resp}= Post Request aaf authz/perms/user/m99751@dmaapBC.openecomp.org headers=&{headers}
62 Should Be Equal As Strings ${resp.status_code} 406
63 log 'JSON Response Code :'${resp.text}