Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra expect command to avoid timing issue #11601

Merged
merged 1 commit into from Dec 12, 2020
Merged

Conversation

coolgw
Copy link
Contributor

@coolgw coolgw commented Dec 11, 2020

Sometimes the sleep(1) is not enough in following code, assert_script_run(1>>) start to execute before former type_string(2>>) finish.
So i am try to add extra expect command to make sure user already login before next command start execute.

1>>> type_string "expect -c 'spawn ssh $ssh_testman@localhost -t;expect "Are you sure";send yes\n;expect sword:; send $ssh_testman_passwd\n;";
sleep(1);

 # Check that we are really in the SSH session

2>>> assert_script_run 'echo $SSH_TTY | grep "/dev/pts/"';

@coolgw coolgw requested a review from dzedro December 11, 2020 02:27
tests/console/sshd.pm Outdated Show resolved Hide resolved
Copy link
Contributor

@dzedro dzedro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should help

@coolgw coolgw merged commit 27cfd7f into os-autoinst:master Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants