blob: 821eabaec048d4e07e13f772ff4f9a5c3f0438bc [file] [log] [blame]
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -05001*** Settings ***
2Documentation This suite is for testing general IPMI functions.
3
4Resource ../../lib/ipmi_client.robot
5Resource ../../lib/openbmc_ffdc.robot
Rahul Maheshwari615da152018-02-13 23:53:36 -06006Resource ../lib/boot_utils.robot
7Library ../../lib/ipmi_utils.py
Sweta Potthurif39022d2018-02-06 03:40:07 -06008Resource ../../lib/bmc_network_utils.robot
Rahul Maheshwariabe13af2018-02-15 22:42:08 -06009Variables ../data/ipmi_raw_cmd_table.py
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -050010
Sweta Potthurif39022d2018-02-06 03:40:07 -060011Suite Setup Suite Setup Execution
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -050012Test Teardown FFDC On Test Case Fail
13
Rahul Maheshwariabe13af2018-02-15 22:42:08 -060014
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -050015*** Variables ***
16
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -060017${new_mc_id}= HOST
Rahul Maheshwari901dcde2018-02-06 03:14:31 -060018${allowed_temp_diff}= ${1}
Rahul Maheshwari615da152018-02-13 23:53:36 -060019${allowed_power_diff}= ${10}
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -060020
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -050021*** Test Cases ***
22
23Set Asset Tag With Valid String Length
24 [Documentation] Set asset tag with valid string length and verify.
25 [Tags] Set_Asset_Tag_With_Valid_String_Length
26
27 # Allowed MAX characters length for asset tag name is 63.
28 ${random_string}= Generate Random String 63
29 Run Keyword Run IPMI Standard Command dcmi set_asset_tag ${random_string}
30
31 ${asset_tag}= Run Keyword Run IPMI Standard Command dcmi asset_tag
32 Should Contain ${asset_tag} ${random_string}
33
34
35Set Asset Tag With Invalid String Length
36 [Documentation] Verify error while setting invalid asset tag via IPMI.
37 [Tags] Set_Asset_Tag_With_Invalid_String_Length
38
39 # Any string more than 63 character is invalid for asset tag.
40 ${random_string}= Generate Random String 64
41
42 ${resp}= Run Keyword And Expect Error * Run IPMI Standard Command
43 ... dcmi set_asset_tag ${random_string}
44 Should Contain ${resp} Parameter out of range ignore_case=True
45
46
47Set Asset Tag With Valid String Length Via REST
48 [Documentation] Set valid asset tag via REST and verify.
49 [Tags] Set_Asset_Tag_With_Valid_String_Length_Via_REST
50
51 ${random_string}= Generate Random String 63
52 ${args}= Create Dictionary data=${random_string}
53 Write Attribute /xyz/openbmc_project/inventory/system AssetTag
54 ... data=${args}
55
56 ${asset_tag}= Read Attribute /xyz/openbmc_project/inventory/system
57 ... AssetTag
58 Should Be Equal As Strings ${asset_tag} ${random_string}
59
Sweta Potthurif39022d2018-02-06 03:40:07 -060060
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -060061Verify Get And Set Management Controller ID String
62 [Documentation] Verify get and set management controller ID string.
63 [Tags] Verify_Get_And_Set_Management_Controller_ID_String
64
65 # Get the value of the managemment controller ID string.
66 # Example:
67 # Get Management Controller Identifier String: witherspoon
68
69 ${cmd_output}= Run IPMI Standard Command dcmi get_mc_id_string
70
71 # Extract management controller ID from cmd_output.
72 ${initial_mc_id}= Fetch From Right ${cmd_output} :${SPACE}
73
74 # Set the management controller ID string to other value.
75 # Example:
76 # Set Management Controller Identifier String Command: HOST
77
78 Set Management Controller ID String ${new_mc_id}
79
80 # Get the management controller ID and verify.
81 Get Management Controller ID String And Verify ${new_mc_id}
82
83 # Set the value back to the initial value and verify.
84 Set Management Controller ID String ${initial_mc_id}
85
86 # Get the management controller ID and verify.
87 Get Management Controller ID String And Verify ${initial_mc_id}
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -050088
Sweta Potthurif39022d2018-02-06 03:40:07 -060089
Sweta Potthuri0cc60502018-01-24 00:36:17 -060090Verify Chassis Identify via IPMI
91 [Documentation] Verify "chassis identify" using IPMI command.
92 [Tags] Verify_Chassis_Identify_via_IPMI
93
94 # Set to default "chassis identify" and verify that LED blinks for 15s.
95 Run IPMI Standard Command chassis identify
96 Verify Identify LED State Blink
97
98 Sleep 15s
99 Verify Identify LED State Off
100
101 # Set "chassis identify" to 10s and verify that the LED blinks for 10s.
102 Run IPMI Standard Command chassis identify 10
103 Verify Identify LED State Blink
104
105 Sleep 10s
106 Verify Identify LED State Off
107
Sweta Potthurif39022d2018-02-06 03:40:07 -0600108
Sweta Potthuri0cc60502018-01-24 00:36:17 -0600109Verify Chassis Identify Off And Force Identify On via IPMI
110 [Documentation] Verify "chassis identify" off
111 ... and "force identify on" via IPMI.
112 [Tags] Verify_Chassis_Identify_Off_And_Force_Identify_On_via_IPMI
113
114 # Set the LED to "Force Identify On".
115 Run IPMI Standard Command chassis identify force
116 Verify Identify LED State Blink
117
118 # Set "chassis identify" to 0 and verify that the LED turns off.
119 Run IPMI Standard Command chassis identify 0
120 Verify Identify LED State Off
121
Sweta Potthurif39022d2018-02-06 03:40:07 -0600122
Sweta Potthuri7d3af3c2018-01-29 03:07:07 -0600123Test Watchdog Reset Via IPMI And Verify Using REST
124 [Documentation] Test watchdog reset via IPMI and verify using REST.
125 [Tags] Test_Watchdog_Reset_Via_IPMI_And_Verify_Using_REST
126
127 Initiate Host Boot
128
129 Set Watchdog Enabled Using REST ${1}
130
131 Watchdog Object Should Exist
132
133 # Resetting the watchdog via IPMI.
134 Run IPMI Standard Command mc watchdog reset
135
136 # Verify the watchdog is reset using REST after an interval of 1000ms.
137 Sleep 1000ms
138 ${watchdog_time_left}=
139 ... Read Attribute ${HOST_WATCHDOG_URI} TimeRemaining
140 Should Be True
141 ... ${watchdog_time_left}<${1200000} and ${watchdog_time_left}>${2000}
142 ... msg=Watchdog timer didn't reset.
143
Sweta Potthurif39022d2018-02-06 03:40:07 -0600144
Sweta Potthuri7d3af3c2018-01-29 03:07:07 -0600145Test Watchdog Off Via IPMI And Verify Using REST
146 [Documentation] Test watchdog off via IPMI and verify using REST.
147 [Tags] Test_Watchdog_Off_Via_IPMI_And_Verify_Using_REST
148
149 Initiate Host Boot
150
151 Set Watchdog Enabled Using REST ${1}
152
153 Watchdog Object Should Exist
154
155 # Turn off the watchdog via IPMI.
156 Run IPMI Standard Command mc watchdog off
157
158 # Verify the watchdog is off using REST
159 ${watchdog_state}= Read Attribute ${HOST_WATCHDOG_URI} Enabled
160 Should Be Equal ${watchdog_state} ${0}
161 ... msg=msg=Verification failed for watchdog off check.
Rahul Maheshwari901dcde2018-02-06 03:14:31 -0600162
163
164Test Ambient Temperature Via IPMI
165 [Documentation] Test ambient temperature via IPMI and verify using REST.
166 [Tags] Test_Ambient_Temperature_Via_IPMI
167
168 # Entity ID Entity Instance Temp. Readings
169 # Inlet air temperature(40h) 1 +19 C
170 # CPU temperature sensors(41h) 5 +51 C
171 # CPU temperature sensors(41h) 6 +50 C
172 # CPU temperature sensors(41h) 7 +50 C
173 # CPU temperature sensors(41h) 8 +50 C
174 # CPU temperature sensors(41h) 9 +50 C
175 # CPU temperature sensors(41h) 10 +48 C
176 # CPU temperature sensors(41h) 11 +49 C
177 # CPU temperature sensors(41h) 12 +47 C
178 # CPU temperature sensors(41h) 8 +50 C
179 # CPU temperature sensors(41h) 16 +51 C
180 # CPU temperature sensors(41h) 24 +50 C
181 # CPU temperature sensors(41h) 32 +43 C
182 # CPU temperature sensors(41h) 40 +43 C
183 # Baseboard temperature sensors(42h) 1 +35 C
184
185 ${temp_reading}= Run IPMI Standard Command dcmi get_temp_reading -N 10
186 ${ambient_temp_line}=
187 ... Get Lines Containing String ${temp_reading}
188 ... Inlet air temperature case-insensitive
189
190 ${ambient_temp_ipmi}= Fetch From Right ${ambient_temp_line} +
191 ${ambient_temp_ipmi}= Remove String ${ambient_temp_ipmi} ${SPACE}C
192
193 ${ambient_temp_rest}= Read Attribute
194 ... ${SENSORS_URI}temperature/ambient Value
195
196 # Example of ambient temperature via REST
197 # "CriticalAlarmHigh": 0,
198 # "CriticalAlarmLow": 0,
199 # "CriticalHigh": 35000,
200 # "CriticalLow": 0,
201 # "Scale": -3,
202 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.DegreesC",
203 # "Value": 21775,
204 # "WarningAlarmHigh": 0,
205 # "WarningAlarmLow": 0,
206 # "WarningHigh": 25000,
207 # "WarningLow": 0
208
209 # Get temperature value based on scale i.e. Value * (10 power Scale Value)
210 # e.g. from above case 21775 * (10 power -3) = 21775/1000
211
212 ${ambient_temp_rest}= Evaluate ${ambient_temp_rest}/1000
213 ${ipmi_rest_temp_diff}=
214 ... Evaluate abs(${ambient_temp_rest} - ${ambient_temp_ipmi})
215
216 Should Be True ${ipmi_rest_temp_diff} <= ${allowed_temp_diff}
217 ... msg=Ambient temperature above allowed threshold ${allowed_temp_diff}.
218
219
Rahul Maheshwari43556632018-02-05 23:42:52 -0600220Verify Get DCMI Capabilities
221 [Documentation] Verify get DCMI capabilities command output.
222 [Tags] Verify_Get_DCMI_Capabilities
223
224 ${cmd_output}= Run IPMI Standard Command dcmi discover
225
226 @{supported_capabilities}= Create List
227 # Supported DCMI capabilities:
228 ... Mandatory platform capabilties
229 ... Optional platform capabilties
230 ... Power management available
231 ... Managebility access capabilties
232 ... In-band KCS channel available
233 # Mandatory platform attributes:
234 ... 200 SEL entries
235 ... SEL automatic rollover is enabled
236 # Optional Platform Attributes:
237 ... Slave address of device: 0h (8bits)(Satellite/External controller)
238 ... Channel number is 0h (Primary BMC)
239 ... Device revision is 0
240 # Manageability Access Attributes:
241 ... Primary LAN channel number: 1 is available
242 ... Secondary LAN channel is not available for OOB
243 ... No serial channel is available
244
245 :FOR ${capability} IN @{supported_capabilities}
246 \ Should Contain ${cmd_output} ${capability} ignore_case=True
247 ... msg=Supported DCMI capabilities not present.
248
249
Rahul Maheshwari615da152018-02-13 23:53:36 -0600250Test Power Reading Via IPMI With Host Booted
251 [Documentation] Test power reading via IPMI with host booted state and
252 ... verify using REST.
253 [Tags] Test_Power_Reading_Via_IPMI_With_Host_Booted
254
255 REST Power On stack_mode=skip quiet=1
256
257 # Example of power reading command output via IPMI.
258 # Instantaneous power reading: 235 Watts
259 # Minimum during sampling period: 235 Watts
260 # Maximum during sampling period: 235 Watts
261 # Average power reading over sample period: 235 Watts
262 # IPMI timestamp: Thu Jan 1 00:00:00 1970
263 # Sampling period: 00000000 Seconds.
264 # Power reading state is: deactivated
265
266 ${power_reading}= Get IPMI Power Reading
267 ${power_reading_ipmi}= Set Variable
268 ... ${power_reading['instantaneous_power_reading']}
269 ${power_reading_ipmi}= Remove String ${power_reading_ipmi} ${SPACE}Watts
270
271 ${power_reading_rest}= Read Attribute
272 ... ${SENSORS_URI}power/total_power Value
273
274 # Example of power reading via REST
275 # "CriticalAlarmHigh": 0,
276 # "CriticalAlarmLow": 0,
277 # "CriticalHigh": 3100000000,
278 # "CriticalLow": 0,
279 # "Scale": -6,
280 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts",
281 # "Value": 228000000,
282 # "WarningAlarmHigh": 0,
283 # "WarningAlarmLow": 0,
284 # "WarningHigh": 3050000000,
285 # "WarningLow": 0
286
287 # Get power value based on scale i.e. Value * (10 power Scale Value)
288 # e.g. from above case 228000000 * (10 power -6) = 228000000/1000000
289
290 ${power_reading_rest}= Evaluate ${power_reading_rest}/1000000
291 ${ipmi_rest_power_diff}=
292 ... Evaluate abs(${power_reading_rest} - ${power_reading_ipmi})
293
294 Should Be True ${ipmi_rest_power_diff} <= ${allowed_power_diff}
295 ... msg=Power reading above allowed threshold ${allowed_power_diff}.
296
297
Rahul Maheshwariabe13af2018-02-15 22:42:08 -0600298Test Power Reading Via IPMI Raw Command
299 [Documentation] Test power reading via IPMI raw command and verify
300 ... using REST.
301 [Tags] Test_Power_Reading_Via_IPMI_Raw_Command
302
303 # Response data structure of power reading command output via IPMI.
304 # 1 Completion Code. Refer to section 8, DCMI Completion Codes.
305 # 2 Group Extension Identification = DCh
306 # 3:4 Current Power in watts
307
308 ${ipmi_raw_output}= Run IPMI Standard Command
309 ... raw ${IPMI_RAW_CMD['power_reading']['Get'][0]}
310
311 @{raw_output_list}= Split String ${ipmi_raw_output} ${SPACE}
312
313 # On successful execution of raw IPMI power reading command, completion
314 # code does not come in output. So current power value will start from 2
315 # byte instead of 3.
316
317 ${power_reading_ipmi_raw_3_item}= Get From List ${raw_output_list} 2
318 ${power_reading_ipmi_raw_3_item}=
319 ... Convert To Integer 0x${power_reading_ipmi_raw_3_item}
320
321 ${power_reading_rest}= Read Attribute
322 ... ${SENSORS_URI}power/total_power Value
323
324 # Example of power reading via REST
325 # "CriticalAlarmHigh": 0,
326 # "CriticalAlarmLow": 0,
327 # "CriticalHigh": 3100000000,
328 # "CriticalLow": 0,
329 # "Scale": -6,
330 # "Unit": "xyz.openbmc_project.Sensor.Value.Unit.Watts",
331 # "Value": 228000000,
332 # "WarningAlarmHigh": 0,
333 # "WarningAlarmLow": 0,
334 # "WarningHigh": 3050000000,
335 # "WarningLow": 0
336
337 # Get power value based on scale i.e. Value * (10 power Scale Value)
338 # e.g. from above case 228000000 * (10 power -6) = 228000000/1000000
339
340 ${power_reading_rest}= Evaluate ${power_reading_rest}/1000000
341 ${ipmi_rest_power_diff}=
342 ... Evaluate abs(${power_reading_rest} - ${power_reading_ipmi_raw_3_item})
343
344 Should Be True ${ipmi_rest_power_diff} <= ${allowed_power_diff}
345 ... msg=Power Reading above allowed threshold ${allowed_power_diff}.
346
347
Rahul Maheshwari91a18ef2018-02-15 04:54:59 -0600348Test Baseboard Temperature Via IPMI
349 [Documentation] Test baseboard temperature via IPMI and verify using REST.
350 [Tags] Test_Baseboard_Temperature_Via_IPMI
351
352 # Example of IPMI dcmi get_temp_reading output:
353 # Entity ID Entity Instance Temp. Readings
354 # Inlet air temperature(40h) 1 +19 C
355 # CPU temperature sensors(41h) 5 +51 C
356 # CPU temperature sensors(41h) 6 +50 C
357 # CPU temperature sensors(41h) 7 +50 C
358 # CPU temperature sensors(41h) 8 +50 C
359 # CPU temperature sensors(41h) 9 +50 C
360 # CPU temperature sensors(41h) 10 +48 C
361 # CPU temperature sensors(41h) 11 +49 C
362 # CPU temperature sensors(41h) 12 +47 C
363 # CPU temperature sensors(41h) 8 +50 C
364 # CPU temperature sensors(41h) 16 +51 C
365 # CPU temperature sensors(41h) 24 +50 C
366 # CPU temperature sensors(41h) 32 +43 C
367 # CPU temperature sensors(41h) 40 +43 C
368 # Baseboard temperature sensors(42h) 1 +35 C
369
370 ${temp_reading}= Run IPMI Standard Command dcmi get_temp_reading -N 10
371 ${baseboard_temp_line}=
372 ... Get Lines Containing String ${temp_reading}
373 ... Baseboard temperature case-insensitive=True
374
375 ${baseboard_temp_ipmi}= Fetch From Right ${baseboard_temp_line} +
376 ${baseboard_temp_ipmi}= Remove String ${baseboard_temp_ipmi} ${SPACE}C
377
378 ${baseboard_temp_rest}= Read Attribute
379 ... /xyz/openbmc_project/sensors/temperature/pcie Value
380 ${baseboard_temp_rest}= Evaluate ${baseboard_temp_rest}/1000
381
382 Should Be True
383 ... ${baseboard_temp_rest} - ${baseboard_temp_ipmi} <= ${allowed_temp_diff}
384 ... msg=Baseboard temperature above allowed threshold ${allowed_temp_diff}.
385
386
Sweta Potthurif39022d2018-02-06 03:40:07 -0600387Retrieve Default Gateway Via IPMI And Verify Using REST
388 [Documentation] Retrieve default gateway from LAN print using IPMI.
389 [Tags] Retrieve_Default_Gateway_Via_IPMI_And_Verify_Using_REST
390
391 # Fetch "Default Gateway" from IPMI LAN print.
392 ${default_gateway_ipmi}= Fetch Details From LAN Print Default Gateway IP
393
394 # Verify "Default Gateway" using REST.
395 Read Attribute ${NETWORK_MANAGER}/config DefaultGateway
396 ... expected_value=${default_gateway_ipmi}
397
398
399Retrieve MAC Address Via IPMI And Verify Using REST
400 [Documentation] Retrieve MAC Address from LAN print using IPMI.
401 [Tags] Retrieve_MAC_Address_Via_IPMI_And_Verify_Using_REST
402
403 # Fetch "MAC Address" from IPMI LAN print.
404 ${mac_address_ipmi}= Fetch Details From LAN Print MAC Address
405
406 # Verify "MAC Address" using REST.
407 ${mac_address_rest}= Get BMC MAC Address
408 Should Be Equal ${mac_address_ipmi} ${mac_address_rest}
409 ... msg=Verification of MAC address from lan print using IPMI failed.
410
411
412Retrieve Network Mode Via IPMI And Verify Using REST
413 [Documentation] Retrieve network mode from LAN print using IPMI.
414 [Tags] Retrieve_Network_Mode_Via_IPMI_And_Verify_Using_REST
415
416 # Fetch "Mode" from IPMI LAN print.
417 ${network_mode_ipmi}= Fetch Details From LAN Print Source
418
419 # Verify "Mode" using REST.
420 ${network_mode_rest}= Read Attribute
421 ... ${NETWORK_MANAGER}/eth0 DHCPEnabled
422 Run Keyword If '${network_mode_ipmi}' == 'Static Address'
423 ... Should Be Equal ${network_mode_rest} ${0}
424 ... msg=Verification of network setting failed.
425 ... ELSE IF '${network_mode_ipmi}' == 'DHCP'
426 ... Should Be Equal ${network_mode_rest} ${1}
427 ... msg=Verification of network setting failed.
428
429
430Retrieve IP Address Via IPMI And Verify With BMC Details
431 [Documentation] Retrieve IP address from LAN print using IPMI.
432 [Tags] Retrieve_IP_Address_Via_IPMI_And_Verify_With_BMC_Details
433
434 # Fetch "IP Address" from IPMI LAN print.
435 ${ip_addr_ipmi}= Fetch Details From LAN Print IP Address
436
437 # Verify the IP address retrieved via IPMI with BMC IPs.
438 ${ip_address_rest}= Get BMC IP Info
439 Validate IP On BMC ${ip_addr_ipmi} ${ip_address_rest}
440
441
Rahul Maheshwarife8639b2018-02-05 22:42:24 -0600442Verify Get Device ID
443 [Documentation] Verify get device ID command output.
444 [Tags] Verify_Get_Device_ID
445
446 # Example of get device ID command output:
447 # Device ID : 0
448 # Device Revision : 0
449 # Firmware Revision : 2.01
450 # IPMI Version : 2.0
451 # Manufacturer ID : 42817
452 # Manufacturer Name : Unknown (0xA741)
453 # Product ID : 16975 (0x424f)
454 # Product Name : Unknown (0x424F)
455 # Device Available : yes
456 # Provides Device SDRs : yes
457 # Additional Device Support :
458 # Sensor Device
459 # SEL Device
460 # FRU Inventory Device
461 # Chassis Device
462 # Aux Firmware Rev Info :
463 # 0x00
464 # 0x00
465 # 0x00
466 # 0x00
467
468 ${mc_info}= Get MC Info
469
470 Should Be Equal ${mc_info['device_id']} 0
471 Should Be Equal ${mc_info['device_revision']} 0
472
473 # Get major BMC version from BMC cli i.e. 2.1 from "v2.1-51-g04ff12c"
474 ${bmc_version}= Get BMC Version
475 ${bmc_version}= Fetch From Left ${bmc_version} -
476 ${bmc_version}= Remove String ${bmc_version} "v
477
478 Should Be Equal ${mc_info['firmware_revision']} ${bmc_version}
479 Should Be Equal ${mc_info['ipmi_version']} 2.0
480
481 # TODO: Verify Manufacturer and Product IDs directy from json file.
482 # Reference : openbmc/openbmc-test-automation#1244
483 Should Be Equal ${mc_info['manufacturer_id']} 42817
484 Should Be Equal ${mc_info['product_id']} 16975 (0x424f)
485
486 Should Be Equal ${mc_info['device_available']} yes
487 Should Be Equal ${mc_info['provides_device_sdrs']} yes
488 Should Contain ${mc_info['additional_device_support']} Sensor Device
489 Should Contain ${mc_info['additional_device_support']} SEL Device
490 Should Contain
491 ... ${mc_info['additional_device_support']} FRU Inventory Device
492 Should Contain ${mc_info['additional_device_support']} Chassis Device
493 Should Contain X Times ${mc_info['aux_firmware_rev_info']} 0x00 4
494
495
Rahul Maheshwarifdd5ff62017-08-01 04:15:03 -0500496*** Keywords ***
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -0600497
Sweta Potthurif39022d2018-02-06 03:40:07 -0600498
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -0600499Set Management Controller ID String
500 [Documentation] Set the management controller ID string.
501 [Arguments] ${string}
502
503 # Description of argument(s):
504 # string Management Controller ID String to be set
505
506 ${set_mc_id_string}= Run IPMI Standard Command
507 ... dcmi set_mc_id_string ${string}
508
Sweta Potthurif39022d2018-02-06 03:40:07 -0600509
Sweta Potthuri5c6c72e2018-01-23 05:48:35 -0600510Get Management Controller ID String And Verify
511 [Documentation] Get the management controller ID sting.
512 [Arguments] ${string}
513
514 # Description of argument(s):
515 # string Management Controller ID string
516
517 ${get_mc_id}= Run IPMI Standard Command dcmi get_mc_id_string
518 Should Contain ${get_mc_id} ${string}
519 ... msg=Command failed: get_mc_id.
Sweta Potthuri0cc60502018-01-24 00:36:17 -0600520
Sweta Potthurif39022d2018-02-06 03:40:07 -0600521
Sweta Potthuri0cc60502018-01-24 00:36:17 -0600522Verify Identify LED State
523 [Documentation] Verify the identify LED state
524 ... matches caller's expectations.
525 [Arguments] ${expected_state}
526
527 # Description of argument(s):
528 # expected_state The LED state expected by the caller ("Blink" or "Off").
529
530 ${resp}= Read Attribute ${LED_PHYSICAL_URI}/front_id State
531 Should Be Equal ${resp} xyz.openbmc_project.Led.Physical.Action.${expected_state}
532 ... msg=Unexpected LED state.
533
534 ${resp}= Read Attribute ${LED_PHYSICAL_URI}/rear_id State
535 Should Be Equal ${resp} xyz.openbmc_project.Led.Physical.Action.${expected_state}
536 ... msg=Unexpected LED state.
537
Sweta Potthurif39022d2018-02-06 03:40:07 -0600538
Sweta Potthuri7d3af3c2018-01-29 03:07:07 -0600539Set Watchdog Enabled Using REST
540 [Documentation] Set watchdog Enabled field using REST.
541 [Arguments] ${value}
542
543 # Description of argument(s):
544 # value Integer value (eg. "0-Disabled", "1-Enabled").
545
546 ${value_dict}= Create Dictionary data=${value}
547 ${resp}= OpenBMC Put Request ${HOST_WATCHDOG_URI}/attr/Enabled
548 ... data=${value_dict}
Sweta Potthurif39022d2018-02-06 03:40:07 -0600549
550
551Log LAN Print Details
552 [Documentation] Log IPMI LAN print details and return them as a string.
553
554 # Example:
555
556 # Set in Progress : Set Complete
557 # Auth Type Support : MD5
558 # Auth Type Enable : Callback : MD5
559 # : User : MD5
560 # : Operator : MD5
561 # : Admin : MD5
562 # : OEM : MD5
563 # IP Address Source : Static Address
564 # IP Address : xx.xx.xx.xx
565 # Subnet Mask : yy.yy.yy.yy
566 # MAC Address : xx.xx.xx.xx.xx.xx
567 # Default Gateway IP : xx.xx.xx.xx
568 # 802.1q VLAN ID : Disabled Cipher Suite
569 # Priv Max : Not Available
570 # Bad Password Threshold : Not Available
571
572 Login To OS Host
573 Check If IPMI Tool Exist
574
575 ${cmd_buf}= Catenate ${IPMI_INBAND_CMD} lan print
576
577 ${stdout} ${stderr} ${rc}= OS Execute Command ${cmd_buf}
578 Log ${stdout}
579 [Return] ${stdout}
580
581
582Fetch Details From LAN Print
583 [Documentation] Fetch details from LAN print.
584 [Arguments] ${field_name}
585
586 # Description of argument(s):
587 # ${field_name} Field name to be fetched from LAN print
588 # (e.g. "MAC Address", "Source").
589
590 ${stdout}= Log LAN Print Details
591 ${fetch_value}= Get Lines Containing String ${stdout} ${field_name}
592 ${value_fetch}= Fetch From Right ${fetch_value} :${SPACE}
593 [Return] ${value_fetch}
594
595
596Suite Setup Execution
597 [Documentation] Do the suite setup execution tasks.
598
599 Should Not Be Empty
600 ... ${OS_HOST} msg=You must provide DNS name/IP of the OS host.
601 Should Not Be Empty
602 ... ${OS_USERNAME} msg=You must provide OS host user name.
603 Should Not Be Empty
604 ... ${OS_PASSWORD} msg=You must provide OS host user password.
605
606 # Boot To OS
607 REST Power On quiet=${1}
608