From e49b5f9645dbb2a6147338ae7c64cf19761be04e Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 4 Sep 2024 12:06:49 -0700 Subject: [PATCH] Initial ELN update test support (installer build) This should make the installer image build test work for ELN, so we can try doing some update tests on ELN. Signed-off-by: Adam Williamson --- lib/utils.pm | 14 +++++++++++--- tests/_installer_build.pm | 13 +++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 62eba9a5..87c5c56f 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -478,6 +478,7 @@ sub get_workarounds { "40" => [], "41" => [], "42" => [], + "eln" => [], ); my $advortasks = $workarounds{$version}; return @$advortasks; @@ -589,8 +590,12 @@ sub setup_repos { if ($args{waonly} || $tag || $copr) { return unless (@was); } - # if we got this far, we're definitely downloading *something* - script_run "dnf -y install createrepo_c bodhi-client koji", 300; + # if we got this far, we're definitely downloading *something* so + # install the download tools. split bodhi-client out because it + # isn't there on ELN currently, which means we can't use workarounds + # specified as update IDs on ELN + script_run "dnf -y install createrepo_c koji", 300; + script_run "dnf -y install bodhi-client", 300; get_setup_repos_script; my $wastring = join(',', @was); my $udstring; @@ -700,6 +705,9 @@ sub _repo_setup_updates { if (get_var("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/rawhide/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'; + } if (get_var("CANNED")) { # install and use en_US.UTF-8 locale for consistent sort # ordering @@ -725,7 +733,7 @@ sub _repo_setup_updates { # above (and their deps, which dnf will include automatically), # just in case they're in the update under test; otherwise we # get a bogus failure for the package not being updated - script_run "dnf -y remove bodhi-client createrepo_c koji", 600 if (get_var("INSTALL") && !get_var("CANNED")); + script_run "dnf -y remove createrepo_c koji", 600 if (get_var("INSTALL") && !get_var("CANNED")); } # exit the toolbox on CANNED if (get_var("CANNED")) { diff --git a/tests/_installer_build.pm b/tests/_installer_build.pm index b1187715..93460314 100644 --- a/tests/_installer_build.pm +++ b/tests/_installer_build.pm @@ -8,7 +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 = "fedora.repo"; + $repo = "fedora-rawhide.repo" if ($version eq $rawrel); + $repo = "fedora-eln.repo" if (lc($version) eq "eln"); my $advortask = get_var("ADVISORY_OR_TASK"); my $arch = get_var("ARCH"); # python3-dnf is for updvercheck.py @@ -23,11 +25,18 @@ sub run { assert_script_run "setenforce Permissive"; # Fedora pungi config always sets rootfs size to 3GiB since F32 my $cmd = "lorax -p Fedora -v ${version} -r ${version} --repo=/etc/yum.repos.d/${repo} --rootfs-size 3 --squashfs-only"; - unless ($version > $currrel) { + unless ($version > $currrel || lc($version) eq "eln") { $cmd .= " --isfinal --repo=/etc/yum.repos.d/fedora-updates.repo"; } + if (lc($version) eq "eln") { + $cmd .= " --variant=BaseOS --nomacboot --volid=Fedora-eln-BaseOS-${arch}" + } + else { + $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/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";