From 72369df2fca92fef71c4bb938b798eefa38cbae2 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 5 Mar 2021 17:56:56 -0800 Subject: [PATCH] Set several extra schema keys for update notification test GNOME got even more clever-clever about only checking for and notifying about updates after a certain amount of time, so we need to fake it out even harder. See https://bugzilla.redhat.com/show_bug.cgi?id=1930401 and https://wiki.gnome.org/Design/Apps/Software/Updates#Tentative_Design Note the test will still fail for now as there is an actual bug that needs fixing, but once the fix is in, this should work. Signed-off-by: Adam Williamson --- tests/desktop_notifications.pm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index 296dc4f2..da20ae93 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -36,17 +36,22 @@ sub run { assert_script_run 'date --set="06:00:00"'; } if (get_var("BOOTFROM")) { - # Also reset the 'last update notification check' timestamp - # to >24 hours ago (as that matters too) + # Set a bunch of update checking-related timestamps to + # two days ago or two weeks ago to try and make sure we + # get notifications, see: + # https://wiki.gnome.org/Design/Apps/Software/Updates#Tentative_Design my $now = script_output 'date +%s'; - my $yday = $now - 48*60*60; + my $yyday = $now - 2*24*60*60; + my $longago = $now - 14*24*60*60; # have to log in as the user to do this script_run 'exit', 0; console_login(user=>get_var('USER_LOGIN', 'test'), password=>get_var('USER_PASSWORD', 'weakpassword')); - script_run "gsettings set org.gnome.software check-timestamp ${yday}", 0; - wait_still_screen 3; - script_run "gsettings get org.gnome.software check-timestamp", 0; - wait_still_screen 3; + script_run "gsettings set org.gnome.software check-timestamp ${yyday}", 0; + script_run "gsettings set org.gnome.software update-notification-timestamp ${longago}", 0; + script_run "gsettings set org.gnome.software online-updates-timestamp ${longago}", 0; + script_run "gsettings set org.gnome.software upgrade-notification-timestamp ${longago}", 0; + script_run "gsettings set org.gnome.software install-timestamp ${longago}", 0; + wait_still_screen 5; script_run 'exit', 0; console_login(user=>'root', password=>get_var('ROOT_PASSWORD', 'weakpassword')); }