1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-09-12 11:27:21 +00:00
os-autoinst-distri-fedora/tests/upgrade_run.pm
Adam Williamson 2df55efb49 add desktop_terminal test, refactor test loading a bit
Summary:
I really just want to add the desktop_terminal test, but I think
this refactor is in order now. It splits up loading of the
various test phases (much as SUSE do it) and allows us to run
the post-install tests without the install tests, for e.g. I
tweaked things to allow the upgrade tests to use the existing
_wait_login tests for final login and combine the two upgrade
postinstall tests into one simple one.

This comes with a bit of a behaviour change to make graphical
wait login behave the same as console wait login: it will log
in unless USER_LOGIN is set to 'false'. Previously it only
logged in if both USER_LOGIN and USER_PASSWORD were set, which
I don't think ever happened in a graphical test, so we never
actually did a graphical login. The intent here is we should do
a login on the default_install tests. That's going a bit beyond
the test case, but it seems like a reasonable thing to test. We
can set USER_LOGIN to false if we don't want to do it.

Test Plan:
Do a full test run, make sure the new tests work and
no old tests break.

Reviewers: jskladan, garretraziel

Reviewed By: garretraziel

Subscribers: tflink

Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D839
2016-05-05 16:39:47 -07:00

41 lines
1.2 KiB
Perl

use base "installedtest";
use strict;
use testapi;
sub run {
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;
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;
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");
}
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: