diff --git a/lib/installedtest.pm b/lib/installedtest.pm index b9773a16..7347cd5b 100644 --- a/lib/installedtest.pm +++ b/lib/installedtest.pm @@ -10,14 +10,24 @@ use testapi; use utils; sub root_console { - # Switch to a default or specified TTY and log in as root. + # Switch to a default or specified TTY and log in as root, or + # log in as regular user and sudo if no root password. my $self = shift; my %args = ( tty => 1, # what TTY to login to @_); send_key "ctrl-alt-f$args{tty}"; - console_login; + if (get_var("ROOT_PASSWORD") eq "false") { + console_login(user=>get_var("USER_LOGIN", "test"), password=>get_var("USER_PASSWORD", "weakpassword")); + type_string "sudo su"; + type_string get_var("USER_PASSWORD", "weakpassword"); + send_key "ret"; + assert_screen "root_console"; + } + else { + console_login; + } } sub post_fail_hook { diff --git a/main.pm b/main.pm index b87ea818..e36948dc 100644 --- a/main.pm +++ b/main.pm @@ -148,7 +148,8 @@ sub load_install_tests() { # respins, so we can't just do this in the templates yet, sadly. if (get_var('LIVE') && get_var('DESKTOP') eq 'gnome') { set_var('ROOT_PASSWORD', 'false'); - set_var('USER_LOGIN', 'false'); + # this is effectively a forced install_no_user + set_var('INSTALL_NO_USER', 'false'); } if (get_var('ANACONDA_TEXT')) {