blob: a88b84f7f5d3e8faea1317a3447b8505a05f1302 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** Settings ***
Mariusz Wagner73fcc392018-10-02 12:13:14 +02002Suite Setup Run keywords SMS Check SMS API Docker Container Created header Created session
Gary Wu9abb61c2018-09-27 10:38:50 -07003Library OperatingSystem
4Library RequestsLibrary
Gary Wu9abb61c2018-09-27 10:38:50 -07005
6*** Variables ***
Gary Wu9abb61c2018-09-27 10:38:50 -07007
8*** Test Cases ***
Mariusz Wagner73fcc392018-10-02 12:13:14 +02009Create Domain
10 [Template] Post template
11 /v1/sms/domain create_domain.json
12 /v1/sms/domain/curltestdomain/secret create_secret.json
13
14Get 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
20Delete from Domain
21 [Template] Delete template
22 /v1/sms/domain/curltestdomain/secret/curltestsecret1
23 /v1/sms/domain/curltestdomain
24
25*** Keywords ***
26Created session
27 Create Session aaf_sms_session ${SMS_HOSTNAME}:${SMS_PORT}
28 Set Suite Variable ${suite_aaf_sms_session} aaf_sms_session
29
30Created header
31 ${headers}= Create Dictionary Content-Type=application/json Accept=application/json
32 Set Suite Variable ${suite_headers} ${headers}
33
34Delete 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
43Post 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
53Get 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 Wu9abb61c2018-09-27 10:38:50 -070062SMS 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