| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 1 | *** Settings *** | 
| Joy Onyerikwu | dbfe97d | 2019-03-11 19:44:56 -0500 | [diff] [blame] | 2 | Documentation    Verify that Redfish software inventory can be collected. | 
 | 3 |  | 
| George Keishing | 2db7bca | 2019-02-14 13:03:08 -0600 | [diff] [blame] | 4 | Resource         ../../lib/resource.robot | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 5 | Resource         ../../lib/bmc_redfish_resource.robot | 
| George Keishing | 3298d5c | 2019-02-12 06:59:25 -0600 | [diff] [blame] | 6 | Resource         ../../lib/openbmc_ffdc.robot | 
| Sushil Singh | 5bd5002 | 2021-06-03 07:11:59 -0500 | [diff] [blame] | 7 | Resource         ../../lib/redfish_code_update_utils.robot | 
| George Keishing | 40f7664 | 2019-07-01 02:09:33 -0500 | [diff] [blame] | 8 | Library          ../../lib/gen_robot_valid.py | 
| George Keishing | 3298d5c | 2019-02-12 06:59:25 -0600 | [diff] [blame] | 9 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 10 | Test Setup       Test Setup Execution | 
 | 11 | Test Teardown    Test Teardown Execution | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 12 |  | 
| Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 13 | Test Tags     Firmware_Inventory | 
| George Keishing | 504a371 | 2022-07-22 09:41:28 -0500 | [diff] [blame] | 14 |  | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 15 | *** Test Cases *** | 
 | 16 |  | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 17 | Verify Redfish Update Service Enabled | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 18 |     [Documentation]  Verify "ServiceEnabled" is enabled. | 
| George Keishing | 5236ec5 | 2022-01-31 12:07:58 -0600 | [diff] [blame] | 19 |     [Tags]  Verify_Redfish_Update_Service_Enabled | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 20 |  | 
 | 21 |     # Example: | 
 | 22 |     # "HttpPushUri": "/redfish/v1/UpdateService", | 
 | 23 |     # "Id": "UpdateService", | 
 | 24 |     # "Name": "Update Service", | 
 | 25 |     # "ServiceEnabled": true | 
 | 26 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 27 |     ${resp}=  Redfish.Get  /redfish/v1/UpdateService | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 28 |     Should Be Equal As Strings  ${resp.dict["ServiceEnabled"]}  ${True} | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 29 |  | 
 | 30 |  | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 31 | Verify Redfish Software Inventory Collection | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 32 |     [Documentation]  Verify software inventory collection member and object entries. | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 33 |     [Tags]  Verify_Redfish_Software_Inventory_Collection | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 34 |  | 
 | 35 |     # Example: | 
 | 36 |     # { | 
 | 37 |     #    "@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection", | 
 | 38 |     #    "Members": [ | 
 | 39 |     #      { | 
 | 40 |     #        "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/a3522998" | 
 | 41 |     #      }, | 
 | 42 |     #      { | 
 | 43 |     #        "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/a7c79f71" | 
 | 44 |     #      }, | 
 | 45 |     #      { | 
 | 46 |     #        "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/ace821ef" | 
 | 47 |     #      } | 
 | 48 |     #   ], | 
 | 49 |     #   "Members@odata.count": 3, | 
 | 50 |     #   "Name": "Software Inventory Collection" | 
 | 51 |     # } | 
 | 52 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 53 |     ${resp}=  Redfish.Get  /redfish/v1/UpdateService/FirmwareInventory | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 54 |  | 
 | 55 |     Should Be True  ${resp.dict["Members@odata.count"]} >= ${1} | 
 | 56 |     Length Should Be  ${resp.dict["Members"]}  ${resp.dict["Members@odata.count"]} | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 57 |  | 
 | 58 |  | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 59 | Redfish Software Inventory Status Check | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 60 |     [Documentation]  Get firmware inventory entries and do health check status. | 
| George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 61 |     [Tags]  Redfish_Software_Inventory_Status_Check | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 62 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 63 |     ${resp}=  Redfish.Get  /redfish/v1/UpdateService/FirmwareInventory | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 64 |  | 
 | 65 |     # Entries "Members@odata.count": 3, | 
 | 66 |     # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a3522998'} | 
 | 67 |     # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a7c79f71'} | 
 | 68 |     # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/ace821ef'} | 
 | 69 |  | 
| Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 70 |     FOR  ${entry}  IN RANGE  0  ${resp.dict["Members@odata.count"]} | 
 | 71 |       ${resp_resource}=  Redfish.Get  ${resp.dict["Members"][${entry}]["@odata.id"]} | 
| George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 72 |     # Example: | 
 | 73 |     # "Status": { | 
 | 74 |     #     "Health": "OK", | 
 | 75 |     #     "HealthRollup": "OK", | 
 | 76 |     #     "State": "Enabled" | 
 | 77 |     # }, | 
| Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 78 |       Should Be Equal As Strings  ${resp_resource.dict["Status"]["Health"]}  OK | 
 | 79 |       Should Be Equal As Strings  ${resp_resource.dict["Status"]["HealthRollup"]}  OK | 
 | 80 |       Should Be Equal As Strings  ${resp_resource.dict["Status"]["State"]}  Enabled | 
 | 81 |     END | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 82 |  | 
 | 83 |  | 
| Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 84 | Verify BMC Version Matches With FirmwareInventory | 
 | 85 |     [Documentation]  Verify BMC version from FirmwareInventory same as in manager. | 
 | 86 |     [Tags]  Verify_BMC_Version_Matches_With_FirmwareInventory | 
 | 87 |  | 
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 88 |     ${bmc_manager}=  Redfish.Get  /redfish/v1/Managers/${MANAGER_ID} | 
| Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 89 |     ${manager_bmc_version}=  Get BMC Version | 
 | 90 |     # Check for manager version and cat /etc/os-release. | 
 | 91 |     Should Be Equal As Strings | 
 | 92 |     ...  ${bmc_manager.dict["FirmwareVersion"]}  ${manager_bmc_version.strip('"')} | 
 | 93 |  | 
 | 94 |     ${resp}=  Redfish.Get  /redfish/v1/UpdateService/FirmwareInventory | 
 | 95 |  | 
 | 96 |     # Entries "Members@odata.count": 3, | 
 | 97 |     # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a3522998'} | 
 | 98 |     # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a7c79f71'} | 
 | 99 |     # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/ace821ef'} | 
 | 100 |  | 
 | 101 |     ${actual_count}=  Evaluate  ${resp.dict["Members@odata.count"]}-1 | 
| Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 102 |     FOR  ${entry}  IN RANGE  0  ${resp.dict["Members@odata.count"]} | 
 | 103 |       ${resp_resource}=  Redfish.Get  ${resp.dict["Members"][${entry}]["@odata.id"]} | 
| Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 104 |     # 3rd comparison of BMC version and verify FirmwareInventory bmc version. | 
 | 105 |     # Example: | 
 | 106 |     # "Version": 2.7.0-dev-19-g9b44ea7 | 
| Sridevi Ramesh | 6dcfc39 | 2025-05-06 11:09:43 -0500 | [diff] [blame] | 107 |       IF  '${resp_resource.dict["Version"]}' == '${manager_bmc_version.strip('"')}'  BREAK | 
 | 108 |       IF  '${entry}' == '${actual_count}'  Fail  BMC version not there in Firmware Inventory | 
| Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 109 |     END | 
| Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 110 |  | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 111 |  | 
| George Keishing | 40f7664 | 2019-07-01 02:09:33 -0500 | [diff] [blame] | 112 | Verify UpdateService Supports TransferProtocol TFTP | 
 | 113 |     [Documentation]  Verify update service supported values have TFTP protocol. | 
 | 114 |     [Tags]  Verify_UpdateService_Supports_TransferProtocol_TFTP | 
 | 115 |  | 
 | 116 |     # Example: | 
 | 117 |     #   "Actions": { | 
 | 118 |     #     "#UpdateService.SimpleUpdate": { | 
 | 119 |     #       "TransferProtocol@Redfish.AllowableValues": [ | 
 | 120 |     #         "TFTP" | 
 | 121 |     #       ], | 
 | 122 |     #       "target": "/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate" | 
 | 123 |     #     } | 
 | 124 |     #  }, | 
 | 125 |  | 
 | 126 |     ${allowable_values}=  Redfish.Get Attribute  /redfish/v1/UpdateService  Actions | 
 | 127 |  | 
| George Keishing | e4d4142 | 2019-12-12 11:17:03 -0600 | [diff] [blame] | 128 |     Valid Value | 
 | 129 |     ...  allowable_values["#UpdateService.SimpleUpdate"]["TransferProtocol@Redfish.AllowableValues"][0] | 
 | 130 |     ...  valid_values=['TFTP'] | 
 | 131 |     Valid Value  allowable_values["#UpdateService.SimpleUpdate"]["target"] | 
 | 132 |     ...  valid_values=['/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate'] | 
| George Keishing | 40f7664 | 2019-07-01 02:09:33 -0500 | [diff] [blame] | 133 |  | 
 | 134 |  | 
| Sushil Singh | 5bd5002 | 2021-06-03 07:11:59 -0500 | [diff] [blame] | 135 | Verify Redfish Software Hex ID | 
 | 136 |     [Documentation]  Verify BMC images have valid 8-digit hex IDs. | 
 | 137 |     [Tags]  Verify_Redfish_Software_Hex_ID | 
 | 138 |  | 
 | 139 |     ${sw_inv_dict}=  Get Software Inventory State | 
 | 140 |  | 
 | 141 |     FOR  ${id_key}  IN  @{sw_inv_dict} | 
 | 142 |       ${sw_inv}=  Get From Dictionary  ${sw_inv_dict}  ${id_key} | 
 | 143 |       Should Be Equal As Strings  ${id_key}  ${sw_inv['image_id']} | 
 | 144 |       Length Should Be  ${sw_inv['image_id']}  ${8} | 
 | 145 |       Should Match Regexp  ${sw_inv['image_id']}  [0-9a-f]* | 
 | 146 |     END | 
 | 147 |  | 
 | 148 |  | 
| Sushil Singh | 1d5bd9a | 2021-06-07 00:51:42 -0500 | [diff] [blame] | 149 | Verify Redfish FirmwareInventory Is Updateable | 
 | 150 |     [Documentation]  Verify the redfish firmware inventory path is updateable. | 
 | 151 |     [Tags]  Verify_Redfish_FirmwareInventory_Is_Updateable | 
 | 152 |  | 
 | 153 |     ${sw_member_list}=  Redfish_Utils.Get Member List  /redfish/v1/UpdateService/FirmwareInventory | 
 | 154 |  | 
 | 155 |     # sw_member_list: | 
 | 156 |     #   [0]:                            /redfish/v1/UpdateService/FirmwareInventory/98744d76 | 
 | 157 |     #   [1]:                            /redfish/v1/UpdateService/FirmwareInventory/9a8028ec | 
 | 158 |     #   [2]:                            /redfish/v1/UpdateService/FirmwareInventory/acc9e073 | 
 | 159 |  | 
 | 160 |     FOR  ${sw_member}  IN  @{sw_member_list} | 
 | 161 |       ${resp}=  Redfish.Get Attribute  ${sw_member}  Updateable | 
 | 162 |  | 
 | 163 |       # Example: | 
 | 164 |       # "Updateable": true, | 
 | 165 |  | 
 | 166 |       Should Be Equal As Strings  ${resp}  True | 
| Sushil Singh | 1d5bd9a | 2021-06-07 00:51:42 -0500 | [diff] [blame] | 167 |     END | 
 | 168 |  | 
 | 169 |  | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 170 | Check Redfish Functional Image Version Is Same | 
 | 171 |     [Documentation]  Verify functional image version is same as in Redfish managers. | 
 | 172 |     [Tags]  Check_Redfish_Functional_Image_Version_Is_Same | 
 | 173 |     [Template]  Verify Redfish Functional Image Version Is Same | 
| Sushil Singh | 5455100 | 2021-06-08 02:35:48 -0500 | [diff] [blame] | 174 |  | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 175 |     # image | 
 | 176 |     functional_image | 
 | 177 |     backup_image | 
| Sushil Singh | 5455100 | 2021-06-08 02:35:48 -0500 | [diff] [blame] | 178 |  | 
| Sushil Singh | 5455100 | 2021-06-08 02:35:48 -0500 | [diff] [blame] | 179 |  | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 180 | Check Redfish Backup Image Version Is Same | 
 | 181 |     [Documentation]  Switch to backup image and then verify functional image version | 
 | 182 |     ...  is same as in Redfish managers.. | 
 | 183 |     [Tags]  Check_Redfish_Backup_Image_Version_Is_Same | 
 | 184 |     [Template]  Verify Redfish Functional Image Version Is Same | 
| Sushil Singh | 5455100 | 2021-06-08 02:35:48 -0500 | [diff] [blame] | 185 |  | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 186 |     # image | 
 | 187 |     switch_backup_image | 
| Sushil Singh | 5455100 | 2021-06-08 02:35:48 -0500 | [diff] [blame] | 188 |  | 
 | 189 |  | 
| Sushil Singh | fcce0d3 | 2021-06-18 00:06:51 -0500 | [diff] [blame] | 190 | Verify Redfish Software Image And Firmware Inventory Are Same | 
 | 191 |     [Documentation]  Verify the firmware software inventory is same as software images of managers. | 
 | 192 |     [Tags]  Verify_Redfish_Software_Image_And_Firmware_Inventory_Are_Same | 
 | 193 |  | 
 | 194 |     # SoftwareImages | 
 | 195 |     # /redfish/v1/UpdateService/FirmwareInventory/632c5114 | 
 | 196 |     # /redfish/v1/UpdateService/FirmwareInventory/e702a011 | 
 | 197 |  | 
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 198 |     ${firmware_inv_path}=  Redfish.Get Properties  ${REDFISH_BASE_URI}Managers/${MANAGER_ID} | 
| Sushil Singh | fcce0d3 | 2021-06-18 00:06:51 -0500 | [diff] [blame] | 199 |     ${firmware_inv_path}=  Get From Dictionary  ${firmware_inv_path}  Links | 
 | 200 |     ${sw_image}=  Get From Dictionary  ${firmware_inv_path}  SoftwareImages | 
 | 201 |  | 
 | 202 |     ${sw_member_list}=  Redfish_Utils.Get Member List  /redfish/v1/UpdateService/FirmwareInventory | 
 | 203 |  | 
 | 204 |     FOR  ${sw_inv_path}  IN  @{sw_image} | 
 | 205 |       List Should Contain Value  ${sw_member_list}  ${sw_inv_path['@odata.id']} | 
 | 206 |     END | 
 | 207 |  | 
 | 208 |     ${num_records_sw_image}=  Get Length  ${sw_image} | 
 | 209 |     ${num_records_sw_inv}=  Get Length  ${sw_member_list} | 
 | 210 |     Should Be Equal  ${num_records_sw_image}  ${num_records_sw_inv} | 
 | 211 |  | 
 | 212 |  | 
| Sushil Singh | d8af36d | 2021-08-10 02:14:34 -0500 | [diff] [blame] | 213 | Check If Firmware Image Is Same In Firmware Inventory And Redfish Read Operation | 
 | 214 |     [Documentation]  Check the Redfish firmware inventory path is same as in | 
 | 215 |     ...  active software image of Redfish managers and firmware inventory of update service. | 
 | 216 |     [Tags]  Check_If_Firmware_Image_Is_Same_In_Firmware_Inventory_And_Redfish_Read_Operation | 
 | 217 |  | 
 | 218 |     Verify Active Software Image And Firmware Inventory Is Same | 
 | 219 |  | 
 | 220 |  | 
 | 221 | Check If Backup Firmware Image Is Same In Firmware Inventory And Redfish Read Operation | 
 | 222 |     [Documentation]  Check the Redfish backup image firmware inventory path is same as in | 
 | 223 |     ...  active software image of Redfish managers and firmware inventory of update service. | 
 | 224 |     [Tags]  Check_If_Backup_Firmware_Image_Is_Same_In_Firmware_Inventory_And_Redfish_Read_Operation | 
 | 225 |  | 
 | 226 |     Verify Active Software Image And Firmware Inventory Is Same | 
 | 227 |     Set Backup Firmware Image As Functional | 
 | 228 |     Verify Active Software Image And Firmware Inventory Is Same | 
 | 229 |     Set Backup Firmware Image As Functional | 
 | 230 |     Verify Active Software Image And Firmware Inventory Is Same | 
 | 231 |  | 
 | 232 |  | 
| George Keishing | 1b8865c | 2019-07-04 12:16:49 -0500 | [diff] [blame] | 233 | Verify Redfish BIOS Version | 
 | 234 |     [Documentation]  Get host firmware version from system inventory. | 
 | 235 |     [Tags]  Verify_Redfish_BIOS_Version | 
 | 236 |  | 
| Yi Hu | c32434a | 2024-01-11 17:33:10 -0800 | [diff] [blame] | 237 |     ${bios_version}=  Redfish.Get Attribute  /redfish/v1/Systems/${SYSTEM_ID}/  BiosVersion | 
| George Keishing | 1b8865c | 2019-07-04 12:16:49 -0500 | [diff] [blame] | 238 |     ${pnor_version}=  Get PNOR Version | 
 | 239 |     Should Be Equal  ${pnor_version}  ${bios_version} | 
 | 240 |  | 
 | 241 |  | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 242 | *** Keywords *** | 
 | 243 |  | 
 | 244 | Test Setup Execution | 
 | 245 |     [Documentation]  Do test case setup tasks. | 
 | 246 |  | 
 | 247 |     Redfish.Login | 
| Sushil Singh | f7a5aa3 | 2023-04-12 09:40:43 -0500 | [diff] [blame] | 248 |     Redfish Power Off  stack_mode=skip | 
| George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 249 |  | 
 | 250 |  | 
 | 251 | Test Teardown Execution | 
 | 252 |     [Documentation]  Do the post test teardown. | 
 | 253 |  | 
 | 254 |     FFDC On Test Case Fail | 
 | 255 |     Redfish.Logout | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 256 |  | 
 | 257 |  | 
 | 258 | Verify Firmware Version Same In Firmware Inventory And Managers | 
| Sushil Singh | d8af36d | 2021-08-10 02:14:34 -0500 | [diff] [blame] | 259 |     [Documentation]  Verify the Redfish firmware inventory path version is same as Redfish managers. | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 260 |  | 
 | 261 |     # User defined state for software objects. | 
 | 262 |     # Note: "Functional" term refers to firmware which system is currently booted with. | 
 | 263 |  | 
 | 264 |     # sw_inv_dict: | 
 | 265 |     #   [b9101858]: | 
 | 266 |     #     [image_type]:                 BMC update | 
 | 267 |     #     [image_id]:                   b9101858 | 
 | 268 |     #     [functional]:                 True | 
 | 269 |     #     [version]:                    2.8.0-dev-150-g04508dc9f | 
 | 270 |  | 
 | 271 |     ${sw_inv_list}=  Get Functional Firmware  BMC image | 
 | 272 |     ${sw_inv_dict}=  Get Non Functional Firmware  ${sw_inv_list}  True | 
 | 273 |  | 
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 274 |     # /redfish/v1/Managers/${MANAGER_ID} | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 275 |     # "FirmwareVersion": "2.8.0-dev-150-g04508dc9f" | 
 | 276 |  | 
 | 277 |     ${firmware_version}=  Redfish.Get Attribute | 
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 278 |     ...  ${REDFISH_BASE_URI}Managers/${MANAGER_ID}  FirmwareVersion | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 279 |  | 
 | 280 |     Should Be Equal  ${sw_inv_dict['version']}  ${firmware_version} | 
 | 281 |  | 
 | 282 |  | 
 | 283 | Verify Firmware Version Is Not Same In Firmware Inventory And Managers | 
| Sushil Singh | d8af36d | 2021-08-10 02:14:34 -0500 | [diff] [blame] | 284 |     [Documentation]  Verify the Redfish firmware inventory path version is not same as | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 285 |     ...  Redfish managers for backup image. | 
 | 286 |  | 
 | 287 |     # User defined state for software objects. | 
 | 288 |     # Note: "Functional" term refers to firmware which system is currently booted with. | 
 | 289 |  | 
 | 290 |     # sw_inv_dict: | 
 | 291 |     #   [b9101858]: | 
 | 292 |     #     [image_type]:                 BMC update | 
 | 293 |     #     [image_id]:                   b9101858 | 
 | 294 |     #     [functional]:                 True | 
 | 295 |     #     [version]:                    2.8.0-dev-150-g04508dc9f | 
 | 296 |  | 
 | 297 |     ${sw_inv_list}=  Get Functional Firmware  BMC image | 
 | 298 |     ${sw_inv_list}=  Get Non Functional Firmware List  ${sw_inv_list}  False | 
 | 299 |  | 
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 300 |     # /redfish/v1/Managers/${MANAGER_ID} | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 301 |     # "FirmwareVersion": "2.8.0-dev-150-g04508dc9f" | 
 | 302 |  | 
 | 303 |     ${firmware_version}=  Redfish.Get Attribute | 
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 304 |     ...  ${REDFISH_BASE_URI}Managers/${MANAGER_ID}  FirmwareVersion | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 305 |  | 
 | 306 |     FOR  ${sw_inv}  IN  @{sw_inv_list} | 
 | 307 |       Should Not Be Equal  ${sw_inv['version']}  ${firmware_version} | 
 | 308 |     END | 
 | 309 |  | 
 | 310 |  | 
 | 311 | Set Backup Firmware Image As Functional | 
 | 312 |     [Documentation]  Switch to the backup firmware image to make functional. | 
 | 313 |  | 
 | 314 |     ${state}=  Get Pre Reboot State | 
 | 315 |     Rprint Vars  state | 
 | 316 |  | 
 | 317 |     Switch Backup Firmware Image To Functional | 
 | 318 |     Wait For Reboot  start_boot_seconds=${state['epoch_seconds']} | 
 | 319 |  | 
 | 320 |  | 
 | 321 | Verify Redfish Functional Image Version Is Same | 
 | 322 |     [Documentation]  Verify the functional image version is same as in firmware inventory and managers. | 
 | 323 |     [Arguments]  ${image} | 
 | 324 |  | 
 | 325 |     # Description of argument(s): | 
| George Keishing | e16f158 | 2022-12-15 07:32:21 -0600 | [diff] [blame] | 326 |     # image           Functional Image or Backup Image | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 327 |  | 
 | 328 |     Verify Firmware Version Same In Firmware Inventory And Managers | 
 | 329 |  | 
| George Keishing | d1e0507 | 2025-05-12 19:57:26 +0530 | [diff] [blame] | 330 |     IF  'backup_image' == '${image}' | 
 | 331 |         Verify Firmware Version Is Not Same In Firmware Inventory And Managers | 
 | 332 |     END | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 333 |  | 
| George Keishing | d1e0507 | 2025-05-12 19:57:26 +0530 | [diff] [blame] | 334 |     IF  'switch_backup_image' == '${image}' | 
 | 335 |         Set Backup Firmware Image As Functional | 
 | 336 |         Verify Firmware Version Same In Firmware Inventory And Managers | 
 | 337 |         Set Backup Firmware Image As Functional | 
 | 338 |         Verify Firmware Version Same In Firmware Inventory And Managers | 
 | 339 |     END | 
| Sushil Singh | 50a1be9 | 2021-06-15 06:52:36 -0500 | [diff] [blame] | 340 |  | 
| Sushil Singh | d8af36d | 2021-08-10 02:14:34 -0500 | [diff] [blame] | 341 |  | 
 | 342 | Verify Active Software Image And Firmware Inventory Is Same | 
 | 343 |     [Documentation]  Verify Redfish firmware inventory path and active software image is same. | 
 | 344 |  | 
 | 345 |     # ActiveSoftwareImage | 
 | 346 |     # /redfish/v1/UpdateService/FirmwareInventory/632c5114 | 
 | 347 |  | 
 | 348 |     # Firmware Inventory | 
 | 349 |     # /redfish/v1/UpdateService/FirmwareInventory | 
 | 350 |     # /redfish/v1/UpdateService/FirmwareInventory/632c5114 | 
 | 351 |     # /redfish/v1/UpdateService/FirmwareInventory/632c5444 | 
 | 352 |  | 
| ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 353 |     ${firmware_inv_path}=  Redfish.Get Properties  ${REDFISH_BASE_URI}Managers/${MANAGER_ID} | 
| Sushil Singh | d8af36d | 2021-08-10 02:14:34 -0500 | [diff] [blame] | 354 |     ${firmware_inv_path}=  Get From Dictionary  ${firmware_inv_path}  Links | 
 | 355 |     ${active_sw_image}=  Get From Dictionary  ${firmware_inv_path}  ActiveSoftwareImage | 
 | 356 |     ${active_sw_image}=  Get From Dictionary  ${active_sw_image}  @odata.id | 
 | 357 |  | 
 | 358 |     ${sw_member_list}=  Redfish_Utils.Get Member List  /redfish/v1/UpdateService/FirmwareInventory | 
 | 359 |     List Should Contain Value  ${sw_member_list}  ${active_sw_image} |