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 |
George Keishing | 40f7664 | 2019-07-01 02:09:33 -0500 | [diff] [blame] | 7 | Library ../../lib/gen_robot_valid.py |
George Keishing | 3298d5c | 2019-02-12 06:59:25 -0600 | [diff] [blame] | 8 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 9 | Test Setup Test Setup Execution |
| 10 | Test Teardown Test Teardown Execution |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 11 | |
| 12 | *** Test Cases *** |
| 13 | |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 14 | Verify Redfish Update Service Enabled |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 15 | [Documentation] Verify "ServiceEnabled" is enabled. |
| 16 | [Tags] Verify_Update_Service_Enabled |
| 17 | |
| 18 | # Example: |
| 19 | # "HttpPushUri": "/redfish/v1/UpdateService", |
| 20 | # "Id": "UpdateService", |
| 21 | # "Name": "Update Service", |
| 22 | # "ServiceEnabled": true |
| 23 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 24 | ${resp}= Redfish.Get /redfish/v1/UpdateService |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 25 | Should Be Equal As Strings ${resp.dict["ServiceEnabled"]} ${True} |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 26 | |
| 27 | |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 28 | Verify Redfish Software Inventory Collection |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 29 | [Documentation] Verify software inventory collection member and object entries. |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 30 | [Tags] Verify_Redfish_Software_Inventory_Collection |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 31 | |
| 32 | # Example: |
| 33 | # { |
| 34 | # "@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection", |
| 35 | # "Members": [ |
| 36 | # { |
| 37 | # "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/a3522998" |
| 38 | # }, |
| 39 | # { |
| 40 | # "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/a7c79f71" |
| 41 | # }, |
| 42 | # { |
| 43 | # "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/ace821ef" |
| 44 | # } |
| 45 | # ], |
| 46 | # "Members@odata.count": 3, |
| 47 | # "Name": "Software Inventory Collection" |
| 48 | # } |
| 49 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 50 | ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 51 | |
| 52 | Should Be True ${resp.dict["Members@odata.count"]} >= ${1} |
| 53 | Length Should Be ${resp.dict["Members"]} ${resp.dict["Members@odata.count"]} |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 54 | |
| 55 | |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 56 | Redfish Software Inventory Status Check |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 57 | [Documentation] Get firmware inventory entries and do health check status. |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 58 | [Tags] Redfish_Software_Inventory_Status_Check |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 59 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 60 | ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 61 | |
| 62 | # Entries "Members@odata.count": 3, |
| 63 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a3522998'} |
| 64 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a7c79f71'} |
| 65 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/ace821ef'} |
| 66 | |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 67 | FOR ${entry} IN RANGE 0 ${resp.dict["Members@odata.count"]} |
| 68 | ${resp_resource}= Redfish.Get ${resp.dict["Members"][${entry}]["@odata.id"]} |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 69 | # Example: |
| 70 | # "Status": { |
| 71 | # "Health": "OK", |
| 72 | # "HealthRollup": "OK", |
| 73 | # "State": "Enabled" |
| 74 | # }, |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 75 | Should Be Equal As Strings ${resp_resource.dict["Status"]["Health"]} OK |
| 76 | Should Be Equal As Strings ${resp_resource.dict["Status"]["HealthRollup"]} OK |
| 77 | Should Be Equal As Strings ${resp_resource.dict["Status"]["State"]} Enabled |
| 78 | END |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 79 | |
| 80 | |
Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 81 | Verify BMC Version Matches With FirmwareInventory |
| 82 | [Documentation] Verify BMC version from FirmwareInventory same as in manager. |
| 83 | [Tags] Verify_BMC_Version_Matches_With_FirmwareInventory |
| 84 | |
| 85 | ${bmc_manager}= Redfish.Get /redfish/v1/Managers/bmc |
| 86 | ${manager_bmc_version}= Get BMC Version |
| 87 | # Check for manager version and cat /etc/os-release. |
| 88 | Should Be Equal As Strings |
| 89 | ... ${bmc_manager.dict["FirmwareVersion"]} ${manager_bmc_version.strip('"')} |
| 90 | |
| 91 | ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory |
| 92 | |
| 93 | # Entries "Members@odata.count": 3, |
| 94 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a3522998'} |
| 95 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a7c79f71'} |
| 96 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/ace821ef'} |
| 97 | |
| 98 | ${actual_count}= Evaluate ${resp.dict["Members@odata.count"]}-1 |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 99 | FOR ${entry} IN RANGE 0 ${resp.dict["Members@odata.count"]} |
| 100 | ${resp_resource}= Redfish.Get ${resp.dict["Members"][${entry}]["@odata.id"]} |
Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 101 | # 3rd comparison of BMC version and verify FirmwareInventory bmc version. |
| 102 | # Example: |
| 103 | # "Version": 2.7.0-dev-19-g9b44ea7 |
Sushil Singh | 5062114 | 2020-06-16 11:12:21 -0500 | [diff] [blame] | 104 | Exit For Loop If '${resp_resource.dict["Version"]}' == '${manager_bmc_version.strip('"')}' |
| 105 | Run Keyword If '${entry}' == '${actual_count}' Fail BMC version not there in Firmware Inventory |
| 106 | END |
Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 107 | |
George Keishing | 40f7664 | 2019-07-01 02:09:33 -0500 | [diff] [blame] | 108 | Verify UpdateService Supports TransferProtocol TFTP |
| 109 | [Documentation] Verify update service supported values have TFTP protocol. |
| 110 | [Tags] Verify_UpdateService_Supports_TransferProtocol_TFTP |
| 111 | |
| 112 | # Example: |
| 113 | # "Actions": { |
| 114 | # "#UpdateService.SimpleUpdate": { |
| 115 | # "TransferProtocol@Redfish.AllowableValues": [ |
| 116 | # "TFTP" |
| 117 | # ], |
| 118 | # "target": "/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate" |
| 119 | # } |
| 120 | # }, |
| 121 | |
| 122 | ${allowable_values}= Redfish.Get Attribute /redfish/v1/UpdateService Actions |
| 123 | |
George Keishing | e4d4142 | 2019-12-12 11:17:03 -0600 | [diff] [blame] | 124 | Valid Value |
| 125 | ... allowable_values["#UpdateService.SimpleUpdate"]["TransferProtocol@Redfish.AllowableValues"][0] |
| 126 | ... valid_values=['TFTP'] |
| 127 | Valid Value allowable_values["#UpdateService.SimpleUpdate"]["target"] |
| 128 | ... valid_values=['/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate'] |
George Keishing | 40f7664 | 2019-07-01 02:09:33 -0500 | [diff] [blame] | 129 | |
| 130 | |
George Keishing | 1b8865c | 2019-07-04 12:16:49 -0500 | [diff] [blame] | 131 | Verify Redfish BIOS Version |
| 132 | [Documentation] Get host firmware version from system inventory. |
| 133 | [Tags] Verify_Redfish_BIOS_Version |
| 134 | |
| 135 | ${bios_version}= Redfish.Get Attribute /redfish/v1/Systems/system/ BiosVersion |
| 136 | ${pnor_version}= Get PNOR Version |
| 137 | Should Be Equal ${pnor_version} ${bios_version} |
| 138 | |
| 139 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 140 | *** Keywords *** |
| 141 | |
| 142 | Test Setup Execution |
| 143 | [Documentation] Do test case setup tasks. |
| 144 | |
| 145 | Redfish.Login |
| 146 | |
| 147 | |
| 148 | Test Teardown Execution |
| 149 | [Documentation] Do the post test teardown. |
| 150 | |
| 151 | FFDC On Test Case Fail |
| 152 | Redfish.Logout |