2019-01-29 14:56:01 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
2024-11-23 19:14:50 +00:00
|
|
|
use mock;
|
2019-01-29 14:56:01 +00:00
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $self = shift;
|
|
|
|
my $version = get_var("VERSION");
|
2022-04-26 17:41:23 +00:00
|
|
|
my $rawrel = get_var("RAWREL");
|
|
|
|
my $branch;
|
|
|
|
my $repoks;
|
|
|
|
my $releasever;
|
|
|
|
if ($version eq $rawrel) {
|
|
|
|
$branch = "main";
|
|
|
|
$repoks = "fedora-repo-rawhide.ks";
|
|
|
|
$releasever = "Rawhide";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$branch = "f${version}";
|
|
|
|
$repoks = "fedora-repo-not-rawhide.ks";
|
|
|
|
$releasever = $version;
|
|
|
|
}
|
2019-01-29 14:56:01 +00:00
|
|
|
my $advortask = get_var("ADVISORY_OR_TASK");
|
|
|
|
my $arch = get_var("ARCH");
|
|
|
|
my $subv = get_var("SUBVARIANT");
|
|
|
|
my $lcsubv = lc($subv);
|
Revert to having tests, not the scheduler, download packages (#108)
This effectively reverts 97618193 - but had to be done manually
and adjusted to maintain support for testing side tags and for
testing multiple tasks, since those features were added since
the update ISO change.
The 'scheduler injects ISOs of packages into the tests' approach
was intended to speed things up, especially for large updates,
and it did, but it had a few drawbacks. It means restarting
older tests from the web UI doesn't work as the ISOs get garbage
collected (you have to re-schedule in this case). And it has the
rather large problem that you can now only schedule tests from
the openQA server (or at least a machine with the openQA asset
share mounted), because the package download and ISO creation
just happen wherever the scheduler is running and assume that
the openQA asset share that will be used by the tests is at
/var/lib/openqa/share in that filesystem.
That's too big of a drawback to continue with this approach, IMO,
so this reverts back to the old way of doing things, with a bit
of refactoring to clean up the flow a little, and with support
for testing side tags and multiple tasks maintained.
As a follow-up I'm going to see if I can replace
_download_packages with a much more efficient downloader script
to mitigate the time this process takes on each test, especially
for large updates.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-01-05 19:41:50 +00:00
|
|
|
my $tag = get_var("TAG");
|
2024-04-30 20:45:32 +00:00
|
|
|
my $copr = get_var("COPR");
|
2024-01-06 00:22:01 +00:00
|
|
|
my $workarounds = get_workarounds;
|
2019-01-29 14:56:01 +00:00
|
|
|
# install the tools we need
|
2023-09-19 19:47:35 +00:00
|
|
|
assert_script_run "dnf -y install mock git pykickstart tar", 300;
|
2024-11-23 19:14:50 +00:00
|
|
|
# set up the mock config
|
|
|
|
mock_setup;
|
2019-01-29 14:56:01 +00:00
|
|
|
# now check out the kickstarts
|
|
|
|
assert_script_run 'git clone https://pagure.io/fedora-kickstarts.git';
|
|
|
|
assert_script_run 'cd fedora-kickstarts';
|
2022-04-26 17:41:23 +00:00
|
|
|
assert_script_run "git checkout ${branch}";
|
2024-04-30 20:45:32 +00:00
|
|
|
# now add the side, tag or COPR repo to the appropriate repo ks
|
|
|
|
assert_script_run 'echo "repo --name=advisory --baseurl=file:///mnt/update_repo" >> ' . $repoks unless ($tag || $copr);
|
|
|
|
assert_script_run 'echo "repo --name=openqa-testtag --baseurl=' . get_var("UPDATE_OR_TAG_REPO") . '" >> ' . $repoks if ($tag || $copr);
|
2020-09-15 21:21:07 +00:00
|
|
|
# and the workarounds repo
|
2024-01-06 00:22:01 +00:00
|
|
|
assert_script_run 'echo "repo --name=workarounds --baseurl=file:///mnt/workarounds_repo" >> ' . $repoks if ($workarounds);
|
2022-12-10 17:25:29 +00:00
|
|
|
# and the buildroot repo, for Rawhide
|
|
|
|
if ($version eq $rawrel) {
|
2023-07-28 17:31:32 +00:00
|
|
|
assert_script_run 'echo "repo --name=koji-rawhide --baseurl=https://kojipkgs.fedoraproject.org/repos/f' . $version . '-build/latest/\$basearch/" >> ' . $repoks;
|
2022-12-10 17:25:29 +00:00
|
|
|
}
|
2019-01-29 14:56:01 +00:00
|
|
|
# now flatten the kickstart
|
|
|
|
assert_script_run "ksflatten -c fedora-live-${lcsubv}.ks -o openqa.ks";
|
|
|
|
# upload the kickstart so we can check it
|
|
|
|
upload_logs "openqa.ks";
|
|
|
|
# now install the tools into the mock
|
2023-02-03 17:04:48 +00:00
|
|
|
assert_script_run "mock -r openqa --isolation=simple --install bash coreutils glibc-all-langpacks lorax-lmc-novirt selinux-policy-targeted shadow-utils util-linux", 900;
|
2019-01-29 14:56:01 +00:00
|
|
|
# now make the image build directory inside the mock root and put the kickstart there
|
2021-03-10 00:02:06 +00:00
|
|
|
assert_script_run 'mock -r openqa --isolation=simple --chroot "mkdir -p /chroot_tmpdir"';
|
|
|
|
assert_script_run "mock -r openqa --isolation=simple --copyin openqa.ks /chroot_tmpdir";
|
2023-07-28 22:10:37 +00:00
|
|
|
# make sure volume ID isn't too long (for multiple Koji task cases)
|
|
|
|
my $aot28 = substr($advortask, 0, 28);
|
|
|
|
my $volid = "FWL-${aot28}";
|
2019-01-29 14:56:01 +00:00
|
|
|
# PULL SOME LEVERS! PULL SOME LEVERS!
|
2023-07-28 22:10:37 +00:00
|
|
|
assert_script_run "mock -r openqa --enable-network --isolation=simple --chroot \"/sbin/livemedia-creator --ks /chroot_tmpdir/openqa.ks --logfile /chroot_tmpdir/lmc-logs/livemedia-out.log --no-virt --resultdir /chroot_tmpdir/lmc --project Fedora-${subv}-Live --make-iso --volid ${volid} --iso-only --iso-name Fedora-${subv}-Live-${arch}-${advortask}.iso --releasever ${releasever} --macboot\"", 7200;
|
2022-08-19 19:23:36 +00:00
|
|
|
unless (script_run "mock -r openqa --isolation=simple --copyout /chroot_tmpdir/lmc-logs/livemedia-out.log .", 90) {
|
2019-01-29 14:56:01 +00:00
|
|
|
upload_logs "livemedia-out.log";
|
|
|
|
}
|
2022-08-19 19:23:36 +00:00
|
|
|
unless (script_run "mock -r openqa --isolation=simple --copyout /chroot_tmpdir/lmc-logs/anaconda/ anaconda", 90) {
|
2019-01-29 14:56:01 +00:00
|
|
|
assert_script_run "tar cvzf anaconda.tar.gz anaconda/";
|
|
|
|
upload_logs "anaconda.tar.gz";
|
|
|
|
}
|
2022-08-19 19:23:36 +00:00
|
|
|
assert_script_run "mock -r openqa --isolation=simple --copyout /chroot_tmpdir/lmc/Fedora-${subv}-Live-${arch}-${advortask}.iso .", 180;
|
2019-01-29 14:56:01 +00:00
|
|
|
upload_asset "./Fedora-${subv}-Live-${arch}-${advortask}.iso";
|
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
2022-07-28 20:32:57 +00:00
|
|
|
return {fatal => 1};
|
2019-01-29 14:56:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|