-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Sending e.g device.reload() doesn't always produce expected result. It's sitting and waiting for something at the reload confirm prompt and eventually timeouts and prompt recovery kicks in which effectively sends a new line and allows for reload to proceed.
YAML:
test_bed = """
devices:
$HOSTNAME:
os: iosxe
platform: iosxe
type: router
credentials:
default:
username: $USERNAME
password: $PASSWORD
terminal_server:
username: $USERNAME
password: $PASSWORD
fallback:
username: cisco
password: cisco
connections:
a:
protocol: telnet
ip: $CONSOLE_IP
port: $CONSOLE_PORT
login_creds: [terminal_server, default, fallback]
arguments:
connection_timeout: 120
mit: True
cred_action:
terminal_server:
post: sendline()
settings:
SENDLINE_AFTER_CRED: terminal_server
ESCAPE_CHAR_CHATTY_TERM_WAIT: 0.5
ESCAPE_CHAR_PROMPT_WAIT: 1
ESCAPE_CHAR_CHATTY_TERM_WAIT_RETRIES: 15
EXEC_TIMEOUT: 30
CONFIG_TIMEOUT: 30
CONFIG_TRANSITION_WAIT: 0.5
RELOAD_TIMEOUT: 420
RELOAD_WAIT: 300
POST_RELOAD_WAIT: 60
RELOAD_RECONNECT_ATTEMPTS: 5
SLEEP_PRE_LAUNCH: 0.2
POST_DISCONNECT_WAIT_SEC: 0
GRACEFUL_DISCONNECT_WAIT_SEC: 0.2
CONSOLE_TIMEOUT: 120
"""
LOG output:
2022-11-28 11:47:58,156: %UNICON-INFO: +++ DUT-C1117-4PM logfile /opt/autom8_app/autom8_app/logs/pyats/DUT-C1117-4PM.log +++
2022-11-28 11:47:58,156: %UNICON-INFO: +++ Unicon plugin iosxe (unicon.plugins.iosxe) +++
Trying 80.194.79.121...
2022-11-28 11:47:58,169: %UNICON-INFO: +++ connection to spawn: telnet 80.194.79.121 10014, id: 140694475231472 +++
2022-11-28 11:47:58,169: %UNICON-INFO: connection to DUT-C1117-4PM
Connected to 80.194.79.121.
Escape character is '^]'.
Login: automation
Password:
2022-11-28 11:47:58,282: %UNICON-INFO: Executing post credential command: sendline()
DUT-C1117-4PM#
2022-11-28 11:47:58,396: %UNICON-INFO: Learned hostname(s): 'DUT-C1117-4PM'.
2022-11-28 11:47:58,460: %UNICON-INFO: +++ DUT-C1117-4PM with via 'a': enable +++
2022-11-28 11:47:58,526: %UNICON-INFO: +++ DUT-C1117-4PM with via 'a': executing command 'write erase' +++
write erase
************************************************************************************************************
Erasing Nvram will not clear license trust code.
************************************************************************************************************
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
DUT-C1117-4PM#
2022-11-28 11:48:00,922: %UNICON-INFO: +++ DUT-C1117-4PM with via 'a': reload +++
2022-11-28 11:48:00,985: %UNICON-INFO: +++ reloading DUT-C1117-4PM with reload_command 'reload' and timeout is 420 seconds +++
reload
System configuration has been modified. Save? [yes/no]: n
WARNING:
Boot variable either does not exist or buffer is too small
This may impact autoboot of the router. Proceed with caution
Do you wish to proceed with reload anyway[confirm]
2022-11-28 11:55:00,991: %UNICON-WARNING: Timeout of 420 seconds has been reached.
Prompt Recovery has commenced. Total timeout occurs in 100 seconds.
2022-11-28 11:55:00,994: %UNICON-INFO: Sending prompt recovery command: b'\r'
Proceed with reload? [confirm]
2022-11-28 11:55:11,007: %UNICON-INFO: Sending prompt recovery command: b'\x15'
2022-11-28 11:55:21,028: %UNICON-INFO: Sending prompt recovery command: b'\x1a'
2022-11-28 11:55:31,036: %UNICON-INFO: Sending prompt recovery command: b'\r'
Rom image verified correctly
Metadata
Metadata
Assignees
Labels
No labels