blob: ae17bf984c38f6b839ecfe04257dcc1cce68fac8 [file] [log] [blame]
chithraga6be41e2022-03-01 13:20:23 +00001*** Settings ***
2Documentation This suite tests IPMI POH Counter Support in OpenBMC.
3... Feature: IPMI POH Counter Support
4...
George Keishing6e641262022-05-05 10:46:22 -05005... POH (Power-On Hours) counter is the incremental count of power ON
6... hours in the system.
chithraga6be41e2022-03-01 13:20:23 +00007...
8... Request and Response data defined under data/ipmi_raw_cmd_table.py
9...
10... Testcases added -
11... Get POH Counter Command Via IPMI
12... Verify Get POH Counter With Invalid Data Request Via IPMI
13... Verify POH Counter Reading With Wait Time
14... Verify POH Counter Reading With Host Power Off
15... Verify POH Counter Reading With Host Power On
16...
17... Script compares Minutes per count and Counter reading for the above scenarios.
18...
19... Minutes per count usually 60 minutes.
20...
George Keishing6e641262022-05-05 10:46:22 -050021... Wait Time given - 1 hour, 1 hour 30minutes when Host power OFF, 1 hour
22... after Host Power ON
chithraga6be41e2022-03-01 13:20:23 +000023...
George Keishing6e641262022-05-05 10:46:22 -050024... Comparison between Initial POH Counter reading and reading after wait
25... time / Power operation.
chithraga6be41e2022-03-01 13:20:23 +000026
27
chithraga6be41e2022-03-01 13:20:23 +000028Resource ../lib/ipmi_client.robot
29Resource ../lib/openbmc_ffdc.robot
ganesanbd0c4b802023-04-28 18:29:38 +000030Library Collections
31Library ../lib/ipmi_utils.py
chithraga6be41e2022-03-01 13:20:23 +000032Variables ../data/ipmi_raw_cmd_table.py
33
George Keishing87dc4422023-10-20 12:56:30 +053034Suite Setup Suite Setup Execution
35Suite Teardown Suite Teardown Execution
chithraga6be41e2022-03-01 13:20:23 +000036
George Keishing87dc4422023-10-20 12:56:30 +053037Test Teardown FFDC On Test Case Fail
chithraga6be41e2022-03-01 13:20:23 +000038
George Keishing87dc4422023-10-20 12:56:30 +053039Force Tags IPMI_Poh_Counter
chithraga6be41e2022-03-01 13:20:23 +000040
41*** Variables ***
42
43
44*** Test Cases ***
45
46Get POH Counter Command Via IPMI
47 [Documentation] Verify get POH counter command Via IPMI.
48 [Tags] Get_POH_Counter_Command_Via_IPMI
49
50 # Verify get POH counter command via IPMI.
51 ${resp}= Run IPMI Command
52 ... ${IPMI_RAW_CMD['Get']['POH_Counter'][0]}
53 Should Not Contain ${resp} ${IPMI_RAW_CMD['Get']['POH_Counter'][1]}
54
55
56Verify Get POH Counter With Invalid Data Request Via IPMI
57 [Documentation] Verify get POH counter with invalid data request via IPMI.
58 [Tags] Verify_Get_POH_Counter_With_Invalid_Data_Request_Via_IPMI
59
60 # verify get POH counter command with invalid data request Via IPMI.
61 ${resp}= Run Keyword and Expect Error *Request data length invalid*
62 ... Run IPMI Command ${IPMI_RAW_CMD['Get']['POH_Counter'][0]} 0x00
63
64
65Verify POH Counter Reading With Wait Time
66 [Documentation] Verify POH counter reading with wait time via IPMI.
67 [Tags] Verify_POH_Counter_Reading_With_Wait_Time
68
69 # Get initial POH command counter reading.
70 ${poh_counter_1}= Run Get POH Command And Return Counter Reading
71
72 # Sleep for given time.
73 Sleep 1h
74
75 # Get POH Counter Reading after waiting for given time period.
76 ${poh_counter_2}= Run Get POH Command And Return Counter Reading
77
78 # Verify difference between initial and present counter readings.
79 # The counter reading should always be incremented by 1 for each hour.
80 ${difference}= Evaluate ${poh_counter_2} - ${poh_counter_1}
81 Should Be Equal As Integers ${difference} 1
82
83
84Verify POH Counter Reading With Host Power Off
85 [Documentation] Verify POH counter reading with wait time after host power off.
86 [Tags] Verify_POH_Counter_Reading_With_Host_Power_Off
87
88 # Get initial POH command counter reading.
89 ${poh_counter_1}= Run Get POH Command And Return Counter Reading
90
91 # Power off the system.
92 IPMI Power Off
93
94 # Sleep for given time.
95 Sleep 1 hours 30 minutes
96
97 # Get POH counter reading after waiting for given time period.
98 ${poh_counter_2}= Run Get POH Command And Return Counter Reading
99
100 # Once the system is powered off,
101 # the poh counter reading should not increment.
102 Should Be Equal As Integers ${poh_counter_2} ${poh_counter_1}
103
104
105Verify POH Counter Reading With Host Power On
106 [Documentation] Verify Get POH Counter with wait time after host power on.
107 [Tags] Verify_POH_Counter_Reading_With_Host_Power_On
108
109 # Get initial POH command counter reading.
110 ${poh_counter_1}= Run Get POH Command And Return Counter Reading
111
112 # Power on the system.
113 IPMI Power On
114
115 # Sleep for given time.
116 Sleep 1h
117
118 # Get POH Counter reading after waiting for given time period.
119 ${poh_counter_2}= Run Get POH Command And Return Counter Reading
120
121 # Once the system is powered on,
122 # the pon counter reading should increment by 1.
123 ${difference}= Evaluate ${poh_counter_2} - ${poh_counter_1}
124 Should Be Equal As Integers ${difference} 1
125
126
127*** Keywords ***
128
129Run Get POH Command And Return Counter Reading
130 [Documentation] Run the IPMI command to Get POH Counter.
131
132 # Get POH counter Via IPMI.
133 ${resp}= Run IPMI Command
134 ... ${IPMI_RAW_CMD['Get']['POH_Counter'][0]}
135
136 # Verify Minutes per count.
137 ${data}= Split String ${resp}
138 Should Be Equal ${data[0]} 3c
139
140 # Get POH Command counter reading.
141 ${poh_counter_reading}= Set Variable ${data[1:]}
142 Reverse List ${poh_counter_reading}
143 ${poh_counter_reading}= Evaluate "".join(${poh_counter_reading})
144 ${poh_counter_reading}= Convert To Integer ${poh_counter_reading} 16
145
146 [Return] ${poh_counter_reading}
147
148
149Suite Setup Execution
150 [Documentation] Suite Setup Execution.
151
152 Redfish.Login
153
154 # Check Host current status.
155 ${current_host_state}= Get Host State Via Redfish
156
157 # If Host state is 'On' then the condition will not be executed.
158 # Host may take approx 5 - 6 minutes to complete power ON process.
159 Run Keyword If '${current_host_state}' == 'Off'
160 ... IPMI Power On
161
162
163Suite Teardown Execution
164 [Documentation] Suite Teardown Execution.
165
166 IPMI Power On
167 Redfish.Logout