diff --git a/lib/anacondatest.pm b/lib/anacondatest.pm index 3a2c2dc1..feb46331 100644 --- a/lib/anacondatest.pm +++ b/lib/anacondatest.pm @@ -61,6 +61,9 @@ sub root_console { # Switch to an appropriate TTY and log in as root. my $self = shift; my %args = ( + # 0 means use console_login's default, non-zero values + # passed to console_login + timeout => 0, @_); # Handle https://bugzilla.redhat.com/show_bug.cgi?id=1635033 if (get_var("LIVE") && get_var("DESKTOP") eq "gnome") { @@ -69,7 +72,7 @@ sub root_console { else { send_key "ctrl-alt-f2"; } - console_login(user=>"root"); + console_login(user=>"root", timeout=>$args{timeout}); } 1; diff --git a/lib/utils.pm b/lib/utils.pm index 4d755443..d88af0d1 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -152,7 +152,10 @@ sub console_login { my %args = ( user => "root", password => get_var("ROOT_PASSWORD", "weakpassword"), + # default is 10 seconds, set below, 0 means 'default' + timeout => 0; @_); + $args{timeout} ||= 10; # There's a timing problem when we switch from a logged-in console # to a non-logged in console and immediately call this function; @@ -179,7 +182,7 @@ sub console_login { sleep 2; } - check_screen [$good, 'text_console_login'], 10; + check_screen [$good, 'text_console_login'], $args{timeout}; # if we're already logged in, all is good if (match_has_tag $good) { _console_login_finish(); diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 825788c2..827bc110 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -117,8 +117,9 @@ sub run { assert_and_click "anaconda_install_done"; if (get_var('LIVE')) { # reboot from a console, it's more reliable than the desktop - # runners - $self->root_console; + # runners. As of 2018-10 switching to console after liveinst + # seems to take a long time, so use a longer timeout here + $self->root_console(timeout=>30); # if we didn't set a root password during install, set it # now...this is kinda icky, but I don't see a great option if (get_var("INSTALLER_NO_ROOT")) {