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
18Test Tags        Redfishtool_General
19
20*** Variables ***
21
22
23${root_cmd_args} =  SEPARATOR=
24...  redfishtool raw -r ${OPENBMC_HOST}:${HTTPS_PORT} -u ${OPENBMC_USERNAME} -p ${OPENBMC_PASSWORD} -S Always
25${min_number_sensors}  ${15}
26
27
28*** Test Cases ***
29
30Verify Redfishtool Sensor Commands
31    [Documentation]  Verify redfishtool's sensor commands.
32    [Tags]  Verify_Redfishtool_Sensor_Commands
33
34    ${sensor_status}=  Redfishtool Get  /redfish/v1/Chassis/${CHASSIS_ID}/Sensors
35    ${json_object}=  Evaluate  json.loads('''${sensor_status}''')  json
36    Should Be True  ${json_object["Members@odata.count"]} > ${min_number_sensors}
37    ...  msg=There should be at least ${min_number_sensors} sensors.
38
39
40Verify Redfishtool Health Check Commands
41    [Documentation]  Verify redfishtool's health check command.
42    [Tags]  Verify_Redfishtool_Health_Check_Commands
43
44    ${chassis_data}=  Redfishtool Get  /redfish/v1/Chassis/${CHASSIS_ID}/
45    ${json_object}=  Evaluate  json.loads('''${chassis_data}''')  json
46    ${status}=  Set Variable  ${json_object["Status"]}
47    Should Be Equal  OK  ${status["Health"]}
48    ...  msg=Health status should be OK.
49
50
51*** Keywords ***
52
53
54Suite Setup Execution
55    [Documentation]  Do suite setup execution.
56
57    ${tool_exist}=  Run  which redfishtool
58    Should Not Be Empty  ${tool_exist}
59