Test FreeIPA upgrade on updates

This adds the FreeIPA server and client upgrade tests to a new
updates-server-upgrade flavor which fedora_openqa will schedule
for updates. This way, we can test whether updates break
FreeIPA upgrades, which is a request the FreeIPA team made to
me. This has been deployed on staging for the last week or so
and appears to work fine.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-04-20 10:12:01 -07:00
parent aae0041f6f
commit e931cfa0a5
3 changed files with 94 additions and 27 deletions

View File

@ -345,22 +345,7 @@ sub _repo_setup_compose {
script_run "cat /etc/yum.repos.d/{fedora,fedora-rawhide,fedora-modular,fedora-rawhide-modular}.repo", 0;
}
sub _repo_setup_updates {
# Appropriate repo setup steps for testing a Bodhi update
# Check if we already ran, bail if so
return unless script_run "test -f /etc/yum.repos.d/advisory.repo";
# Use baseurl not metalink so we don't hit the timing issue where
# the infra repo is updated but mirrormanager metadata checksums
# have not been updated, and the infra repo is rejected as its
# metadata checksum isn't known to MM
assert_script_run "sed -i -e 's,^metalink,#metalink,g' -e 's,^#baseurl,baseurl,g' /etc/yum.repos.d/fedora*.repo";
if (get_var("OFW")) {
# the uncommented baseurl line must be changed for PowerPC
# from download.fedoraproject.org/pub/fedora/linux/...
# to download.fedoraproject.org/pub/fedora-secondary/...
script_run "sed -i -e 's,/pub/fedora/linux/,/pub/fedora-secondary/,g' /etc/yum.repos.d/fedora*.repo", 0;
}
if (get_var("DEVELOPMENT")) {
sub _repo_setup_updates_development {
# Fix URL for fedora.repo if this is a development release
# This is rather icky, but I can't think of any better way
# The problem is that the 'baseurl' line in fedora.repo is
@ -380,7 +365,26 @@ sub _repo_setup_updates {
assert_script_run "dnf config-manager --set-disabled updates-testing-modular";
assert_script_run "dnf config-manager --set-disabled updates-modular";
}
}
sub _repo_setup_updates {
# Appropriate repo setup steps for testing a Bodhi update
# Check if we already ran, bail if so
return unless script_run "test -f /etc/yum.repos.d/advisory.repo";
# Use baseurl not metalink so we don't hit the timing issue where
# the infra repo is updated but mirrormanager metadata checksums
# have not been updated, and the infra repo is rejected as its
# metadata checksum isn't known to MM
assert_script_run "sed -i -e 's,^metalink,#metalink,g' -e 's,^#baseurl,baseurl,g' /etc/yum.repos.d/fedora*.repo";
if (get_var("OFW")) {
# the uncommented baseurl line must be changed for PowerPC
# from download.fedoraproject.org/pub/fedora/linux/...
# to download.fedoraproject.org/pub/fedora-secondary/...
script_run "sed -i -e 's,/pub/fedora/linux/,/pub/fedora-secondary/,g' /etc/yum.repos.d/fedora*.repo", 0;
}
# for non-upgrade tests, we want to do the 'development' changes
# *before* we set up the update repo...
_repo_setup_updates_development if (get_var("DEVELOPMENT") &! get_var("UPGRADE"));
# Set up an additional repo containing the update packages. We do
# this rather than simply running a one-time update because it may
# be the case that a package from the update isn't installed *now*
@ -404,6 +408,9 @@ sub _repo_setup_updates {
assert_script_run "git clone https://github.com/fedora-infra/python-fedora.git";
assert_script_run "PYTHONPATH=python-fedora/ bodhi -D " . get_var("ADVISORY"), 600;
}
# for upgrade tests, we want to do the 'development' changes *after*
# we set up the update repo
_repo_setup_updates_development if (get_var("DEVELOPMENT") && get_var("UPGRADE"));
# log the exact packages in the update at test time, with their
# source packages and epochs. log is uploaded by _advisory_update
# and used for later comparison by _advisory_post
@ -412,8 +419,8 @@ sub _repo_setup_updates {
assert_script_run "createrepo .";
# write a repo config file
assert_script_run 'printf "[advisory]\nname=Advisory repo\nbaseurl=file:///opt/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0" > /etc/yum.repos.d/advisory.repo';
# run an update now
script_run "dnf -y update", 600;
# run an update now (except for upgrade tests)
script_run "dnf -y update", 600 unless (get_var("UPGRADE"));
}
sub repo_setup {

View File

@ -4849,7 +4849,7 @@
name => "upgrade_server_domain_controller",
settings => [
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "HDD_1", value => "disk_f%CURRREL%_server_3_x86_64.img" },
{ key => "+HDD_1", value => "disk_f%CURRREL%_server_3_x86_64.img" },
{ key => "UPGRADE", value => "1" },
{ key => "TEST_TARGET", value => "COMPOSE" },
{ key => "PREUPGRADE", value => "role_deploy_domain_controller" },
@ -4867,7 +4867,7 @@
name => "upgrade_realmd_client",
settings => [
{ key => "ROOT_PASSWORD", value => "weakpassword" },
{ key => "HDD_1", value => "disk_f%CURRREL%_server_3_x86_64.img" },
{ key => "+HDD_1", value => "disk_f%CURRREL%_server_3_x86_64.img" },
{ key => "UPGRADE", value => "1" },
{ key => "TEST_TARGET", value => "COMPOSE" },
{ key => "PREUPGRADE", value => "realmd_join_sssd" },
@ -4889,7 +4889,7 @@
{ key => "USER_LOGIN", value => "test" },
{ key => "USER_PASSWORD", value => "weakpassword" },
{ key => "BOOTFROM", value => "c" },
{ key => "HDD_1", value => "disk_f%CURRREL%_kde_3_x86_64.img" },
{ key => "+HDD_1", value => "disk_f%CURRREL%_kde_3_x86_64.img" },
{ key => "UPGRADE", value => "1" },
{ key => "DESKTOP", value => "kde" },
{ key => "TEST_TARGET", value => "COMPOSE" },

View File

@ -282,6 +282,30 @@
},
test_suite => { name => "realmd_join_sssd" },
},
{
group_name => "Fedora Updates",
machine => { name => "64bit" },
prio => 40,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "updates-server-upgrade",
version => "*",
},
test_suite => { name => "upgrade_server_domain_controller" },
},
{
group_name => "Fedora Updates",
machine => { name => "64bit" },
prio => 30,
product => {
arch => "x86_64",
distri => "fedora",
flavor => "updates-server-upgrade",
version => "*",
},
test_suite => { name => "upgrade_realmd_client" },
},
{
group_name => "Fedora Updates",
machine => { name => "64bit" },
@ -781,6 +805,15 @@
],
version => "*",
},
{
arch => "x86_64",
distri => "fedora",
flavor => "updates-server-upgrade",
name => "",
settings => [
],
version => "*",
},
{
arch => "ppc64le",
distri => "fedora",
@ -790,6 +823,15 @@
],
version => "*",
},
{
arch => "ppc64le",
distri => "fedora",
flavor => "updates-server-upgrade",
name => "",
settings => [
],
version => "*",
},
{
arch => "ppc64",
distri => "fedora",
@ -799,6 +841,15 @@
],
version => "*",
},
{
arch => "ppc64",
distri => "fedora",
flavor => "updates-server-upgrade",
name => "",
settings => [
],
version => "*",
},
{
arch => "aarch64",
distri => "fedora",
@ -808,5 +859,14 @@
],
version => "*",
},
{
arch => "aarch64",
distri => "fedora",
flavor => "updates-server-upgrade",
name => "",
settings => [
],
version => "*",
},
],
}