153670795SGeorge Keishing*** Settings ***
253670795SGeorge KeishingDocumentation    Verify that firmware update properties.
353670795SGeorge Keishing
453670795SGeorge KeishingResource         ../../lib/resource.robot
553670795SGeorge KeishingResource         ../../lib/bmc_redfish_resource.robot
653670795SGeorge KeishingResource         ../../lib/openbmc_ffdc.robot
799ffe43eSGeorge KeishingLibrary          ../../lib/gen_robot_valid.py
853670795SGeorge Keishing
953670795SGeorge KeishingSuite Setup      Redfish.Login
1053670795SGeorge KeishingSuite Teardown   Redfish.Logout
1153670795SGeorge KeishingTest Setup       Printn
1253670795SGeorge KeishingTest Teardown    FFDC On Test Case Fail
1353670795SGeorge Keishing
14*6fb70d98SMatt FischerTest Tags    Firmware_Property
15504a371eSGeorge Keishing
1653670795SGeorge Keishing*** Test Cases ***
1753670795SGeorge Keishing
1853670795SGeorge KeishingVerify Firmware Update ApplyTime Immediate
1953670795SGeorge Keishing    [Documentation]  Verify supported apply time "Immediate" property.
2053670795SGeorge Keishing    [Tags]  Verify_Firmware_Update_ApplyTime_Immediate
2153670795SGeorge Keishing
2253670795SGeorge Keishing    # Example:
2399ffe43eSGeorge Keishing    # /redfish/v1/UpdateService
2499ffe43eSGeorge Keishing    # "HttpPushUriOptions": {
2599ffe43eSGeorge Keishing    #    "HttpPushUriApplyTime": {
2699ffe43eSGeorge Keishing    #        "ApplyTime": "Immediate"
2799ffe43eSGeorge Keishing    #    }
2853670795SGeorge Keishing    # }
2953670795SGeorge Keishing
3099ffe43eSGeorge Keishing    Redfish.Patch  ${REDFISH_BASE_URI}UpdateService
3199ffe43eSGeorge Keishing    ...  body={'HttpPushUriOptions' : {'HttpPushUriApplyTime' : {'ApplyTime' : 'Immediate'}}}
3253670795SGeorge Keishing
3399ffe43eSGeorge Keishing    ${http_push_uri_options}=  Redfish.Get Attribute  ${REDFISH_BASE_URI}UpdateService  HttpPushUriOptions
3499ffe43eSGeorge Keishing    Rprint Vars  http_push_uri_options
3599ffe43eSGeorge Keishing    Valid Value  http_push_uri_options["HttpPushUriApplyTime"]["ApplyTime"]  ['Immediate']
3653670795SGeorge Keishing
3753670795SGeorge Keishing
3853670795SGeorge KeishingVerify Firmware Update ApplyTime OnReset
3953670795SGeorge Keishing    [Documentation]  Verify supported apply time "OnReset" property.
4053670795SGeorge Keishing    [Tags]  Verify_Firmware_Update_ApplyTime_OnReset
4153670795SGeorge Keishing
4253670795SGeorge Keishing    # Example:
4399ffe43eSGeorge Keishing    # /redfish/v1/UpdateService
4499ffe43eSGeorge Keishing    # "HttpPushUriOptions": {
4599ffe43eSGeorge Keishing    #    "HttpPushUriApplyTime": {
4699ffe43eSGeorge Keishing    #        "ApplyTime": "OnReset"
4799ffe43eSGeorge Keishing    #    }
4853670795SGeorge Keishing    # }
4953670795SGeorge Keishing
5099ffe43eSGeorge Keishing    Redfish.Patch  ${REDFISH_BASE_URI}UpdateService
5199ffe43eSGeorge Keishing    ...  body={'HttpPushUriOptions' : {'HttpPushUriApplyTime' : {'ApplyTime' : 'OnReset'}}}
5253670795SGeorge Keishing
5399ffe43eSGeorge Keishing    ${http_push_uri_options}=  Redfish.Get Attribute  ${REDFISH_BASE_URI}UpdateService  HttpPushUriOptions
5499ffe43eSGeorge Keishing    Rprint Vars  http_push_uri_options
5599ffe43eSGeorge Keishing    Valid Value  http_push_uri_options["HttpPushUriApplyTime"]["ApplyTime"]  ['OnReset']
5653670795SGeorge Keishing
5753670795SGeorge Keishing
5853670795SGeorge KeishingVerify Firmware Update ApplyTime Invalid
5953670795SGeorge Keishing    [Documentation]  Verify supported apply time returns error on invalid value.
6053670795SGeorge Keishing    [Tags]  Verify_Firmware_Update_ApplyTime_Invalid
6153670795SGeorge Keishing
6299ffe43eSGeorge Keishing    Redfish.Patch  ${REDFISH_BASE_URI}UpdateService
6399ffe43eSGeorge Keishing    ...  body={'HttpPushUriOptions' : {'HttpPushUriApplyTime' : {'ApplyTime' : 'Invalid'}}}
6499ffe43eSGeorge Keishing    ...  valid_status_codes=[${HTTP_BAD_REQUEST}]
65