From d63c327b16deda170bbe8f87556aac996416f33d Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 11 Feb 2025 09:47:55 -0800 Subject: [PATCH] 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 --- lib/mock.pm | 7 ++++--- lib/utils.pm | 12 +++++------- tests/_boot_to_anaconda.pm | 8 ++++---- tests/_installer_build.pm | 4 ++-- tests/_kiwi_build.pm | 5 +++-- tests/_live_build.pm | 3 ++- tests/_ostree_build.pm | 9 +++++---- tests/desktop_notifications.pm | 6 ++++++ tests/desktop_update_graphical.pm | 6 +++--- 9 files changed, 34 insertions(+), 26 deletions(-) diff --git a/lib/mock.pm b/lib/mock.pm index fc694682..3569bdc1 100644 --- a/lib/mock.pm +++ b/lib/mock.pm @@ -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'; diff --git a/lib/utils.pm b/lib/utils.pm index fc4ce71c..f5e8b6cd 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -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 diff --git a/tests/_boot_to_anaconda.pm b/tests/_boot_to_anaconda.pm index 0ae72e0f..35798f68 100644 --- a/tests/_boot_to_anaconda.pm +++ b/tests/_boot_to_anaconda.pm @@ -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")) { diff --git a/tests/_installer_build.pm b/tests/_installer_build.pm index 1b9f67e3..906adfaa 100644 --- a/tests/_installer_build.pm +++ b/tests/_installer_build.pm @@ -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"; diff --git a/tests/_kiwi_build.pm b/tests/_kiwi_build.pm index bd1b2fa3..6230d0be 100644 --- a/tests/_kiwi_build.pm +++ b/tests/_kiwi_build.pm @@ -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 \n \n \n\n" > ' . $repoxml if ($tag || $copr); # and the workarounds repo assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n \n \n \n\n" > ' . $repoxml if ($workarounds); - # and the buildroot repo, for Rawhide - assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n \n \n \n\n" > ' . $repoxml if ($version eq $rawrel); + # and the buildroot repo, if applicable + assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n \n \n \n\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 diff --git a/tests/_live_build.pm b/tests/_live_build.pm index 6d0ad907..78b56743 100644 --- a/tests/_live_build.pm +++ b/tests/_live_build.pm @@ -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"; diff --git a/tests/_ostree_build.pm b/tests/_ostree_build.pm index f518de87..445e579c 100644 --- a/tests/_ostree_build.pm +++ b/tests/_ostree_build.pm @@ -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"; diff --git a/tests/desktop_notifications.pm b/tests/desktop_notifications.pm index ca2501b7..4efc4f4f 100644 --- a/tests/desktop_notifications.pm +++ b/tests/desktop_notifications.pm @@ -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') { diff --git a/tests/desktop_update_graphical.pm b/tests/desktop_update_graphical.pm index 623492da..56d97bc7 100644 --- a/tests/desktop_update_graphical.pm +++ b/tests/desktop_update_graphical.pm @@ -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";