Kiran Kamineni | ac3438c | 2019-03-13 12:24:23 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Suite Setup Run keywords Check k8splugin API Docker Container Created header Created session |
| 3 | Library OperatingSystem |
| 4 | Library RequestsLibrary |
| 5 | |
| 6 | *** Variables *** |
| 7 | |
| 8 | *** Test Cases *** |
| 9 | Create Definition |
| 10 | [Template] Post template |
| 11 | /v1/rb/definition create_rbdefinition.json |
| 12 | |
| 13 | Get Definition |
| 14 | [Template] Get template |
Kiran Kamineni | 3875fc2 | 2019-04-02 10:46:55 -0700 | [diff] [blame] | 15 | /v1/rb/definition/test-rbdef |
| 16 | /v1/rb/definition/test-rbdef/v1 |
Kiran Kamineni | ac3438c | 2019-03-13 12:24:23 -0700 | [diff] [blame] | 17 | |
Kiran Kamineni | d356432 | 2019-04-02 11:14:30 -0700 | [diff] [blame] | 18 | Create Profile |
| 19 | [Template] Post template |
| 20 | /v1/rb/definition/test-rbdef/v1/profile create_rbprofile.json |
| 21 | |
| 22 | Get Profile |
| 23 | [Template] Get template |
| 24 | /v1/rb/definition/test-rbdef/v1/profile/profile1 |
| 25 | |
| 26 | Delete Profile |
| 27 | [Template] Delete template |
| 28 | /v1/rb/definition/test-rbdef/v1/profile/profile1 |
| 29 | |
Kiran Kamineni | ac3438c | 2019-03-13 12:24:23 -0700 | [diff] [blame] | 30 | Delete Definition |
| 31 | [Template] Delete template |
Kiran Kamineni | 3875fc2 | 2019-04-02 10:46:55 -0700 | [diff] [blame] | 32 | /v1/rb/definition/test-rbdef/v1 |
Kiran Kamineni | ac3438c | 2019-03-13 12:24:23 -0700 | [diff] [blame] | 33 | |
| 34 | *** Keywords *** |
| 35 | Created session |
| 36 | Create Session multicloud_k8s_session http://${SERVICE_IP}:${SERVICE_PORT} |
| 37 | Set Suite Variable ${suite_multicloud_k8s_session} multicloud_k8s_session |
| 38 | |
| 39 | Created header |
| 40 | ${headers}= Create Dictionary Content-Type=application/json Accept=application/json |
| 41 | Set Suite Variable ${suite_headers} ${headers} |
| 42 | |
| 43 | Delete template |
| 44 | [Documentation] Deletes from Definition |
| 45 | [Arguments] ${topic} |
| 46 | ${resp}= Delete Request ${suite_multicloud_k8s_session} ${topic} headers=${suite_headers} |
| 47 | Log To Console ********************* |
| 48 | Log To Console response = ${resp} |
| 49 | Log To Console body = ${resp.text} |
| 50 | Should Be Equal As Integers ${resp.status_code} 204 |
| 51 | |
| 52 | Post template |
| 53 | [Documentation] Create A Definition |
| 54 | [Arguments] ${topic} ${file} |
| 55 | ${data} Get Binary File ${CURDIR}${/}data${/}${file} |
| 56 | ${resp}= Post Request ${suite_multicloud_k8s_session} ${topic} data=${data} headers=${suite_headers} |
| 57 | Log To Console ********************* |
| 58 | Log To Console response = ${resp} |
| 59 | Log To Console body = ${resp.text} |
| 60 | Should Be Equal As Integers ${resp.status_code} 201 |
| 61 | |
| 62 | Get template |
| 63 | [Documentation] Gets from Definition |
| 64 | [Arguments] ${topic} |
| 65 | ${resp}= Get Request ${suite_multicloud_k8s_session} ${topic} headers=${suite_headers} |
| 66 | Log To Console ********************* |
| 67 | Log To Console response = ${resp} |
| 68 | Log To Console body = ${resp.text} |
| 69 | Should Be Equal As Integers ${resp.status_code} 200 |
| 70 | |
| 71 | Check k8splugin API Docker Container |
| 72 | [Documentation] Checks if k8splugin docker container is running |
| 73 | ${rc} ${output}= Run and Return RC and Output docker ps |
| 74 | Log To Console ********************* |
| 75 | Log To Console retrurn_code = ${rc} |
| 76 | Log To Console output = ${output} |
| 77 | Should Be Equal As Integers ${rc} 0 |
| 78 | Should Contain ${output} nexus3.onap.org:10001/onap/multicloud/k8s |