blob: f81ef01112a9c170e0e907043aa3b2850e52a1b3 [file] [log] [blame]
Kiran Kamineniac3438c2019-03-13 12:24:23 -07001*** Settings ***
2Suite Setup Run keywords Check k8splugin API Docker Container Created header Created session
3Library OperatingSystem
4Library RequestsLibrary
5
6*** Variables ***
7
8*** Test Cases ***
9Create Definition
10 [Template] Post template
11 /v1/rb/definition create_rbdefinition.json
12
13Get Definition
14 [Template] Get template
Kiran Kamineni3875fc22019-04-02 10:46:55 -070015 /v1/rb/definition/test-rbdef
16 /v1/rb/definition/test-rbdef/v1
Kiran Kamineniac3438c2019-03-13 12:24:23 -070017
Kiran Kaminenid3564322019-04-02 11:14:30 -070018Create Profile
19 [Template] Post template
20 /v1/rb/definition/test-rbdef/v1/profile create_rbprofile.json
21
22Get Profile
23 [Template] Get template
24 /v1/rb/definition/test-rbdef/v1/profile/profile1
25
26Delete Profile
27 [Template] Delete template
28 /v1/rb/definition/test-rbdef/v1/profile/profile1
29
Kiran Kamineniac3438c2019-03-13 12:24:23 -070030Delete Definition
31 [Template] Delete template
Kiran Kamineni3875fc22019-04-02 10:46:55 -070032 /v1/rb/definition/test-rbdef/v1
Kiran Kamineniac3438c2019-03-13 12:24:23 -070033
34*** Keywords ***
35Created session
36 Create Session multicloud_k8s_session http://${SERVICE_IP}:${SERVICE_PORT}
37 Set Suite Variable ${suite_multicloud_k8s_session} multicloud_k8s_session
38
39Created header
40 ${headers}= Create Dictionary Content-Type=application/json Accept=application/json
41 Set Suite Variable ${suite_headers} ${headers}
42
43Delete 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
52Post 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
62Get 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
71Check 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