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
This commit is contained in:
parent
c9ec17b2b7
commit
68acecb6d4
@ -118,6 +118,9 @@ or in upgrade tests). It uploads `/var/log` in `post_fail_hook()`. It provides t
|
|||||||
and then calls `console_login()` for root. If you set `check` argument, it dies if it fails to log in.
|
and then calls `console_login()` for root. If you set `check` argument, it dies if it fails to log in.
|
||||||
Example usage: running `$self->root_console(tty=>2, check=>0);` results in TTY2 displayed with root logged
|
Example usage: running `$self->root_console(tty=>2, check=>0);` results in TTY2 displayed with root logged
|
||||||
in.
|
in.
|
||||||
|
- `check_release()` checks whether the installed release matches a given value. E.g. `check_release(23)`
|
||||||
|
checks whether the installed system is Fedora 23. The value can be 'Rawhide' or a Fedora release number;
|
||||||
|
often you will want to use `get_var('VERSION')`. Expects a console prompt to be active when it is called.
|
||||||
|
|
||||||
### New test development workflow
|
### New test development workflow
|
||||||
|
|
||||||
|
@ -35,6 +35,15 @@ sub post_fail_hook {
|
|||||||
upload_logs "/tmp/var_log.tar.gz";
|
upload_logs "/tmp/var_log.tar.gz";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub check_release {
|
||||||
|
my $self = shift;
|
||||||
|
my $release = shift;
|
||||||
|
type_string "clear\n";
|
||||||
|
type_string "grep SUPPORT_PRODUCT_VERSION /usr/lib/os.release.d/os-release-fedora | grep -q ${release}\n";
|
||||||
|
type_string "echo \$?\n";
|
||||||
|
assert_screen "console_command_success";
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
# vim: set sw=4 et:
|
# vim: set sw=4 et:
|
||||||
|
6
main.pm
6
main.pm
@ -57,9 +57,9 @@ if (get_var("ENTRYPOINT"))
|
|||||||
}
|
}
|
||||||
elsif (get_var("UPGRADE"))
|
elsif (get_var("UPGRADE"))
|
||||||
{
|
{
|
||||||
# all upgrade tests consist of: preinstall phase (where packages are upgraded and fedup is
|
# all upgrade tests consist of: preinstall phase (where packages are upgraded and
|
||||||
# installed), run phase (where fedup is run) and postinstall phase (where is checked if
|
# dnf-plugin-system-upgrade is installed), run phase (where upgrade is run) and postinstall
|
||||||
# fedora was upgraded successfully)
|
# phase (where is checked if fedora was upgraded successfully)
|
||||||
autotest::loadtest get_var('CASEDIR')."/tests/upgrade_preinstall.pm";
|
autotest::loadtest get_var('CASEDIR')."/tests/upgrade_preinstall.pm";
|
||||||
autotest::loadtest get_var('CASEDIR')."/tests/upgrade_run.pm";
|
autotest::loadtest get_var('CASEDIR')."/tests/upgrade_run.pm";
|
||||||
# UPGRADE can be set to "minimal", "encrypted", "desktop"...
|
# UPGRADE can be set to "minimal", "encrypted", "desktop"...
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"properties": [],
|
|
||||||
"area": [
|
|
||||||
{
|
|
||||||
"xpos": 0,
|
|
||||||
"ypos": 129,
|
|
||||||
"width": 238,
|
|
||||||
"height": 12,
|
|
||||||
"type": "match"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"console_f22_installed",
|
|
||||||
"ENV-DISTRI-fedora",
|
|
||||||
"ENV-INSTLANG-en_US",
|
|
||||||
"ENV-FLAVOR-develop"
|
|
||||||
]
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
@ -1,25 +1,18 @@
|
|||||||
{
|
{
|
||||||
"area": [
|
"area": [
|
||||||
{
|
{
|
||||||
"xpos": 341,
|
|
||||||
"ypos": 372,
|
|
||||||
"width": 343,
|
|
||||||
"height": 65,
|
"height": 65,
|
||||||
"type": "match"
|
"type": "match",
|
||||||
},
|
"width": 343,
|
||||||
{
|
"xpos": 341,
|
||||||
"xpos": 600,
|
"ypos": 372
|
||||||
"ypos": 470,
|
|
||||||
"width": 80,
|
|
||||||
"height": 30,
|
|
||||||
"type": "match"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"properties": [],
|
||||||
"tags": [
|
"tags": [
|
||||||
"graphical_login_input",
|
"graphical_login_input",
|
||||||
"ENV-DISTRI-fedora",
|
"ENV-DISTRI-fedora",
|
||||||
"ENV-INSTLANG-en_US",
|
"ENV-INSTLANG-en_US",
|
||||||
"ENV-FLAVOR-develop"
|
"ENV-FLAVOR-develop"
|
||||||
],
|
]
|
||||||
"properties": []
|
|
||||||
}
|
}
|
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"properties": [],
|
|
||||||
"area": [
|
|
||||||
{
|
|
||||||
"xpos": 119,
|
|
||||||
"ypos": 51,
|
|
||||||
"width": 61,
|
|
||||||
"height": 10,
|
|
||||||
"type": "match"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"grub_fedup",
|
|
||||||
"ENV-DISTRI-fedora",
|
|
||||||
"ENV-INSTLANG-en_US",
|
|
||||||
"ENV-FLAVOR-server"
|
|
||||||
]
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.5 KiB |
16
templates
16
templates
@ -224,7 +224,7 @@
|
|||||||
flavor => "universal",
|
flavor => "universal",
|
||||||
version => "*",
|
version => "*",
|
||||||
},
|
},
|
||||||
test_suite => { name => "fedup_minimal_64bit" },
|
test_suite => { name => "upgrade_minimal_64bit" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
machine => { name => "64bit" },
|
machine => { name => "64bit" },
|
||||||
@ -234,7 +234,7 @@
|
|||||||
flavor => "universal",
|
flavor => "universal",
|
||||||
version => "*",
|
version => "*",
|
||||||
},
|
},
|
||||||
test_suite => { name => "fedup_desktop_64bit" },
|
test_suite => { name => "upgrade_desktop_64bit" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
machine => { name => "64bit" },
|
machine => { name => "64bit" },
|
||||||
@ -484,7 +484,7 @@
|
|||||||
flavor => "universal",
|
flavor => "universal",
|
||||||
version => "*",
|
version => "*",
|
||||||
},
|
},
|
||||||
test_suite => { name => "fedup_minimal_32bit" },
|
test_suite => { name => "upgrade_minimal_32bit" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
machine => { name => "32bit" },
|
machine => { name => "32bit" },
|
||||||
@ -494,7 +494,7 @@
|
|||||||
flavor => "universal",
|
flavor => "universal",
|
||||||
version => "*",
|
version => "*",
|
||||||
},
|
},
|
||||||
test_suite => { name => "fedup_desktop_32bit" },
|
test_suite => { name => "upgrade_desktop_32bit" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
machine => { name => "32bit" },
|
machine => { name => "32bit" },
|
||||||
@ -801,7 +801,7 @@
|
|||||||
variables => "",
|
variables => "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "fedup_minimal_64bit",
|
name => "upgrade_minimal_64bit",
|
||||||
prio => 19,
|
prio => 19,
|
||||||
settings => [
|
settings => [
|
||||||
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
||||||
@ -812,7 +812,7 @@
|
|||||||
variables => "",
|
variables => "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "fedup_desktop_64bit",
|
name => "upgrade_desktop_64bit",
|
||||||
prio => 20,
|
prio => 20,
|
||||||
settings => [
|
settings => [
|
||||||
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
||||||
@ -823,7 +823,7 @@
|
|||||||
variables => "",
|
variables => "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "fedup_minimal_32bit",
|
name => "upgrade_minimal_32bit",
|
||||||
prio => 19,
|
prio => 19,
|
||||||
settings => [
|
settings => [
|
||||||
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
||||||
@ -834,7 +834,7 @@
|
|||||||
variables => "",
|
variables => "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name => "fedup_desktop_32bit",
|
name => "upgrade_desktop_32bit",
|
||||||
prio => 20,
|
prio => 20,
|
||||||
settings => [
|
settings => [
|
||||||
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
{ key => "ROOT_PASSWORD", value => "weakpassword" },
|
||||||
|
@ -17,6 +17,9 @@ sub run {
|
|||||||
send_key "ret";
|
send_key "ret";
|
||||||
# wait until desktop appears
|
# wait until desktop appears
|
||||||
assert_screen "graphical_desktop_clean", 30;
|
assert_screen "graphical_desktop_clean", 30;
|
||||||
|
# check an upgrade actually happened (and we can log into a console)
|
||||||
|
$self->root_console(tty=>3);
|
||||||
|
$self->check_release(get_var('VERSION'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,11 +6,10 @@ use testapi;
|
|||||||
sub run {
|
sub run {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
# try to login, check whether F22 is installed
|
# try to login, check whether target release is installed
|
||||||
$self->boot_to_login_screen();
|
$self->boot_to_login_screen();
|
||||||
$self->root_console(tty=>3);
|
$self->root_console(tty=>3);
|
||||||
|
$self->check_release(get_var('VERSION'));
|
||||||
assert_screen "console_f22_installed";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@ sub run {
|
|||||||
# switch to TTY3 for both, graphical and console tests
|
# switch to TTY3 for both, graphical and console tests
|
||||||
$self->root_console(tty=>3);
|
$self->root_console(tty=>3);
|
||||||
|
|
||||||
# fedup should be installed on up-to-date system
|
# upgrader should be installed on up-to-date system
|
||||||
|
|
||||||
type_string 'yum -y update; echo $?';
|
type_string 'dnf -y update; echo $?';
|
||||||
send_key "ret";
|
send_key "ret";
|
||||||
|
|
||||||
assert_screen "console_command_success", 1800;
|
assert_screen "console_command_success", 1800;
|
||||||
@ -31,7 +31,7 @@ sub run {
|
|||||||
}
|
}
|
||||||
$self->root_console(tty=>3);
|
$self->root_console(tty=>3);
|
||||||
|
|
||||||
type_string 'yum -y install fedup; echo $?';
|
type_string 'dnf -y --enablerepo=updates-testing install dnf-plugin-system-upgrade; echo $?';
|
||||||
send_key "ret";
|
send_key "ret";
|
||||||
|
|
||||||
assert_screen "console_command_success", 1800;
|
assert_screen "console_command_success", 1800;
|
||||||
|
@ -3,32 +3,24 @@ use strict;
|
|||||||
use testapi;
|
use testapi;
|
||||||
|
|
||||||
sub run {
|
sub run {
|
||||||
my $fedup_url;
|
my $release = lc(get_var('VERSION'));
|
||||||
my $to_version;
|
my $milestone = lc((split /_/, get_var("BUILD"))[1]);
|
||||||
# FIXME: this is just a workaround, see https://phab.qadevel.cloud.fedoraproject.org/T478
|
my $args = "--releasever=${release}";
|
||||||
# construct download URL
|
# This is excessive - after the Bodhi activation point we don't
|
||||||
if (get_var("BUILD") =~ /^(\d+)_Final_(.*)$/) {
|
# need --nogpgcheck for Branched. But that's hard to detect magically
|
||||||
$fedup_url = "https://dl.fedoraproject.org/pub/alt/stage/".$1."_".$2."/Server/".get_var("ARCH")."/os";
|
if ($release eq 'rawhide' or $milestone eq 'branched') {
|
||||||
$to_version = $1;
|
$args .= " --nogpgcheck";
|
||||||
} else {
|
|
||||||
$fedup_url = "https://dl.fedoraproject.org/pub/alt/stage/".get_var("BUILD")."/Server/".get_var("ARCH")."/os";
|
|
||||||
get_var("BUILD") =~ /^(\d+)/;
|
|
||||||
$to_version = $1;
|
|
||||||
}
|
}
|
||||||
|
type_string "dnf -y system-upgrade download ${args}";
|
||||||
type_string "fedup --network ".$to_version." --instrepo ".$fedup_url;
|
|
||||||
send_key "ret";
|
send_key "ret";
|
||||||
|
|
||||||
# wait untill fedup finishes its work (screen stops moving for 30 seconds)
|
# wait until dnf finishes its work (screen stops moving for 30 seconds)
|
||||||
wait_still_screen 30, 6000; # TODO: shorter timeout, longer stillscreen?
|
wait_still_screen 30, 6000; # TODO: shorter timeout, longer stillscreen?
|
||||||
|
|
||||||
upload_logs "/var/log/fedup.log";
|
upload_logs "/var/log/dnf.log";
|
||||||
|
upload_logs "/var/log/dnf.rpm.log";
|
||||||
|
|
||||||
type_string "reboot";
|
type_string "dnf system-upgrade reboot";
|
||||||
send_key "ret";
|
|
||||||
|
|
||||||
# check that "upgrade" item is shown in GRUB
|
|
||||||
assert_screen "grub_fedup", 30;
|
|
||||||
send_key "ret";
|
send_key "ret";
|
||||||
|
|
||||||
# now offline upgrading starts. user doesn't have to do anything, just wait untill
|
# now offline upgrading starts. user doesn't have to do anything, just wait untill
|
||||||
|
Loading…
Reference in New Issue
Block a user