os-autoinst-distri-rocky/tests/upgrade_run.pm
Adam Williamson 52ceed6f39 upgrade: disable screen blanking before long-running commands
Summary:
Updating the stable release prior to doing the update can take
a long time if the image hasn't been updated for a while, and
the upgrade download process itself can take a long time. If
the screen blanks out in either case, either the following
needle match may fail (if we're waiting for a needle) or 'still
screen' may be detected early (if we're waiting for a still
screen), so let's disable screen blanking to avoid it.

Test Plan: Run the upgrade tests and see if they work.

Reviewers: garretraziel, jskladan

Reviewed By: jskladan

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D628
2015-10-26 18:02:22 -07:00

50 lines
1.5 KiB
Perl

use base "installedtest";
use strict;
use testapi;
sub run {
my $release = lc(get_var('VERSION'));
my $milestone = lc((split /_/, get_var("BUILD"))[1]);
my $args = "--releasever=${release}";
# This is excessive - after the Bodhi activation point we don't
# need --nogpgcheck for Branched. But that's hard to detect magically
if ($release eq 'rawhide' or $milestone eq 'branched') {
$args .= " --nogpgcheck";
}
# disable screen blanking (download can take a long time)
type_string "setterm -blank 0\n";
type_string "dnf -y system-upgrade download ${args}";
send_key "ret";
# wait until dnf finishes its work (screen stops moving for 30 seconds)
wait_still_screen 30, 6000; # TODO: shorter timeout, longer stillscreen?
upload_logs "/var/log/dnf.log";
upload_logs "/var/log/dnf.rpm.log";
type_string "dnf system-upgrade reboot";
send_key "ret";
# now offline upgrading starts. user doesn't have to do anything, just wait untill
# system reboots and login screen is shown
if (get_var('UPGRADE') eq "desktop") {
assert_screen "graphical_login", 6000;
} else {
assert_screen "text_console_login", 6000;
}
}
sub test_flags {
# without anything - rollback to 'lastgood' snapshot if failed
# 'fatal' - whole test suite is in danger if this fails
# 'milestone' - after this test succeeds, update 'lastgood'
# 'important' - if this fails, set the overall state to 'fail'
return { fatal => 1 };
}
1;
# vim: set sw=4 et: