blob: 78e3522294d46a634dfc00df26254ca73999f850 [file] [log] [blame]
Kiran Kaminenibe7fcd92018-03-27 11:23:37 -07001*** Settings ***
2Library OperatingSystem
3Library RequestsLibrary
4Library json
5
6*** Variables ***
7${MESSAGE} {"ping": "ok"}
8
9#global variables
Kiran Kaminenif4226d62018-09-18 13:00:07 -070010
Kiran Kaminenibe7fcd92018-03-27 11:23:37 -070011
12*** Test Cases ***
13SMS Check SMS API Docker Container
14 [Documentation] Checks if SMS docker container is running
15 ${rc} ${output}= Run and Return RC and Output docker ps
16 Log To Console *********************
17 Log To Console retrurn_code = ${rc}
18 Log To Console output = ${output}
19 Should Be Equal As Integers ${rc} 0
20 Should Contain ${output} nexus3.onap.org:10001/onap/aaf/sms
21
22SMS GetStatus
23 [Documentation] Gets Backend Status
24 Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
25 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
Kiran Kaminenia42f86e2018-04-17 11:58:21 -070026 ${resp}= Get Request SMS /v1/sms/quorum/status headers=${headers}
Kiran Kaminenibe7fcd92018-03-27 11:23:37 -070027 Log To Console *********************
28 Log To Console response = ${resp}
29 Log To Console body = ${resp.text}
30 Should Be Equal As Integers ${resp.status_code} 200
31
32SMS CreateDomain
33 [Documentation] Creates a Secret Domain to hold Secrets
34 Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
35 ${data} Get Binary File ${CURDIR}${/}data${/}create_domain.json
36 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
37 ${resp}= Post Request SMS /v1/sms/domain data=${data} headers=${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} 201
42
43SMS CreateSecret
44 [Documentation] Create A Secret within the Domain
45 Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
46 ${data} Get Binary File ${CURDIR}${/}data${/}create_secret.json
47 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
Kiran Kaminenif4226d62018-09-18 13:00:07 -070048 ${resp}= Post Request SMS /v1/sms/domain/curltestdomain/secret data=${data} headers=${headers}
Kiran Kaminenibe7fcd92018-03-27 11:23:37 -070049 Log To Console *********************
50 Log To Console response = ${resp}
51 Log To Console body = ${resp.text}
52 Should Be Equal As Integers ${resp.status_code} 201
53
54SMS ListSecret
55 [Documentation] Lists all Secret Names within Domain
56 Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
57 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
Kiran Kaminenif4226d62018-09-18 13:00:07 -070058 ${resp}= Get Request SMS /v1/sms/domain/curltestdomain/secret headers=${headers}
Kiran Kaminenibe7fcd92018-03-27 11:23:37 -070059 Log To Console *********************
60 Log To Console response = ${resp}
61 Log To Console body = ${resp.text}
62 Should Be Equal As Integers ${resp.status_code} 200
63
64SMS GetSecret
65 [Documentation] Gets a single Secret with Values from Domain
66 Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
67 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
Kiran Kaminenif4226d62018-09-18 13:00:07 -070068 ${resp}= Get Request SMS /v1/sms/domain/curltestdomain/secret/curltestsecret1 headers=${headers}
Kiran Kaminenibe7fcd92018-03-27 11:23:37 -070069 Log To Console *********************
70 Log To Console response = ${resp}
71 Log To Console body = ${resp.text}
72 Should Be Equal As Integers ${resp.status_code} 200
73
74SMS DeleteSecret
75 [Documentation] Deletes a Secret referenced by Name from Domain
76 Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
77 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
Kiran Kaminenif4226d62018-09-18 13:00:07 -070078 ${resp}= Delete Request SMS /v1/sms/domain/curltestdomain/secret/curltestsecret1 headers=${headers}
Kiran Kaminenibe7fcd92018-03-27 11:23:37 -070079 Log To Console *********************
80 Log To Console response = ${resp}
81 Log To Console body = ${resp.text}
82 Should Be Equal As Integers ${resp.status_code} 204
83
84SMS DeleteDomain
85 [Documentation] Deletes a Domain referenced by Name
86 Create Session SMS ${SMS_HOSTNAME}:${SMS_PORT}
87 &{headers}= Create Dictionary Content-Type=application/json Accept=application/json
Kiran Kaminenif4226d62018-09-18 13:00:07 -070088 ${resp}= Delete Request SMS /v1/sms/domain/curltestdomain headers=${headers}
Kiran Kaminenibe7fcd92018-03-27 11:23:37 -070089 Log To Console *********************
90 Log To Console response = ${resp}
91 Log To Console body = ${resp.text}
92 Should Be Equal As Integers ${resp.status_code} 204
93
94*** Keywords ***