From bd2fc548b53a582fa67b657639b20549c36d116f Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 7 Apr 2026 17:30:57 -0700 Subject: [PATCH] Run postinstall notifications test on updates (#512) This requires a bit of special handling because we do not want to just use the POSTINSTALL flow as we don't want to log in until we've done all our preparations. So let's use ENTRYPOINT, do the repo prep and update stuff directly in desktop_notifications, and load _advisory_post in the ENTRYPOINT list. We'll have to remember to keep this all in sync if we change the flow, but we don't do that a lot. Signed-off-by: Adam Williamson --- templates-updates.fif.json | 9 +++++++++ tests/desktop_notifications.pm | 26 +++++++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/templates-updates.fif.json b/templates-updates.fif.json index 3ef4bdd3..76874298 100644 --- a/templates-updates.fif.json +++ b/templates-updates.fif.json @@ -459,6 +459,15 @@ "updates-desktops": 5 } }, + "desktop_notifications_postinstall_updatetest": { + "profile_groups": { + "updates-desktops": 5 + }, + "settings": { + "BOOTFROM": "c", + "ENTRYPOINT": "desktop_notifications _advisory_post" + } + }, "desktop_printing": { "profile_groups": { "updates-desktops": 5 diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index f47cac47..f0ce0f03 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -22,18 +22,32 @@ sub create_user_i3_config { assert_script_run "restorecon -vr /home/$login/.config"; } -sub run { - my $self = shift; - my $desktop = get_var("DESKTOP"); - my $relnum = get_release_number; - # for the live image case, handle bootloader here +sub _handle_bootloader { + # boot with '3' to get to a console. factored out of run() as + # it's repeated on the update flow if (get_var("BOOTFROM")) { do_bootloader(postinstall => 1, params => '3'); } else { do_bootloader(postinstall => 0, params => '3'); } +} + +sub run { + my $self = shift; + my $desktop = get_var("DESKTOP"); + my $relnum = get_release_number; + _handle_bootloader; boot_to_login_screen; + # do _advisory_update steps on update tests; ensure this stays + # in sync with _advisory_update + if (get_var('ADVISORY_OR_TASK')) { + $self->root_console(tty => 3); + repo_setup; + script_run 'reboot', 0; + _handle_bootloader; + boot_to_login_screen; + } # tty1 is used here for historic reasons, but it's not hurting # anything and changing it might, so let's leave it... $self->root_console(tty => 1); @@ -106,6 +120,8 @@ sub run { assert_screen 'graphical_login', 60; wait_still_screen 10, 30; dm_perform_login($desktop, $password); + # on update flow we encounter welcome screen for first time here + handle_welcome_screen if (get_var('ADVISORY_OR_TASK')); } check_desktop(timeout => 180); # now, WE WAIT. this is just an unconditional wait - rather than