blob: 36d4e668c228290d164bee4e0aad5553a9d781d6 [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
15 /v1/rb/definition
16 /v1/rb/definition/7eb09e38-4363-9942-1234-3beb2e95fd85
17
18Delete Definition
19 [Template] Delete template
20 /v1/rb/definition/7eb09e38-4363-9942-1234-3beb2e95fd85
21
22*** Keywords ***
23Created session
24 Create Session multicloud_k8s_session http://${SERVICE_IP}:${SERVICE_PORT}
25 Set Suite Variable ${suite_multicloud_k8s_session} multicloud_k8s_session
26
27Created header
28 ${headers}= Create Dictionary Content-Type=application/json Accept=application/json
29 Set Suite Variable ${suite_headers} ${headers}
30
31Delete template
32 [Documentation] Deletes from Definition
33 [Arguments] ${topic}
34 ${resp}= Delete Request ${suite_multicloud_k8s_session} ${topic} headers=${suite_headers}
35 Log To Console *********************
36 Log To Console response = ${resp}
37 Log To Console body = ${resp.text}
38 Should Be Equal As Integers ${resp.status_code} 204
39
40Post template
41 [Documentation] Create A Definition
42 [Arguments] ${topic} ${file}
43 ${data} Get Binary File ${CURDIR}${/}data${/}${file}
44 ${resp}= Post Request ${suite_multicloud_k8s_session} ${topic} data=${data} headers=${suite_headers}
45 Log To Console *********************
46 Log To Console response = ${resp}
47 Log To Console body = ${resp.text}
48 Should Be Equal As Integers ${resp.status_code} 201
49
50Get template
51 [Documentation] Gets from Definition
52 [Arguments] ${topic}
53 ${resp}= Get Request ${suite_multicloud_k8s_session} ${topic} headers=${suite_headers}
54 Log To Console *********************
55 Log To Console response = ${resp}
56 Log To Console body = ${resp.text}
57 Should Be Equal As Integers ${resp.status_code} 200
58
59Check k8splugin API Docker Container
60 [Documentation] Checks if k8splugin docker container is running
61 ${rc} ${output}= Run and Return RC and Output docker ps
62 Log To Console *********************
63 Log To Console retrurn_code = ${rc}
64 Log To Console output = ${output}
65 Should Be Equal As Integers ${rc} 0
66 Should Contain ${output} nexus3.onap.org:10001/onap/multicloud/k8s