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