George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Resource ../../lib/resource.txt |
| 3 | Resource ../../lib/bmc_redfish_resource.robot |
| 4 | |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 5 | *** Test Cases *** |
| 6 | |
| 7 | Login And Logout BMCweb |
| 8 | [Documentation] Login to BMCweb and then logout. |
| 9 | [Tags] Login_And_Logout_BMCweb |
| 10 | |
| 11 | redfish.Login |
| 12 | redfish.Logout |
| 13 | |
| 14 | |
| 15 | GET BMCweb Hypermedia Without Login |
George Keishing | 6510cfb | 2019-01-31 12:28:36 -0600 | [diff] [blame] | 16 | [Documentation] GET hypermedia URL without login. |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 17 | [Tags] GET_BMCweb_Hypermedia_Without_Login |
George Keishing | 6510cfb | 2019-01-31 12:28:36 -0600 | [diff] [blame] | 18 | [Template] GET And Verify Redfish Response |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 19 | |
George Keishing | 6510cfb | 2019-01-31 12:28:36 -0600 | [diff] [blame] | 20 | # Expect status Resource URL Path |
| 21 | ${HTTP_OK} / |
| 22 | ${HTTP_OK} /redfish |
| 23 | ${HTTP_OK} /redfish/v1 |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 24 | |
| 25 | |
| 26 | GET SessionService Resource With Login |
| 27 | [Documentation] Login to BMCweb and get /redfish/v1/SessionService. |
| 28 | [Tags] GET_SessionService_Resource_With_Login |
| 29 | |
| 30 | redfish.Login |
George Keishing | 6510cfb | 2019-01-31 12:28:36 -0600 | [diff] [blame] | 31 | ${resp}= redfish.Get /redfish/v1/SessionService |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 32 | Should Be Equal As Strings ${resp.status} ${HTTP_OK} |
George Keishing | 3a813a9 | 2019-02-01 20:34:47 -0600 | [diff] [blame] | 33 | redfish.Logout |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 34 | |
| 35 | |
| 36 | GET SessionService Without Login |
| 37 | [Documentation] Get /redfish/v1/SessionService without login |
| 38 | [Tags] GET_SessionService_Without_Login |
| 39 | |
George Keishing | 6510cfb | 2019-01-31 12:28:36 -0600 | [diff] [blame] | 40 | ${resp}= redfish.Get /redfish/v1/SessionService |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 41 | Should Be Equal As Strings ${resp.status} ${HTTP_UNAUTHORIZED} |
| 42 | |
| 43 | |
| 44 | Login Using Invalid Token |
| 45 | [Documentation] Login to BMCweb with invalid token. |
| 46 | [Tags] Login_Using_Invalid_Token |
| 47 | |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 48 | Create Session openbmc ${AUTH_URI} |
| 49 | |
| 50 | # Example: "X-Auth-Token: 3la1JUf1vY4yN2dNOwun" |
| 51 | ${headers}= Create Dictionary Content-Type=application/json |
| 52 | ... X-Auth-Token=deadbeef |
| 53 | |
| 54 | ${resp}= Get Request |
| 55 | ... openbmc /redfish/v1/SessionService/Sessions headers=${headers} |
| 56 | |
| 57 | Should Be Equal As Strings ${resp.status_code} ${HTTP_UNAUTHORIZED} |
| 58 | |
| 59 | |
| 60 | Delete Session Using Valid login |
| 61 | [Documentation] Delete a session using valid login. |
| 62 | [Tags] Delete_Session_Using_Valid_Login |
| 63 | |
| 64 | redfish.Login |
| 65 | |
| 66 | # Example o/p: |
| 67 | # [{'@odata.id': '/redfish/v1/SessionService/Sessions/bOol3WlCI8'}, |
| 68 | # {'@odata.id': '/redfish/v1/SessionService/Sessions/Yu3xFqjZr1'}] |
George Keishing | 3a813a9 | 2019-02-01 20:34:47 -0600 | [diff] [blame] | 69 | ${resp_list}= redfish.List Request SessionService/Sessions |
George Keishing | 3a813a9 | 2019-02-01 20:34:47 -0600 | [diff] [blame] | 70 | redfish.Delete ${resp_list[1]} |
George Keishing | 5a73ee0 | 2019-01-28 08:21:47 -0600 | [diff] [blame] | 71 | |
George Keishing | 3a813a9 | 2019-02-01 20:34:47 -0600 | [diff] [blame] | 72 | ${resp}= redfish.List Request SessionService/Sessions |
| 73 | List Should Not Contain Value ${resp} ${resp_list[1]} |
George Keishing | 4db114c | 2019-02-02 07:22:17 -0600 | [diff] [blame] | 74 | |
George Keishing | 6510cfb | 2019-01-31 12:28:36 -0600 | [diff] [blame] | 75 | |
| 76 | *** Keywords *** |
| 77 | |
| 78 | GET And Verify Redfish Response |
| 79 | [Documentation] GET given resource and verfiy response. |
| 80 | [Arguments] ${expected_response_code} ${resource_path} |
| 81 | |
| 82 | # Description of arguments: |
| 83 | # expected_response_code Expected REST status codes. |
| 84 | # resource_path Redfish resource URL path. |
| 85 | |
| 86 | ${resp}= redfish.Get ${resource_path} |
| 87 | Should Be Equal As Strings ${resp.status} ${expected_response_code} |