mirror of
https://github.com/rocky-linux/os-autoinst-distri-rocky.git
synced 2024-11-22 13:11:26 +00:00
Be more strict in console_login
Because we use check_screen not assert_screen here, the match can actually fail, but the match_has_tag conditional can pass on the *previous* match, if that happened to also be matching on a console tag. We don't want that. Let's just make these into assert_screens to avoid it; I don't think there's any path where we're actually expecting this to work if those check_screens didn't match. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
a0a8e3350d
commit
e87348abca
12
lib/utils.pm
12
lib/utils.pm
@ -157,22 +157,21 @@ sub console_login {
|
||||
sleep 2;
|
||||
}
|
||||
|
||||
check_screen [$good, 'text_console_login'], $args{timeout};
|
||||
assert_screen [$good, 'text_console_login'], $args{timeout};
|
||||
# if we're already logged in, all is good
|
||||
if (match_has_tag $good) {
|
||||
_console_login_finish();
|
||||
return;
|
||||
}
|
||||
# if we see the login prompt, type the username
|
||||
type_string("$args{user}\n") if (match_has_tag 'text_console_login');
|
||||
check_screen [$good, 'console_password_required'], 30;
|
||||
# otherwise, we saw the login prompt, type the username
|
||||
type_string("$args{user}\n");
|
||||
assert_screen [$good, 'console_password_required'], 30;
|
||||
# on a live image, just the user name will be enough
|
||||
if (match_has_tag $good) {
|
||||
_console_login_finish();
|
||||
return;
|
||||
}
|
||||
# otherwise, type the password if we see the prompt
|
||||
if (match_has_tag 'console_password_required') {
|
||||
# otherwise, type the password
|
||||
type_string "$args{password}";
|
||||
if (get_var("SWITCHED_LAYOUT") and $args{user} ne "root") {
|
||||
# see _do_install_and_reboot; when layout is switched
|
||||
@ -183,7 +182,6 @@ sub console_login {
|
||||
console_switch_layout;
|
||||
}
|
||||
send_key "ret";
|
||||
}
|
||||
# make sure we reached the console
|
||||
unless (check_screen($good, 30)) {
|
||||
# as of 2018-10 we have a bug in sssd which makes this take
|
||||
|
Loading…
Reference in New Issue
Block a user