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