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 |
Charles Paul Hofer | e0e1780 | 2017-09-21 09:19:33 -0500 | [diff] [blame] | 7 | Library String |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 8 | |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 9 | |
| 10 | *** Keywords *** |
| 11 | |
Charles Paul Hofer | e0e1780 | 2017-09-21 09:19:33 -0500 | [diff] [blame] | 12 | Open Telnet Connection To BMC Serial Console |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 13 | [Documentation] Open telnet connection session to BMC serial console |
| 14 | ... The login prompt expected, for example, for barreleye |
Charles Paul Hofer | e0e1780 | 2017-09-21 09:19:33 -0500 | [diff] [blame] | 15 | ... is "barreleye login:". |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 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 | |
Charles Paul Hofer | e0e1780 | 2017-09-21 09:19:33 -0500 | [diff] [blame] | 20 | # Description of argument(s): |
| 21 | # i_host The host name or IP of the serial console. |
| 22 | # i_port The port of the serial console. |
| 23 | # i_model The path to the system data, i.e. "./data/Witherspoon.py". |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 24 | |
Charles Paul Hofer | e0e1780 | 2017-09-21 09:19:33 -0500 | [diff] [blame] | 25 | ${prompt_string}= Remove String ${i_model} ./data/ .py |
| 26 | ${prompt_string}= Convert To Lowercase ${prompt_string} login: |
George Keishing | bfae2ff | 2016-11-28 04:16:10 -0600 | [diff] [blame] | 27 | Telnet.Open Connection |
Charles Paul Hofer | e0e1780 | 2017-09-21 09:19:33 -0500 | [diff] [blame] | 28 | ... ${i_host} port=${i_port} prompt=# |
| 29 | Telnet.Set Newline \n |
| 30 | Telnet.Set Newline CRLF |
| 31 | Telnet.Write \n |
| 32 | Telnet.Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD} |
| 33 | ... login_prompt=${prompt_string} password_prompt=Password: |
| 34 | Telnet.Set Timeout 30 minute 30 seconds |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 35 | |
| 36 | |
| 37 | Read and Log BMC Serial Console Output |
| 38 | [Documentation] Reads everything that is currently available |
| 39 | ... in the output. |
Charles Paul Hofer | e0e1780 | 2017-09-21 09:19:33 -0500 | [diff] [blame] | 40 | |
George Keishing | beec26d | 2016-11-09 06:57:28 -0600 | [diff] [blame] | 41 | ${bmc_serial_log}= Telnet.Read |
| 42 | Log ${bmc_serial_log} |
Charles Paul Hofer | e0e1780 | 2017-09-21 09:19:33 -0500 | [diff] [blame] | 43 | |
| 44 | |
| 45 | Execute Command On Serial Console |
| 46 | [Documentation] Execute a command on the BMC serial console. |
| 47 | [Arguments] ${command_string} |
| 48 | |
| 49 | # Description of argument(s): |
| 50 | # command The command to execute on the BMC. |
| 51 | |
| 52 | Open Telnet Connection To BMC Serial Console |
| 53 | Telnet.Write \n |
| 54 | Telnet.Execute Command ${command_string} |
| 55 | Close Serial Console Connection |
| 56 | |
| 57 | |
| 58 | Close Serial Console Connection |
| 59 | [Documentation] Log out of the BMC and close telnet. |
| 60 | |
| 61 | Execute Command On Serial Console exit |
| 62 | Telnet.Close Connection |