From 12c9651ae71ab27287d1fe27e625087e6008f9a0 Mon Sep 17 00:00:00 2001 From: chenliangyjy Date: Thu, 19 Mar 2020 10:10:00 +0800 Subject: fix flake8 checking issue of hdv Signed-off-by: chenliangyjy Change-Id: Ie779c186635e57fe5d900df7326e4a704ebcad42 --- tools/hdv/redfish/conf/report.yaml | 831 ----------------------------- tools/hdv/redfish/conf/report_sample.yaml | 832 ++++++++++++++++++++++++++++++ tools/hdv/redfish/excel_2_yaml.py | 3 +- tools/hdv/redfish/hdv.py | 27 +- tools/hdv/redfish/hdv_redfish.py | 20 +- tools/hdv/redfish/http_handler.py | 2 +- tools/hdv/redfish/yaml_utils.py | 2 +- tox.ini | 2 +- 8 files changed, 861 insertions(+), 858 deletions(-) delete mode 100644 tools/hdv/redfish/conf/report.yaml create mode 100644 tools/hdv/redfish/conf/report_sample.yaml diff --git a/tools/hdv/redfish/conf/report.yaml b/tools/hdv/redfish/conf/report.yaml deleted file mode 100644 index fc15f65..0000000 --- a/tools/hdv/redfish/conf/report.yaml +++ /dev/null @@ -1,831 +0,0 @@ -- case_name: set asset code - case_sn: 1 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''AssetTag'': "Failure, expect value: CM_cc@1234, return value: Can''t - find the key AssetTag in return value"}]}' - expected_code: 200 - expected_result: '{"AssetTag": "CM_cc@1234"}' - final_rst: Failure - group: asset managment - header: null - method: PATCH - request_body: '{"AssetTag": "CM_cc@1234"}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: get asset code - case_sn: 2 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''AssetTag'': ''Success''}]}' - expected_code: 200 - expected_result: '{"AssetTag": "CM_cc@1234"}' - final_rst: Success - group: asset managment - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: set host name - case_sn: 3 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''HostName'': "Failure, expect value: NFV-RPZJHZ-01B, return value: - Can''t find the key HostName in return value"}]}' - expected_code: 200 - expected_result: '{"HostName": "NFV-RPZJHZ-01B"}' - final_rst: Failure - group: asset managment - header: null - method: PATCH - request_body: '{"HostName": "NFV-RPZJHZ-01B"}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: check host name - case_sn: 4 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''HostName'': "Failure, expect value: NFV-RPZJHZ-01B, return value: - Can''t find the key HostName in return value"}]}' - expected_code: 200 - expected_result: '{"HostName": "NFV-RPZJHZ-01B"}' - final_rst: Failure - group: asset managment - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: check manufacturer - case_sn: 5 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Manufacturer'': ''Failure, expect value: New H3C Technologies Co., - Ltd., return value: Huawei''}]}' - expected_code: 200 - expected_result: '{"Manufacturer": "New H3C Technologies Co., Ltd."}' - final_rst: Failure - group: asset managment - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: check model - case_sn: 6 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Model'': ''Failure, expect value: UniServer R4900 G3, return value: - RH2288H V3''}]}' - expected_code: 200 - expected_result: '{"Model": "UniServer R4900 G3"}' - final_rst: Failure - group: asset managment - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: check serial number - case_sn: 7 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''SerialNumber'': ''Success''}]}' - expected_code: 200 - expected_result: '{"SerialNumber": "N/A"}' - final_rst: Success - group: asset managment - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: check main board name - case_sn: 8 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Oem'': "Failure, expect value: {''Mainboard'': {''BoardName'': - ''RS33M2C9S''}}, return value: Can''t find the key Oem in return value"}]}' - expected_code: 200 - expected_result: '{"Oem":{"Mainboard": {"BoardName": "RS33M2C9S"}}}' - final_rst: Failure - group: asset managment - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id} -- case_name: check main board serial number - case_sn: 9 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Oem'': "Failure, expect value: {''Mainboard'': {''SerialNumber'': - ''N/A''}}, return value: Can''t find the key Oem in return value"}]}' - expected_code: 200 - expected_result: '{"Oem": {"Mainboard": {"SerialNumber": "N/A"}}}' - final_rst: Failure - group: asset managment - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id} -- case_name: check BIOS version - case_sn: 10 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''BiosVersion'': ''Failure, expect value: 2.00.35P01 V100R001B02D035SP01, - return value: 3.63''}]}' - expected_code: 200 - expected_result: '{"BiosVersion": "2.00.35P01 V100R001B02D035SP01"}' - final_rst: Failure - group: asset managment - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: check CPU amount - case_sn: 11 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Members@odata.count'': ''Success''}]}' - expected_code: 200 - expected_result: '{"Members@odata.count": 2}' - final_rst: Success - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Processors -- case_name: check CPU info - case_sn: 12 - details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Success'', - ''Manufacturer'': ''Success'', ''MaxSpeedMHz'': ''Failure, expect value: 2300, - return value: 3500'', ''Model'': ''Failure, expect value: Intel(R) Xeon(R) Gold - 5218N CPU @ 2.30GHz, return value: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz'', - ''ProcessorArchitecture'': ''Success'', ''Socket'': ''Failure, expect value: [1, - 2], return value: 0'', ''Status'': {''Health'': ''Success'', ''State'': ''Success''}, - ''TotalCores'': ''Failure, expect value: 16, return value: 8'', ''TotalThreads'': - ''Failure, expect value: 32, return value: 16''}, {''return_code'': ''Success'', - ''Manufacturer'': ''Success'', ''MaxSpeedMHz'': ''Failure, expect value: 2300, - return value: 3500'', ''Model'': ''Failure, expect value: Intel(R) Xeon(R) Gold - 5218N CPU @ 2.30GHz, return value: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz'', - ''ProcessorArchitecture'': ''Success'', ''Socket'': ''Success'', ''Status'': {''Health'': - ''Success'', ''State'': ''Success''}, ''TotalCores'': ''Failure, expect value: - 16, return value: 8'', ''TotalThreads'': ''Failure, expect value: 32, return value: - 16''}]}' - expected_code: 200 - expected_result: '{ "count": 2, "Manufacturer": "Intel(R) Corporation", "MaxSpeedMHz": - 2300, "Model": "Intel(R) Xeon(R) Gold 5218N CPU @ 2.30GHz", "ProcessorArchitecture": - ["x86", "IA-64", "ARM", "MIPS", "OEM"], "Socket": [1, 2], "Status": { "Health": - "OK", "State": "Enabled" }, "TotalCores": 16, "TotalThreads": - 32}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200, 200]' - url: https://{bmc_ip}{cpu_id} -- case_name: check memory mount - case_sn: 13 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Members@odata.count'': ''Failure, expect value: 12, return value: - 4''}]}' - expected_code: 200 - expected_result: '{"Members@odata.count": 12}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Memory -- case_name: check memory information - case_sn: 14 - details_result: '{''count'': ''Failure, the actual num is 4'', ''info'': [{''return_code'': - ''Success'', ''BaseModuleType'': "Failure, expect value: RDIMM, return value: - Can''t find the key BaseModuleType in return value", ''CapacityMiB'': ''Success'', - ''DeviceLocator'': ''Success'', ''Manufacturer'': ''Success'', ''MemoryDeviceType'': - ''Success'', ''OperatingSpeedMhz'': ''Failure, expect value: 2666, return value: - 2400'', ''PartNumber'': "Failure, expect value: [''HMA84GR7AFR4N-VK'', ''36ASF4G72PZ-2G6D1''], - return value: Can''t find the key PartNumber in return value", ''Status'': {''Health'': - ''Success'', ''State'': ''Success''}}, {''return_code'': ''Success'', ''BaseModuleType'': - "Failure, expect value: RDIMM, return value: Can''t find the key BaseModuleType - in return value", ''CapacityMiB'': ''Success'', ''DeviceLocator'': ''Success'', - ''Manufacturer'': ''Success'', ''MemoryDeviceType'': ''Success'', ''OperatingSpeedMhz'': - ''Failure, expect value: 2666, return value: 2400'', ''PartNumber'': "Failure, - expect value: [''HMA84GR7AFR4N-VK'', ''36ASF4G72PZ-2G6D1''], return value: Can''t - find the key PartNumber in return value", ''Status'': {''Health'': ''Success'', - ''State'': ''Success''}}, {''return_code'': ''Success'', ''BaseModuleType'': "Failure, - expect value: RDIMM, return value: Can''t find the key BaseModuleType in return - value", ''CapacityMiB'': ''Success'', ''DeviceLocator'': ''Success'', ''Manufacturer'': - ''Success'', ''MemoryDeviceType'': ''Success'', ''OperatingSpeedMhz'': ''Failure, - expect value: 2666, return value: 2400'', ''PartNumber'': "Failure, expect value: - [''HMA84GR7AFR4N-VK'', ''36ASF4G72PZ-2G6D1''], return value: Can''t find the key - PartNumber in return value", ''Status'': {''Health'': ''Success'', ''State'': - ''Success''}}, {''return_code'': ''Success'', ''BaseModuleType'': "Failure, expect - value: RDIMM, return value: Can''t find the key BaseModuleType in return value", - ''CapacityMiB'': ''Success'', ''DeviceLocator'': ''Success'', ''Manufacturer'': - ''Success'', ''MemoryDeviceType'': ''Success'', ''OperatingSpeedMhz'': ''Failure, - expect value: 2666, return value: 2400'', ''PartNumber'': "Failure, expect value: - [''HMA84GR7AFR4N-VK'', ''36ASF4G72PZ-2G6D1''], return value: Can''t find the key - PartNumber in return value", ''Status'': {''Health'': ''Success'', ''State'': - ''Success''}}]}' - expected_code: 200 - expected_result: '{ "count": 12, "BaseModuleType": "RDIMM", "CapacityMiB": - 32768, "DeviceLocator": "N/A", "Manufacturer": ["Hynix Semiconductor", "Micron"], "MemoryDeviceType": - "DDR4", "OperatingSpeedMhz": 2666, "PartNumber": ["HMA84GR7AFR4N-VK","36ASF4G72PZ-2G6D1"], "Status": - { "Health": "OK", "State": "Enabled" }}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200, 200, 200, 200]' - url: https://{bmc_ip}{memory_id} -- case_name: check raid card amount - case_sn: 15 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Members@odata.count'': ''Success''}]}' - expected_code: 200 - expected_result: '{"Members@odata.count": 1}' - final_rst: Success - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Storages -- case_name: check raid card information - case_sn: 16 - details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Success'', - ''StorageControllers'': [{''FirmwareVersion'': ''2.62'', ''Manufacturer'': ''H3C'', - ''Model'': ''N/A'', ''Status'': {''Health'': ''Success'', ''State'': ''Success''}}]}]}' - expected_code: 200 - expected_result: '{ "count": 1, "StorageControllers": [ { "FirmwareVersion": - "2.62", "Manufacturer": "H3C", "Model": "N/A", "Status": - { "Health": "OK", "State": "Enabled" } } ]}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}{storage_id} -- case_name: check harddisk information - case_sn: 17 - details_result: '{''count'': ''Failure, the actual num is 6'', ''info'': [{''return_code'': - ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], - return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, - ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect - value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': - ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': - ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], - return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, - ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect - value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': - ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': - ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], - return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, - ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect - value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': - ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': - ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], - return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, - ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect - value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': - ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': - ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], - return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, - ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect - value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': - ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': - ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], - return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, - ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect - value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': - ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}]}' - expected_code: 200 - expected_result: '{ "count": 4, "CapacityBytes": [480102187008, 960193626112], "Location": - { "Info": "N/A", "InfoFormat": "DeviceName" }, "Manufacturer": - "ATA", "MediaType": "SSD", "Model": ["INTEL SSDSC2KB48", "INTEL SSDSC2KB96"], "Protocol": - "SATA", "Status": { "Health": "OK", "State": "Enabled" }}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200, 200, 200, 200, 200, 200]' - url: https://{bmc_ip}{drives_id} -- case_name: check network interface adapter information - case_sn: 18 - details_result: N/A - expected_code: 200 - expected_result: '{ "count": 3, "Manufacturer": "Mellanox", "Model": "NIC-620F-B2-25Gb-2P-1-X", "Name": - ["PCIeSlot2", "PCIeSlot3", "PCIeSlot6"], "Oem": { "Public": { "CardModel": - "2*25GE", "RootBDF": ["0000:17:00.0", "0000:17:02.0", "0000:AE:02.0"], } }, "Status": - { "Health": "OK", "State": "Enabled" }}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - url: https://{bmc_ip}{networkadapters_id} -- case_name: check network interface adapter port information - case_sn: 19 - details_result: N/A - expected_code: 200 - expected_result: '{ "count": 6, "AssociatedNetworkAddresses": [ "N/A" ], "Oem": - { "Public": { "BDF": "N/A", "PortType": "OpticalPort" } }, "PhysicalPortNumber": - ["1", "2"]}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - url: https://{bmc_ip}{networkports_id} -- case_name: check fans information - case_sn: 20 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''FanSummary'': "Failure, expect value: {''Count'': 6}, return value: - Can''t find the key FanSummary in return value", ''Fans'': [{''MemberId'': ''Success'', - ''Oem'': {''Public'': {''SpeedRatio'': ''N/A''}}, ''Status'': {''Health'': ''Success'', - ''State'': ''Success''}}, {''MemberId'': ''Success'', ''Oem'': {''Public'': {''SpeedRatio'': - ''N/A''}}, ''Status'': {''Health'': ''Success'', ''State'': ''Success''}}, {''MemberId'': - ''Success'', ''Oem'': {''Public'': {''SpeedRatio'': ''N/A''}}, ''Status'': {''Health'': - ''Success'', ''State'': ''Success''}}, {''MemberId'': ''Success'', ''Oem'': {''Public'': - {''SpeedRatio'': ''N/A''}}, ''Status'': {''Health'': ''Success'', ''State'': ''Success''}}, - {''MemberId'': ''Success'', ''Oem'': {''Public'': {''SpeedRatio'': ''N/A''}}, - ''Status'': {''Health'': ''Success'', ''State'': ''Success''}}, {''MemberId'': - ''Success'', ''Oem'': {''Public'': {''SpeedRatio'': ''N/A''}}, ''Status'': {''Health'': - ''Success'', ''State'': ''Success''}}]}]}' - expected_code: 200 - expected_result: '{ "FanSummary": { "Count": 6 }, "Fans": [ { "MemberId": - "N/A", "Oem": { "Public": { "SpeedRatio": - "N/A" } }, "Status": { "Health": - "OK", "State": "Enabled" } }, { "MemberId": - "N/A", "Oem": { "Public": { "SpeedRatio": - "N/A" } }, "Status": { "Health": - "OK", "State": "Enabled" } },{ "MemberId": - "N/A", "Oem": { "Public": { "SpeedRatio": - "N/A" } }, "Status": { "Health": - "OK", "State": "Enabled" } },{ "MemberId": - "N/A", "Oem": { "Public": { "SpeedRatio": - "N/A" } }, "Status": { "Health": - "OK", "State": "Enabled" } },{ "MemberId": - "N/A", "Oem": { "Public": { "SpeedRatio": - "N/A" } }, "Status": { "Health": - "OK", "State": "Enabled" } },{ "MemberId": - "N/A", "Oem": { "Public": { "SpeedRatio": - "N/A" } }, "Status": { "Health": - "OK", "State": "Enabled" } } ],}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id}/Thermal -- case_name: check power amount - case_sn: 21 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''DeviceMaxNum'': "Failure, expect value: {''PowerSupplyNum'': 2}, - return value: Can''t find the key DeviceMaxNum in return value"}]}' - expected_code: 200 - expected_result: '{ "DeviceMaxNum": { "PowerSupplyNum": 2},}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id} -- case_name: check power detail info - case_sn: 22 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''PowerControl'': [{''PowerConsumedWatts'': ''Success'', ''Status'': - {''Health'': ''OK'', ''State'': ''Enabled''}}], ''PowerSupplies'': [{''LineInputVoltage'': - ''Success'', ''MemberId'': ''Failure, expect value: 1, return value: 0'', ''PowerCapacityWatts'': - ''Failure, expect value: 800, return value: 460'', ''Status'': {''Health'': ''Success'', - ''State'': ''Success''}}, {''LineInputVoltage'': ''Success'', ''MemberId'': ''Failure, - expect value: 2, return value: 1'', ''PowerCapacityWatts'': ''Failure, expect - value: 800, return value: 460'', ''Status'': {''Health'': ''Failure, expect value: - OK, return value: Critical'', ''State'': ''Success''}}]}]}' - expected_code: 200 - expected_result: '{ "PowerControl": [ { "PowerConsumedWatts": - "N/A","Status":{ "Health": "OK", "State": "Enabled" } }, ], "PowerSupplies": - [ { "LineInputVoltage": "N/A", "MemberId": "1", "PowerCapacityWatts": - 800,"Status": { "Health": "OK", "State": "Enabled" } }, { "LineInputVoltage": - "N/A", "MemberId": "2", "PowerCapacityWatts": 800,"Status": - { "Health": "OK", "State": "Enabled" } } ],}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id}/Power -- case_name: check logical dirve health status - case_sn: 23 - details_result: N/A - expected_code: 200 - expected_result: '{ "count": 2, "Name": "N/A", "Status": { "Health": - ["OK", "Critical"], "State": "Enabled" }}' - final_rst: Failure - group: compoment management - header: null - method: GET - request_body: null - url: https://{bmc_ip}{volume_id} -- case_name: check server temperature air intake - case_sn: 24 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Temperatures'': [{''Name'': ''Failure, expect value: INPUT_TEMP, - return value: Inlet Temp'', ''ReadingCelsius'': ''Success''}]}]}' - expected_code: 200 - expected_result: '{ "Temperatures": [ { "Name": "INPUT_TEMP", "ReadingCelsius": - "N/A", } ]}' - final_rst: Failure - group: sensor management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id}/Thermal -- case_name: check cpu temperature - case_sn: 25 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''Temperatures'': [{''Name'': ''Failure, expect value: INPUT_TEMP, - return value: Inlet Temp'', ''ReadingCelsius'': ''Success''}, {''Name'': ''Failure, - expect value: CPU1_TEMP, return value: Outlet Temp'', ''ReadingCelsius'': ''Success''}, - {''Name'': ''Failure, expect value: CPU2_TEMP, return value: PCH Temp'', ''ReadingCelsius'': - ''N/A''}]}]}' - expected_code: 200 - expected_result: '{ "Temperatures": [ { "Name": "INPUT_TEMP", "ReadingCelsius": - "N/A", }, { "Name": "CPU1_TEMP", "ReadingCelsius": - "N/A", }, { "Name": "CPU2_TEMP", "ReadingCelsius": - "N/A", }, ]}' - final_rst: Failure - group: sensor management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id}/Thermal -- case_name: check server power state - case_sn: 26 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Success'', ''PowerState'': ''Failure, expect value: On, return value: Off''}]}' - expected_code: 200 - expected_result: '{"PowerState": "On"}' - final_rst: Failure - group: power management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id} -- case_name: remote power on server - case_sn: 27 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{"error":{"@Message.ExtendedInfo": [{"Message": "Successfully - Completed Request", "Severity":"OK"}]}}' - final_rst: Failure - group: power management - header: null - method: POST - request_body: '{"ResetType": "On"}' - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Actions/ComputerSystem.Reset -- case_name: remote power off server - case_sn: 28 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{"error":{"@Message.ExtendedInfo": [{"Message": "Successfully - Completed Request", "Severity":"OK"}]}}' - final_rst: Failure - group: power management - header: null - method: POST - request_body: '{"ResetType": "GracefulShutdown"}' - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Actions/ComputerSystem.Reset -- case_name: remote reset server - case_sn: 29 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{"error":{"@Message.ExtendedInfo": [{"Message": "Successfully - Completed Request", "Severity":"OK"}]}}' - final_rst: Failure - group: power management - header: null - method: POST - request_body: '{"ResetType": "ForceRestart"}' - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Actions/ComputerSystem.Reset -- case_name: remote configure CPU in hyperthreading disabled - case_sn: 30 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''Attributes'': "Failure, expect value: {''ProcessorHyperThreading'': - ''Disabled''}, return value: Can''t find the key Attributes in return value"}]}' - expected_code: 200 - expected_result: '{"Attributes": {"ProcessorHyperThreading": "Disabled"}}' - final_rst: Failure - group: remote configure - header: null - method: PATCH - request_body: '{ "Attributes": { "ProcessorHyperThreading": "Disabled" }}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings -- case_name: remote get CPU hyperthreading in disabled - case_sn: 31 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{"Attributes": {"ProcessorHyperThreading": "Disabled"}}' - final_rst: Failure - group: remote configure - header: null - method: GET - request_body: null - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios -- case_name: remote configure CPU in hyperthreading enabled - case_sn: 32 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''Attributes'': "Failure, expect value: {''ProcessorHyperThreading'': - ''Enabled''}, return value: Can''t find the key Attributes in return value"}]}' - expected_code: 200 - expected_result: '{"Attributes": {"ProcessorHyperThreading": "Enabled"}}' - final_rst: Failure - group: remote configure - header: null - method: PATCH - request_body: '{ "Attributes": { "ProcessorHyperThreading": "Enabled" }}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings -- case_name: remote get CPU hyperthreading in enabled - case_sn: 33 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{"Attributes": {"ProcessorHyperThreading": "Enabled"}}' - final_rst: Failure - group: remote configure - header: null - method: GET - request_body: null - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios -- case_name: disable PXE mode - case_sn: 34 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''Attributes'': "Failure, expect value: {''IPv4PXESupport'': ''Disabled''}, - return value: Can''t find the key Attributes in return value"}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "IPv4PXESupport": "Disabled" }}' - final_rst: Failure - group: remote configure - header: null - method: PATCH - request_body: '{ "Attributes": { "IPv4PXESupport": "Disabled" }}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings -- case_name: check IPV4 PXE mode in disabled - case_sn: 35 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "IPv4PXESupport": "Disabled" }}' - final_rst: Failure - group: remote configure - header: null - method: GET - request_body: null - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios -- case_name: enable PXE mode - case_sn: 36 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''Attributes'': "Failure, expect value: {''IPv4PXESupport'': ''Enabled''}, - return value: Can''t find the key Attributes in return value"}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "IPv4PXESupport": "Enabled" }}' - final_rst: Failure - group: remote configure - header: null - method: PATCH - request_body: '{ "Attributes": { "IPv4PXESupport": "Enabled" }}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings -- case_name: check ipv4 PXE mode in enabled - case_sn: 37 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "IPv4PXESupport": "Enabled" }}' - final_rst: Failure - group: remote configure - header: null - method: GET - request_body: null - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios -- case_name: set boot type order - case_sn: 38 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''Attributes'': "Failure, expect value: {''BootTypeOrder0'': ''HardDiskDrive'', - ''BootTypeOrder1'': ''DVDROMDrive'', ''BootTypeOrder2'': ''PXE'', ''BootTypeOrder3'': - ''Others''}, return value: Can''t find the key Attributes in return value"}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "BootTypeOrder0": "HardDiskDrive", "BootTypeOrder1": - "DVDROMDrive", "BootTypeOrder2": "PXE", "BootTypeOrder3": - "Others", }}' - final_rst: Failure - group: remote interface management - header: null - method: PATCH - request_body: '{ "Attributes": { "BootTypeOrder0": "HardDiskDrive", "BootTypeOrder1": - "DVDROMDrive", "BootTypeOrder2": "PXE", "BootTypeOrder3": - "Others", }}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings -- case_name: check boot order - case_sn: 39 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "BootTypeOrder0": "HardDiskDrive", "BootTypeOrder1": - "DVDROMDrive", "BootTypeOrder2": "PXE", "BootTypeOrder3": - "Others", }}' - final_rst: Failure - group: remote interface management - header: null - method: GET - request_body: null - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios -- case_name: configure boot order - case_sn: 40 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''Attributes'': "Failure, expect value: {''BootTypeOrder0'': ''DVDROMDrive'', - ''BootTypeOrder1'': ''HardDiskDrive'', ''BootTypeOrder2'': ''Others'', ''BootTypeOrder3'': - ''PXE''}, return value: Can''t find the key Attributes in return value"}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "BootTypeOrder0": "DVDROMDrive", "BootTypeOrder1": - "HardDiskDrive", "BootTypeOrder2": "Others", "BootTypeOrder3": - "PXE", }}' - final_rst: Failure - group: remote interface management - header: null - method: PATCH - request_body: '{ "Attributes": { "BootTypeOrder0": "DVDROMDrive", "BootTypeOrder1": - "HardDiskDrive", "BootTypeOrder2": "Others", "BootTypeOrder3": - "PXE", }}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings -- case_name: check boot order - case_sn: 41 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "BootTypeOrder0": "DVDROMDrive", "BootTypeOrder1": - "HardDiskDrive", "BootTypeOrder2": "Others", "BootTypeOrder3": - "PXE", }}' - final_rst: Failure - group: remote interface management - header: null - method: GET - request_body: null - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios -- case_name: configure new boot PXE order first - case_sn: 42 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''Attributes'': "Failure, expect value: {''BootTypeOrder0'': ''PXE'', - ''BootTypeOrder1'': ''HardDiskDrive'', ''BootTypeOrder2'': ''DVDROMDrive'', ''BootTypeOrder3'': - ''Others''}, return value: Can''t find the key Attributes in return value"}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "BootTypeOrder0": "PXE", "BootTypeOrder1": - "HardDiskDrive", "BootTypeOrder2": "DVDROMDrive", "BootTypeOrder3": - "Others", }}' - final_rst: Failure - group: remote interface management - header: null - method: PATCH - request_body: '{ "Attributes": { "BootTypeOrder0": "PXE", "BootTypeOrder1": - "HardDiskDrive", "BootTypeOrder2": "DVDROMDrive", "BootTypeOrder3": - "Others", }}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings -- case_name: check boot order PEX order first - case_sn: 43 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure''}]}' - expected_code: 200 - expected_result: '{ "Attributes": { "BootTypeOrder0": "PXE", "BootTypeOrder1": - "HardDiskDrive", "BootTypeOrder2": "DVDROMDrive", "BootTypeOrder3": - "Others", }}' - final_rst: Failure - group: remote interface management - header: null - method: GET - request_body: null - return_code_seq: '[]' - url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios -- case_name: check BMC Firmware version - case_sn: 44 - details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Success'', - ''FirmwareVersion'': ''Failure, expect value: 1.30.11P01 HDM V100R001B03D011SP01, - return value: 2.43''}]}' - expected_code: 200 - expected_result: '{"count": 1, "FirmwareVersion": "1.30.11P01 HDM V100R001B03D011SP01"}' - final_rst: Failure - group: remote interface management - header: null - method: GET - request_body: null - return_code_seq: '[200]' - url: https://{bmc_ip}{manager_id} -- case_name: change BMC account - case_sn: 45 - details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': - ''Failure'', ''UserName'': "Failure, expect value: CM_cc@1234, return value: Can''t - find the key UserName in return value", ''RoleId'': "Failure, expect value: Administrator, - return value: Can''t find the key RoleId in return value"}]}' - expected_code: 200 - expected_result: '{"UserName": "CM_cc@1234","RoleId": "Administrator",}' - final_rst: Failure - group: remote interface management - header: null - method: PATCH - request_body: '{"UserName": "CM_cc@1234","Password": "1234@CM_cc","RoleId": "Administrator",}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}/redfish/v1/AccountService/Accounts/3 -- case_name: configure BMC ip in static, ipv4 - case_sn: 46 - details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Failure'', - ''IPv4Addresses'': "Failure, expect value: [{''Address'': ''192.168.66.120'', - ''AddressOrigin'': ''Static'', ''Gateway'': ''192.168.66.1'', ''SubnetMask'': - ''255.255.255.128''}], return value: Can''t find the key IPv4Addresses in return - value"}]}' - expected_code: 200 - expected_result: '{"count": 1, "IPv4Addresses": [ { "Address": - "192.168.66.120", "AddressOrigin": "Static", "Gateway": - "192.168.66.1", "SubnetMask": "255.255.255.128" } ]}' - final_rst: Failure - group: remote interface management - header: null - method: PATCH - request_body: '{ "IPv4Addresses": [ { "Address": "192.168.66.120", "AddressOrigin": - "Static", "Gateway": "192.168.66.1", "SubnetMask": "255.255.255.128" } ]}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}{manager_id}/EthernetInterfaces/eth1 -- case_name: configure BMC ip in DHCP, gateway and subnet mask ipv4 - case_sn: 47 - details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Failure'', - ''IPv4Addresses'': "Failure, expect value: [{''Address'': ''192.168.66.120'', - ''AddressOrigin'': ''DHCP'', ''Gateway'': ''192.168.66.1'', ''SubnetMask'': ''255.255.255.128''}], - return value: Can''t find the key IPv4Addresses in return value"}]}' - expected_code: 200 - expected_result: '{"count": 1, "IPv4Addresses": [ { "Address": - "192.168.66.120", "AddressOrigin": "DHCP", "Gateway": "192.168.66.1", "SubnetMask": - "255.255.255.128" } ]}' - final_rst: Failure - group: remote interface management - header: null - method: PATCH - request_body: '{ "IPv4Addresses": [ { "AddressOrigin": "DHCP" } ]}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}{manager_id}/EthernetInterfaces/eth1 -- case_name: configure BMC ip in static, ipv4 - case_sn: 48 - details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Failure'', - ''IPv4Addresses'': "Failure, expect value: [{''AddressOrigin'': ''DHCP''}], return - value: Can''t find the key IPv4Addresses in return value"}]}' - expected_code: 200 - expected_result: '{"count": 1, "IPv4Addresses": [ { "AddressOrigin": - "DHCP", } ]}' - final_rst: Failure - group: remote interface management - header: null - method: PATCH - request_body: '{ "IPv4Addresses": [ { "AddressOrigin": "DHCP" } ]}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}{manager_id}/EthernetInterfaces/eth1 -- case_name: configure BMC ip in static, ipv6 - case_sn: 49 - details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Failure'', - ''IPv6Addresses'': "Failure, expect value: [{''Address'': ''N/A'', ''AddressOrigin'': - ''N/A'', ''PrefixLength'': 64}, {''Address'': ''2019::11'', ''AddressOrigin'': - ''Static'', ''PrefixLength'': 64}], return value: Can''t find the key IPv6Addresses - in return value"}]}' - expected_code: 200 - expected_result: '{"count": 1, "IPv6Addresses": [ { "Address": - "N/A", "AddressOrigin": "N/A", "PrefixLength": 64 }, { "Address": - "2019::11", "AddressOrigin": "Static", "PrefixLength": 64 } ]}' - final_rst: Failure - group: remote interface management - header: null - method: PATCH - request_body: '{ "IPv6Addresses": [ { "Address": "2019::11", "AddressOrigin": - "Static", "PrefixLength": 64 } ]}' - return_code_seq: '[''N/A'']' - url: https://{bmc_ip}{manager_id}/EthernetInterfaces/eth1 diff --git a/tools/hdv/redfish/conf/report_sample.yaml b/tools/hdv/redfish/conf/report_sample.yaml new file mode 100644 index 0000000..d396360 --- /dev/null +++ b/tools/hdv/redfish/conf/report_sample.yaml @@ -0,0 +1,832 @@ +--- +- case_name: set asset code + case_sn: 1 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''AssetTag'': "Failure, expect value: CM_cc@1234, return value: Can''t + find the key AssetTag in return value"}]}' + expected_code: 200 + expected_result: '{"AssetTag": "CM_cc@1234"}' + final_rst: Failure + group: asset managment + header: null + method: PATCH + request_body: '{"AssetTag": "CM_cc@1234"}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: get asset code + case_sn: 2 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''AssetTag'': ''Success''}]}' + expected_code: 200 + expected_result: '{"AssetTag": "CM_cc@1234"}' + final_rst: Success + group: asset managment + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: set host name + case_sn: 3 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''HostName'': "Failure, expect value: NFV-RPZJHZ-01B, return value: + Can''t find the key HostName in return value"}]}' + expected_code: 200 + expected_result: '{"HostName": "NFV-RPZJHZ-01B"}' + final_rst: Failure + group: asset managment + header: null + method: PATCH + request_body: '{"HostName": "NFV-RPZJHZ-01B"}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: check host name + case_sn: 4 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''HostName'': "Failure, expect value: NFV-RPZJHZ-01B, return value: + Can''t find the key HostName in return value"}]}' + expected_code: 200 + expected_result: '{"HostName": "NFV-RPZJHZ-01B"}' + final_rst: Failure + group: asset managment + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: check manufacturer + case_sn: 5 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Manufacturer'': ''Failure, expect value: New H3C Technologies Co., + Ltd., return value: Huawei''}]}' + expected_code: 200 + expected_result: '{"Manufacturer": "New H3C Technologies Co., Ltd."}' + final_rst: Failure + group: asset managment + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: check model + case_sn: 6 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Model'': ''Failure, expect value: UniServer R4900 G3, return value: + RH2288H V3''}]}' + expected_code: 200 + expected_result: '{"Model": "UniServer R4900 G3"}' + final_rst: Failure + group: asset managment + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: check serial number + case_sn: 7 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''SerialNumber'': ''Success''}]}' + expected_code: 200 + expected_result: '{"SerialNumber": "N/A"}' + final_rst: Success + group: asset managment + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: check main board name + case_sn: 8 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Oem'': "Failure, expect value: {''Mainboard'': {''BoardName'': + ''RS33M2C9S''}}, return value: Can''t find the key Oem in return value"}]}' + expected_code: 200 + expected_result: '{"Oem":{"Mainboard": {"BoardName": "RS33M2C9S"}}}' + final_rst: Failure + group: asset managment + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id} +- case_name: check main board serial number + case_sn: 9 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Oem'': "Failure, expect value: {''Mainboard'': {''SerialNumber'': + ''N/A''}}, return value: Can''t find the key Oem in return value"}]}' + expected_code: 200 + expected_result: '{"Oem": {"Mainboard": {"SerialNumber": "N/A"}}}' + final_rst: Failure + group: asset managment + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id} +- case_name: check BIOS version + case_sn: 10 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''BiosVersion'': ''Failure, expect value: 2.00.35P01 V100R001B02D035SP01, + return value: 3.63''}]}' + expected_code: 200 + expected_result: '{"BiosVersion": "2.00.35P01 V100R001B02D035SP01"}' + final_rst: Failure + group: asset managment + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: check CPU amount + case_sn: 11 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Members@odata.count'': ''Success''}]}' + expected_code: 200 + expected_result: '{"Members@odata.count": 2}' + final_rst: Success + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Processors +- case_name: check CPU info + case_sn: 12 + details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Success'', + ''Manufacturer'': ''Success'', ''MaxSpeedMHz'': ''Failure, expect value: 2300, + return value: 3500'', ''Model'': ''Failure, expect value: Intel(R) Xeon(R) Gold + 5218N CPU @ 2.30GHz, return value: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz'', + ''ProcessorArchitecture'': ''Success'', ''Socket'': ''Failure, expect value: [1, + 2], return value: 0'', ''Status'': {''Health'': ''Success'', ''State'': ''Success''}, + ''TotalCores'': ''Failure, expect value: 16, return value: 8'', ''TotalThreads'': + ''Failure, expect value: 32, return value: 16''}, {''return_code'': ''Success'', + ''Manufacturer'': ''Success'', ''MaxSpeedMHz'': ''Failure, expect value: 2300, + return value: 3500'', ''Model'': ''Failure, expect value: Intel(R) Xeon(R) Gold + 5218N CPU @ 2.30GHz, return value: Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz'', + ''ProcessorArchitecture'': ''Success'', ''Socket'': ''Success'', ''Status'': {''Health'': + ''Success'', ''State'': ''Success''}, ''TotalCores'': ''Failure, expect value: + 16, return value: 8'', ''TotalThreads'': ''Failure, expect value: 32, return value: + 16''}]}' + expected_code: 200 + expected_result: '{ "count": 2, "Manufacturer": "Intel(R) Corporation", "MaxSpeedMHz": + 2300, "Model": "Intel(R) Xeon(R) Gold 5218N CPU @ 2.30GHz", "ProcessorArchitecture": + ["x86", "IA-64", "ARM", "MIPS", "OEM"], "Socket": [1, 2], "Status": { "Health": + "OK", "State": "Enabled" }, "TotalCores": 16, "TotalThreads": + 32}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200, 200]' + url: https://{bmc_ip}{cpu_id} +- case_name: check memory mount + case_sn: 13 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Members@odata.count'': ''Failure, expect value: 12, return value: + 4''}]}' + expected_code: 200 + expected_result: '{"Members@odata.count": 12}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Memory +- case_name: check memory information + case_sn: 14 + details_result: '{''count'': ''Failure, the actual num is 4'', ''info'': [{''return_code'': + ''Success'', ''BaseModuleType'': "Failure, expect value: RDIMM, return value: + Can''t find the key BaseModuleType in return value", ''CapacityMiB'': ''Success'', + ''DeviceLocator'': ''Success'', ''Manufacturer'': ''Success'', ''MemoryDeviceType'': + ''Success'', ''OperatingSpeedMhz'': ''Failure, expect value: 2666, return value: + 2400'', ''PartNumber'': "Failure, expect value: [''HMA84GR7AFR4N-VK'', ''36ASF4G72PZ-2G6D1''], + return value: Can''t find the key PartNumber in return value", ''Status'': {''Health'': + ''Success'', ''State'': ''Success''}}, {''return_code'': ''Success'', ''BaseModuleType'': + "Failure, expect value: RDIMM, return value: Can''t find the key BaseModuleType + in return value", ''CapacityMiB'': ''Success'', ''DeviceLocator'': ''Success'', + ''Manufacturer'': ''Success'', ''MemoryDeviceType'': ''Success'', ''OperatingSpeedMhz'': + ''Failure, expect value: 2666, return value: 2400'', ''PartNumber'': "Failure, + expect value: [''HMA84GR7AFR4N-VK'', ''36ASF4G72PZ-2G6D1''], return value: Can''t + find the key PartNumber in return value", ''Status'': {''Health'': ''Success'', + ''State'': ''Success''}}, {''return_code'': ''Success'', ''BaseModuleType'': "Failure, + expect value: RDIMM, return value: Can''t find the key BaseModuleType in return + value", ''CapacityMiB'': ''Success'', ''DeviceLocator'': ''Success'', ''Manufacturer'': + ''Success'', ''MemoryDeviceType'': ''Success'', ''OperatingSpeedMhz'': ''Failure, + expect value: 2666, return value: 2400'', ''PartNumber'': "Failure, expect value: + [''HMA84GR7AFR4N-VK'', ''36ASF4G72PZ-2G6D1''], return value: Can''t find the key + PartNumber in return value", ''Status'': {''Health'': ''Success'', ''State'': + ''Success''}}, {''return_code'': ''Success'', ''BaseModuleType'': "Failure, expect + value: RDIMM, return value: Can''t find the key BaseModuleType in return value", + ''CapacityMiB'': ''Success'', ''DeviceLocator'': ''Success'', ''Manufacturer'': + ''Success'', ''MemoryDeviceType'': ''Success'', ''OperatingSpeedMhz'': ''Failure, + expect value: 2666, return value: 2400'', ''PartNumber'': "Failure, expect value: + [''HMA84GR7AFR4N-VK'', ''36ASF4G72PZ-2G6D1''], return value: Can''t find the key + PartNumber in return value", ''Status'': {''Health'': ''Success'', ''State'': + ''Success''}}]}' + expected_code: 200 + expected_result: '{ "count": 12, "BaseModuleType": "RDIMM", "CapacityMiB": + 32768, "DeviceLocator": "N/A", "Manufacturer": ["Hynix Semiconductor", "Micron"], "MemoryDeviceType": + "DDR4", "OperatingSpeedMhz": 2666, "PartNumber": ["HMA84GR7AFR4N-VK","36ASF4G72PZ-2G6D1"], "Status": + { "Health": "OK", "State": "Enabled" }}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200, 200, 200, 200]' + url: https://{bmc_ip}{memory_id} +- case_name: check raid card amount + case_sn: 15 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Members@odata.count'': ''Success''}]}' + expected_code: 200 + expected_result: '{"Members@odata.count": 1}' + final_rst: Success + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Storages +- case_name: check raid card information + case_sn: 16 + details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Success'', + ''StorageControllers'': [{''FirmwareVersion'': ''2.62'', ''Manufacturer'': ''H3C'', + ''Model'': ''N/A'', ''Status'': {''Health'': ''Success'', ''State'': ''Success''}}]}]}' + expected_code: 200 + expected_result: '{ "count": 1, "StorageControllers": [ { "FirmwareVersion": + "2.62", "Manufacturer": "H3C", "Model": "N/A", "Status": + { "Health": "OK", "State": "Enabled" } } ]}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}{storage_id} +- case_name: check harddisk information + case_sn: 17 + details_result: '{''count'': ''Failure, the actual num is 6'', ''info'': [{''return_code'': + ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], + return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, + ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect + value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': + ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': + ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], + return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, + ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect + value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': + ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': + ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], + return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, + ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect + value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': + ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': + ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], + return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, + ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect + value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': + ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': + ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], + return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, + ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect + value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': + ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}, {''return_code'': + ''Success'', ''CapacityBytes'': ''Failure, expect value: [480102187008, 960193626112], + return value: None'', ''Location'': {''Info'': ''N/A'', ''InfoFormat'': ''DeviceName''}, + ''Manufacturer'': ''ATA'', ''MediaType'': ''SSD'', ''Model'': "Failure, expect + value: [''INTEL SSDSC2KB48'', ''INTEL SSDSC2KB96''], return value: None", ''Protocol'': + ''Success'', ''Status'': {''Health'': ''Success'', ''State'': ''Enabled''}}]}' + expected_code: 200 + expected_result: '{ "count": 4, "CapacityBytes": [480102187008, 960193626112], "Location": + { "Info": "N/A", "InfoFormat": "DeviceName" }, "Manufacturer": + "ATA", "MediaType": "SSD", "Model": ["INTEL SSDSC2KB48", "INTEL SSDSC2KB96"], "Protocol": + "SATA", "Status": { "Health": "OK", "State": "Enabled" }}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200, 200, 200, 200, 200, 200]' + url: https://{bmc_ip}{drives_id} +- case_name: check network interface adapter information + case_sn: 18 + details_result: N/A + expected_code: 200 + expected_result: '{ "count": 3, "Manufacturer": "Mellanox", "Model": "NIC-620F-B2-25Gb-2P-1-X", "Name": + ["PCIeSlot2", "PCIeSlot3", "PCIeSlot6"], "Oem": { "Public": { "CardModel": + "2*25GE", "RootBDF": ["0000:17:00.0", "0000:17:02.0", "0000:AE:02.0"], } }, "Status": + { "Health": "OK", "State": "Enabled" }}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + url: https://{bmc_ip}{networkadapters_id} +- case_name: check network interface adapter port information + case_sn: 19 + details_result: N/A + expected_code: 200 + expected_result: '{ "count": 6, "AssociatedNetworkAddresses": [ "N/A" ], "Oem": + { "Public": { "BDF": "N/A", "PortType": "OpticalPort" } }, "PhysicalPortNumber": + ["1", "2"]}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + url: https://{bmc_ip}{networkports_id} +- case_name: check fans information + case_sn: 20 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''FanSummary'': "Failure, expect value: {''Count'': 6}, return value: + Can''t find the key FanSummary in return value", ''Fans'': [{''MemberId'': ''Success'', + ''Oem'': {''Public'': {''SpeedRatio'': ''N/A''}}, ''Status'': {''Health'': ''Success'', + ''State'': ''Success''}}, {''MemberId'': ''Success'', ''Oem'': {''Public'': {''SpeedRatio'': + ''N/A''}}, ''Status'': {''Health'': ''Success'', ''State'': ''Success''}}, {''MemberId'': + ''Success'', ''Oem'': {''Public'': {''SpeedRatio'': ''N/A''}}, ''Status'': {''Health'': + ''Success'', ''State'': ''Success''}}, {''MemberId'': ''Success'', ''Oem'': {''Public'': + {''SpeedRatio'': ''N/A''}}, ''Status'': {''Health'': ''Success'', ''State'': ''Success''}}, + {''MemberId'': ''Success'', ''Oem'': {''Public'': {''SpeedRatio'': ''N/A''}}, + ''Status'': {''Health'': ''Success'', ''State'': ''Success''}}, {''MemberId'': + ''Success'', ''Oem'': {''Public'': {''SpeedRatio'': ''N/A''}}, ''Status'': {''Health'': + ''Success'', ''State'': ''Success''}}]}]}' + expected_code: 200 + expected_result: '{ "FanSummary": { "Count": 6 }, "Fans": [ { "MemberId": + "N/A", "Oem": { "Public": { "SpeedRatio": + "N/A" } }, "Status": { "Health": + "OK", "State": "Enabled" } }, { "MemberId": + "N/A", "Oem": { "Public": { "SpeedRatio": + "N/A" } }, "Status": { "Health": + "OK", "State": "Enabled" } },{ "MemberId": + "N/A", "Oem": { "Public": { "SpeedRatio": + "N/A" } }, "Status": { "Health": + "OK", "State": "Enabled" } },{ "MemberId": + "N/A", "Oem": { "Public": { "SpeedRatio": + "N/A" } }, "Status": { "Health": + "OK", "State": "Enabled" } },{ "MemberId": + "N/A", "Oem": { "Public": { "SpeedRatio": + "N/A" } }, "Status": { "Health": + "OK", "State": "Enabled" } },{ "MemberId": + "N/A", "Oem": { "Public": { "SpeedRatio": + "N/A" } }, "Status": { "Health": + "OK", "State": "Enabled" } } ],}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id}/Thermal +- case_name: check power amount + case_sn: 21 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''DeviceMaxNum'': "Failure, expect value: {''PowerSupplyNum'': 2}, + return value: Can''t find the key DeviceMaxNum in return value"}]}' + expected_code: 200 + expected_result: '{ "DeviceMaxNum": { "PowerSupplyNum": 2},}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id} +- case_name: check power detail info + case_sn: 22 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''PowerControl'': [{''PowerConsumedWatts'': ''Success'', ''Status'': + {''Health'': ''OK'', ''State'': ''Enabled''}}], ''PowerSupplies'': [{''LineInputVoltage'': + ''Success'', ''MemberId'': ''Failure, expect value: 1, return value: 0'', ''PowerCapacityWatts'': + ''Failure, expect value: 800, return value: 460'', ''Status'': {''Health'': ''Success'', + ''State'': ''Success''}}, {''LineInputVoltage'': ''Success'', ''MemberId'': ''Failure, + expect value: 2, return value: 1'', ''PowerCapacityWatts'': ''Failure, expect + value: 800, return value: 460'', ''Status'': {''Health'': ''Failure, expect value: + OK, return value: Critical'', ''State'': ''Success''}}]}]}' + expected_code: 200 + expected_result: '{ "PowerControl": [ { "PowerConsumedWatts": + "N/A","Status":{ "Health": "OK", "State": "Enabled" } }, ], "PowerSupplies": + [ { "LineInputVoltage": "N/A", "MemberId": "1", "PowerCapacityWatts": + 800,"Status": { "Health": "OK", "State": "Enabled" } }, { "LineInputVoltage": + "N/A", "MemberId": "2", "PowerCapacityWatts": 800,"Status": + { "Health": "OK", "State": "Enabled" } } ],}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id}/Power +- case_name: check logical dirve health status + case_sn: 23 + details_result: N/A + expected_code: 200 + expected_result: '{ "count": 2, "Name": "N/A", "Status": { "Health": + ["OK", "Critical"], "State": "Enabled" }}' + final_rst: Failure + group: compoment management + header: null + method: GET + request_body: null + url: https://{bmc_ip}{volume_id} +- case_name: check server temperature air intake + case_sn: 24 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Temperatures'': [{''Name'': ''Failure, expect value: INPUT_TEMP, + return value: Inlet Temp'', ''ReadingCelsius'': ''Success''}]}]}' + expected_code: 200 + expected_result: '{ "Temperatures": [ { "Name": "INPUT_TEMP", "ReadingCelsius": + "N/A", } ]}' + final_rst: Failure + group: sensor management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id}/Thermal +- case_name: check cpu temperature + case_sn: 25 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''Temperatures'': [{''Name'': ''Failure, expect value: INPUT_TEMP, + return value: Inlet Temp'', ''ReadingCelsius'': ''Success''}, {''Name'': ''Failure, + expect value: CPU1_TEMP, return value: Outlet Temp'', ''ReadingCelsius'': ''Success''}, + {''Name'': ''Failure, expect value: CPU2_TEMP, return value: PCH Temp'', ''ReadingCelsius'': + ''N/A''}]}]}' + expected_code: 200 + expected_result: '{ "Temperatures": [ { "Name": "INPUT_TEMP", "ReadingCelsius": + "N/A", }, { "Name": "CPU1_TEMP", "ReadingCelsius": + "N/A", }, { "Name": "CPU2_TEMP", "ReadingCelsius": + "N/A", }, ]}' + final_rst: Failure + group: sensor management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Chassis/{chassis_id}/Thermal +- case_name: check server power state + case_sn: 26 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Success'', ''PowerState'': ''Failure, expect value: On, return value: Off''}]}' + expected_code: 200 + expected_result: '{"PowerState": "On"}' + final_rst: Failure + group: power management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id} +- case_name: remote power on server + case_sn: 27 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{"error":{"@Message.ExtendedInfo": [{"Message": "Successfully + Completed Request", "Severity":"OK"}]}}' + final_rst: Failure + group: power management + header: null + method: POST + request_body: '{"ResetType": "On"}' + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Actions/ComputerSystem.Reset +- case_name: remote power off server + case_sn: 28 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{"error":{"@Message.ExtendedInfo": [{"Message": "Successfully + Completed Request", "Severity":"OK"}]}}' + final_rst: Failure + group: power management + header: null + method: POST + request_body: '{"ResetType": "GracefulShutdown"}' + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Actions/ComputerSystem.Reset +- case_name: remote reset server + case_sn: 29 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{"error":{"@Message.ExtendedInfo": [{"Message": "Successfully + Completed Request", "Severity":"OK"}]}}' + final_rst: Failure + group: power management + header: null + method: POST + request_body: '{"ResetType": "ForceRestart"}' + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Actions/ComputerSystem.Reset +- case_name: remote configure CPU in hyperthreading disabled + case_sn: 30 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''Attributes'': "Failure, expect value: {''ProcessorHyperThreading'': + ''Disabled''}, return value: Can''t find the key Attributes in return value"}]}' + expected_code: 200 + expected_result: '{"Attributes": {"ProcessorHyperThreading": "Disabled"}}' + final_rst: Failure + group: remote configure + header: null + method: PATCH + request_body: '{ "Attributes": { "ProcessorHyperThreading": "Disabled" }}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings +- case_name: remote get CPU hyperthreading in disabled + case_sn: 31 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{"Attributes": {"ProcessorHyperThreading": "Disabled"}}' + final_rst: Failure + group: remote configure + header: null + method: GET + request_body: null + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios +- case_name: remote configure CPU in hyperthreading enabled + case_sn: 32 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''Attributes'': "Failure, expect value: {''ProcessorHyperThreading'': + ''Enabled''}, return value: Can''t find the key Attributes in return value"}]}' + expected_code: 200 + expected_result: '{"Attributes": {"ProcessorHyperThreading": "Enabled"}}' + final_rst: Failure + group: remote configure + header: null + method: PATCH + request_body: '{ "Attributes": { "ProcessorHyperThreading": "Enabled" }}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings +- case_name: remote get CPU hyperthreading in enabled + case_sn: 33 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{"Attributes": {"ProcessorHyperThreading": "Enabled"}}' + final_rst: Failure + group: remote configure + header: null + method: GET + request_body: null + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios +- case_name: disable PXE mode + case_sn: 34 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''Attributes'': "Failure, expect value: {''IPv4PXESupport'': ''Disabled''}, + return value: Can''t find the key Attributes in return value"}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "IPv4PXESupport": "Disabled" }}' + final_rst: Failure + group: remote configure + header: null + method: PATCH + request_body: '{ "Attributes": { "IPv4PXESupport": "Disabled" }}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings +- case_name: check IPV4 PXE mode in disabled + case_sn: 35 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "IPv4PXESupport": "Disabled" }}' + final_rst: Failure + group: remote configure + header: null + method: GET + request_body: null + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios +- case_name: enable PXE mode + case_sn: 36 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''Attributes'': "Failure, expect value: {''IPv4PXESupport'': ''Enabled''}, + return value: Can''t find the key Attributes in return value"}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "IPv4PXESupport": "Enabled" }}' + final_rst: Failure + group: remote configure + header: null + method: PATCH + request_body: '{ "Attributes": { "IPv4PXESupport": "Enabled" }}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings +- case_name: check ipv4 PXE mode in enabled + case_sn: 37 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "IPv4PXESupport": "Enabled" }}' + final_rst: Failure + group: remote configure + header: null + method: GET + request_body: null + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios +- case_name: set boot type order + case_sn: 38 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''Attributes'': "Failure, expect value: {''BootTypeOrder0'': ''HardDiskDrive'', + ''BootTypeOrder1'': ''DVDROMDrive'', ''BootTypeOrder2'': ''PXE'', ''BootTypeOrder3'': + ''Others''}, return value: Can''t find the key Attributes in return value"}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "BootTypeOrder0": "HardDiskDrive", "BootTypeOrder1": + "DVDROMDrive", "BootTypeOrder2": "PXE", "BootTypeOrder3": + "Others", }}' + final_rst: Failure + group: remote interface management + header: null + method: PATCH + request_body: '{ "Attributes": { "BootTypeOrder0": "HardDiskDrive", "BootTypeOrder1": + "DVDROMDrive", "BootTypeOrder2": "PXE", "BootTypeOrder3": + "Others", }}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings +- case_name: check boot order + case_sn: 39 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "BootTypeOrder0": "HardDiskDrive", "BootTypeOrder1": + "DVDROMDrive", "BootTypeOrder2": "PXE", "BootTypeOrder3": + "Others", }}' + final_rst: Failure + group: remote interface management + header: null + method: GET + request_body: null + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios +- case_name: configure boot order + case_sn: 40 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''Attributes'': "Failure, expect value: {''BootTypeOrder0'': ''DVDROMDrive'', + ''BootTypeOrder1'': ''HardDiskDrive'', ''BootTypeOrder2'': ''Others'', ''BootTypeOrder3'': + ''PXE''}, return value: Can''t find the key Attributes in return value"}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "BootTypeOrder0": "DVDROMDrive", "BootTypeOrder1": + "HardDiskDrive", "BootTypeOrder2": "Others", "BootTypeOrder3": + "PXE", }}' + final_rst: Failure + group: remote interface management + header: null + method: PATCH + request_body: '{ "Attributes": { "BootTypeOrder0": "DVDROMDrive", "BootTypeOrder1": + "HardDiskDrive", "BootTypeOrder2": "Others", "BootTypeOrder3": + "PXE", }}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings +- case_name: check boot order + case_sn: 41 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "BootTypeOrder0": "DVDROMDrive", "BootTypeOrder1": + "HardDiskDrive", "BootTypeOrder2": "Others", "BootTypeOrder3": + "PXE", }}' + final_rst: Failure + group: remote interface management + header: null + method: GET + request_body: null + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios +- case_name: configure new boot PXE order first + case_sn: 42 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''Attributes'': "Failure, expect value: {''BootTypeOrder0'': ''PXE'', + ''BootTypeOrder1'': ''HardDiskDrive'', ''BootTypeOrder2'': ''DVDROMDrive'', ''BootTypeOrder3'': + ''Others''}, return value: Can''t find the key Attributes in return value"}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "BootTypeOrder0": "PXE", "BootTypeOrder1": + "HardDiskDrive", "BootTypeOrder2": "DVDROMDrive", "BootTypeOrder3": + "Others", }}' + final_rst: Failure + group: remote interface management + header: null + method: PATCH + request_body: '{ "Attributes": { "BootTypeOrder0": "PXE", "BootTypeOrder1": + "HardDiskDrive", "BootTypeOrder2": "DVDROMDrive", "BootTypeOrder3": + "Others", }}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios/Settings +- case_name: check boot order PEX order first + case_sn: 43 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure''}]}' + expected_code: 200 + expected_result: '{ "Attributes": { "BootTypeOrder0": "PXE", "BootTypeOrder1": + "HardDiskDrive", "BootTypeOrder2": "DVDROMDrive", "BootTypeOrder3": + "Others", }}' + final_rst: Failure + group: remote interface management + header: null + method: GET + request_body: null + return_code_seq: '[]' + url: https://{bmc_ip}/redfish/v1/Systems/{system_id}/Bios +- case_name: check BMC Firmware version + case_sn: 44 + details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Success'', + ''FirmwareVersion'': ''Failure, expect value: 1.30.11P01 HDM V100R001B03D011SP01, + return value: 2.43''}]}' + expected_code: 200 + expected_result: '{"count": 1, "FirmwareVersion": "1.30.11P01 HDM V100R001B03D011SP01"}' + final_rst: Failure + group: remote interface management + header: null + method: GET + request_body: null + return_code_seq: '[200]' + url: https://{bmc_ip}{manager_id} +- case_name: change BMC account + case_sn: 45 + details_result: '{''count'': ''N/A for this case'', ''info'': [{''return_code'': + ''Failure'', ''UserName'': "Failure, expect value: CM_cc@1234, return value: Can''t + find the key UserName in return value", ''RoleId'': "Failure, expect value: Administrator, + return value: Can''t find the key RoleId in return value"}]}' + expected_code: 200 + expected_result: '{"UserName": "CM_cc@1234","RoleId": "Administrator",}' + final_rst: Failure + group: remote interface management + header: null + method: PATCH + request_body: '{"UserName": "CM_cc@1234","Password": "1234@CM_cc","RoleId": "Administrator",}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}/redfish/v1/AccountService/Accounts/3 +- case_name: configure BMC ip in static, ipv4 + case_sn: 46 + details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Failure'', + ''IPv4Addresses'': "Failure, expect value: [{''Address'': ''192.168.66.120'', + ''AddressOrigin'': ''Static'', ''Gateway'': ''192.168.66.1'', ''SubnetMask'': + ''255.255.255.128''}], return value: Can''t find the key IPv4Addresses in return + value"}]}' + expected_code: 200 + expected_result: '{"count": 1, "IPv4Addresses": [ { "Address": + "192.168.66.120", "AddressOrigin": "Static", "Gateway": + "192.168.66.1", "SubnetMask": "255.255.255.128" } ]}' + final_rst: Failure + group: remote interface management + header: null + method: PATCH + request_body: '{ "IPv4Addresses": [ { "Address": "192.168.66.120", "AddressOrigin": + "Static", "Gateway": "192.168.66.1", "SubnetMask": "255.255.255.128" } ]}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}{manager_id}/EthernetInterfaces/eth1 +- case_name: configure BMC ip in DHCP, gateway and subnet mask ipv4 + case_sn: 47 + details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Failure'', + ''IPv4Addresses'': "Failure, expect value: [{''Address'': ''192.168.66.120'', + ''AddressOrigin'': ''DHCP'', ''Gateway'': ''192.168.66.1'', ''SubnetMask'': ''255.255.255.128''}], + return value: Can''t find the key IPv4Addresses in return value"}]}' + expected_code: 200 + expected_result: '{"count": 1, "IPv4Addresses": [ { "Address": + "192.168.66.120", "AddressOrigin": "DHCP", "Gateway": "192.168.66.1", "SubnetMask": + "255.255.255.128" } ]}' + final_rst: Failure + group: remote interface management + header: null + method: PATCH + request_body: '{ "IPv4Addresses": [ { "AddressOrigin": "DHCP" } ]}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}{manager_id}/EthernetInterfaces/eth1 +- case_name: configure BMC ip in static, ipv4 + case_sn: 48 + details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Failure'', + ''IPv4Addresses'': "Failure, expect value: [{''AddressOrigin'': ''DHCP''}], return + value: Can''t find the key IPv4Addresses in return value"}]}' + expected_code: 200 + expected_result: '{"count": 1, "IPv4Addresses": [ { "AddressOrigin": + "DHCP", } ]}' + final_rst: Failure + group: remote interface management + header: null + method: PATCH + request_body: '{ "IPv4Addresses": [ { "AddressOrigin": "DHCP" } ]}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}{manager_id}/EthernetInterfaces/eth1 +- case_name: configure BMC ip in static, ipv6 + case_sn: 49 + details_result: '{''count'': ''Success'', ''info'': [{''return_code'': ''Failure'', + ''IPv6Addresses'': "Failure, expect value: [{''Address'': ''N/A'', ''AddressOrigin'': + ''N/A'', ''PrefixLength'': 64}, {''Address'': ''2019::11'', ''AddressOrigin'': + ''Static'', ''PrefixLength'': 64}], return value: Can''t find the key IPv6Addresses + in return value"}]}' + expected_code: 200 + expected_result: '{"count": 1, "IPv6Addresses": [ { "Address": + "N/A", "AddressOrigin": "N/A", "PrefixLength": 64 }, { "Address": + "2019::11", "AddressOrigin": "Static", "PrefixLength": 64 } ]}' + final_rst: Failure + group: remote interface management + header: null + method: PATCH + request_body: '{ "IPv6Addresses": [ { "Address": "2019::11", "AddressOrigin": + "Static", "PrefixLength": 64 } ]}' + return_code_seq: '[''N/A'']' + url: https://{bmc_ip}{manager_id}/EthernetInterfaces/eth1 diff --git a/tools/hdv/redfish/excel_2_yaml.py b/tools/hdv/redfish/excel_2_yaml.py index 3bda3d5..948ead3 100644 --- a/tools/hdv/redfish/excel_2_yaml.py +++ b/tools/hdv/redfish/excel_2_yaml.py @@ -13,7 +13,7 @@ convert excel config to yaml format config: depends.yaml and cases.yaml. import os import yaml from openpyxl.reader.excel import load_workbook -#pylint: disable=E0611 +# pylint: disable=E0611 from log_utils import LOGGER @@ -45,6 +45,7 @@ def load_sheet(excel_file, sheet_index, start_col, end_col): LOGGER.info(rows_list) return rows_list + def create_yaml(id_dict, yaml_file): ''' create yaml diff --git a/tools/hdv/redfish/hdv.py b/tools/hdv/redfish/hdv.py index 80db3c9..e06286e 100644 --- a/tools/hdv/redfish/hdv.py +++ b/tools/hdv/redfish/hdv.py @@ -11,10 +11,10 @@ hdv tools all config files are put under conf/ config.yaml is the global configuration additional config for supporting two modes - - excel: tools will parse the depend_id sheet and cases sheet and \ + - excel: tools will parse the depend_id sheet and cases sheet and execute test case and write report back to excel - - yaml: tools will parse depends.yaml and cases.yaml and execute test case and\ - write a report.yaml + - yaml: tools will parse depends.yaml and cases.yaml and execute test case + and write a report.yaml theory: either test case can be finished by one restful request, or an additional request needed to get dependency parent resource. @@ -23,24 +23,25 @@ hdv tools import argparse from hdv_redfish import run as run_case + def parse_args(): ''' parse arguments ''' parser = argparse.ArgumentParser(description="hdv tool by redfish, \ check readme under ./docs") - parser.add_argument('--version', action='version', \ + parser.add_argument('--version', action='version', version='%(prog)s 0.1', help="show tool version") - parser.add_argument('--config', type=str, default="./conf/config.yaml", \ + parser.add_argument('--config', type=str, default="./conf/config.yaml", help="given global config.yaml file") - parser.add_argument('--file_type', type=str, default="excel", \ + parser.add_argument('--file_type', type=str, default="excel", help="config file type, [yaml|excel],default is excel") - parser.add_argument('--case_yaml', type=str, default="./conf/cases.yaml", \ + parser.add_argument('--case_yaml', type=str, default="./conf/cases.yaml", help="case yaml file, uesd if file_type = yaml") - parser.add_argument('--depends_yaml', type=str, \ - default="./conf/depends.yaml",\ - help="depends yaml file,uesd if file_type = yaml") - parser.add_argument('--case_excel', type=str, default="./conf/cases.xlsx", \ + parser.add_argument('--depends_yaml', type=str, + default="./conf/depends.yaml", + help="depends yaml file,uesd if file_type = yaml") + parser.add_argument('--case_excel', type=str, default="./conf/cases.xlsx", help="excel case file used if file_type = excel") args = parser.parse_args() return args @@ -51,8 +52,8 @@ def main(): main function ''' args = parse_args() - run_case(args.config, args.case_excel, args.depends_yaml, args.case_yaml,\ - args.file_type) + run_case(args.config, args.case_excel, args.depends_yaml, args.case_yaml, + args.file_type) if __name__ == "__main__": diff --git a/tools/hdv/redfish/hdv_redfish.py b/tools/hdv/redfish/hdv_redfish.py index 6d325f6..5fc44ca 100644 --- a/tools/hdv/redfish/hdv_redfish.py +++ b/tools/hdv/redfish/hdv_redfish.py @@ -29,7 +29,6 @@ ACCOUNT_INFO = {} WAIT_INTERVAL = 5 - def parse_config(config_yaml): """ parse setting from config.yaml @@ -428,8 +427,8 @@ def check_component_cnt(expect_return_value, res_list, result): if expect_return_value['count'] == len(res_list): result.update({"count": "Success"}) else: - result.update({"count": \ - "Failure, the actual num is "+ str(len(res_list))}) + result.update({"count": + "Failure, the actual num is " + str(len(res_list))}) else: result.update({"count": "N/A for this case"}) return result @@ -471,7 +470,7 @@ def parse_test_result(expect_return_value, expect_return_code, flag += 1 continue - #parse the actual result according to the expected value hierachy. + # parse the actual result according to the expected value hierachy. ex_value = copy.deepcopy(expect_return_value) exp_act_pairs = {} for key, value in ex_value.items(): @@ -482,7 +481,7 @@ def parse_test_result(expect_return_value, expect_return_code, else: LOGGER.error("%s, %s", ERROR_CODE['E500001'], key) exp_act_pairs[key] = \ - (value, "Can't find the key {} in return value".format(key)) + (value, "Can't find key {} in return value".format(key)) LOGGER.debug("real_result:%s", exp_act_pairs) # comparing expected result with real result. @@ -525,7 +524,7 @@ def execute_final_url(config_file, depends_id, http_handler, def run_test_case_yaml(config_file, case_file, depends_id, http_handler): '''run test case from cases.yaml ''' - LOGGER.info("################# start perform test case ###################") + LOGGER.info("############### start perform test case #################") cases_result = [] cases = read_yaml(case_file) for case in cases: @@ -556,7 +555,7 @@ def run_test_case_yaml(config_file, case_file, depends_id, http_handler): write_result_2_yaml(cases_result) - LOGGER.info("################# end perform test case #####################") + LOGGER.info("############### end perform test case ###################") def read_yaml(file): @@ -573,7 +572,8 @@ def write_result_2_yaml(result): write test result to new report.yaml ''' LOGGER.info("writing to yaml file") - yaml.dump(result, open("./conf/report.yaml", "w")) + yaml.safe_dump(result, open("./conf/report.yaml", "w"), + explicit_start=True) def run_test_case_excel(config_file, case_file, depends_id, http_handler): @@ -581,7 +581,7 @@ def run_test_case_excel(config_file, case_file, depends_id, http_handler): perform the test case one by one, and write test final_result back to the excel. ''' - LOGGER.info("################# start perform test case ###################") + LOGGER.info("############### start perform test case #################") input_file = load_workbook(case_file) input_ws = input_file[input_file.sheetnames[0]] @@ -615,7 +615,7 @@ def run_test_case_excel(config_file, case_file, depends_id, http_handler): config_file, input_ws, row, flag, final_result) row += 1 input_file.save(case_file) - LOGGER.info("################# end perform test case #####################") + LOGGER.info("############### end perform test case ###################") def run(conf_file, case_excel_file=None, depend_yaml_file=None, diff --git a/tools/hdv/redfish/http_handler.py b/tools/hdv/redfish/http_handler.py index 259bcaf..c1b0a13 100644 --- a/tools/hdv/redfish/http_handler.py +++ b/tools/hdv/redfish/http_handler.py @@ -23,7 +23,7 @@ ssl._create_default_https_context = ssl._create_unverified_context HEADERS = { 'Connection': 'keep-alive', - 'User-Agent': \ + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 \ (KHTML, like Gecko) Chrome/67.0.3396.62 Safari/537.36', } diff --git a/tools/hdv/redfish/yaml_utils.py b/tools/hdv/redfish/yaml_utils.py index 21e4fb6..438c150 100644 --- a/tools/hdv/redfish/yaml_utils.py +++ b/tools/hdv/redfish/yaml_utils.py @@ -6,6 +6,7 @@ import yaml # pylint: disable=E0611 from log_utils import LOGGER + def read_yaml(file): '''read a yaml file ''' @@ -18,7 +19,6 @@ def read_yaml(file): def write_yaml(file, dict_data): '''write a yaml file ''' - #yaml.dump(dict_data, open(file, "w"), width = 80) yaml.safe_dump(dict_data, open(file, "w"), explicit_start=True) diff --git a/tox.ini b/tox.ini index d60f800..4464987 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ files = INFO.yaml tools commands = - yamllint -s {[testenv:yamllint]files} + yamllint -s {[testenv:yamllint]files} -c {toxinidir}/yamllintrc [testenv:bashate] basepython = python3 -- cgit 1.2.3-korg