blob: 293ff4fa557eb8a74dad8e979cdc1eb9a6ad3368 [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
George Keishingbe3cdfd2018-08-28 00:00:06 -050014 ... The login prompt expected, for example, for Witherspoon
15 ... is "Witherspoon 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=#
Charles Paul Hofer62fc3f02018-09-05 11:54:19 -050028 Telnet.Set Timeout 30 seconds
Charles Paul Hofere0e17802017-09-21 09:19:33 -050029 Telnet.Set Newline \n
30 Telnet.Set Newline CRLF
31 Telnet.Write \n
Charles Paul Hofer62fc3f02018-09-05 11:54:19 -050032 Telnet.Write exit
33 Telnet.Write \n
34 Telnet.Read Until Regexp (Password:|logout)
35 Telnet.Write \n
36 Telnet.Read Until ${prompt_string}
37 Telnet.Write ${OPENBMC_USERNAME}
38 Telnet.Write \n
39 Telnet.Read Until Password:
40 Telnet.Write ${OPENBMC_PASSWORD}
41 Telnet.Write \n
42 Telnet.Read Until Prompt
Charles Paul Hofere0e17802017-09-21 09:19:33 -050043 Telnet.Set Timeout 30 minute 30 seconds
George Keishingbeec26d2016-11-09 06:57:28 -060044
45
Charles Paul Hofer6cd4d892017-10-12 15:13:36 -050046Read And Log BMC Serial Console Output
George Keishingbeec26d2016-11-09 06:57:28 -060047 [Documentation] Reads everything that is currently available
48 ... in the output.
Charles Paul Hofere0e17802017-09-21 09:19:33 -050049
George Keishingbeec26d2016-11-09 06:57:28 -060050 ${bmc_serial_log}= Telnet.Read
51 Log ${bmc_serial_log}
Charles Paul Hofere0e17802017-09-21 09:19:33 -050052
53
54Execute Command On Serial Console
55 [Documentation] Execute a command on the BMC serial console.
56 [Arguments] ${command_string}
57
58 # Description of argument(s):
59 # command The command to execute on the BMC.
60
61 Open Telnet Connection To BMC Serial Console
62 Telnet.Write \n
Charles Paul Hoferac112472018-08-03 15:04:35 -050063 Telnet.Write \n
Charles Paul Hofere0e17802017-09-21 09:19:33 -050064 Telnet.Execute Command ${command_string}
Charles Paul Hofer6cd4d892017-10-12 15:13:36 -050065 Read And Log BMC Serial Console Output
Charles Paul Hofere0e17802017-09-21 09:19:33 -050066 Close Serial Console Connection
67
68
69Close Serial Console Connection
70 [Documentation] Log out of the BMC and close telnet.
71
Charles Paul Hofer6cd4d892017-10-12 15:13:36 -050072 Telnet.Write \n
73 Telnet.Write exit
George Keishingd54591a2018-07-10 13:05:14 -050074 Telnet.Close Connection