blob: b9b9a260332da5dbf884a56b302316fb6b2b8785 [file] [log] [blame]
George Keishing5a73ee02019-01-28 08:21:47 -06001*** Settings ***
2Resource ../../lib/resource.txt
3Resource ../../lib/bmc_redfish_resource.robot
George Keishing3298d5c2019-02-12 06:59:25 -06004Resource ../../lib/openbmc_ffdc.robot
5
6Test Teardown FFDC On Test Case Fail
George Keishing5a73ee02019-01-28 08:21:47 -06007
George Keishing5a73ee02019-01-28 08:21:47 -06008*** Test Cases ***
9
George Keishing5ee33d92019-02-02 12:33:25 -060010Redfish Login And Logout
George Keishing5a73ee02019-01-28 08:21:47 -060011 [Documentation] Login to BMCweb and then logout.
George Keishing5ee33d92019-02-02 12:33:25 -060012 [Tags] Redfish_Login_And_Logout
George Keishing5a73ee02019-01-28 08:21:47 -060013
14 redfish.Login
15 redfish.Logout
16
17
George Keishing5ee33d92019-02-02 12:33:25 -060018GET Redfish Hypermedia Without Login
George Keishing6510cfb2019-01-31 12:28:36 -060019 [Documentation] GET hypermedia URL without login.
George Keishing5ee33d92019-02-02 12:33:25 -060020 [Tags] GET_Redfish_Hypermedia_Without_Login
George Keishing6510cfb2019-01-31 12:28:36 -060021 [Template] GET And Verify Redfish Response
George Keishing5a73ee02019-01-28 08:21:47 -060022
George Keishing6510cfb2019-01-31 12:28:36 -060023 # Expect status Resource URL Path
24 ${HTTP_OK} /
25 ${HTTP_OK} /redfish
26 ${HTTP_OK} /redfish/v1
George Keishing5a73ee02019-01-28 08:21:47 -060027
28
George Keishing5ee33d92019-02-02 12:33:25 -060029GET Redfish SessionService Resource With Login
George Keishing5a73ee02019-01-28 08:21:47 -060030 [Documentation] Login to BMCweb and get /redfish/v1/SessionService.
George Keishing5ee33d92019-02-02 12:33:25 -060031 [Tags] GET_Redfish_SessionService_Resource_With_Login
George Keishing5a73ee02019-01-28 08:21:47 -060032
33 redfish.Login
George Keishing6510cfb2019-01-31 12:28:36 -060034 ${resp}= redfish.Get /redfish/v1/SessionService
George Keishing5a73ee02019-01-28 08:21:47 -060035 Should Be Equal As Strings ${resp.status} ${HTTP_OK}
George Keishing3a813a92019-02-01 20:34:47 -060036 redfish.Logout
George Keishing5a73ee02019-01-28 08:21:47 -060037
38
George Keishing5ee33d92019-02-02 12:33:25 -060039GET Redfish SessionService Without Login
George Keishing5a73ee02019-01-28 08:21:47 -060040 [Documentation] Get /redfish/v1/SessionService without login
George Keishing5ee33d92019-02-02 12:33:25 -060041 [Tags] GET_Redfish_SessionService_Without_Login
George Keishing5a73ee02019-01-28 08:21:47 -060042
George Keishing6510cfb2019-01-31 12:28:36 -060043 ${resp}= redfish.Get /redfish/v1/SessionService
George Keishing5a73ee02019-01-28 08:21:47 -060044 Should Be Equal As Strings ${resp.status} ${HTTP_UNAUTHORIZED}
45
46
George Keishing5ee33d92019-02-02 12:33:25 -060047Redfish Login Using Invalid Token
George Keishing5a73ee02019-01-28 08:21:47 -060048 [Documentation] Login to BMCweb with invalid token.
George Keishing5ee33d92019-02-02 12:33:25 -060049 [Tags] Redfish_Login_Using_Invalid_Token
George Keishing5a73ee02019-01-28 08:21:47 -060050
George Keishing5a73ee02019-01-28 08:21:47 -060051 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 Keishing5ee33d92019-02-02 12:33:25 -060063Delete Redfish Session Using Valid login
George Keishing5a73ee02019-01-28 08:21:47 -060064 [Documentation] Delete a session using valid login.
George Keishing5ee33d92019-02-02 12:33:25 -060065 [Tags] Delete_Redfish_Session_Using_Valid_Login
George Keishing5a73ee02019-01-28 08:21:47 -060066
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 Keishing77695672019-02-12 13:13:52 -060072 ${resp_list}= redfish.List Request /redfish/v1/SessionService/Sessions
George Keishing3a813a92019-02-01 20:34:47 -060073 redfish.Delete ${resp_list[1]}
George Keishing5a73ee02019-01-28 08:21:47 -060074
George Keishing77695672019-02-12 13:13:52 -060075 ${resp}= redfish.List Request /redfish/v1/SessionService/Sessions
George Keishing3a813a92019-02-01 20:34:47 -060076 List Should Not Contain Value ${resp} ${resp_list[1]}
George Keishing4db114c2019-02-02 07:22:17 -060077
George Keishing6510cfb2019-01-31 12:28:36 -060078
79*** Keywords ***
80
81GET 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}