15a73ee0bSGeorge Keishing*** Settings *** 2*97c93945SGeorge Keishing 3839a0c27SSandhya SomashekarResource ../../lib/resource.robot 45a73ee0bSGeorge KeishingResource ../../lib/bmc_redfish_resource.robot 53298d5c3SGeorge KeishingResource ../../lib/openbmc_ffdc.robot 63298d5c3SGeorge Keishing 7*97c93945SGeorge Keishing 83298d5c3SGeorge KeishingTest Teardown FFDC On Test Case Fail 9*97c93945SGeorge KeishingTest Setup Rprintn 105a73ee0bSGeorge Keishing 115a73ee0bSGeorge Keishing*** Test Cases *** 125a73ee0bSGeorge Keishing 135ee33d93SGeorge KeishingRedfish Login And Logout 145a73ee0bSGeorge Keishing [Documentation] Login to BMCweb and then logout. 155ee33d93SGeorge Keishing [Tags] Redfish_Login_And_Logout 165a73ee0bSGeorge Keishing 17*97c93945SGeorge Keishing Redfish.Login 18*97c93945SGeorge Keishing Redfish.Logout 195a73ee0bSGeorge Keishing 205a73ee0bSGeorge Keishing 215ee33d93SGeorge KeishingGET Redfish Hypermedia Without Login 226510cfbeSGeorge Keishing [Documentation] GET hypermedia URL without login. 235ee33d93SGeorge Keishing [Tags] GET_Redfish_Hypermedia_Without_Login 246510cfbeSGeorge Keishing [Template] GET And Verify Redfish Response 255a73ee0bSGeorge Keishing 266510cfbeSGeorge Keishing # Expect status Resource URL Path 276510cfbeSGeorge Keishing ${HTTP_OK} / 286510cfbeSGeorge Keishing ${HTTP_OK} /redfish 296510cfbeSGeorge Keishing ${HTTP_OK} /redfish/v1 305a73ee0bSGeorge Keishing 315a73ee0bSGeorge Keishing 325ee33d93SGeorge KeishingGET Redfish SessionService Resource With Login 335a73ee0bSGeorge Keishing [Documentation] Login to BMCweb and get /redfish/v1/SessionService. 345ee33d93SGeorge Keishing [Tags] GET_Redfish_SessionService_Resource_With_Login 355a73ee0bSGeorge Keishing 36*97c93945SGeorge Keishing Redfish.Login 37*97c93945SGeorge Keishing ${resp}= Redfish.Get /redfish/v1/SessionService 38*97c93945SGeorge Keishing Redfish.Logout 395a73ee0bSGeorge Keishing 405a73ee0bSGeorge Keishing 415ee33d93SGeorge KeishingGET Redfish SessionService Without Login 425a73ee0bSGeorge Keishing [Documentation] Get /redfish/v1/SessionService without login 435ee33d93SGeorge Keishing [Tags] GET_Redfish_SessionService_Without_Login 445a73ee0bSGeorge Keishing 45*97c93945SGeorge Keishing ${resp}= Redfish.Get /redfish/v1/SessionService 46*97c93945SGeorge Keishing ... valid_status_codes=[${HTTP_UNAUTHORIZED}] 475a73ee0bSGeorge Keishing 485a73ee0bSGeorge Keishing 495ee33d93SGeorge KeishingRedfish Login Using Invalid Token 505a73ee0bSGeorge Keishing [Documentation] Login to BMCweb with invalid token. 515ee33d93SGeorge Keishing [Tags] Redfish_Login_Using_Invalid_Token 525a73ee0bSGeorge Keishing 535a73ee0bSGeorge Keishing Create Session openbmc ${AUTH_URI} 545a73ee0bSGeorge Keishing 555a73ee0bSGeorge Keishing # Example: "X-Auth-Token: 3la1JUf1vY4yN2dNOwun" 565a73ee0bSGeorge Keishing ${headers}= Create Dictionary Content-Type=application/json 575a73ee0bSGeorge Keishing ... X-Auth-Token=deadbeef 585a73ee0bSGeorge Keishing 595a73ee0bSGeorge Keishing ${resp}= Get Request 605a73ee0bSGeorge Keishing ... openbmc /redfish/v1/SessionService/Sessions headers=${headers} 615a73ee0bSGeorge Keishing 625a73ee0bSGeorge Keishing Should Be Equal As Strings ${resp.status_code} ${HTTP_UNAUTHORIZED} 635a73ee0bSGeorge Keishing 645a73ee0bSGeorge Keishing 655ee33d93SGeorge KeishingDelete Redfish Session Using Valid login 665a73ee0bSGeorge Keishing [Documentation] Delete a session using valid login. 675ee33d93SGeorge Keishing [Tags] Delete_Redfish_Session_Using_Valid_Login 685a73ee0bSGeorge Keishing 69*97c93945SGeorge Keishing Redfish.Login 70*97c93945SGeorge Keishing Redfish.Login 715a73ee0bSGeorge Keishing 725a73ee0bSGeorge Keishing # Example o/p: 735a73ee0bSGeorge Keishing # [{'@odata.id': '/redfish/v1/SessionService/Sessions/bOol3WlCI8'}, 745a73ee0bSGeorge Keishing # {'@odata.id': '/redfish/v1/SessionService/Sessions/Yu3xFqjZr1'}] 75*97c93945SGeorge Keishing ${resp_list}= Redfish_Utils.List Request 76*97c93945SGeorge Keishing ... /redfish/v1/SessionService/Sessions 77*97c93945SGeorge Keishing Redfish.Delete ${resp_list[1]} 785a73ee0bSGeorge Keishing 79*97c93945SGeorge Keishing ${resp}= Redfish_Utils.List Request /redfish/v1/SessionService/Sessions 803a813a97SGeorge Keishing List Should Not Contain Value ${resp} ${resp_list[1]} 814db114ccSGeorge Keishing 826510cfbeSGeorge Keishing 836510cfbeSGeorge Keishing*** Keywords *** 846510cfbeSGeorge Keishing 856510cfbeSGeorge KeishingGET And Verify Redfish Response 866510cfbeSGeorge Keishing [Documentation] GET given resource and verfiy response. 87*97c93945SGeorge Keishing [Arguments] ${valid_status_codes} ${resource_path} 886510cfbeSGeorge Keishing 89*97c93945SGeorge Keishing # Description of argument(s): 90*97c93945SGeorge Keishing # valid_status_codes A comma-separated list of acceptable 91*97c93945SGeorge Keishing # status codes (e.g. 200). 926510cfbeSGeorge Keishing # resource_path Redfish resource URL path. 936510cfbeSGeorge Keishing 94*97c93945SGeorge Keishing ${resp}= Redfish.Get ${resource_path} 95*97c93945SGeorge Keishing ... valid_status_codes=[${valid_status_codes}] 96