Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
Mariusz Wagner | 73fcc39 | 2018-10-02 12:13:14 +0200 | [diff] [blame] | 2 | Suite Setup Run keywords SMS Check SMS API Docker Container Created header Created session |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 3 | Library OperatingSystem |
| 4 | Library RequestsLibrary |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 5 | |
| 6 | *** Variables *** |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 7 | |
| 8 | *** Test Cases *** |
Mariusz Wagner | 73fcc39 | 2018-10-02 12:13:14 +0200 | [diff] [blame] | 9 | Create Domain |
| 10 | [Template] Post template |
| 11 | /v1/sms/domain create_domain.json |
| 12 | /v1/sms/domain/curltestdomain/secret create_secret.json |
| 13 | |
| 14 | Get information from Domain |
| 15 | [Template] Get template |
| 16 | /v1/sms/quorum/status |
| 17 | /v1/sms/domain/curltestdomain/secret |
| 18 | /v1/sms/domain/curltestdomain/secret/curltestsecret1 |
| 19 | |
| 20 | Delete from Domain |
| 21 | [Template] Delete template |
| 22 | /v1/sms/domain/curltestdomain/secret/curltestsecret1 |
| 23 | /v1/sms/domain/curltestdomain |
| 24 | |
| 25 | *** Keywords *** |
| 26 | Created session |
| 27 | Create Session aaf_sms_session ${SMS_HOSTNAME}:${SMS_PORT} |
| 28 | Set Suite Variable ${suite_aaf_sms_session} aaf_sms_session |
| 29 | |
| 30 | Created header |
| 31 | ${headers}= Create Dictionary Content-Type=application/json Accept=application/json |
| 32 | Set Suite Variable ${suite_headers} ${headers} |
| 33 | |
| 34 | Delete template |
| 35 | [Documentation] Deletes from Domain |
| 36 | [Arguments] ${topic} |
| 37 | ${resp}= Delete Request ${suite_aaf_sms_session} ${topic} headers=${suite_headers} |
| 38 | Log To Console ********************* |
| 39 | Log To Console response = ${resp} |
| 40 | Log To Console body = ${resp.text} |
| 41 | Should Be Equal As Integers ${resp.status_code} 204 |
| 42 | |
| 43 | Post template |
| 44 | [Documentation] Create A Domain/Secret Names |
| 45 | [Arguments] ${topic} ${file} |
| 46 | ${data} Get Binary File ${CURDIR}${/}data${/}${file} |
| 47 | ${resp}= Post Request ${suite_aaf_sms_session} ${topic} data=${data} headers=${suite_headers} |
| 48 | Log To Console ********************* |
| 49 | Log To Console response = ${resp} |
| 50 | Log To Console body = ${resp.text} |
| 51 | Should Be Equal As Integers ${resp.status_code} 201 |
| 52 | |
| 53 | Get template |
| 54 | [Documentation] Gets from Domain |
| 55 | [Arguments] ${topic} |
| 56 | ${resp}= Get Request ${suite_aaf_sms_session} ${topic} 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} 200 |
| 61 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 62 | SMS Check SMS API Docker Container |
| 63 | [Documentation] Checks if SMS docker container is running |
| 64 | ${rc} ${output}= Run and Return RC and Output docker ps |
| 65 | Log To Console ********************* |
| 66 | Log To Console retrurn_code = ${rc} |
| 67 | Log To Console output = ${output} |
| 68 | Should Be Equal As Integers ${rc} 0 |
| 69 | Should Contain ${output} nexus3.onap.org:10001/onap/aaf/sms |