1*** Settings ***
2Documentation    This suite tests Redfish Host power operations.
3
4Resource         ../../lib/boot_utils.robot
5Resource         ../../lib/common_utils.robot
6Resource         ../../lib/open_power_utils.robot
7
8Test Setup       Test Setup Execution
9Test Teardown    Test Teardown Execution
10
11*** Test Cases ***
12
13Verify Redfish Host GracefulShutdown
14    [Documentation]  Verify Redfish host graceful shutdown operation.
15    [Tags]  Verify_Redfish_Host_GracefulShutdown
16
17    Redfish Power Off
18
19
20Verify Redfish BMC PowerOn
21    [Documentation]  Verify Redfish host power on operation.
22    [Tags]  Verify_Redfish_Host_PowerOn
23
24    Redfish Power On
25
26    # TODO: Replace OCC state check with redfish property when available.
27    Verify OCC State
28
29    Redfish.Login
30    ${power_control}=  Redfish.Get Attribute  ${REDFISH_CHASSIS_POWER_URI}  PowerControl
31    Rprint Vars   power_control
32    Valid Dict  power_control[${0}]  ['PowerConsumedWatts']
33
34
35Verify Redfish BMC GracefulRestart
36    [Documentation]  Verify Redfish host graceful restart operation.
37    [Tags]  Verify_Redfish_Host_GracefulRestart
38
39    Redfish Host Reboot
40
41
42Verify Redfish BMC PowerOff
43    [Documentation]  Verify Redfish host power off operation.
44    [Tags]  Verify_Redfish_Host_PowerOff
45
46    Redfish Hard Power Off
47
48*** Keywords ***
49
50Test Setup Execution
51    [Documentation]  Do test case setup tasks.
52
53    Printn
54    Start SOL Console Logging
55
56
57Test Teardown Execution
58    [Documentation]  Collect FFDC and SOL log.
59
60    FFDC On Test Case Fail
61    ${sol_log}=    Stop SOL Console Logging
62    Log   ${sol_log}
63    Set Auto Reboot  ${1}
64