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 | |
George Keishing | 872ee59 | 2017-10-28 08:43:09 -0500 | [diff] [blame^] | 27 | Verify 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 35 | |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 36 | io_board Present |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 37 | [Tags] io_board_Present |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 38 | ${uri}= Get System component io_board |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 39 | Read The Attribute ${uri} present |
| 40 | Response Should Be Equal True |
| 41 | |
| 42 | io_board Fault |
Rahul Maheshwari | f811910 | 2016-10-05 01:15:56 -0500 | [diff] [blame] | 43 | [Tags] io_board_Fault |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 44 | ${uri}= Get System component io_board |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 45 | Read The Attribute ${uri} fault |
| 46 | Response Should Be Equal False |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 47 | |
| 48 | *** Keywords *** |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 49 | |
| 50 | Setup The Suite |
Steven Sombar | aaf72c4 | 2017-09-05 12:02:00 -0500 | [diff] [blame] | 51 | [Documentation] Initial suite setup. |
George Keishing | f142668 | 2017-07-12 23:17:17 -0500 | [diff] [blame] | 52 | |
Sweta Potthuri | af741cb | 2017-07-04 09:41:17 -0500 | [diff] [blame] | 53 | # Boot Host. |
| 54 | REST Power On |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 55 | |
| 56 | Open Connection And Log In |
George Keishing | ab1bd92 | 2016-12-05 05:29:59 -0600 | [diff] [blame] | 57 | ${resp}= Read Properties ${OPENBMC_BASE_URI}enumerate timeout=30 |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 58 | Set Suite Variable ${SYSTEM_INFO} ${resp} |
| 59 | log Dictionary ${resp} |
| 60 | |
| 61 | Get System component |
| 62 | [Arguments] ${type} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 63 | ${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 Mills | c9ea936 | 2016-12-13 16:21:13 -0600 | [diff] [blame] | 66 | [Return] ${url} |
Rahul Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 67 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 68 | |
| 69 | response Should Be Equal |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 70 | [Arguments] ${args} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 71 | Should Be Equal ${OUTPUT} ${args} |
| 72 | |
Gunnar Mills | 56b3289 | 2016-11-14 13:56:17 -0600 | [diff] [blame] | 73 | Read the Attribute |
Gunnar Mills | 3803280 | 2016-12-12 13:43:40 -0600 | [diff] [blame] | 74 | [Arguments] ${uri} ${parm} |
Gunnar Mills | 1cd544d | 2016-12-06 11:19:22 -0600 | [diff] [blame] | 75 | ${output}= Read Attribute ${uri} ${parm} |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 76 | set test variable ${OUTPUT} ${output} |
| 77 | |
Rahul Maheshwari | 06174f2 | 2017-03-06 03:17:09 -0600 | [diff] [blame] | 78 | Post 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 |