blob: 405105bd2ee811dcb4b7b92c065e48d878dc8ecf [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
Gunnar Millseac1af22016-11-14 15:30:09 -06008Test Teardown FFDC On Test Case Fail
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.
George Keishing97651c72016-10-04 00:44:15 -050014 [Tags] Test_SSL_Connection
Chris Austenb29d2e82016-06-07 12:25:35 -050015 Create Session openbmc https://${OPENBMC_HOST}/
16 ${headers}= Create Dictionary Content-Type=application/json
17 @{credentials} = Create List ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
18 ${data} = create dictionary data=@{credentials}
19 ${resp} = Post Request openbmc /login data=${data} headers=${headers}
20 ${resp}= Get Request openbmc /list
21 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
22 ${jsondata}= To Json ${resp.content}
23 Should Not Be Empty ${jsondata}
24
25Test non-SSL Connection to port 80
26 [Documentation] This testcase is for test to check OpenBMC machine
27 ... will not accepts the non-secure connection that is with http to
28 ... port 80 and expect a connection error
George Keishing97651c72016-10-04 00:44:15 -050029 [Tags] Test_non_SSL_Connection_to_port_80
Chris Austenb29d2e82016-06-07 12:25:35 -050030 Create Session openbmc http://${OPENBMC_HOST}/ timeout=3
George Keishing410b6292016-07-05 10:40:16 -050031 Run Keyword And Expect Error ConnectionError* Get Request openbmc /list
Chris Austenb29d2e82016-06-07 12:25:35 -050032
33Test non-SSL Connection to port 443
34 [Documentation] This testcase is for test to check OpenBMC machine
35 ... will not accepts the non-secure connection that is with http to
36 ... port 443 and expect 400 in response
George Keishingcac24c72016-09-23 04:44:19 -050037 [Tags] Test_non_SSL_Connection_to_port_443
Chris Austenb29d2e82016-06-07 12:25:35 -050038 Create Session openbmc http://${OPENBMC_HOST}:443/
39 ${resp}= Get Request openbmc /list
40 Should Be Equal As Strings ${resp.status_code} ${HTTP_BAD_REQUEST}
41 Should Be Equal ${resp.content} Bad Request