Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This testsuite is for testing SSL connection to OpenBMC |
| 3 | Suite Teardown Delete All Sessions |
| 4 | |
| 5 | Resource ../../lib/rest_client.robot |
| 6 | Resource ../../lib/resource.txt |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 7 | Resource ../../lib/openbmc_ffdc.robot |
| 8 | Test Teardown Log FFDC |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 10 | *** Test Cases *** |
| 11 | Test SSL Connection |
| 12 | [Documentation] This testcase is for testing the SSL connection to the |
| 13 | ... OpenBMC machine. |
George Keishing | 97651c7 | 2016-10-04 00:44:15 -0500 | [diff] [blame] | 14 | [Tags] Test_SSL_Connection |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 15 | 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 | |
| 25 | Test 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 Keishing | 97651c7 | 2016-10-04 00:44:15 -0500 | [diff] [blame] | 29 | [Tags] Test_non_SSL_Connection_to_port_80 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 30 | Create Session openbmc http://${OPENBMC_HOST}/ timeout=3 |
George Keishing | 410b629 | 2016-07-05 10:40:16 -0500 | [diff] [blame] | 31 | Run Keyword And Expect Error ConnectionError* Get Request openbmc /list |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 32 | |
| 33 | Test 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 Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 37 | [Tags] Test_non_SSL_Connection_to_port_443 |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 38 | 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 |