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 | |
| 67 | :FOR ${entry} IN RANGE 0 ${resp.dict["Members@odata.count"]} |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 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 | # }, |
| 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 |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 78 | |
| 79 | |
Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 80 | Verify BMC Version Matches With FirmwareInventory |
| 81 | [Documentation] Verify BMC version from FirmwareInventory same as in manager. |
| 82 | [Tags] Verify_BMC_Version_Matches_With_FirmwareInventory |
| 83 | |
| 84 | ${bmc_manager}= Redfish.Get /redfish/v1/Managers/bmc |
| 85 | ${manager_bmc_version}= Get BMC Version |
| 86 | # Check for manager version and cat /etc/os-release. |
| 87 | Should Be Equal As Strings |
| 88 | ... ${bmc_manager.dict["FirmwareVersion"]} ${manager_bmc_version.strip('"')} |
| 89 | |
| 90 | ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory |
| 91 | |
| 92 | # Entries "Members@odata.count": 3, |
| 93 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a3522998'} |
| 94 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a7c79f71'} |
| 95 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/ace821ef'} |
| 96 | |
| 97 | ${actual_count}= Evaluate ${resp.dict["Members@odata.count"]}-1 |
| 98 | :FOR ${entry} IN RANGE 0 ${resp.dict["Members@odata.count"]} |
| 99 | \ ${resp_resource}= Redfish.Get ${resp.dict["Members"][${entry}]["@odata.id"]} |
| 100 | # 3rd comparison of BMC version and verify FirmwareInventory bmc version. |
| 101 | # Example: |
| 102 | # "Version": 2.7.0-dev-19-g9b44ea7 |
| 103 | \ Exit For Loop If '${resp_resource.dict["Version"]}' == '${manager_bmc_version.strip('"')}' |
| 104 | \ Run Keyword If '${entry}' == '${actual_count}' Fail |
| 105 | ... BMC version not there in Firmware Inventory |
| 106 | |
| 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 | |
Michael Walsh | e7edb22 | 2019-08-19 17:39:38 -0500 | [diff] [blame] | 124 | Valid Value allowable_values["#UpdateService.SimpleUpdate"]["TransferProtocol@Redfish.AllowableValues"][0] valid_values=['TFTP'] |
| 125 | Valid Value allowable_values["#UpdateService.SimpleUpdate"]["target"] valid_values=['/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate'] |
George Keishing | 40f7664 | 2019-07-01 02:09:33 -0500 | [diff] [blame] | 126 | |
| 127 | |
George Keishing | 1b8865c | 2019-07-04 12:16:49 -0500 | [diff] [blame] | 128 | Verify Redfish BIOS Version |
| 129 | [Documentation] Get host firmware version from system inventory. |
| 130 | [Tags] Verify_Redfish_BIOS_Version |
| 131 | |
| 132 | ${bios_version}= Redfish.Get Attribute /redfish/v1/Systems/system/ BiosVersion |
| 133 | ${pnor_version}= Get PNOR Version |
| 134 | Should Be Equal ${pnor_version} ${bios_version} |
| 135 | |
| 136 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 137 | *** Keywords *** |
| 138 | |
| 139 | Test Setup Execution |
| 140 | [Documentation] Do test case setup tasks. |
| 141 | |
| 142 | Redfish.Login |
| 143 | |
| 144 | |
| 145 | Test Teardown Execution |
| 146 | [Documentation] Do the post test teardown. |
| 147 | |
| 148 | FFDC On Test Case Fail |
| 149 | Redfish.Logout |