blob: 3e992509f30b46e875913957b9819f678eb04fd1 [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
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -050027 [Documentation] Verify that the IO board is 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
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -050033 [Documentation] Verify that the IO board signals "fault".
Rahul Maheshwarif8119102016-10-05 01:15:56 -050034 [Tags] io_board_Fault
Sweta Potthuri4a556022017-11-24 04:03:37 -060035 ${uri}= Get System component io_board
36 Verify The Attribute ${uri} fault ${False}
Chris Austenb29d2e82016-06-07 12:25:35 -050037
38*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050039
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060040Suite Setup Execution
Steven Sombaraaf72c42017-09-05 12:02:00 -050041 [Documentation] Initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -050042
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050043 # Boot Host.
44 REST Power On
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050045
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
Joy Onyerikwuf4a807b2018-06-20 08:43:54 -050051 [Documentation] Get the system component.
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050052 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060053 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
Michael Walshd917c6e2018-12-11 10:09:09 -060054 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}\[0-9]*$
Gunnar Mills1cd544d2016-12-06 11:19:22 -060055 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -060056 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050057
Chris Austenb29d2e82016-06-07 12:25:35 -050058
Sweta Potthuri09a3cf92017-12-08 01:19:53 -060059Test Teardown Execution
Rahul Maheshwari06174f22017-03-06 03:17:09 -060060 [Documentation] Do the post test teardown.
61 ... 1. Capture FFDC on test failure.
62 ... 2. Close all open SSH connections.
63
64 FFDC On Test Case Fail
65 Close All Connections