blob: fd1e99dc86719bf2eb98954807dd277b3ab75278 [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
George Keishing872ee592017-10-28 08:43:09 -050027Verify IPMI BT Capabilities Command
28 [Documentation] Verify IPMI BT capability command response.
29 [Tags] Verify_IPMI BT_Capabilities_Command
30 [Setup] REST Power On
31
32 ${output} = Run IPMI command 0x06 0x36
33 Should Be Equal As Strings "${output}" " 01 3f 3f 0a 01"
34
Chris Austenb29d2e82016-06-07 12:25:35 -050035
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050036io_board Present
Rahul Maheshwarif8119102016-10-05 01:15:56 -050037 [Tags] io_board_Present
Gunnar Mills1cd544d2016-12-06 11:19:22 -060038 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050039 Read The Attribute ${uri} present
40 Response Should Be Equal True
41
42io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -050043 [Tags] io_board_Fault
Gunnar Mills1cd544d2016-12-06 11:19:22 -060044 ${uri}= Get System component io_board
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050045 Read The Attribute ${uri} fault
46 Response Should Be Equal False
Chris Austenb29d2e82016-06-07 12:25:35 -050047
48*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050049
50Setup The Suite
Steven Sombaraaf72c42017-09-05 12:02:00 -050051 [Documentation] Initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -050052
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050053 # Boot Host.
54 REST Power On
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050055
56 Open Connection And Log In
George Keishingab1bd922016-12-05 05:29:59 -060057 ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050058 Set Suite Variable ${SYSTEM_INFO} ${resp}
59 log Dictionary ${resp}
60
61Get System component
62 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060063 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
64 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
65 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -060066 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050067
Chris Austenb29d2e82016-06-07 12:25:35 -050068
69response Should Be Equal
Gunnar Mills38032802016-12-12 13:43:40 -060070 [Arguments] ${args}
Chris Austenb29d2e82016-06-07 12:25:35 -050071 Should Be Equal ${OUTPUT} ${args}
72
Gunnar Mills56b32892016-11-14 13:56:17 -060073Read the Attribute
Gunnar Mills38032802016-12-12 13:43:40 -060074 [Arguments] ${uri} ${parm}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060075 ${output}= Read Attribute ${uri} ${parm}
Chris Austenb29d2e82016-06-07 12:25:35 -050076 set test variable ${OUTPUT} ${output}
77
Rahul Maheshwari06174f22017-03-06 03:17:09 -060078Post Test Case Execution
79 [Documentation] Do the post test teardown.
80 ... 1. Capture FFDC on test failure.
81 ... 2. Close all open SSH connections.
82
83 FFDC On Test Case Fail
84 Close All Connections