blob: df76bfdcf9fffe78a5f91ffb4664a56a672cc773 [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
8
9Suite Setup Suite Setup Execution
10Test Teardown Test Teardown Execution
11
12*** Test Cases ***
13
14Verify OCC Object Count
15 [Documentation] Verify that OCC and inventory entries match.
16 [Tags] Verify_OCC_Object_Count
17
18 # Example:
19 # /org/open_power/control/enumerate
20 # {
21 # "/org/open_power/control/host0": {},
22 # "/org/open_power/control/occ0": {
23 # "OccActive": 0
24 # },
25 # "/org/open_power/control/occ1": {
26 # "OccActive": 0
27 # }
28 # }
29
30 # Inventory counterpart cpu's:
31 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0",
32 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1",
33
34 ${inventory_count}= Count Object Entries
35 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/ cpu*
36
37 Should Be Equal ${occ_count} ${inventory_count}
38 ... msg=OCC and inventory entry counts are mismatched.
39
40
41Verify OCC Active State
42 [Documentation] Check OCC active state.
43 [Tags] Verify_OCC_Active_State
44
45 # Example cpu_list data output:
46 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
47 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
48 ${cpu_list}= Get Endpoint Paths
49 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/ cpu*
50
51 :FOR ${endpoint_path} IN @{cpu_list}
52 \ ${is_functional}= Read Object Attribute ${endpoint_path} Functional
53 \ Continue For Loop If ${is_functional} == ${0}
54 \ ${num}= Set Variable ${endpoint_path[-1]}
55 \ ${occ_active}= Get OCC Active State ${OPENPOWER_CONTROL}occ${num}
56 \ Should Be True ${occ_active} msg=OCC ${num} is not active.
57
58
59*** Keywords ***
60
61Suite Setup Execution
62 [Documentation] Do the initial test suite setup.
63 # - Power off.
64 # - Boot Host.
65
66 Smart Power Off
67 REST Power On
68 Count OCC Object Entry
69
70
71Count OCC Object Entry
72 [Documentation] Count OCC object entry and set count.
73
74 ${object_count}= Count Object Entries ${OPENPOWER_CONTROL} occ*
75 Set Suite Variable ${occ_count] ${object_count}
76
77
78Test Teardown Execution
79 [Documentation] Do the post test teardown.
80 # - Capture FFDC on test failure.
81 # - Delete error logs.
82 # - Close all open SSH connections.
83
84 FFDC On Test Case Fail
85 Delete Error Logs
86 Close All Connections
87