Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation 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 Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 8 | Resource ../lib/rest_client.robot |
| 9 | Resource ../lib/ipmi_client.robot |
| 10 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | a743322 | 2017-03-23 23:47:11 -0500 | [diff] [blame] | 11 | Resource ../lib/state_manager.robot |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 12 | Library ../data/model.py |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 13 | Resource ../lib/boot_utils.robot |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 14 | Resource ../lib/utils.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 15 | |
Sweta Potthuri | 7e5dc59 | 2017-07-03 06:10:02 -0500 | [diff] [blame] | 16 | Suite Setup Setup The Suite |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 17 | Test Setup Open Connection And Log In |
| 18 | Test Teardown Post Test Case Execution |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 19 | |
| 20 | *** Variables *** |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 21 | |
| 22 | ${stack_mode} skip |
| 23 | ${model}= ${OPENBMC_MODEL} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 24 | |
| 25 | *** Test Cases *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 26 | |
| 27 | Execute ipmi BT capabilities command |
George Keishing | cac24c7 | 2016-09-23 04:44:19 -0500 | [diff] [blame] | 28 | [Tags] Execute_ipmi_BT_capabilities_command |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 29 | Run IPMI command 0x06 0x36 |
| 30 | response Should Be Equal " 01 40 40 0a 01" |
| 31 | |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 32 | io_board Present |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 33 | [Tags] io_board_Present |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 34 | ${uri}= Get System component io_board |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 35 | Read The Attribute ${uri} present |
| 36 | Response Should Be Equal True |
| 37 | |
| 38 | io_board Fault |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 39 | [Tags] io_board_Fault |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 40 | ${uri}= Get System component io_board |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 41 | Read The Attribute ${uri} fault |
| 42 | Response Should Be Equal False |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 43 | |
| 44 | *** Keywords *** |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 45 | |
| 46 | Setup The Suite |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 47 | [Documentation] Initial suite setup. |
George Keishing | f142668 | 2017-07-12 23:17:17 -0500 | [diff] [blame] | 48 | |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 49 | # Boot Host. |
| 50 | REST Power On |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 51 | |
| 52 | Open Connection And Log In |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 53 | ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30 |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 54 | Set Suite Variable ${SYSTEM_INFO} ${resp} |
| 55 | log Dictionary ${resp} |
| 56 | |
| 57 | Get System component |
| 58 | [Arguments] ${type} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 59 | ${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 Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 62 | [Return] ${url} |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 63 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 64 | |
| 65 | response Should Be Equal |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 66 | [Arguments] ${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 67 | Should Be Equal ${OUTPUT} ${args} |
| 68 | |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 69 | Read the Attribute |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 70 | [Arguments] ${uri} ${parm} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 71 | ${output}= Read Attribute ${uri} ${parm} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 72 | set test variable ${OUTPUT} ${output} |
| 73 | |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 74 | Post 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 |