blob: 50f86b9ed8fcfedd8d5c08d26f802a46f2af4cf7 [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.
Sweta Potthuri4a556022017-11-24 04:03:37 -060029 [Tags] Verify_IPMI_BT_Capabilities_Command
George Keishing872ee592017-10-28 08:43:09 -050030 [Setup] REST Power On
31
Sweta Potthuri4a556022017-11-24 04:03:37 -060032 ${output}= Run IPMI command 0x06 0x36
33 Should Be True "${output}" == " 01 3f 3f 0a 01"
34 ... msg=Incorrect Output
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
Sweta Potthuri4a556022017-11-24 04:03:37 -060038 ${uri}= Get System component io_board
39 Verify The Attribute ${uri} Present ${True}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050040
41io_board Fault
Rahul Maheshwarif8119102016-10-05 01:15:56 -050042 [Tags] io_board_Fault
Sweta Potthuri4a556022017-11-24 04:03:37 -060043 ${uri}= Get System component io_board
44 Verify The Attribute ${uri} fault ${False}
Chris Austenb29d2e82016-06-07 12:25:35 -050045
46*** Keywords ***
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050047
48Setup The Suite
Steven Sombaraaf72c42017-09-05 12:02:00 -050049 [Documentation] Initial suite setup.
George Keishingf1426682017-07-12 23:17:17 -050050
Sweta Potthuriaf741cb2017-07-04 09:41:17 -050051 # Boot Host.
52 REST Power On
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050053
54 Open Connection And Log In
George Keishingab1bd922016-12-05 05:29:59 -060055 ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050056 Set Suite Variable ${SYSTEM_INFO} ${resp}
57 log Dictionary ${resp}
58
59Get System component
60 [Arguments] ${type}
Gunnar Mills1cd544d2016-12-06 11:19:22 -060061 ${list}= Get Dictionary Keys ${SYSTEM_INFO}
62 ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$
63 ${url}= Get From List ${resp} 0
Gunnar Millsc9ea9362016-12-13 16:21:13 -060064 [Return] ${url}
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050065
Sweta Potthuri4a556022017-11-24 04:03:37 -060066Verify The Attribute
67 [Arguments] ${uri} ${parm} ${value}
68 # Description of arguments:
69 # ${uri} URI path.
70 # ${parm} Attribute.
71 # ${value} Output to be compared.
Chris Austenb29d2e82016-06-07 12:25:35 -050072
Sweta Potthuri4a556022017-11-24 04:03:37 -060073 ${output}= Read Attribute ${uri} ${parm}
74 Should Be Equal ${value} ${output}
Chris Austenb29d2e82016-06-07 12:25:35 -050075
Rahul Maheshwari06174f22017-03-06 03:17:09 -060076Post Test Case Execution
77 [Documentation] Do the post test teardown.
78 ... 1. Capture FFDC on test failure.
79 ... 2. Close all open SSH connections.
80
81 FFDC On Test Case Fail
82 Close All Connections