1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-02-15 12:04:31 +00:00

Unify buildroot repo handling and base it on a variable

This is intended to address the problem that we don't use the
buildroot repo for Branched between branching and u-t activation,
which often causes problems when newly-created updates depend on
builds that recently went stable. So instead of having logic in
the tests that sets up the buildroot repo only if the release is
Rawhide (or ELN), we'll do the decision about whether to set it
up in the scheduler (which decides based on info from Bodhi), and
just have the 'set up the repo' steps in the tests. Let's also
use the same code and repo name for ELN and non-ELN so we don't
have pointless divergence there.

Depends on the matching fedora_openqa change, of course - without
that, no test will use the buildroot repo.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2025-02-11 09:47:55 -08:00
parent 0b0bf1fcf6
commit d63c327b16
9 changed files with 34 additions and 26 deletions

View File

@ -43,9 +43,10 @@ sub mock_setup {
$repos .= '[openqa-testtag]\nname=Tag test repo\nbaseurl=' . get_var("UPDATE_OR_TAG_REPO") . '\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\npriority=1\n' if ($tag || $copr);
# and the workaround repo
$repos .= '\n[workarounds]\nname=Workarounds repo\nbaseurl=file:///mnt/workarounds_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n' if ($workarounds);
# also the buildroot repo, for Rawhide
if ($version eq $rawrel) {
$repos .= '\n[koji-rawhide]\nname=Buildroot repo\nbaseurl=https://kojipkgs.fedoraproject.org/repos/f' . $version . '-build/latest/\$basearch/\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\nskip_if_unavailable=1\n';
# also the buildroot repo if applicable
my $brrepo = get_var("BUILDROOT_REPO");
if ($brrepo) {
$repos .= '\n[buildroot]\nname=Buildroot repo\nbaseurl=https://kojipkgs.fedoraproject.org/repos/' . $brrepo . '/latest/\$basearch/\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\nskip_if_unavailable=1\n';
}
$repos .= '\"\"\"';
assert_script_run 'printf "' . $repos . '" >> /etc/mock/openqa.cfg';

View File

@ -708,13 +708,11 @@ sub _repo_setup_updates {
repos_mirrorlist();
# Disable updates-testing so other bad updates don't break us
disable_updates_repos(both => 0) if ($version > $currrel);
# use the buildroot repo on Rawhide: see e.g.
# https://pagure.io/fedora-ci/general/issue/376 for why
if ($version eq get_var("RAWREL") && get_var("TEST") ne "support_server") {
assert_script_run 'printf "[koji-rawhide]\nname=koji-rawhide\nbaseurl=https://kojipkgs.fedoraproject.org/repos/f' . $version . '-build/latest/' . $arch . '/\ncost=2000\nenabled=1\ngpgcheck=0\n" > /etc/yum.repos.d/koji-rawhide.repo';
}
if (lc(get_var("VERSION")) eq "eln" && get_var("TEST") ne "support_server") {
assert_script_run 'printf "[koji-eln]\nname=koji-eln\nbaseurl=https://kojipkgs.fedoraproject.org/repos/eln-build/latest/' . $arch . '/\ncost=2000\nenabled=1\ngpgcheck=0\n" > /etc/yum.repos.d/koji-eln.repo';
# use the buildroot repo on Rawhide and Branched pre-ut-activation:
# see e.g. https://pagure.io/fedora-ci/general/issue/376 for why
my $brrepo = get_var("BUILDROOT_REPO");
if ($brrepo && get_var("TEST") ne "support_server") {
assert_script_run 'printf "[buildroot]\nname=buildroot\nbaseurl=https://kojipkgs.fedoraproject.org/repos/' . $brrepo . '/latest/' . $arch . '/\ncost=2000\nenabled=1\ngpgcheck=0\n" > /etc/yum.repos.d/buildroot.repo';
}
if (get_var("CANNED")) {
# install and use en_US.UTF-8 locale for consistent sort

View File

@ -58,10 +58,10 @@ sub run {
if (get_var("ADVISORY_OR_TASK")) {
# add workaround repo if there is one
$params .= "inst.addrepo=workarounds,nfs://172.16.2.110:/mnt/workarounds_repo " if (get_workarounds);
# add tag repo if we're on rawhide
my $version = get_var("VERSION");
if ($version eq get_var("RAWREL")) {
$params .= "inst.addrepo=koji-rawhide,https://kojipkgs.fedoraproject.org/repos/f${version}-build/latest/${arch} ";
# add buildroot repo if applicable
my $brrepo = get_var("BUILDROOT_REPO");
if ($brrepo) {
$params .= "inst.addrepo=buildroot,https://kojipkgs.fedoraproject.org/repos/${brrepo}/latest/${arch} ";
}
}
if (get_var("ANACONDA_TEXT")) {

View File

@ -8,6 +8,7 @@ sub run {
my $version = get_var("VERSION");
my $currrel = get_var("CURRREL");
my $rawrel = get_var("RAWREL");
my $brrepo = get_var("BUILDROOT_REPO");
my $repo = "fedora.repo";
$repo = "fedora-rawhide.repo" if ($version eq $rawrel);
$repo = "fedora-eln.repo" if (lc($version) eq "eln");
@ -35,8 +36,7 @@ sub run {
$cmd .= " --variant=Everything --volid=Fedora-E-dvd-${arch}";
}
$cmd .= " --repo=/etc/yum.repos.d/workarounds.repo" if (get_workarounds);
$cmd .= " --repo=/etc/yum.repos.d/koji-rawhide.repo" if ($version eq $rawrel);
$cmd .= " --repo=/etc/yum.repos.d/koji-eln.repo" if (lc($version) eq "eln");
$cmd .= " --repo=/etc/yum.repos.d/buildroot.repo" if ($brrepo);
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo" unless (get_var("TAG") || get_var("COPR"));
$cmd .= " --repo=/etc/yum.repos.d/openqa-testtag.repo" if (get_var("TAG") || get_var("COPR"));
$cmd .= " ./results";

View File

@ -9,6 +9,7 @@ sub run {
my $version = get_var("VERSION");
my $advortask = get_var("ADVISORY_OR_TASK");
my $rawrel = get_var("RAWREL");
my $brrepo = get_var("BUILDROOT_REPO");
my $branch;
my $repoxml;
my $releasever;
@ -53,8 +54,8 @@ sub run {
assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n <repository type=\"rpm-md\" alias=\"openqa-testtag\" sourcetype=\"baseurl\">\n <source path=\"' . get_var("UPDATE_OR_TAG_REPO") . '\"/>\n </repository>\n</image>\n" > ' . $repoxml if ($tag || $copr);
# and the workarounds repo
assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n <repository type=\"rpm-md\" alias=\"workarounds\" sourcetype=\"baseurl\">\n <source path=\"file:///mnt/workarounds_repo\"/>\n </repository>\n</image>\n" > ' . $repoxml if ($workarounds);
# and the buildroot repo, for Rawhide
assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n <repository type=\"rpm-md\" alias=\"koji-rawhide\" sourcetype=\"baseurl\">\n <source path=\"https://kojipkgs.fedoraproject.org/repos/f' . $version . '-build/latest/\$basearch/\"/>\n </repository>\n</image>\n" > ' . $repoxml if ($version eq $rawrel);
# and the buildroot repo, if applicable
assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n <repository type=\"rpm-md\" alias=\"buildroot\" sourcetype=\"baseurl\">\n <source path=\"https://kojipkgs.fedoraproject.org/repos/' . $brrepo . '/latest/\$basearch/\"/>\n </repository>\n</image>\n" > ' . $repoxml if ($brrepo);
# upload the repositories XML so we can check it
# NOTE: koji kiwi plugin does much more futzing around with the XML
# it flattens includes, fiddles with the repos, and and messes with

View File

@ -8,6 +8,7 @@ sub run {
my $self = shift;
my $version = get_var("VERSION");
my $rawrel = get_var("RAWREL");
my $brrepo = get_var("BUILDROOT_REPO");
my $branch;
my $repoks;
my $releasever;
@ -43,7 +44,7 @@ sub run {
assert_script_run 'echo "repo --name=workarounds --baseurl=file:///mnt/workarounds_repo" >> ' . $repoks if ($workarounds);
# and the buildroot repo, for Rawhide
if ($version eq $rawrel) {
assert_script_run 'echo "repo --name=koji-rawhide --baseurl=https://kojipkgs.fedoraproject.org/repos/f' . $version . '-build/latest/\$basearch/" >> ' . $repoks;
assert_script_run 'echo "repo --name=buildroot --baseurl=https://kojipkgs.fedoraproject.org/repos/' . $brrepo . '/latest/\$basearch/" >> ' . $repoks;
}
# now flatten the kickstart
assert_script_run "ksflatten -c fedora-live-${lcsubv}.ks -o openqa.ks";

View File

@ -8,6 +8,7 @@ sub run {
my $version = get_var("VERSION");
my $currrel = get_var("CURRREL");
my $rawrel = get_var("RAWREL");
my $brrepo = get_var("BUILDROOT_REPO");
my $repo = $version eq $rawrel ? "fedora-rawhide.repo" : "fedora.repo";
my $branch;
if ($version eq $rawrel) {
@ -38,15 +39,15 @@ sub run {
assert_script_run 'git clone https://pagure.io/workstation-ostree-config.git';
assert_script_run 'pushd workstation-ostree-config';
assert_script_run "git checkout ${branch}";
# now copy the advisory, workaround repo and koji-rawhide config files
# now copy the advisory, workaround repo and buildroot repo config files
assert_script_run 'cp /etc/yum.repos.d/workarounds.repo .' if ($workarounds);
assert_script_run 'cp /etc/yum.repos.d/koji-rawhide.repo .' if ($version eq $rawrel);
assert_script_run 'cp /etc/yum.repos.d/buildroot.repo .' if ($brrepo);
assert_script_run 'cp /etc/yum.repos.d/advisory.repo .' unless ($tag || $copr);
assert_script_run 'cp /etc/yum.repos.d/openqa-testtag.repo .' if ($tag || $copr);
# and add them to the config file
my $repl = 'repos:';
$repl .= '\n - workarounds' if ($workarounds);
$repl .= '\n - koji-rawhide' if ($version eq $rawrel);
$repl .= '\n - buildroot' if ($brrepo);
$repl .= '\n - advisory' unless ($tag || $copr);
$repl .= '\n - openqa-testtag' if ($tag || $copr);
# Just add them to all config files, as the names change a lot
@ -98,7 +99,7 @@ sub run {
$cmd .= " --isfinal --repo=/etc/yum.repos.d/fedora-updates.repo";
}
$cmd .= " --repo=/etc/yum.repos.d/workarounds.repo" if ($workarounds);
$cmd .= " --repo=/etc/yum.repos.d/koji-rawhide.repo" if ($version eq $rawrel);
$cmd .= " --repo=/etc/yum.repos.d/buildroot.repo" if ($brrepo);
$cmd .= " --repo=/etc/yum.repos.d/advisory.repo" unless ($tag || $copr);
$cmd .= " --repo=/etc/yum.repos.d/openqa-testtag.repo" if ($tag || $copr);
$cmd .= " ./results";

View File

@ -140,6 +140,12 @@ sub run {
# In F32+ we may get an 'akonadi did something' message
if (check_screen 'akonadi_migration_notification', 5) {
click_lastmatch;
# ...and on F42+ that makes the notification pane close
# so we have to open it again
if (check_screen 'desktop_expand_systray', 5) {
click_lastmatch;
assert_and_click 'desktop_systray_notifications';
}
}
}
if ($desktop eq 'i3') {

View File

@ -11,11 +11,11 @@ sub run {
# use a tty console for repo config and package prep
$self->root_console(tty => 3);
disable_updates_repos;
# for update tests, disable koji-rawhide at this point, otherwise
# for update tests, disable buildroot repo at this point, otherwise
# gnome-software will complain about things being unsigned even
# though the repo has gpgcheck=0
if (get_var("ADVISORY_OR_TASK") && get_var("VERSION") eq get_var("RAWREL")) {
assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/koji-rawhide.repo';
if (get_var("BUILDROOT_REPO")) {
assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/buildroot.repo';
}
# fwupd causes problems sometimes, and we're not testing it
script_run "systemctl stop fwupd.service";