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