George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Module for capturing BMC serial output |
| 3 | |
| 4 | Library Telnet newline=LF |
| 5 | Library OperatingSystem |
| 6 | Library Collections |
| 7 | |
| 8 | *** Variables *** |
| 9 | |
| 10 | *** Keywords *** |
| 11 | |
| 12 | Open Telnet Connection to BMC Serial Console |
| 13 | [Documentation] Open telnet connection session to BMC serial console |
| 14 | ... The login prompt expected, for example, for barreleye |
| 15 | ... is "barreleye login:" |
| 16 | [Arguments] ${i_host}=${OPENBMC_SERIAL_HOST} |
George Keishing | bfae2ff | 2016-11-28 04:16:10 -0600 | [diff] [blame] | 17 | ... ${i_port}=${OPENBMC_SERIAL_PORT} |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 18 | ... ${i_model}=${OPENBMC_MODEL} |
| 19 | |
| 20 | Run Keyword If |
| 21 | ... '${i_host}' != '${EMPTY}' and '${i_port}' != '${EMPTY}' and '${i_model}' != '${EMPTY}' |
George Keishing | bfae2ff | 2016-11-28 04:16:10 -0600 | [diff] [blame] | 22 | ... Establish Telnet Session on BMC Serial Console |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 23 | ... ELSE Fail msg=One of the paramaters is EMPTY |
| 24 | |
| 25 | |
| 26 | Establish Telnet Session on BMC Serial Console |
| 27 | [Documentation] Establish telnet session and set timeout to 30 mins |
| 28 | ... 30 secs. |
| 29 | |
| 30 | ${prompt_string} Set Variable ${OPENBMC_MODEL} login: |
George Keishing | bfae2ff | 2016-11-28 04:16:10 -0600 | [diff] [blame] | 31 | Telnet.Open Connection |
| 32 | ... ${OPENBMC_SERIAL_HOST} port=${OPENBMC_SERIAL_PORT} prompt=# |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 33 | Set Newline \n |
| 34 | Set Newline CRLF |
| 35 | Telnet.Write \n |
| 36 | Telnet.Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 37 | ... login_prompt=${prompt_string} password_prompt=Password: |
| 38 | Telnet.Set Timeout 30 minute 30 seconds |
| 39 | |
| 40 | |
| 41 | Read and Log BMC Serial Console Output |
| 42 | [Documentation] Reads everything that is currently available |
| 43 | ... in the output. |
| 44 | ${bmc_serial_log}= Telnet.Read |
| 45 | Log ${bmc_serial_log} |