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. |
| 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 | |
| 24 | Test 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 Keishing | 410b629 | 2016-07-05 10:40:16 -0500 | [diff] [blame] | 29 | Run Keyword And Expect Error ConnectionError* Get Request openbmc /list |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 30 | |
| 31 | Test 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 |