blob: fadf4ce46f296cbf29c98ae2dfea3e475ea7b6ba [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
Rahul Maheshwari06174f22017-03-06 03:17:09 -060017Test Setup Open Connection And Log In
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060018Test Teardown Test Teardown Execution
Chris Austenb29d2e82016-06-07 12:25:35 -050019
20*** Variables ***
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050021
22${stack_mode} skip
23${model}= ${OPENBMC_MODEL}
Chris Austenb29d2e82016-06-07 12:25:35 -050024
25*** Test Cases ***
Chris Austenb29d2e82016-06-07 12:25:35 -050026
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050027io_board Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -050028 [Tags] io_board_Present
Sweta Potthuri4a556022017-11-24 04:03:37 -060029 ${uri}= Get System component io_board
30 Verify The Attribute ${uri} Present ${True}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050031
32io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -050033 [Tags] io_board_Fault
Sweta Potthuri4a556022017-11-24 04:03:37 -060034 ${uri}= Get System component io_board
35 Verify The Attribute ${uri} fault ${False}
Chris Austenb29d2e82016-06-07 12:25:35 -050036
37*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050038
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060039Suite Setup Execution
Steven Sombaraaf72c42017-09-05 12:02:00 -050040 [Documentation] Initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -050041
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050042 # Boot Host.
43 REST Power On
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050044
45 Open Connection And Log In
George Keishingab1bd922016-12-05 05:29:59 -060046 ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050047 Set Suite Variable ${SYSTEM_INFO} ${resp}
48 log Dictionary ${resp}
49
50Get System component
51 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060052 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
53 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
54 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -060055 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050056
Chris Austenb29d2e82016-06-07 12:25:35 -050057
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060058Test Teardown Execution
Rahul Maheshwari06174f22017-03-06 03:17:09 -060059 [Documentation] Do the post test teardown.
60 ... 1. Capture FFDC on test failure.
61 ... 2. Close all open SSH connections.
62
63 FFDC On Test Case Fail
64 Close All Connections