blob: b8ea79f0457dda8df6e2369c813f4a7c5cb33189 [file] [log] [blame]
George Keishingeaa73b72018-07-30 09:30:16 -05001*** Settings ***
2Documentation Test Redfish interfaces supported.
3
George Keishing9cef1092018-08-06 01:06:24 -05004Resource ../lib/redfish_client.robot
5
6Test Setup Test Setup Execution
7Test Teardown Test Teardown Execution
8
George Keishingeaa73b72018-07-30 09:30:16 -05009
10** Test Cases **
11
George Keishing9cef1092018-08-06 01:06:24 -050012Test 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
23Test Get Redfish Response Codes
George Keishingeaa73b72018-07-30 09:30:16 -050024 [Documentation] Get Redfish response codes and validate them.
George Keishing9cef1092018-08-06 01:06:24 -050025 [Tags] Test_Get_Redfish_Response_Codes
George Keishingeaa73b72018-07-30 09:30:16 -050026 [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 Keishing9cef1092018-08-06 01:06:24 -050035
George Keishingeaa73b72018-07-30 09:30:16 -050036*** Keywords ***
37
38Execute 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 Keishing9cef1092018-08-06 01:06:24 -050045 ${resp} = Redfish Get Request
46 ... ${url_path} xauth_token=${test_auth_token} response_format=${0}
George Keishingeaa73b72018-07-30 09:30:16 -050047 Should Be Equal As Strings ${resp.status_code} ${expected_response_code}
George Keishing9cef1092018-08-06 01:06:24 -050048
49
50Test 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
58Test Teardown Execution
59 [Documentation] Do the test teardown.
60
61 Redfish Delete Request ${test_session_id} ${test_auth_token}