George Keishing | eaa73b7 | 2018-07-30 09:30:16 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test Redfish interfaces supported. |
| 3 | |
George Keishing | 9cef109 | 2018-08-06 01:06:24 -0500 | [diff] [blame^] | 4 | Resource ../lib/redfish_client.robot |
| 5 | |
| 6 | Test Setup Test Setup Execution |
| 7 | Test Teardown Test Teardown Execution |
| 8 | |
George Keishing | eaa73b7 | 2018-07-30 09:30:16 -0500 | [diff] [blame] | 9 | |
| 10 | ** Test Cases ** |
| 11 | |
George Keishing | 9cef109 | 2018-08-06 01:06:24 -0500 | [diff] [blame^] | 12 | Test Get Redfish Session Id |
| 13 | [Documentation] Establish session to BMC and get session identifier. |
| 14 | [Tags] Test_Get_Redfish_Session_Id |
| 15 | |
| 16 | ${session_url} = |
| 17 | ... Catenate SEPARATOR= ${REDFISH_SESSION_URI} ${test_session_id} |
| 18 | ${resp} = Redfish Get Request |
| 19 | ... ${session_url} xauth_token=${test_auth_token} response_format=${0} |
| 20 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 21 | |
| 22 | |
| 23 | Test Get Redfish Response Codes |
George Keishing | eaa73b7 | 2018-07-30 09:30:16 -0500 | [diff] [blame] | 24 | [Documentation] Get Redfish response codes and validate them. |
George Keishing | 9cef109 | 2018-08-06 01:06:24 -0500 | [diff] [blame^] | 25 | [Tags] Test_Get_Redfish_Response_Codes |
George Keishing | eaa73b7 | 2018-07-30 09:30:16 -0500 | [diff] [blame] | 26 | [Template] Execute Get And Check Response |
| 27 | |
| 28 | # Expected status URL Path |
| 29 | ${HTTP_OK} Systems |
| 30 | ${HTTP_OK} Systems/motherboard |
| 31 | ${HTTP_OK} Chassis/system |
| 32 | ${HTTP_OK} Managers/openbmc/EthernetInterfaces/eth0 |
| 33 | ${HTTP_NOT_FOUND} /i/dont/exist/ |
| 34 | |
George Keishing | 9cef109 | 2018-08-06 01:06:24 -0500 | [diff] [blame^] | 35 | |
George Keishing | eaa73b7 | 2018-07-30 09:30:16 -0500 | [diff] [blame] | 36 | *** Keywords *** |
| 37 | |
| 38 | Execute Get And Check Response |
| 39 | [Documentation] Execute "GET" request and check for expected status. |
| 40 | [Arguments] ${expected_response_code} ${url_path} |
| 41 | # Description of argument(s): |
| 42 | # expected_response_code Expected REST status codes. |
| 43 | # url_path URL path. |
| 44 | |
George Keishing | 9cef109 | 2018-08-06 01:06:24 -0500 | [diff] [blame^] | 45 | ${resp} = Redfish Get Request |
| 46 | ... ${url_path} xauth_token=${test_auth_token} response_format=${0} |
George Keishing | eaa73b7 | 2018-07-30 09:30:16 -0500 | [diff] [blame] | 47 | Should Be Equal As Strings ${resp.status_code} ${expected_response_code} |
George Keishing | 9cef109 | 2018-08-06 01:06:24 -0500 | [diff] [blame^] | 48 | |
| 49 | |
| 50 | Test Setup Execution |
| 51 | [Documentation] Do the test setup. |
| 52 | |
| 53 | ${session_id} ${auth_token} = Redfish Login Request |
| 54 | Set Test Variable ${test_session_id} ${session_id} |
| 55 | Set Test Variable ${test_auth_token} ${auth_token} |
| 56 | |
| 57 | |
| 58 | Test Teardown Execution |
| 59 | [Documentation] Do the test teardown. |
| 60 | |
| 61 | Redfish Delete Request ${test_session_id} ${test_auth_token} |