You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a CLI application for which commands can take close to 30 seconds. I used the "Read Until Prompt" to determine when the command has terminated and set the timeout using "Set Client Configuration timeout=60 seconds". This works if I specify the prompt using "Set Client Configuration prompt=MyPrompt#" but fails if I do "Set Client Configuration prompt=REGEXP:[$.*#]".
The failure seems to indicate that the "Set Client Configuration timeout=60 seconds" didn't go into effect as the output captured is only partial and the test fails before the expected 60 seconds for a timeout condition (seems to actually fail after 3 seconds which is the Default value of timeout).
I am using robot-framework 5.0.1 and SSHLibrary > 3.2.0 over Ubuntu 22.04 LTS.
Btw, it would be a good idea to add a delay parameter to the Read Until Prompt (and any Read command) as it is available to Read.
*** Settings ***
Documentation Robot Framework test script
Library SSHLibrary
*** Variables ***
${controller} 192.168.2.10
${controller_username} admin
${controller_password} admin
${firmware} /tftpboot/ArubaOS_90xx_8.11.1.0
${host} 192.168.2.1
${host_username} ykoehler
${host_password} mypassword
${partition} 1
*** Keywords ***
Connect To SSH
[Arguments] ${host} ${username} ${password}
Open Connection ${host}
Login ${username} ${password} delay=1
Connect To AOS SSH
[Arguments] ${host} ${username} ${password}
Connect To SSH ${host} ${username} ${password}
# Set Client Configuration prompt=(YK_A9004) *[mynode] #
Set Client Configuration prompt=REGEXP:[$\(.+\)\s+.*\\\[.+\\\]\s+#]
Upgrade Firmware
[Arguments] ${host} ${username} ${password} ${firmware} ${partition}
Write copy scp: ${host} ${username} ${firmware} system: partition ${partition}
${pw_output}= Read delay=10
Should Contain ${pw_output} Password:
Write ${password}
${output}= Read Until Prompt
Should Contain ${output} copied to partition ${partition} successfully.
*** Test Cases ***
Test SSH Connection
Connect To AOS SSH ${controller} ${controller_username} ${controller_password}
Set Client Configuration timeout=60
# This validates that the 'Read Until Prompt' is working
Write show image version
Read Until Prompt
# This runs a command that can take 30-40 seconds.
Upgrade Firmware ${host} ${host_username} ${host_password} ${firmware} ${partition}
Close All Connections
The text was updated successfully, but these errors were encountered:
I have a CLI application for which commands can take close to 30 seconds. I used the "Read Until Prompt" to determine when the command has terminated and set the timeout using "Set Client Configuration timeout=60 seconds". This works if I specify the prompt using "Set Client Configuration prompt=MyPrompt#" but fails if I do "Set Client Configuration prompt=REGEXP:[$.*#]".
The failure seems to indicate that the "Set Client Configuration timeout=60 seconds" didn't go into effect as the output captured is only partial and the test fails before the expected 60 seconds for a timeout condition (seems to actually fail after 3 seconds which is the Default value of timeout).
I am using robot-framework 5.0.1 and SSHLibrary > 3.2.0 over Ubuntu 22.04 LTS.
Btw, it would be a good idea to add a delay parameter to the Read Until Prompt (and any Read command) as it is available to Read.
The text was updated successfully, but these errors were encountered: