Skip to content

Commit

Permalink
Add PasswordAuthentication=no to first ssh command in wait_for_ssh
Browse files Browse the repository at this point in the history
It now newly sporadically happens that GCE instance just after
creation requires SSH password authentication. We don't support
this scenario and the password prompt blocks our terminal so the
whole test dies. This is disabling the password authentication
leaving us only key authentication which should be always available.
  • Loading branch information
pdostal committed Aug 7, 2024
1 parent 496fedc commit a9edf9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/publiccloud/instance.pm
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ sub wait_for_ssh {
script_run("ssh-keyscan $args{public_ip} | tee -a ~/.ssh/known_hosts");
while (($duration = time() - $start_time) < $args{timeout}) {
# timeout recalculated removing consumed time until now
$sysout = $self->ssh_script_output(cmd => 'sudo systemctl is-system-running',
# We don't support password authentication so it would just block the terminal
$sysout = $self->ssh_script_output(cmd => 'sudo systemctl is-system-running', ssh_opts => '-o PasswordAuthentication=no',
timeout => $args{timeout} - $duration, proceed_on_failure => 1, username => $args{username});
# result check
if ($sysout =~ m/initializing|starting/) { # still starting
Expand Down

0 comments on commit a9edf9b

Please sign in to comment.