blob: a468b4ad6af44261493b09da651698a8cc1519c0 [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
George Keishingd54591a2018-07-10 13:05:14 -050025 ${prompt_string}= Convert To Lowercase ${OPENBMC_MODEL} login:
George Keishingbfae2ff2016-11-28 04:16:10 -060026 Telnet.Open Connection
Charles Paul Hofere0e17802017-09-21 09:19:33 -050027 ... ${i_host} port=${i_port} prompt=#
28 Telnet.Set Newline \n
29 Telnet.Set Newline CRLF
30 Telnet.Write \n
31 Telnet.Login ${OPENBMC_USERNAME} ${OPENBMC_PASSWORD}
32 ... login_prompt=${prompt_string} password_prompt=Password:
33 Telnet.Set Timeout 30 minute 30 seconds
George Keishingbeec26d2016-11-09 06:57:28 -060034
35
Charles Paul Hofer6cd4d892017-10-12 15:13:36 -050036Read And Log BMC Serial Console Output
George Keishingbeec26d2016-11-09 06:57:28 -060037 [Documentation] Reads everything that is currently available
38 ... in the output.
Charles Paul Hofere0e17802017-09-21 09:19:33 -050039
George Keishingbeec26d2016-11-09 06:57:28 -060040 ${bmc_serial_log}= Telnet.Read
41 Log ${bmc_serial_log}
Charles Paul Hofere0e17802017-09-21 09:19:33 -050042
43
44Execute Command On Serial Console
45 [Documentation] Execute a command on the BMC serial console.
46 [Arguments] ${command_string}
47
48 # Description of argument(s):
49 # command The command to execute on the BMC.
50
51 Open Telnet Connection To BMC Serial Console
52 Telnet.Write \n
Charles Paul Hoferac112472018-08-03 15:04:35 -050053 Telnet.Write \n
Charles Paul Hofere0e17802017-09-21 09:19:33 -050054 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
George Keishingd54591a2018-07-10 13:05:14 -050064 Telnet.Close Connection