blob: 3f0c9ae37f4ffcdcace49c08bec2f889d8e7b107 [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 Potthuri7e5dc592017-07-03 06:10:02 -050016Suite Setup Setup The Suite
Rahul Maheshwari06174f22017-03-06 03:17:09 -060017Test Setup Open Connection And Log In
18Test Teardown Post Test Case 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
27Execute ipmi BT capabilities command
George Keishingcac24c72016-09-23 04:44:19 -050028 [Tags] Execute_ipmi_BT_capabilities_command
Chris Austenb29d2e82016-06-07 12:25:35 -050029 Run IPMI command 0x06 0x36
30 response Should Be Equal " 01 40 40 0a 01"
31
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050032io_board Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -050033 [Tags] io_board_Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -060034 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050035 Read The Attribute ${uri} present
36 Response Should Be Equal True
37
38io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -050039 [Tags] io_board_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -060040 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050041 Read The Attribute ${uri} fault
42 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -050043
44*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050045
46Setup The Suite
Steven Sombaraaf72c42017-09-05 12:02:00 -050047 [Documentation] Initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -050048
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050049 # Boot Host.
50 REST Power On
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050051
52 Open Connection And Log In
George Keishingab1bd922016-12-05 05:29:59 -060053 ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050054 Set Suite Variable ${SYSTEM_INFO} ${resp}
55 log Dictionary ${resp}
56
57Get System component
58 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060059 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
60 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
61 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -060062 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050063
Chris Austenb29d2e82016-06-07 12:25:35 -050064
65response Should Be Equal
Gunnar Mills38032802016-12-12 13:43:40 -060066 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -050067 Should Be Equal ${OUTPUT} ${args}
68
Gunnar Mills56b32892016-11-14 13:56:17 -060069Read the Attribute
Gunnar Mills38032802016-12-12 13:43:40 -060070 [Arguments] ${uri} ${parm}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060071 ${output}= Read Attribute ${uri} ${parm}
Chris Austenb29d2e82016-06-07 12:25:35 -050072 set test variable ${OUTPUT} ${output}
73
Rahul Maheshwari06174f22017-03-06 03:17:09 -060074Post Test Case Execution
75 [Documentation] Do the post test teardown.
76 ... 1. Capture FFDC on test failure.
77 ... 2. Close all open SSH connections.
78
79 FFDC On Test Case Fail
80 Close All Connections