1*** Settings ***
2Documentation       BMC collect VPD and hardware status.
3
4# Test Parameters:
5# OPENBMC_HOST      The BMC host name or IP address.
6
7Resource            ../lib/bmc_redfish_resource.robot
8Resource            ../lib/openbmc_ffdc.robot
9
10Suite Setup         Suite Setup Execution
11Test Setup          Printn
12
13*** Variables ***
14${QUIET}  ${1}
15
16*** Test Cases ***
17
18Collect VPD And Hardware Status
19    [Documentation]  Collect VPD and hardware status using Redfish.
20    [Tags]  collect_vpd
21    [Setup]  Redfish.Login
22    [Teardown]  Redfish Test Teardown Execution
23
24    ${system_properties}=  Redfish_Utils.Get Properties  ${SYSTEM_BASE_URI}
25    ${system_memory_info}=  Redfish_Utils.Enumerate Request  ${SYSTEM_BASE_URI}/Memory
26    ${system_processors_info}=  Redfish_Utils.Enumerate Request  ${SYSTEM_BASE_URI}/Processors
27    ${system_fans_info}=  Redfish_Utils.Get Attribute  ${REDFISH_CHASSIS_THERMAL_URI}  Fans
28    ${collected_values}=  gen_robot_print.Sprint Vars
29    ...  system_properties  system_memory_info  system_processors_info  system_fans_info
30    Log To Console  ${\n}${collected_values}${\n}
31
32Run VPD Tool
33    [Documentation]  Run vpd-tool -i.
34    [Tags]  run_vpd_tool
35
36    BMC Execute Command  vpd-tool -i  print_out=${1}
37
38*** Keywords ***
39
40Suite Setup Execution
41    [Documentation]  Do test case setup tasks.
42
43    Set Log Level  DEBUG
44    Log To Console  ${OPENBMC_HOST}
45
46
47Redfish Test Teardown Execution
48    [Documentation]  Do the post test teardown for redfish.
49
50    Redfish.Logout
51    FFDC On Test Case Fail  clean_up=${FALSE}
52