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 | 09a3cf9 | 2017-12-08 01:19:53 -0600 | [diff] [blame] | 16 | Suite Setup Suite Setup Execution |
Sweta Potthuri | 09a3cf9 | 2017-12-08 01:19:53 -0600 | [diff] [blame] | 17 | Test Teardown Test Teardown Execution |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 18 | |
| 19 | *** Variables *** |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 20 | |
| 21 | ${stack_mode} skip |
| 22 | ${model}= ${OPENBMC_MODEL} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 23 | |
| 24 | *** Test Cases *** |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 25 | |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 26 | io_board Present |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 27 | [Tags] io_board_Present |
Sweta Potthuri | 4a55602 | 2017-11-24 04:03:37 -0600 | [diff] [blame] | 28 | ${uri}= Get System component io_board |
| 29 | Verify The Attribute ${uri} Present ${True} |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 30 | |
| 31 | io_board Fault |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 32 | [Tags] io_board_Fault |
Sweta Potthuri | 4a55602 | 2017-11-24 04:03:37 -0600 | [diff] [blame] | 33 | ${uri}= Get System component io_board |
| 34 | Verify The Attribute ${uri} fault ${False} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 35 | |
| 36 | *** Keywords *** |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 37 | |
Sweta Potthuri | 09a3cf9 | 2017-12-08 01:19:53 -0600 | [diff] [blame] | 38 | Suite Setup Execution |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 39 | [Documentation] Initial suite setup. |
George Keishing | f142668 | 2017-07-12 23:17:17 -0500 | [diff] [blame] | 40 | |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 41 | # Boot Host. |
| 42 | REST Power On |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 43 | |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 44 | ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30 |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 45 | Set Suite Variable ${SYSTEM_INFO} ${resp} |
| 46 | log Dictionary ${resp} |
| 47 | |
| 48 | Get System component |
| 49 | [Arguments] ${type} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 50 | ${list}= Get Dictionary Keys ${SYSTEM_INFO} |
| 51 | ${resp}= Get Matches ${list} regexp=^.*[0-9a-z_].${type}[0-9]*$ |
| 52 | ${url}= Get From List ${resp} 0 |
Gunnar Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 53 | [Return] ${url} |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 54 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 55 | |
Sweta Potthuri | 09a3cf9 | 2017-12-08 01:19:53 -0600 | [diff] [blame] | 56 | Test Teardown Execution |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 57 | [Documentation] Do the post test teardown. |
| 58 | ... 1. Capture FFDC on test failure. |
| 59 | ... 2. Close all open SSH connections. |
| 60 | |
| 61 | FFDC On Test Case Fail |
| 62 | Close All Connections |