1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-08-09 18:35:44 +00:00

Add GUI variant of the upgrade test.

This commit is contained in:
Lukáš Růžička 2021-12-02 15:10:11 +01:00
parent ff6165c839
commit 7bb40c4d44

View File

@ -2,7 +2,6 @@ use base "installedtest";
use strict; use strict;
use testapi; use testapi;
use utils; use utils;
sub run { sub run {
my $self = shift; my $self = shift;
my $release = lc(get_var("VERSION")); my $release = lc(get_var("VERSION"));
@ -10,32 +9,85 @@ sub run {
if ($release eq "rawhide") { if ($release eq "rawhide") {
$relnum = get_var("RAWREL", "rawhide"); $relnum = get_var("RAWREL", "rawhide");
} }
# disable screen blanking (download can take a long time)
script_run "setterm -blank 0";
# use compose repo (compose tests) or set up update repo (update tests) if (get_var("GUI_UPGRADE")) {
cleanup_workaround_repo;
repo_setup(); # Get back to the desktop
my $params = "-y --releasever=${relnum}"; desktop_vt();
if ($release eq "rawhide") {
$params .= " --nogpgcheck"; # If the desktop is Gnome
if (get_var("DESKTOP") eq "gnome") {
desktop_login(get_var("USER_LOGIN"), get_var("USER_PASSWORD"));
# Start Gnome software
menu_launch_type("gnome-software");
# If it is run for the first time, hit the Browse button to
# speed things up.
if (check_screen("gnome_software_browse_button")) {
assert_and_click("gnome_software_browse_button");
}
# Click on the updates button. There should be no updates available,
# as updates were already handled by the upgrade_preinstall test,
# so we should only see the new version banner.
assert_and_click("gnome_software_updates_button", 60);
# Check that the banner is there.
assert_screen("gnome_software_new_version");
# Click on the Download button to download the new version.
assert_and_click("gnome_software_new_download");
# Wait until it gets downloaded. It can take a long time, so
# we will do regular checks.
wait_until_needlematch("gnome_software_new_install", 10, 120);
# Click to Install the updates
assert_and_click("gnome_software_new_install");
if (check_screen("gnome_software_authenticate")) {
# If authentication dialogue, then authenticate
type_safely(get_var("USER_PASSWORD"));
send_key("ret");
}
else {
die("There was no authentication dialogue requested for an activity where it should have been.");
}
if (check_screen("gnome_software_restart")) {
assert_and_click("gnome_software_restart");
}
}
} }
else {
# disable screen blanking (download can take a long time)
script_run "setterm -blank 0";
if (script_run "dnf ${params} system-upgrade download", 6000) { # use compose repo (compose tests) or set up update repo (update tests)
record_soft_failure "dnf failed so retry with --allowerasing"; cleanup_workaround_repo;
$params .= " --allowerasing"; repo_setup();
assert_script_run "dnf ${params} system-upgrade download", 6000; my $params = "-y --releasever=${relnum}";
if ($release eq "rawhide") {
$params .= " --nogpgcheck";
}
if (script_run "dnf ${params} system-upgrade download", 6000) {
record_soft_failure "dnf failed so retry with --allowerasing";
$params .= " --allowerasing";
assert_script_run "dnf ${params} system-upgrade download", 6000;
}
upload_logs "/var/log/dnf.log";
upload_logs "/var/log/dnf.rpm.log";
script_run "dnf system-upgrade reboot", 0;
# fail immediately if we see a DNF error message, but keep an eye
# out for the bootloader so we can handle it if requested
check_screen ["upgrade_fail", "bootloader"], 15;
die "DNF reported failure" if (match_has_tag "upgrade_fail");
} }
upload_logs "/var/log/dnf.log";
upload_logs "/var/log/dnf.rpm.log";
script_run "dnf system-upgrade reboot", 0;
# fail immediately if we see a DNF error message, but keep an eye
# out for the bootloader so we can handle it if requested
check_screen ["upgrade_fail", "bootloader"], 15;
die "DNF reported failure" if (match_has_tag "upgrade_fail");
# handle bootloader, if requested; set longer timeout as sometimes # handle bootloader, if requested; set longer timeout as sometimes
# reboot here seems to take a long time # reboot here seems to take a long time
if (get_var("GRUB_POSTINSTALL")) { if (get_var("GRUB_POSTINSTALL")) {