1*** Settings ***
2Documentation    Verify that firmware update properties.
3
4Resource         ../../lib/resource.robot
5Resource         ../../lib/bmc_redfish_resource.robot
6Resource         ../../lib/openbmc_ffdc.robot
7
8Suite Setup      Redfish.Login
9Suite Teardown   Redfish.Logout
10Test Setup       Printn
11Test Teardown    FFDC On Test Case Fail
12
13*** Test Cases ***
14
15Verify Firmware Update ApplyTime Immediate
16    [Documentation]  Verify supported apply time "Immediate" property.
17    [Tags]  Verify_Firmware_Update_ApplyTime_Immediate
18
19    # Example:
20    # /xyz/openbmc_project/software/apply_time
21    # {
22    #   "data": {
23    #       "RequestedApplyTime": "xyz.openbmc_project.Software.ApplyTime.RequestedApplyTimes.Immediate"
24    #   },
25    #   "message": "200 OK",
26    #   "status": "ok"
27    # }
28
29    Redfish.Patch  ${REDFISH_BASE_URI}UpdateService  body={'ApplyTime' : 'Immediate'}
30
31    # TODO: Move to redfish when avialable.
32    ${apply_time}=  Read Attribute   ${SOFTWARE_VERSION_URI}apply_time  RequestedApplyTime
33    Rprint Vars  apply_time
34    Should Be Equal   ${apply_time}  xyz.openbmc_project.Software.ApplyTime.RequestedApplyTimes.Immediate
35
36
37Verify Firmware Update ApplyTime OnReset
38    [Documentation]  Verify supported apply time "OnReset" property.
39    [Tags]  Verify_Firmware_Update_ApplyTime_OnReset
40
41    # Example:
42    # /xyz/openbmc_project/software/apply_time
43    # {
44    #   "data": {
45    #       "RequestedApplyTime": "xyz.openbmc_project.Software.ApplyTime.RequestedApplyTimes.OnReset"
46    #   },
47    #   "message": "200 OK",
48    #   "status": "ok"
49    # }
50
51    Redfish.Patch  ${REDFISH_BASE_URI}UpdateService  body={'ApplyTime' : 'OnReset'}
52
53    # TODO: Move to redfish when avialable.
54    ${apply_time}=  Read Attribute   ${SOFTWARE_VERSION_URI}apply_time  RequestedApplyTime
55    Rprint Vars  apply_time
56    Should Be Equal   ${apply_time}  xyz.openbmc_project.Software.ApplyTime.RequestedApplyTimes.OnReset
57
58
59Verify Firmware Update ApplyTime Invalid
60    [Documentation]  Verify supported apply time returns error on invalid value.
61    [Tags]  Verify_Firmware_Update_ApplyTime_Invalid
62
63    Redfish.Patch  ${REDFISH_BASE_URI}UpdateService  body={'ApplyTime' : 'Invalid'}  valid_status_codes=[${HTTP_BAD_REQUEST}]
64