blob: f2162bd26cada50e343fdc42e6000224bf837ab1 [file] [log] [blame]
George Keishingbeec26d2016-11-09 06:57:28 -06001*** Settings ***
2Documentation Module for capturing BMC serial output
3
4Library Telnet newline=LF
5Library OperatingSystem
6Library Collections
Charles Paul Hofere0e17802017-09-21 09:19:33 -05007Library String
George Keishingbeec26d2016-11-09 06:57:28 -06008
George Keishingbeec26d2016-11-09 06:57:28 -06009
10*** Keywords ***
11
Charles Paul Hofere0e17802017-09-21 09:19:33 -050012Open Telnet Connection To BMC Serial Console
George Keishingbeec26d2016-11-09 06:57:28 -060013 [Documentation] Open telnet connection session to BMC serial console
14 ... The login prompt expected, for example, for barreleye
Charles Paul Hofere0e17802017-09-21 09:19:33 -050015 ... is "barreleye login:".
George Keishingbeec26d2016-11-09 06:57:28 -060016 [Arguments] ${i_host}=${OPENBMC_SERIAL_HOST}
George Keishingbfae2ff2016-11-28 04:16:10 -060017 ... ${i_port}=${OPENBMC_SERIAL_PORT}
George Keishingbeec26d2016-11-09 06:57:28 -060018 ... ${i_model}=${OPENBMC_MODEL}
19
Charles Paul Hofere0e17802017-09-21 09:19:33 -050020 # 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 Keishingbeec26d2016-11-09 06:57:28 -060024
Charles Paul Hofere0e17802017-09-21 09:19:33 -050025 ${prompt_string}= Remove String ${i_model} ./data/ .py
26 ${prompt_string}= Convert To Lowercase ${prompt_string} login:
George Keishingbfae2ff2016-11-28 04:16:10 -060027 Telnet.Open Connection
Charles Paul Hofere0e17802017-09-21 09:19:33 -050028 ... ${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 Keishingbeec26d2016-11-09 06:57:28 -060035
36
Charles Paul Hofer6cd4d892017-10-12 15:13:36 -050037Read And Log BMC Serial Console Output
George Keishingbeec26d2016-11-09 06:57:28 -060038 [Documentation] Reads everything that is currently available
39 ... in the output.
Charles Paul Hofere0e17802017-09-21 09:19:33 -050040
George Keishingbeec26d2016-11-09 06:57:28 -060041 ${bmc_serial_log}= Telnet.Read
42 Log ${bmc_serial_log}
Charles Paul Hofere0e17802017-09-21 09:19:33 -050043
44
45Execute 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}
Charles Paul Hofer6cd4d892017-10-12 15:13:36 -050055 Read And Log BMC Serial Console Output
Charles Paul Hofere0e17802017-09-21 09:19:33 -050056 Close Serial Console Connection
57
58
59Close Serial Console Connection
60 [Documentation] Log out of the BMC and close telnet.
61
Charles Paul Hofer6cd4d892017-10-12 15:13:36 -050062 Telnet.Write \n
63 Telnet.Write exit
Charles Paul Hofere0e17802017-09-21 09:19:33 -050064 Telnet.Close Connection