Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library OperatingSystem |
| 3 | Library RequestsLibrary |
| 4 | Library requests |
| 5 | Library Collections |
| 6 | Library String |
| 7 | |
| 8 | *** Variables *** |
| 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 |
| 14 | |
| 15 | |
| 16 | *** Test Cases *** |
| 17 | View Namesapce |
| 18 | [Tags] get |
| 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} |
| 24 | |
| 25 | View by User Permission |
| 26 | [Tags] get |
| 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} |
| 32 | |
| 33 | View by User Role |
| 34 | [Tags] get |
| 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} |
| 40 | |
| 41 | Cleanup Namespace ( 424 Response - Delete dependencies and try again) |
| 42 | [Tags] delete |
| 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} |
| 48 | |
| 49 | Add Data ( Add Admin to Namespace Explicit ) |
| 50 | [Tags] post |
| 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} |
| 56 | |
| 57 | View Explicit Permission |
| 58 | [Tags] post |
| 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} |