From cf2acf034d9fdc7ce5fa57bab3b795f9140080fb Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Tue, 13 Aug 2024 15:32:17 -0400 Subject: [PATCH] Use 'ge' and 'lt' for Rawhide version checks, not 'eq' This *should* make things easier at branching, where we might want not to tell fedfind/openQA about the new Rawhide release number until there's a compose, but we still want tests of Rawhide updates to go down the Rawhide paths. Signed-off-by: Adam Williamson --- lib/utils.pm | 2 +- tests/_container_build_kiwi.pm | 2 +- tests/_installer_build.pm | 4 ++-- tests/_live_build.pm | 6 +++--- tests/_ostree_build.pm | 10 +++++----- tests/desktop_background.pm | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 32ed2193..cddd9bb0 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -697,7 +697,7 @@ sub _repo_setup_updates { 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 (get_var("VERSION") eq get_var("RAWREL") && get_var("TEST") ne "support_server") { + if (get_var("VERSION") ge get_var("RAWREL") && get_var("TEST") ne "support_server") { assert_script_run 'printf "[koji-rawhide]\nname=koji-rawhide\nbaseurl=https://kojipkgs.fedoraproject.org/repos/rawhide/latest/' . $arch . '/\ncost=2000\nenabled=1\ngpgcheck=0\n" > /etc/yum.repos.d/koji-rawhide.repo'; } if (get_var("CANNED")) { diff --git a/tests/_container_build_kiwi.pm b/tests/_container_build_kiwi.pm index fef4cba0..066f37dd 100644 --- a/tests/_container_build_kiwi.pm +++ b/tests/_container_build_kiwi.pm @@ -19,7 +19,7 @@ sub run { my $repoxml; my $releasever; my $mockver; - if ($version eq $rawrel) { + if ($version ge $rawrel) { $branch = "main"; $repoxml = "repositories/core-rawhide.xml"; $releasever = "Rawhide"; diff --git a/tests/_installer_build.pm b/tests/_installer_build.pm index b1187715..94bea9b2 100644 --- a/tests/_installer_build.pm +++ b/tests/_installer_build.pm @@ -8,7 +8,7 @@ sub run { my $version = get_var("VERSION"); my $currrel = get_var("CURRREL"); my $rawrel = get_var("RAWREL"); - my $repo = $version eq $rawrel ? "fedora-rawhide.repo" : "fedora.repo"; + my $repo = $version ge $rawrel ? "fedora-rawhide.repo" : "fedora.repo"; my $advortask = get_var("ADVISORY_OR_TASK"); my $arch = get_var("ARCH"); # python3-dnf is for updvercheck.py @@ -27,7 +27,7 @@ sub run { $cmd .= " --isfinal --repo=/etc/yum.repos.d/fedora-updates.repo"; } $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-rawhide.repo" if ($version ge $rawrel); $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/_live_build.pm b/tests/_live_build.pm index f94a3e92..7038ee16 100644 --- a/tests/_live_build.pm +++ b/tests/_live_build.pm @@ -11,7 +11,7 @@ sub run { my $repoks; my $releasever; my $mockver; - if ($version eq $rawrel) { + if ($version ge $rawrel) { $branch = "main"; $repoks = "fedora-repo-rawhide.ks"; $releasever = "Rawhide"; @@ -56,7 +56,7 @@ sub run { # 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) { + if ($version ge $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'; } $repos .= '\"\"\"'; @@ -75,7 +75,7 @@ sub run { # and the workarounds repo 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) { + if ($version ge $rawrel) { assert_script_run 'echo "repo --name=koji-rawhide --baseurl=https://kojipkgs.fedoraproject.org/repos/f' . $version . '-build/latest/\$basearch/" >> ' . $repoks; } # now flatten the kickstart diff --git a/tests/_ostree_build.pm b/tests/_ostree_build.pm index 3266e6ae..db154d77 100644 --- a/tests/_ostree_build.pm +++ b/tests/_ostree_build.pm @@ -8,9 +8,9 @@ sub run { my $version = get_var("VERSION"); my $currrel = get_var("CURRREL"); my $rawrel = get_var("RAWREL"); - my $repo = $version eq $rawrel ? "fedora-rawhide.repo" : "fedora.repo"; + my $repo = $version ge $rawrel ? "fedora-rawhide.repo" : "fedora.repo"; my $branch; - if ($version eq $rawrel) { + if ($version ge $rawrel) { $branch = "main"; } else { @@ -40,13 +40,13 @@ sub run { assert_script_run "git checkout ${branch}"; # now copy the advisory, workaround repo and koji-rawhide 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/koji-rawhide.repo .' if ($version ge $rawrel); 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 - koji-rawhide' if ($version ge $rawrel); $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 +98,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/koji-rawhide.repo" if ($version ge $rawrel); $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_background.pm b/tests/desktop_background.pm index 2e57329c..46d11b40 100644 --- a/tests/desktop_background.pm +++ b/tests/desktop_background.pm @@ -11,7 +11,7 @@ sub run { # don't have any requirement for what background Rawhide uses. my $version = get_var('VERSION'); my $rawrel = get_var('RAWREL'); - return unless ($version ne "Rawhide" && $version ne $rawrel); + return unless ($version ne "Rawhide" && $version lt $rawrel); # KDE shows a different version of the welcome center on major upgrades, # which breaks this test click_lastmatch if (get_var("DESKTOP") eq "kde" && get_var("ADVISORY_OR_TASK") && check_screen "kde_ok", 5);