blob: 3a3c0a7a9d02fe7c4ca39744efbc795c1e003efc [file] [log] [blame]
George Keishingc5fab992019-02-02 08:50:37 -06001*** Settings ***
Joy Onyerikwudbfe97d2019-03-11 19:44:56 -05002Documentation Verify that Redfish software inventory can be collected.
3
George Keishing2db7bca2019-02-14 13:03:08 -06004Resource ../../lib/resource.robot
George Keishingc5fab992019-02-02 08:50:37 -06005Resource ../../lib/bmc_redfish_resource.robot
George Keishing3298d5c2019-02-12 06:59:25 -06006Resource ../../lib/openbmc_ffdc.robot
7
George Keishing97c93942019-03-04 12:45:07 -06008Test Setup Test Setup Execution
9Test Teardown Test Teardown Execution
George Keishingc5fab992019-02-02 08:50:37 -060010
11*** Test Cases ***
12
George Keishing5ee33d92019-02-02 12:33:25 -060013Verify Redfish Update Service Enabled
George Keishingc5fab992019-02-02 08:50:37 -060014 [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 Keishing97c93942019-03-04 12:45:07 -060023 ${resp}= Redfish.Get /redfish/v1/UpdateService
George Keishingc5fab992019-02-02 08:50:37 -060024 Should Be Equal As Strings ${resp.dict["ServiceEnabled"]} ${True}
George Keishingc5fab992019-02-02 08:50:37 -060025
26
George Keishing5ee33d92019-02-02 12:33:25 -060027Verify Redfish Software Inventory Collection
George Keishingc5fab992019-02-02 08:50:37 -060028 [Documentation] Verify software inventory collection member and object entries.
George Keishing5ee33d92019-02-02 12:33:25 -060029 [Tags] Verify_Redfish_Software_Inventory_Collection
George Keishingc5fab992019-02-02 08:50:37 -060030
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 Keishing97c93942019-03-04 12:45:07 -060049 ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory
George Keishingc5fab992019-02-02 08:50:37 -060050
51 Should Be True ${resp.dict["Members@odata.count"]} >= ${1}
52 Length Should Be ${resp.dict["Members"]} ${resp.dict["Members@odata.count"]}
George Keishingc5fab992019-02-02 08:50:37 -060053
54
George Keishing5ee33d92019-02-02 12:33:25 -060055Redfish Software Inventory Status Check
George Keishingc5fab992019-02-02 08:50:37 -060056 [Documentation] Get firmware inventory entries and do health check status.
George Keishing5ee33d92019-02-02 12:33:25 -060057 [Tags] Redfish_Software_Inventory_Status_Check
George Keishingc5fab992019-02-02 08:50:37 -060058
George Keishing97c93942019-03-04 12:45:07 -060059 ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory
George Keishingc5fab992019-02-02 08:50:37 -060060
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 Keishing97c93942019-03-04 12:45:07 -060067 \ ${resp_resource}= Redfish.Get ${resp.dict["Members"][${entry}]["@odata.id"]}
George Keishingc5fab992019-02-02 08:50:37 -060068 # 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 Keishing97c93942019-03-04 12:45:07 -060077
78
Sivas SRRd099d362019-03-07 03:33:03 -060079Verify 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 Keishing97c93942019-03-04 12:45:07 -0600107*** Keywords ***
108
109Test Setup Execution
110 [Documentation] Do test case setup tasks.
111
112 Redfish.Login
113
114
115Test Teardown Execution
116 [Documentation] Do the post test teardown.
117
118 FFDC On Test Case Fail
119 Redfish.Logout