diff --git a/needles/console/user_logged_in.json b/needles/console/user_logged_in.json index 4c168fd3..b7bdca0e 100644 --- a/needles/console/user_logged_in.json +++ b/needles/console/user_logged_in.json @@ -8,11 +8,11 @@ "ypos": 95 }, { - "height": 17, + "height": 14, "type": "match", "width": 17, "xpos": 136, - "ypos": 93 + "ypos": 96 } ], "tags": [ @@ -21,4 +21,4 @@ "ENV-DISTRI-fedora", "ENV-FLAVOR-server" ] -} +} \ No newline at end of file diff --git a/needles/gnome/desktop_update_notification_only.json b/needles/gnome/desktop_update_notification_only.json index f597f00d..a17bc8eb 100644 --- a/needles/gnome/desktop_update_notification_only.json +++ b/needles/gnome/desktop_update_notification_only.json @@ -1,15 +1,15 @@ { "area": [ { - "height": 95, + "height": 92, "type": "match", "width": 40, "xpos": 170, - "ypos": 90 + "ypos": 94 } ], "tags": [ "desktop_update_notification_only", "DESKTOP-gnome" ] -} +} \ No newline at end of file diff --git a/templates b/templates index 147bfd20..a8794ba9 100755 --- a/templates +++ b/templates @@ -369,6 +369,17 @@ }, test_suite => { name => "desktop_browser" }, }, + { + machine => { name => "64bit" }, + prio => 30, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "Workstation-live-iso", + version => "*", + }, + test_suite => { name => "desktop_notifications_live" }, + }, { machine => { name => "64bit" }, prio => 32, @@ -380,6 +391,17 @@ }, test_suite => { name => "desktop_notifications_live" }, }, + { + machine => { name => "64bit" }, + prio => 30, + product => { + arch => "x86_64", + distri => "fedora", + flavor => "Workstation-live-iso", + version => "*", + }, + test_suite => { name => "desktop_notifications_postinstall" }, + }, { machine => { name => "64bit" }, prio => 32, @@ -2169,7 +2191,7 @@ { name => "desktop_notifications_postinstall", settings => [ - { key => "POSTINSTALL", value => "desktop_notifications" }, + { key => "ENTRYPOINT", value => "desktop_notifications" }, { key => "START_AFTER_TEST", value => "install_default_upload" }, { key => "BOOTFROM", value => "c" }, { key => "HDD_1", value => "disk_%FLAVOR%_%MACHINE%.qcow2" }, diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index 050f86b9..276a1528 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -12,27 +12,66 @@ use packagetest; sub run { my $self = shift; + my $desktop = get_var("DESKTOP"); # for the live image case, handle bootloader here - unless (get_var("BOOTFROM")) { - $self->do_bootloader(postinstall=>0); + if (get_var("BOOTFROM")) { + $self->do_bootloader(postinstall=>1, params=>'3'); } - assert_screen "graphical_desktop_clean", 300; - # ensure we actually have some package updates available - # we're kinda theoretically racing with the update check here, - # but we have no great way to handle that especially live; let's - # just assume we're gonna win + else { + $self->do_bootloader(postinstall=>0, params=>'3'); + } + boot_to_login_screen; $self->root_console(tty=>3); + # ensure we actually have some package updates available prepare_test_packages; - desktop_vt; + if ($desktop eq 'gnome') { + # On GNOME, move the clock forward if needed, because it won't + # check for updates before 6am(!) + my $hour = script_output 'date +%H'; + if ($hour < 6) { + script_run 'systemctl stop chronyd.service ntpd.service'; + script_run 'systemctl disable chronyd.service ntpd.service'; + script_run 'systemctl mask chronyd.service ntpd.service'; + 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) + my $now = script_output 'date +%s'; + my $yday = $now - 48*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 'exit', 0; + console_login(user=>'root', password=>get_var('ROOT_PASSWORD', 'weakpassword')); + } + } + assert_script_run 'systemctl isolate graphical.target'; + send_key 'ctrl-alt-f1'; + if (get_var("BOOTFROM")) { + assert_screen 'graphical_login'; + wait_still_screen 3; + if (get_var("DESKTOP") eq 'gnome') { + # we have to hit enter to get the password dialog + send_key "ret"; + } + assert_screen "graphical_login_input"; + type_very_safely get_var("USER_PASSWORD", "weakpassword"); + send_key 'ret'; + } + assert_screen 'graphical_desktop_clean', 90; # now, WE WAIT. this is just an unconditional wait - rather than # breaking if we see an update notification appear - so we catch # things that crash a few minutes after startup, etc. - for my $n (1..5) { - sleep 120; + for my $n (1..20) { + sleep 30; mouse_set 10, 10; mouse_hide; } - my $desktop = get_var("DESKTOP"); if ($desktop eq 'gnome') { # of course, we have no idea what'll be in the clock, so we just # have to click where we know it is