2016-09-20 22:32:44 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
2017-01-18 07:15:44 +00:00
|
|
|
use utils;
|
2016-09-20 22:32:44 +00:00
|
|
|
use packagetest;
|
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $self = shift;
|
|
|
|
my $desktop = get_var('DESKTOP');
|
|
|
|
# use a tty console for repo config and package prep
|
|
|
|
$self->root_console(tty=>3);
|
|
|
|
assert_script_run 'dnf config-manager --set-disabled updates-testing';
|
|
|
|
prepare_test_packages;
|
|
|
|
# get back to the desktop
|
2016-09-24 19:42:39 +00:00
|
|
|
desktop_vt;
|
2016-09-20 22:32:44 +00:00
|
|
|
# run the updater
|
|
|
|
if ($desktop eq 'kde') {
|
|
|
|
# KDE team tells me the 'preferred' update method is the
|
|
|
|
# systray applet
|
2016-09-23 23:03:13 +00:00
|
|
|
assert_and_click 'desktop_expand_systray';
|
2016-09-20 22:32:44 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
# this launches GNOME Software on GNOME, dunno for any other
|
|
|
|
# desktop yet
|
2018-07-30 18:23:59 +00:00
|
|
|
sleep 3;
|
2017-01-18 07:15:44 +00:00
|
|
|
menu_launch_type('update');
|
2016-09-20 22:32:44 +00:00
|
|
|
}
|
|
|
|
# GNOME Software has a welcome screen, get rid of it if it shows
|
|
|
|
# up (but don't fail if it doesn't, we're not testing that)
|
|
|
|
if ($desktop eq 'gnome' && check_screen 'gnome_software_welcome', 10) {
|
|
|
|
send_key 'ret';
|
|
|
|
}
|
|
|
|
# go to the 'update' interface. For GNOME, we may be waiting
|
|
|
|
# some time at a 'Software catalog is being loaded' screen.
|
|
|
|
if ($desktop eq 'gnome') {
|
|
|
|
for my $n (1..5) {
|
|
|
|
last if (check_screen 'desktop_package_tool_update', 120);
|
|
|
|
mouse_set 10, 10;
|
|
|
|
mouse_hide;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assert_and_click 'desktop_package_tool_update';
|
2018-03-29 02:42:31 +00:00
|
|
|
# if this is KDE and it had already noticed the notification, we
|
|
|
|
# will already have the apply button at this point
|
|
|
|
unless (check_screen 'desktop_package_tool_update_apply', 5) {
|
|
|
|
# refresh updates
|
|
|
|
assert_and_click 'desktop_package_tool_update_refresh', '', 120;
|
|
|
|
}
|
2018-10-11 23:18:04 +00:00
|
|
|
# wait for refresh, then apply updates, moving the mouse every two
|
|
|
|
# minutes to avoid the idle screen blank kicking in. We use a C-
|
|
|
|
# style loop so we can reset it if needed due to RHBZ #1638563. We
|
|
|
|
# will retry a max of two times if we hit refresh and wind up
|
|
|
|
# being told the system is up to date.
|
2018-10-11 23:05:38 +00:00
|
|
|
my $retries = 2;
|
2018-10-31 19:45:11 +00:00
|
|
|
my $tags = ['desktop_package_tool_update_download', 'desktop_package_tool_update_apply', 'desktop_package_tool_update_refresh'];
|
2018-10-11 23:05:38 +00:00
|
|
|
for (my $n = 1; $n < 6; $n++) {
|
2018-10-31 19:45:11 +00:00
|
|
|
if (check_screen $tags, 120) {
|
2018-10-11 23:18:04 +00:00
|
|
|
# if we see 'apply', we're done here, quit out of the loop
|
2018-10-31 18:43:00 +00:00
|
|
|
last if (match_has_tag 'desktop_package_tool_update_apply');
|
|
|
|
# if we see 'download', we're in the GNOME Software 3.30.5+
|
2018-10-31 19:45:11 +00:00
|
|
|
# two-step process - let's hit it, and continue waiting for
|
|
|
|
# for apply (only), we now 'deactivate' the #1638563 workaround
|
2018-10-31 18:43:00 +00:00
|
|
|
if (match_has_tag 'desktop_package_tool_update_download') {
|
|
|
|
wait_screen_change { assert_and_click 'desktop_package_tool_update_download'; };
|
2018-10-31 19:45:11 +00:00
|
|
|
$n -= 1 if ($n > 1);
|
|
|
|
$tags = ['desktop_package_tool_update_apply'];
|
2018-10-31 18:43:00 +00:00
|
|
|
next;
|
|
|
|
}
|
2018-10-12 05:23:53 +00:00
|
|
|
# otherwise, the refresh button came back - that's the bug
|
2018-10-11 23:05:38 +00:00
|
|
|
if ($retries == 2) {
|
2018-10-11 23:18:04 +00:00
|
|
|
# only record the soft fail on the *first* retry
|
2018-10-11 23:05:38 +00:00
|
|
|
record_soft_failure "Refresh did not find available update - #1638563. Retrying";
|
|
|
|
}
|
|
|
|
if ($retries > 0) {
|
|
|
|
assert_and_click 'desktop_package_tool_update_refresh';
|
2018-10-11 23:18:04 +00:00
|
|
|
# reset the loop counter so we get another 10 minutes
|
2018-10-11 23:05:38 +00:00
|
|
|
$n = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
die "Retried refresh too many times, giving up";
|
|
|
|
}
|
|
|
|
$retries -= 1;
|
|
|
|
}
|
2018-10-11 23:18:04 +00:00
|
|
|
# move the mouse to stop the screen blanking on idle
|
2016-09-20 22:32:44 +00:00
|
|
|
mouse_set 10, 10;
|
|
|
|
mouse_hide;
|
|
|
|
}
|
2016-09-24 00:21:54 +00:00
|
|
|
# KDE annoyingly pops the notification up right over the install
|
2017-03-02 23:33:23 +00:00
|
|
|
# button, which doesn't help...wait for it to go away. Let's also
|
|
|
|
# wait on GNOME, as we've had tests fail at this point for no
|
|
|
|
# obvious reason, a wait may help.
|
|
|
|
wait_still_screen 5;
|
2016-09-20 22:32:44 +00:00
|
|
|
assert_and_click 'desktop_package_tool_update_apply';
|
|
|
|
# on GNOME, wait for reboots.
|
|
|
|
if ($desktop eq 'gnome') {
|
|
|
|
# handle reboot confirm screen which pops up when user is
|
|
|
|
# logged in (but don't fail if it doesn't as we're not testing
|
|
|
|
# that)
|
|
|
|
if (check_screen 'gnome_reboot_confirm', 15) {
|
2017-10-19 19:45:49 +00:00
|
|
|
# on F27+, default is Cancel, earlier, default is Restart
|
|
|
|
my $version = lc(get_var("VERSION"));
|
|
|
|
send_key 'tab' if ($version eq 'rawhide' || $version > 26);
|
2016-09-20 22:32:44 +00:00
|
|
|
send_key 'ret';
|
|
|
|
}
|
consolidate login waits, use postinstall not entrypoint for base
Summary:
I started out wanting to fix an issue I noticed today where
graphical upgrade tests were failing because they didn't wait
for the graphical login screen properly; the test was sitting
at the 'full Fedora logo' state of plymouth for a long time,
so the current boot_to_login_screen's wait_still_screen was
triggered by it and the function wound up failing on the
assert_screen, because it was still some time before the real
login screen appeared.
So I tweaked the boot_to_login_screen implementation to work
slightly differently (look for a login screen match, *then* -
if we're dealing with a graphical login - wait_still_screen
to defeat the 'old GPU buffer showing login screen' problem
and assert the login screen again). But while working on it,
I figured we really should consolidate all the various places
that handle the bootloader -> login, we were doing it quite
differently in all sorts of different places. And as part of
that, I converted the base tests to use POSTINSTALL (and thus
go through the shared _wait_login tests) instead of handling
boot themselves. As part of *that*, I tweaked main.pm to not
require all POSTINSTALL tests have the _postinstall suffix on
their names, as it really doesn't make sense, and renamed the
tests.
Test Plan: Run all tests, see if they work.
Reviewers: jskladan, garretraziel
Reviewed By: garretraziel
Subscribers: tflink
Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D1015
2016-09-27 18:48:15 +00:00
|
|
|
boot_to_login_screen;
|
2016-09-20 22:32:44 +00:00
|
|
|
}
|
|
|
|
else {
|
2016-09-24 00:21:54 +00:00
|
|
|
# KDE will prompt for authentication if any package is not
|
|
|
|
# signed. As of 2016-09-23, puiterwijk claims Rawhide packages
|
|
|
|
# will be autosigned 'by Monday', so if this happens, we're
|
|
|
|
# going to treat it as a soft fail, indicating the update
|
|
|
|
# mechanism works, but a package that should have been signed
|
|
|
|
# was not.
|
|
|
|
assert_screen ['desktop_package_tool_update_done', 'desktop_package_tool_update_authenticate'], 180;
|
|
|
|
if (match_has_tag('desktop_package_tool_update_authenticate')) {
|
|
|
|
record_soft_failure;
|
|
|
|
type_very_safely get_var('USER_PASSWORD', 'weakpassword');
|
|
|
|
send_key 'ret';
|
|
|
|
assert_screen 'desktop_package_tool_update_done', 180;
|
|
|
|
}
|
2016-09-20 22:32:44 +00:00
|
|
|
}
|
|
|
|
# back to console to verify updates
|
|
|
|
$self->root_console(tty=>3);
|
|
|
|
verify_updated_packages;
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
|
|
|
return { fatal => 1 };
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|