blob: 5db24361a112edd2d78dc58c1a5993fc6d33651b [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
2Documentation This example demonstrates executing commands on a remote machine
3... and getting their output and the return code.
4...
5... Notice how connections are handled as part of the suite setup and
6... teardown. This saves some time when executing several test cases.
7
Rahul Maheshwari06174f22017-03-06 03:17:09 -06008Resource ../lib/rest_client.robot
9Resource ../lib/ipmi_client.robot
10Resource ../lib/openbmc_ffdc.robot
George Keishinga7433222017-03-23 23:47:11 -050011Resource ../lib/state_manager.robot
Rahul Maheshwari06174f22017-03-06 03:17:09 -060012Library ../data/model.py
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050013Resource ../lib/boot_utils.robot
Steven Sombaraaf72c42017-09-05 12:02:00 -050014Resource ../lib/utils.robot
Chris Austenb29d2e82016-06-07 12:25:35 -050015
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060016Suite Setup Suite Setup Execution
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060017Test Teardown Test Teardown Execution
Chris Austenb29d2e82016-06-07 12:25:35 -050018
19*** Variables ***
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050020
21${stack_mode} skip
22${model}= ${OPENBMC_MODEL}
Chris Austenb29d2e82016-06-07 12:25:35 -050023
24*** Test Cases ***
Chris Austenb29d2e82016-06-07 12:25:35 -050025
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050026io_board Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -050027 [Tags] io_board_Present
Sweta Potthuri4a556022017-11-24 04:03:37 -060028 ${uri}= Get System component io_board
29 Verify The Attribute ${uri} Present ${True}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050030
31io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -050032 [Tags] io_board_Fault
Sweta Potthuri4a556022017-11-24 04:03:37 -060033 ${uri}= Get System component io_board
34 Verify The Attribute ${uri} fault ${False}
Chris Austenb29d2e82016-06-07 12:25:35 -050035
36*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050037
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060038Suite Setup Execution
Steven Sombaraaf72c42017-09-05 12:02:00 -050039 [Documentation] Initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -050040
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050041 # Boot Host.
42 REST Power On
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050043
George Keishingab1bd922016-12-05 05:29:59 -060044 ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050045 Set Suite Variable ${SYSTEM_INFO} ${resp}
46 log Dictionary ${resp}
47
48Get System component
49 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060050 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
51 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
52 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -060053 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050054
Chris Austenb29d2e82016-06-07 12:25:35 -050055
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060056Test Teardown Execution
Rahul Maheshwari06174f22017-03-06 03:17:09 -060057 [Documentation] Do the post test teardown.
58 ... 1. Capture FFDC on test failure.
59 ... 2. Close all open SSH connections.
60
61 FFDC On Test Case Fail
62 Close All Connections