blob: 8aef25e8a3ab161d17181acd14f35aeb17e167fb [file] [log] [blame]
George Keishing5a73ee02019-01-28 08:21:47 -06001*** Settings ***
George Keishing97c93942019-03-04 12:45:07 -06002
Sandhya Somashekar839a0c22019-01-31 05:05:43 -06003Resource ../../lib/resource.robot
George Keishing5a73ee02019-01-28 08:21:47 -06004Resource ../../lib/bmc_redfish_resource.robot
George Keishing3298d5c2019-02-12 06:59:25 -06005Resource ../../lib/openbmc_ffdc.robot
6
George Keishing97c93942019-03-04 12:45:07 -06007
George Keishing3298d5c2019-02-12 06:59:25 -06008Test Teardown FFDC On Test Case Fail
George Keishing97c93942019-03-04 12:45:07 -06009Test Setup Rprintn
George Keishing5a73ee02019-01-28 08:21:47 -060010
George Keishing5a73ee02019-01-28 08:21:47 -060011*** Test Cases ***
12
George Keishing5ee33d92019-02-02 12:33:25 -060013Redfish Login And Logout
George Keishing5a73ee02019-01-28 08:21:47 -060014 [Documentation] Login to BMCweb and then logout.
George Keishing5ee33d92019-02-02 12:33:25 -060015 [Tags] Redfish_Login_And_Logout
George Keishing5a73ee02019-01-28 08:21:47 -060016
George Keishing97c93942019-03-04 12:45:07 -060017 Redfish.Login
18 Redfish.Logout
George Keishing5a73ee02019-01-28 08:21:47 -060019
20
George Keishing5ee33d92019-02-02 12:33:25 -060021GET Redfish Hypermedia Without Login
George Keishing6510cfb2019-01-31 12:28:36 -060022 [Documentation] GET hypermedia URL without login.
George Keishing5ee33d92019-02-02 12:33:25 -060023 [Tags] GET_Redfish_Hypermedia_Without_Login
George Keishing6510cfb2019-01-31 12:28:36 -060024 [Template] GET And Verify Redfish Response
George Keishing5a73ee02019-01-28 08:21:47 -060025
George Keishing6510cfb2019-01-31 12:28:36 -060026 # Expect status Resource URL Path
27 ${HTTP_OK} /
28 ${HTTP_OK} /redfish
29 ${HTTP_OK} /redfish/v1
George Keishing5a73ee02019-01-28 08:21:47 -060030
31
George Keishing5ee33d92019-02-02 12:33:25 -060032GET Redfish SessionService Resource With Login
George Keishing5a73ee02019-01-28 08:21:47 -060033 [Documentation] Login to BMCweb and get /redfish/v1/SessionService.
George Keishing5ee33d92019-02-02 12:33:25 -060034 [Tags] GET_Redfish_SessionService_Resource_With_Login
George Keishing5a73ee02019-01-28 08:21:47 -060035
George Keishing97c93942019-03-04 12:45:07 -060036 Redfish.Login
37 ${resp}= Redfish.Get /redfish/v1/SessionService
38 Redfish.Logout
George Keishing5a73ee02019-01-28 08:21:47 -060039
40
George Keishing5ee33d92019-02-02 12:33:25 -060041GET Redfish SessionService Without Login
George Keishing5a73ee02019-01-28 08:21:47 -060042 [Documentation] Get /redfish/v1/SessionService without login
George Keishing5ee33d92019-02-02 12:33:25 -060043 [Tags] GET_Redfish_SessionService_Without_Login
George Keishing5a73ee02019-01-28 08:21:47 -060044
George Keishing97c93942019-03-04 12:45:07 -060045 ${resp}= Redfish.Get /redfish/v1/SessionService
46 ... valid_status_codes=[${HTTP_UNAUTHORIZED}]
George Keishing5a73ee02019-01-28 08:21:47 -060047
48
George Keishing5ee33d92019-02-02 12:33:25 -060049Redfish Login Using Invalid Token
George Keishing5a73ee02019-01-28 08:21:47 -060050 [Documentation] Login to BMCweb with invalid token.
George Keishing5ee33d92019-02-02 12:33:25 -060051 [Tags] Redfish_Login_Using_Invalid_Token
George Keishing5a73ee02019-01-28 08:21:47 -060052
George Keishing5a73ee02019-01-28 08:21:47 -060053 Create Session openbmc ${AUTH_URI}
54
55 # Example: "X-Auth-Token: 3la1JUf1vY4yN2dNOwun"
56 ${headers}= Create Dictionary Content-Type=application/json
57 ... X-Auth-Token=deadbeef
58
59 ${resp}= Get Request
60 ... openbmc /redfish/v1/SessionService/Sessions headers=${headers}
61
62 Should Be Equal As Strings ${resp.status_code} ${HTTP_UNAUTHORIZED}
63
64
George Keishing5ee33d92019-02-02 12:33:25 -060065Delete Redfish Session Using Valid login
George Keishing5a73ee02019-01-28 08:21:47 -060066 [Documentation] Delete a session using valid login.
George Keishing5ee33d92019-02-02 12:33:25 -060067 [Tags] Delete_Redfish_Session_Using_Valid_Login
George Keishing5a73ee02019-01-28 08:21:47 -060068
George Keishing97c93942019-03-04 12:45:07 -060069 Redfish.Login
70 Redfish.Login
George Keishing5a73ee02019-01-28 08:21:47 -060071
72 # Example o/p:
73 # [{'@odata.id': '/redfish/v1/SessionService/Sessions/bOol3WlCI8'},
74 # {'@odata.id': '/redfish/v1/SessionService/Sessions/Yu3xFqjZr1'}]
George Keishing97c93942019-03-04 12:45:07 -060075 ${resp_list}= Redfish_Utils.List Request
76 ... /redfish/v1/SessionService/Sessions
77 Redfish.Delete ${resp_list[1]}
George Keishing5a73ee02019-01-28 08:21:47 -060078
George Keishing97c93942019-03-04 12:45:07 -060079 ${resp}= Redfish_Utils.List Request /redfish/v1/SessionService/Sessions
George Keishing3a813a92019-02-01 20:34:47 -060080 List Should Not Contain Value ${resp} ${resp_list[1]}
George Keishing4db114c2019-02-02 07:22:17 -060081
George Keishing6510cfb2019-01-31 12:28:36 -060082
83*** Keywords ***
84
85GET And Verify Redfish Response
86 [Documentation] GET given resource and verfiy response.
George Keishing97c93942019-03-04 12:45:07 -060087 [Arguments] ${valid_status_codes} ${resource_path}
George Keishing6510cfb2019-01-31 12:28:36 -060088
George Keishing97c93942019-03-04 12:45:07 -060089 # Description of argument(s):
90 # valid_status_codes A comma-separated list of acceptable
91 # status codes (e.g. 200).
92 # resource_path Redfish resource URL path.
George Keishing6510cfb2019-01-31 12:28:36 -060093
George Keishing97c93942019-03-04 12:45:07 -060094 ${resp}= Redfish.Get ${resource_path}
95 ... valid_status_codes=[${valid_status_codes}]