blob: 999c6baf893d46231c6495b3f947c78406096006 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** Settings ***
2Library OperatingSystem
3Library RequestsLibrary
4Library HttpLibrary.HTTP
5Library Collections
6Library String
7
8*** Variables ***
9${MESSAGE} Hello, world!
10${DBC_URI} /webapi
11
12*** Test Cases ***
13String Equality Test
14 Should Be Equal ${MESSAGE} Hello, world!
15
16Dir Test
17 [Documentation] Check if /tmp exists
18 Log ${MESSAGE}
19 CheckDir /tmp
20
21Url Test
22 [Documentation] Check if www.onap.org can be reached
23 Create Session openo http://www.onap.org
24 CheckUrl openo / 200
25
26HTTPS Heartbeat Test
27 [Documentation] Check ${DBC_URI}/info SSL endpoint
28 Create Session heartbeat https://${DMAAPBC_IP}:8443
29 CheckUrl heartbeat ${DBC_URI}/info 204
30
31HTTPS Dmaap Init Test
32 [Documentation] Check ${DBC_URI}/dmaap SSL endpoint
33 Create Session heartbeat https://${DMAAPBC_IP}:8443
34 CheckStatus heartbeat ${DBC_URI}/dmaap "VALID"
35
36HTTPS Dmaap dcaeLocations Test
37 [Documentation] Check ${DBC_URI}/dcaeLocations SSL endpoint
38 Create Session heartbeat https://${DMAAPBC_IP}:8443
39 CheckStatus0 heartbeat ${DBC_URI}/dcaeLocations "VALID"
40
41HTTPS Dmaap mr_clusters Test
42 [Documentation] Check ${DBC_URI}/mr_clusters SSL endpoint
43 Create Session heartbeat https://${DMAAPBC_IP}:8443
44 CheckStatus0 heartbeat ${DBC_URI}/mr_clusters "VALID"
45
46
47*** Keywords ***
48CheckDir
49 [Arguments] ${path}
50 Directory Should Exist ${path}
51
52CheckUrl
53 [Arguments] ${session} ${path} ${expect}
54 ${resp}= Get Request ${session} ${path}
55 Should Be Equal As Integers ${resp.status_code} ${expect}
56
57CheckStatus
58 [Arguments] ${session} ${path} ${expect}
59 ${resp}= Get Request ${session} ${path}
60 log ${resp.content}
61 ${val}= Get Json value ${resp.content} /status
62 log ${val}
63 should be equal as strings ${val} ${expect}
64
65CheckStatus0
66 [Arguments] ${session} ${path} ${expect}
67 ${resp}= Get Request ${session} ${path}
68 log ${resp.json()}
69 log ${resp.content}
70# silliness to strip off the brackets returned for a List to get a Dict
71 ${t1}= Remove String ${resp.content} [
72 ${dict}= Remove String ${t1} ]
73 log ${dict}
74 ${val}= Get Json value ${dict} /status
75 log ${val}
76 should be equal as strings ${val} ${expect}
77