os-autoinst-distri-fedora/tests/upgrade_run.pm

50 lines
1.6 KiB
Perl
Raw Normal View History

use base "installedtest";
use strict;
use testapi;
sub run {
2016-01-28 05:40:07 +00:00
my $self = shift;
my $release = lc(get_var("VERSION"));
# NOTE: this doesn't actually work yet, it's a FIXME in fedorabase
my $milestone = $self->get_milestone;
convert upgrade tests to dnf-plugin-system-upgrade Summary: This is a first cut which more or less works for now. Issues: 1) We're not really testing the BUILD, here. All the test does is try and upgrade to the specified VERSION - so it'll be using the latest 'stable' for the given VERSION at the time the test runs. This isn't really that terrible, but especially for TC/RC validation, we might want to make things a bit more elaborate and set up the repo for the actual BUILD (and disable the main repos). 2) We'd actually need --nogpgcheck for non-Rawhide, at one specific point in the release cycle - after Branching but before Bodhi activation (which is when we can be sure all packages are signed). This won't matter until 24 branches, and maybe releng will have it fixed by then...if not, I'll tweak it. 3) We don't really test that the upgrade actually *happened* for desktop, at the moment - the only thing in the old test that really checked that was where we checked for the fedup boot menu entry, but that has no analog in dnf. What we should probably do is check that GUI login works, then switch to a console and check /etc/fedora-release just as the minimal test does. Test Plan: Run the tests. Note that creating the desktop disk image doesn't work ATM, so I can't verify the desktop test works, but the minimal one seems to (with D565). There'll be a matching diff for openqa_fedora_tools to update the test case names there. Reviewers: jskladan, garretraziel Reviewed By: jskladan, garretraziel Subscribers: tflink Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D567
2015-09-10 21:49:13 +00:00
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)
script_run "setterm -blank 0";
assert_script_run "dnf -y system-upgrade download ${args}", 6000;
convert upgrade tests to dnf-plugin-system-upgrade Summary: This is a first cut which more or less works for now. Issues: 1) We're not really testing the BUILD, here. All the test does is try and upgrade to the specified VERSION - so it'll be using the latest 'stable' for the given VERSION at the time the test runs. This isn't really that terrible, but especially for TC/RC validation, we might want to make things a bit more elaborate and set up the repo for the actual BUILD (and disable the main repos). 2) We'd actually need --nogpgcheck for non-Rawhide, at one specific point in the release cycle - after Branching but before Bodhi activation (which is when we can be sure all packages are signed). This won't matter until 24 branches, and maybe releng will have it fixed by then...if not, I'll tweak it. 3) We don't really test that the upgrade actually *happened* for desktop, at the moment - the only thing in the old test that really checked that was where we checked for the fedup boot menu entry, but that has no analog in dnf. What we should probably do is check that GUI login works, then switch to a console and check /etc/fedora-release just as the minimal test does. Test Plan: Run the tests. Note that creating the desktop disk image doesn't work ATM, so I can't verify the desktop test works, but the minimal one seems to (with D565). There'll be a matching diff for openqa_fedora_tools to update the test case names there. Reviewers: jskladan, garretraziel Reviewed By: jskladan, garretraziel Subscribers: tflink Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D567
2015-09-10 21:49:13 +00:00
upload_logs "/var/log/dnf.log";
upload_logs "/var/log/dnf.rpm.log";
script_run "dnf system-upgrade reboot";
# fail immediately if we see a DNF error message
die "DNF reported failure" if (check_screen "upgrade_fail");
# try and catch if we hit RHBZ #1349721 and work around it
if (check_screen "bootloader") {
# wait some secs for the screen to clear
sleep 10;
if (check_screen "bootloader") {
record_soft_failure;
$self->do_bootloader(postinstall=>1, params=>"enforcing=0");
}
}
}
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: