From 4489a6cb3f94b78a5ecb6cfe59d8a8a2cefa389f Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 18 Feb 2021 09:54:06 -0800 Subject: [PATCH] Rejig GNOME welcome screen/g-i-s handling for GNOME 40 In GNOME 40, the new-user mode of g-i-s is gone and we get the welcome tour where we would previously have seen that. This should handle that, I hope. I probably messed up somewhere. Signed-off-by: Adam Williamson --- lib/utils.pm | 26 +++++++++++++++----------- tests/_graphical_wait_login.pm | 26 +++++++++++++++----------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index c9d08c3d..a520f954 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -659,6 +659,19 @@ sub console_initial_setup { type_string "c\n"; # continue } +sub _handle_welcome_screen { + # handle the 'welcome' screen on GNOME. shared in a few places + if (check_screen "getting_started", 45) { + send_key "alt-f4"; + # for GNOME 40, alt-f4 doesn't work + send_key "esc"; + wait_still_screen 5; + } + else { + record_soft_failure "Welcome tour missing"; + } +} + sub gnome_initial_setup { # Handle gnome-initial-setup, with variations for the pre-login # mode (when no user was created during install) and post-login @@ -761,18 +774,9 @@ sub gnome_initial_setup { send_key "ret"; } else { - # wait for the stupid 'help' screen to show and kill it - if (check_screen "getting_started", 45) { - send_key "alt-f4"; - # for GNOME 40, alt-f4 doesn't work - send_key "esc"; - wait_still_screen 5; - } - else { - record_soft_failure "'getting started' missing (probably BGO#790811)"; - } - # don't do it again on second load + _handle_welcome_screen; } + # don't do it again on second load set_var("_setup_done", 1); } diff --git a/tests/_graphical_wait_login.pm b/tests/_graphical_wait_login.pm index 69796df3..aeca555e 100644 --- a/tests/_graphical_wait_login.pm +++ b/tests/_graphical_wait_login.pm @@ -70,7 +70,7 @@ sub run { send_key "ret"; } - # Handle initial-setup, for GNOME, unless START_AFTER_TEST + # 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 @@ -79,20 +79,24 @@ sub run { # we might be on the INSTALL_NO_USER flow, check whether # this happened already unless (get_var("_setup_done")) { + my $relnum = get_release_number; + if ($relnum < 34) { + # before GNOME 40 (F34), we get a per-user version of + # gnome-initial-setup here... gnome_initial_setup(); + } + else { + # ...from GNOME 40 on, we just get a "Welcome" tour + _handle_welcome_screen; + # protect against expecting it again + set_var("_setup_done"); + } } } if (get_var("DESKTOP") eq 'gnome' && get_var("INSTALL_NO_USER")) { - # wait for the stupid 'help' screen to show and kill it - if (check_screen "getting_started", 45) { - send_key "alt-f4"; - # for GNOME 40, alt-f4 doesn't work - send_key "esc"; - wait_still_screen 5; - } - else { - record_soft_failure "'getting started' missing (probably BGO#790811)"; - } + # handle welcome screen if we didn't do it above (holy flow + # control, Batman!) + _handle_welcome_screen unless (get_var("_setup_done")); # if this was an image deployment, we also need to create # root user now, for subsequent tests to work if (get_var("IMAGE_DEPLOY")) {