1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-26 20:23:09 +00:00
os-autoinst-distri-fedora/tests/upgrade_preinstall.pm

54 lines
1.6 KiB
Perl
Raw Normal View History

use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
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
# upgrader should be installed on up-to-date system
my $version = get_var("UP1REL");
# ok this is dumb but I need to fix it fast and can't think of a
# better way in a hurry. We want the pre-upgrade release version.
my $testname = get_var("TEST");
if (index($testname, "upgrade_2") != -1) {
$version = get_var("UP2REL");
}
# setup the workarounds repository for the pre-upgrade release,
# in case we need workarounds for that environment
setup_repos(waonly => 1, version => $version);
# disable updates-testing, this is needed for the case of upgrade
# from branched to rawhide to ensure we don't get packages from
# updates-testing for anything we do between here and upgrade_run
disable_updates_repos(both => 0);
# disable openh264 repo, otherwise stuff from it might cause
# trouble when it's disabled by repo_setup later
assert_script_run "rm -f /etc/yum.repos.d/fedora-cisco-openh264.repo";
assert_script_run 'dnf -y update --refresh', 1800;
script_run "reboot", 0;
# handle bootloader, if requested
if (get_var("GRUB_POSTINSTALL")) {
do_bootloader(postinstall => 1, params => get_var("GRUB_POSTINSTALL"), timeout => 120);
}
# decrypt if necessary
if (get_var("ENCRYPT_PASSWORD")) {
boot_decrypt(120);
}
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;
$self->root_console(tty => 3);
my $update_command = 'dnf -y install dnf-plugin-system-upgrade';
assert_script_run $update_command, 600;
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et: