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 |
| 7 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 8 | Test Setup Test Setup Execution |
| 9 | Test Teardown Test Teardown Execution |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 10 | |
| 11 | *** Test Cases *** |
| 12 | |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 13 | Verify Redfish Update Service Enabled |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 14 | [Documentation] Verify "ServiceEnabled" is enabled. |
| 15 | [Tags] Verify_Update_Service_Enabled |
| 16 | |
| 17 | # Example: |
| 18 | # "HttpPushUri": "/redfish/v1/UpdateService", |
| 19 | # "Id": "UpdateService", |
| 20 | # "Name": "Update Service", |
| 21 | # "ServiceEnabled": true |
| 22 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 23 | ${resp}= Redfish.Get /redfish/v1/UpdateService |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 24 | Should Be Equal As Strings ${resp.dict["ServiceEnabled"]} ${True} |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 25 | |
| 26 | |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 27 | Verify Redfish Software Inventory Collection |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 28 | [Documentation] Verify software inventory collection member and object entries. |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 29 | [Tags] Verify_Redfish_Software_Inventory_Collection |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 30 | |
| 31 | # Example: |
| 32 | # { |
| 33 | # "@odata.type": "#SoftwareInventoryCollection.SoftwareInventoryCollection", |
| 34 | # "Members": [ |
| 35 | # { |
| 36 | # "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/a3522998" |
| 37 | # }, |
| 38 | # { |
| 39 | # "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/a7c79f71" |
| 40 | # }, |
| 41 | # { |
| 42 | # "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/ace821ef" |
| 43 | # } |
| 44 | # ], |
| 45 | # "Members@odata.count": 3, |
| 46 | # "Name": "Software Inventory Collection" |
| 47 | # } |
| 48 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 49 | ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 50 | |
| 51 | Should Be True ${resp.dict["Members@odata.count"]} >= ${1} |
| 52 | Length Should Be ${resp.dict["Members"]} ${resp.dict["Members@odata.count"]} |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 53 | |
| 54 | |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 55 | Redfish Software Inventory Status Check |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 56 | [Documentation] Get firmware inventory entries and do health check status. |
George Keishing | 5ee33d9 | 2019-02-02 12:33:25 -0600 | [diff] [blame] | 57 | [Tags] Redfish_Software_Inventory_Status_Check |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 58 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 59 | ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 60 | |
| 61 | # Entries "Members@odata.count": 3, |
| 62 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a3522998'} |
| 63 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a7c79f71'} |
| 64 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/ace821ef'} |
| 65 | |
| 66 | :FOR ${entry} IN RANGE 0 ${resp.dict["Members@odata.count"]} |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 67 | \ ${resp_resource}= Redfish.Get ${resp.dict["Members"][${entry}]["@odata.id"]} |
George Keishing | c5fab99 | 2019-02-02 08:50:37 -0600 | [diff] [blame] | 68 | # Example: |
| 69 | # "Status": { |
| 70 | # "Health": "OK", |
| 71 | # "HealthRollup": "OK", |
| 72 | # "State": "Enabled" |
| 73 | # }, |
| 74 | \ Should Be Equal As Strings ${resp_resource.dict["Status"]["Health"]} OK |
| 75 | \ Should Be Equal As Strings ${resp_resource.dict["Status"]["HealthRollup"]} OK |
| 76 | \ Should Be Equal As Strings ${resp_resource.dict["Status"]["State"]} Enabled |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 77 | |
| 78 | |
Sivas SRR | d099d36 | 2019-03-07 03:33:03 -0600 | [diff] [blame] | 79 | Verify BMC Version Matches With FirmwareInventory |
| 80 | [Documentation] Verify BMC version from FirmwareInventory same as in manager. |
| 81 | [Tags] Verify_BMC_Version_Matches_With_FirmwareInventory |
| 82 | |
| 83 | ${bmc_manager}= Redfish.Get /redfish/v1/Managers/bmc |
| 84 | ${manager_bmc_version}= Get BMC Version |
| 85 | # Check for manager version and cat /etc/os-release. |
| 86 | Should Be Equal As Strings |
| 87 | ... ${bmc_manager.dict["FirmwareVersion"]} ${manager_bmc_version.strip('"')} |
| 88 | |
| 89 | ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory |
| 90 | |
| 91 | # Entries "Members@odata.count": 3, |
| 92 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a3522998'} |
| 93 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/a7c79f71'} |
| 94 | # {'@odata.id': '/redfish/v1/UpdateService/FirmwareInventory/ace821ef'} |
| 95 | |
| 96 | ${actual_count}= Evaluate ${resp.dict["Members@odata.count"]}-1 |
| 97 | :FOR ${entry} IN RANGE 0 ${resp.dict["Members@odata.count"]} |
| 98 | \ ${resp_resource}= Redfish.Get ${resp.dict["Members"][${entry}]["@odata.id"]} |
| 99 | # 3rd comparison of BMC version and verify FirmwareInventory bmc version. |
| 100 | # Example: |
| 101 | # "Version": 2.7.0-dev-19-g9b44ea7 |
| 102 | \ Exit For Loop If '${resp_resource.dict["Version"]}' == '${manager_bmc_version.strip('"')}' |
| 103 | \ Run Keyword If '${entry}' == '${actual_count}' Fail |
| 104 | ... BMC version not there in Firmware Inventory |
| 105 | |
| 106 | |
George Keishing | 97c9394 | 2019-03-04 12:45:07 -0600 | [diff] [blame] | 107 | *** Keywords *** |
| 108 | |
| 109 | Test Setup Execution |
| 110 | [Documentation] Do test case setup tasks. |
| 111 | |
| 112 | Redfish.Login |
| 113 | |
| 114 | |
| 115 | Test Teardown Execution |
| 116 | [Documentation] Do the post test teardown. |
| 117 | |
| 118 | FFDC On Test Case Fail |
| 119 | Redfish.Logout |