blob: 1d57e6def034e62cba00d0d579ea148ef9bbae5a [file] [log] [blame]
George Keishing50cd0012017-09-14 12:23:41 -05001*** Settings ***
2Documentation Suite to test OCC power module.
3
4Resource ../lib/open_power_utils.robot
5Resource ../lib/boot_utils.robot
6Resource ../lib/state_manager.robot
7Resource ../lib/openbmc_ffdc.robot
George Keishing40588cc2017-11-22 08:13:37 -06008Resource ../lib/utils.robot
George Keishing50cd0012017-09-14 12:23:41 -05009
10Suite Setup Suite Setup Execution
11Test Teardown Test Teardown Execution
12
13*** Test Cases ***
14
15Verify OCC Object Count
16 [Documentation] Verify that OCC and inventory entries match.
17 [Tags] Verify_OCC_Object_Count
18
19 # Example:
20 # /org/open_power/control/enumerate
21 # {
22 # "/org/open_power/control/host0": {},
23 # "/org/open_power/control/occ0": {
24 # "OccActive": 0
25 # },
26 # "/org/open_power/control/occ1": {
27 # "OccActive": 0
28 # }
29 # }
30
31 # Inventory counterpart cpu's:
32 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0",
33 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1",
34
35 ${inventory_count}= Count Object Entries
36 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/ cpu*
37
38 Should Be Equal ${occ_count} ${inventory_count}
39 ... msg=OCC and inventory entry counts are mismatched.
40
George Keishing5d8dc122017-12-20 08:00:34 -060041Verify OCC State When Host Is Booted
Sweta Potthuri9d62b502017-10-10 03:57:42 -050042 [Documentation] Verify OCC state when host is booted.
George Keishing5d8dc122017-12-20 08:00:34 -060043 [Tags] Verify_OCC_State_When_Host_Is_Booted
George Keishing50cd0012017-09-14 12:23:41 -050044
Sweta Potthuri9d62b502017-10-10 03:57:42 -050045 Verify OCC State ${1}
George Keishing50cd0012017-09-14 12:23:41 -050046
Sweta Potthuri9d62b502017-10-10 03:57:42 -050047Verify OCC State After Host Reboot
48 [Documentation] Verify OCC state and count after host reboot.
49 [Tags] Verify_OCC_State_After_Host_Reboot
George Keishing50cd0012017-09-14 12:23:41 -050050
George Keishingfb218a12018-11-28 11:20:42 -060051 ${occ_count_before}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050052 Verify OCC State ${1}
George Keishing8ae18332018-09-04 12:43:55 -050053 Host Reboot
Sweta Potthuri9d62b502017-10-10 03:57:42 -050054 Verify OCC State ${1}
George Keishingfb218a12018-11-28 11:20:42 -060055 ${occ_count_after}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050056 Should be Equal ${occ_count_before} ${occ_count_after}
George Keishing50cd0012017-09-14 12:23:41 -050057
Sweta Potthuri9d62b502017-10-10 03:57:42 -050058Verify OCC State After BMC Reset
59 [Documentation] Verify OCC state and count after BMC reset.
60 [Tags] Verify_OCC_State_After_BMC_Reset
61
George Keishingfb218a12018-11-28 11:20:42 -060062 ${occ_count_before}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050063 OBMC Reboot (run)
64 Verify OCC State ${1}
George Keishingfb218a12018-11-28 11:20:42 -060065 ${occ_count_after}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050066 Should be Equal ${occ_count_before} ${occ_count_after}
67
68Verify OCC State At Standby
69 [Documentation] Verify OCC state at standby.
70 [Tags] Verify_OCC_State_At_Standby
71
72 REST Power Off stack_mode=normal
73 Verify OCC State ${0}
George Keishing50cd0012017-09-14 12:23:41 -050074
75*** Keywords ***
76
77Suite Setup Execution
78 [Documentation] Do the initial test suite setup.
79 # - Power off.
80 # - Boot Host.
81
82 Smart Power Off
83 REST Power On
84 Count OCC Object Entry
85
George Keishing50cd0012017-09-14 12:23:41 -050086Count OCC Object Entry
87 [Documentation] Count OCC object entry and set count.
88
89 ${object_count}= Count Object Entries ${OPENPOWER_CONTROL} occ*
90 Set Suite Variable ${occ_count] ${object_count}
91
92
93Test Teardown Execution
94 [Documentation] Do the post test teardown.
95 # - Capture FFDC on test failure.
96 # - Delete error logs.
97 # - Close all open SSH connections.
98
99 FFDC On Test Case Fail
George Keishing40588cc2017-11-22 08:13:37 -0600100 Delete All Error Logs
George Keishing50cd0012017-09-14 12:23:41 -0500101 Close All Connections