use base "installedtest"; use strict; use testapi; use utils; sub run { my $self = shift; 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 $branch; if ($version eq $rawrel) { $branch = "main"; } else { $branch = "f${version}"; } my $advortask = get_var("ADVISORY_OR_TASK"); my $arch = get_var("ARCH"); my $subv = get_var("SUBVARIANT"); my $lcsubv = lc($subv); my $tag = get_var("TAG"); my $copr = get_var("COPR"); my $workarounds = get_workarounds; # mount our nice big empty scratch disk as /var/tmp assert_script_run "rm -rf /var/tmp/*"; assert_script_run "echo 'type=83' | sfdisk /dev/vdc"; assert_script_run "mkfs.ext4 /dev/vdc1"; assert_script_run "echo '/dev/vdc1 /var/tmp ext4 defaults 1 2' >> /etc/fstab"; assert_script_run "mount /var/tmp"; assert_script_run "cd /"; # usually a good idea for this kinda thing assert_script_run "setenforce Permissive"; # install the tools we need assert_script_run "dnf -y install git lorax flatpak ostree rpm-ostree dbus-daemon moreutils", 300; # now check out workstation-ostree-config 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 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/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 - advisory' unless ($tag || $copr); $repl .= '\n - openqa-testtag' if ($tag || $copr); # Just add them to all config files, as the names change a lot assert_script_run 'sed -i -e "s,repos:,' . $repl . ',g" *.yaml'; # ensure python3-dnf is in the built ostree for _advisory_post # f41+ script_run 'sed -i -e "s,packages:,packages:\n - python3-dnf,g" *-packages.yaml'; # 180; my $loraxargs = script_output "python3 ostree-parse-pungi.py $lcsubv $arch"; # this 'temporary file cleanup' thing can actually wipe bits of # the lorax install root while lorax is still running... assert_script_run "systemctl stop systemd-tmpfiles-clean.timer"; # create the installer ISO assert_script_run "mkdir -p /var/tmp/imgbuild"; assert_script_run "cd /var/tmp/imgbuild"; my $cmd = "lorax -p Fedora -v ${version} -r ${version} --repo=/etc/yum.repos.d/${repo} --variant=${subv} --nomacboot --buildarch=${arch} --volid=F-${subv}-ostree-${arch}-oqa --logfile=./lorax.log ${loraxargs}"; unless ($version > $currrel) { $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/advisory.repo" unless ($tag || $copr); $cmd .= " --repo=/etc/yum.repos.d/openqa-testtag.repo" if ($tag || $copr); $cmd .= " ./results"; assert_script_run $cmd, 9000; # good to have the log around for checks upload_logs "lorax.log", failok => 1; assert_script_run "mv results/images/boot.iso ./${advortask}-${subv}-ostree-${arch}.iso"; upload_asset "./${advortask}-${subv}-ostree-${arch}.iso"; } sub test_flags { return {fatal => 1}; } 1;