blob: 0f05d9d062ec0ab693b0c9bceb075fd144efba92 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2Documentation This testsuite is for testing SSL connection to OpenBMC
3Suite Teardown Delete All Sessions
4
5Resource ../../lib/rest_client.robot
6Resource ../../lib/resource.txt
7
Chris Austenb29d2e82016-06-07 12:25:35 -05008*** Test Cases ***
9Test SSL Connection
10 [Documentation] This testcase is for testing the SSL connection to the
11 ... OpenBMC machine.
12 Create Session openbmc https://${OPENBMC_HOST}/
13 ${headers}= Create Dictionary Content-Type=application/json
14 @{credentials} = Create List ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
15 ${data} = create dictionary data=@{credentials}
16 ${resp} = Post Request openbmc /login data=${data} headers=${headers}
17 ${resp}= Get Request openbmc /list
18 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
19 ${jsondata}= To Json ${resp.content}
20 Should Not Be Empty ${jsondata}
21
22Test non-SSL Connection to port 80
23 [Documentation] This testcase is for test to check OpenBMC machine
24 ... will not accepts the non-secure connection that is with http to
25 ... port 80 and expect a connection error
26 Create Session openbmc http://${OPENBMC_HOST}/ timeout=3
George Keishing410b6292016-07-05 10:40:16 -050027 Run Keyword And Expect Error ConnectionError* Get Request openbmc /list
Chris Austenb29d2e82016-06-07 12:25:35 -050028
29Test non-SSL Connection to port 443
30 [Documentation] This testcase is for test to check OpenBMC machine
31 ... will not accepts the non-secure connection that is with http to
32 ... port 443 and expect 400 in response
33 Create Session openbmc http://${OPENBMC_HOST}:443/
34 ${resp}= Get Request openbmc /list
35 Should Be Equal As Strings ${resp.status_code} ${HTTP_BAD_REQUEST}
36 Should Be Equal ${resp.content} Bad Request