From 83c32fe04eb3174e618827fe2b967b03d0f44ce0 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 8 Mar 2018 19:22:21 -0800 Subject: [PATCH] More tweaking for Workstation live scenario It's really INSTALL_NO_USER, not USER_LOGIN='false'. Also, we need to make root_console work with no root password, sigh. Signed-off-by: Adam Williamson --- lib/installedtest.pm | 14 ++++++++++++-- main.pm | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) 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')) {