blob: aef0b916fdfd44afe871ba54bfe42e04bc9a3e06 [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
George Keishing40f76642019-07-01 02:09:33 -05007Library ../../lib/gen_robot_valid.py
George Keishing3298d5c2019-02-12 06:59:25 -06008
George Keishing97c93942019-03-04 12:45:07 -06009Test Setup Test Setup Execution
10Test Teardown Test Teardown Execution
George Keishingc5fab992019-02-02 08:50:37 -060011
12*** Test Cases ***
13
George Keishing5ee33d92019-02-02 12:33:25 -060014Verify Redfish Update Service Enabled
George Keishingc5fab992019-02-02 08:50:37 -060015 [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 Keishing97c93942019-03-04 12:45:07 -060024 ${resp}= Redfish.Get /redfish/v1/UpdateService
George Keishingc5fab992019-02-02 08:50:37 -060025 Should Be Equal As Strings ${resp.dict["ServiceEnabled"]} ${True}
George Keishingc5fab992019-02-02 08:50:37 -060026
27
George Keishing5ee33d92019-02-02 12:33:25 -060028Verify Redfish Software Inventory Collection
George Keishingc5fab992019-02-02 08:50:37 -060029 [Documentation] Verify software inventory collection member and object entries.
George Keishing5ee33d92019-02-02 12:33:25 -060030 [Tags] Verify_Redfish_Software_Inventory_Collection
George Keishingc5fab992019-02-02 08:50:37 -060031
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 Keishing97c93942019-03-04 12:45:07 -060050 ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory
George Keishingc5fab992019-02-02 08:50:37 -060051
52 Should Be True ${resp.dict["Members@odata.count"]} >= ${1}
53 Length Should Be ${resp.dict["Members"]} ${resp.dict["Members@odata.count"]}
George Keishingc5fab992019-02-02 08:50:37 -060054
55
George Keishing5ee33d92019-02-02 12:33:25 -060056Redfish Software Inventory Status Check
George Keishingc5fab992019-02-02 08:50:37 -060057 [Documentation] Get firmware inventory entries and do health check status.
George Keishing5ee33d92019-02-02 12:33:25 -060058 [Tags] Redfish_Software_Inventory_Status_Check
George Keishingc5fab992019-02-02 08:50:37 -060059
George Keishing97c93942019-03-04 12:45:07 -060060 ${resp}= Redfish.Get /redfish/v1/UpdateService/FirmwareInventory
George Keishingc5fab992019-02-02 08:50:37 -060061
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 Singh50621142020-06-16 11:12:21 -050067 FOR ${entry} IN RANGE 0 ${resp.dict["Members@odata.count"]}
68 ${resp_resource}= Redfish.Get ${resp.dict["Members"][${entry}]["@odata.id"]}
George Keishingc5fab992019-02-02 08:50:37 -060069 # Example:
70 # "Status": {
71 # "Health": "OK",
72 # "HealthRollup": "OK",
73 # "State": "Enabled"
74 # },
Sushil Singh50621142020-06-16 11:12:21 -050075 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 Keishing97c93942019-03-04 12:45:07 -060079
80
Sivas SRRd099d362019-03-07 03:33:03 -060081Verify 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 Singh50621142020-06-16 11:12:21 -050099 FOR ${entry} IN RANGE 0 ${resp.dict["Members@odata.count"]}
100 ${resp_resource}= Redfish.Get ${resp.dict["Members"][${entry}]["@odata.id"]}
Sivas SRRd099d362019-03-07 03:33:03 -0600101 # 3rd comparison of BMC version and verify FirmwareInventory bmc version.
102 # Example:
103 # "Version": 2.7.0-dev-19-g9b44ea7
Sushil Singh50621142020-06-16 11:12:21 -0500104 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 SRRd099d362019-03-07 03:33:03 -0600107
George Keishing40f76642019-07-01 02:09:33 -0500108Verify 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 Keishinge4d41422019-12-12 11:17:03 -0600124 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 Keishing40f76642019-07-01 02:09:33 -0500129
130
George Keishing1b8865c2019-07-04 12:16:49 -0500131Verify 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 Keishing97c93942019-03-04 12:45:07 -0600140*** Keywords ***
141
142Test Setup Execution
143 [Documentation] Do test case setup tasks.
144
145 Redfish.Login
146
147
148Test Teardown Execution
149 [Documentation] Do the post test teardown.
150
151 FFDC On Test Case Fail
152 Redfish.Logout