blob: b15df1ea57f403d24d0dac3f9ea865ad7fd10f95 [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
George Keishingd55a4be2016-08-26 03:28:17 -05007Resource ../../lib/openbmc_ffdc.robot
8Test Teardown Log FFDC
Chris Austenb29d2e82016-06-07 12:25:35 -05009
Chris Austenb29d2e82016-06-07 12:25:35 -050010*** Test Cases ***
11Test SSL Connection
12 [Documentation] This testcase is for testing the SSL connection to the
13 ... OpenBMC machine.
14 Create Session openbmc https://${OPENBMC_HOST}/
15 ${headers}= Create Dictionary Content-Type=application/json
16 @{credentials} = Create List ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
17 ${data} = create dictionary data=@{credentials}
18 ${resp} = Post Request openbmc /login data=${data} headers=${headers}
19 ${resp}= Get Request openbmc /list
20 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
21 ${jsondata}= To Json ${resp.content}
22 Should Not Be Empty ${jsondata}
23
24Test non-SSL Connection to port 80
25 [Documentation] This testcase is for test to check OpenBMC machine
26 ... will not accepts the non-secure connection that is with http to
27 ... port 80 and expect a connection error
28 Create Session openbmc http://${OPENBMC_HOST}/ timeout=3
George Keishing410b6292016-07-05 10:40:16 -050029 Run Keyword And Expect Error ConnectionError* Get Request openbmc /list
Chris Austenb29d2e82016-06-07 12:25:35 -050030
31Test non-SSL Connection to port 443
32 [Documentation] This testcase is for test to check OpenBMC machine
33 ... will not accepts the non-secure connection that is with http to
34 ... port 443 and expect 400 in response
35 Create Session openbmc http://${OPENBMC_HOST}:443/
36 ${resp}= Get Request openbmc /list
37 Should Be Equal As Strings ${resp.status_code} ${HTTP_BAD_REQUEST}
38 Should Be Equal ${resp.content} Bad Request