diff --git a/tests/_graphical_wait_login.pm b/tests/_graphical_wait_login.pm index 9025acff..19ccf880 100644 --- a/tests/_graphical_wait_login.pm +++ b/tests/_graphical_wait_login.pm @@ -87,31 +87,27 @@ sub run { } } - # For GNOME, handle initial-setup or welcome tour, unless START_AFTER_TEST - # is set in which case it will have been done already. Always - # do it if ADVISORY_OR_TASK is set, as for the update testing flow, - # START_AFTER_TEST is set but a no-op and this hasn't happened - if ($desktop eq 'gnome' && (get_var("ADVISORY_OR_TASK") || !get_var("START_AFTER_TEST"))) { - # as this test gets loaded twice on the ADVISORY_OR_TASK flow, and - # we might be on the INSTALL_NO_USER flow, check whether - # this happened already - handle_welcome_screen unless (get_var("_WELCOME_DONE")); - } - if ($desktop eq 'gnome' && get_var("INSTALL_NO_USER")) { - # handle welcome screen if we didn't do it above (holy flow - # control, Batman!) - handle_welcome_screen unless (get_var("_WELCOME_DONE")); + # For GNOME, handle initial-setup or welcome tour, unless _WELCOME_DONE + # is set (indicating it's been done previously within this test run, + # e.g. the second time this module runs on the update flow, or earlier + # in the boot process on the INSTALL_NO_USER flow), or START_AFTER_TEST + # is set to the same value as DEPLOY_UPLOAD_TEST (in which case it will + # have been done by the previous test run) + # the point of the default values here is to make the check fail if + # neither var is set, without needing an extra condition + my $sat = get_var("START_AFTER_TEST", "1"); + my $dut = get_var("DEPLOY_UPLOAD_TEST", "2"); + handle_welcome_screen if ($desktop eq 'gnome' && $sat ne $dut && !get_var("_WELCOME_DONE")); + if (get_var("IMAGE_DEPLOY")) { # if this was an image deployment, we also need to create # root user now, for subsequent tests to work - if (get_var("IMAGE_DEPLOY")) { - send_key "ctrl-alt-f3"; - console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); - type_string "sudo su\n"; - type_string "$password\n"; - my $root_password = get_var("ROOT_PASSWORD") || "weakpassword"; - assert_script_run "echo 'root:$root_password' | chpasswd"; - desktop_vt; - } + send_key "ctrl-alt-f3"; + console_login(user => get_var("USER_LOGIN", "test"), password => get_var("USER_PASSWORD", "weakpassword")); + type_string "sudo su\n"; + type_string "$password\n"; + my $root_password = get_var("ROOT_PASSWORD") || "weakpassword"; + assert_script_run "echo 'root:$root_password' | chpasswd"; + desktop_vt; } # Move the mouse somewhere it won't highlight the match areas