1*** Settings ***
2
3
4Documentation     Verify Redfish tool general functionality.
5
6Library           OperatingSystem
7Library           String
8Library           Collections
9
10Resource          ../../lib/resource.robot
11Resource          ../../lib/bmc_redfish_resource.robot
12Resource          ../../lib/openbmc_ffdc.robot
13Resource          ../../lib/dmtf_redfishtool_utils.robot
14
15
16Suite Setup       Suite Setup Execution
17
18
19*** Variables ***
20
21
22${root_cmd_args} =  SEPARATOR=
23...  redfishtool raw -r ${OPENBMC_HOST} -u ${OPENBMC_USERNAME} -p ${OPENBMC_PASSWORD} -S Always
24${min_number_sensors}  ${15}
25
26
27*** Test Cases ***
28
29Verify Redfishtool Sensor Commands
30    [Documentation]  Verify redfishtool's sensor commands.
31    [Tags]  Verify_Redfishtool_Sensor_Commands
32
33    ${sensor_status}=  Redfishtool Get  /redfish/v1/Chassis/${CHASSIS_ID}/Sensors
34    ${json_object}=  Evaluate  json.loads('''${sensor_status}''')  json
35    Should Be True  ${json_object["Members@odata.count"]} > ${min_number_sensors}
36    ...  msg=There should be at least ${min_number_sensors} sensors.
37
38
39Verify Redfishtool Health Check Commands
40    [Documentation]  Verify redfishtool's health check command.
41    [Tags]  Verify_Redfishtool_Health_Check_Commands
42
43    ${chassis_data}=  Redfishtool Get  /redfish/v1/Chassis/${CHASSIS_ID}/
44    ${json_object}=  Evaluate  json.loads('''${chassis_data}''')  json
45    ${status}=  Set Variable  ${json_object["Status"]}
46    Should Be Equal  OK  ${status["Health"]}
47    ...  msg=Health status should be OK.
48
49
50*** Keywords ***
51
52
53Suite Setup Execution
54    [Documentation]  Do suite setup execution.
55
56    ${tool_exist}=  Run  which redfishtool
57    Should Not Be Empty  ${tool_exist}
58