2019-01-29 14:56:01 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
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);
|
2020-05-06 04:12:12 +00:00
|
|
|
if (get_var("NUMDISKS") > 2) {
|
|
|
|
# put /var/lib/mock on the third disk, so we don't run out of
|
|
|
|
# space on the main disk. The second disk will have already
|
|
|
|
# been claimed for the update repo.
|
|
|
|
assert_script_run "echo 'type=83' | sfdisk /dev/vdc";
|
|
|
|
assert_script_run "mkfs.ext4 /dev/vdc1";
|
|
|
|
assert_script_run "echo '/dev/vdc1 /var/lib/mock ext4 defaults 1 2' >> /etc/fstab";
|
|
|
|
assert_script_run "mkdir -p /var/lib/mock";
|
|
|
|
assert_script_run "mount /var/lib/mock";
|
|
|
|
}
|
2019-01-29 14:56:01 +00:00
|
|
|
# install the tools we need
|
|
|
|
assert_script_run "dnf -y install mock git pykickstart tar", 120;
|
2019-09-23 23:00:08 +00:00
|
|
|
# base mock config on original
|
|
|
|
assert_script_run "echo \"include('/etc/mock/fedora-${version}-${arch}.cfg')\" > /etc/mock/openqa.cfg";
|
2020-09-15 21:44:34 +00:00
|
|
|
# make the side and workarounds repos and the serial device available inside the mock root
|
2019-09-23 23:00:08 +00:00
|
|
|
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_enable\'] = True" >> /etc/mock/openqa.cfg';
|
Add tests to build a Silverblue installer image and install it
This is like the existing tests that build network install and
live images then install them, only for Silverblue. First we
build an ostree, using the standard configuration for the release
and subvariant but with the 'advisory' and 'workarounds' repos
included, so it will contain current stable packages plus the
packages from the update and any workarounds. Then we build an
ostree installer image with the ostree embedded, again including
advisory and workarounds repos in the installer build config so
packages from them will be included in the installer environment.
The image is uploaded, which completes the _ostree_build test.
Then an install_default_update_ostree test runs, which does a
standard install and boot from the installer image.
We do make a change that affects other tests, too. We now run
_advisory_post on live image install tests, as well as this new
ostree install image install test. It was skipped before because
of an exception that's really only needed for the netinst image
install test. In that test, packages from the update won't be
included in the installed system, so we can't run _advisory_post
on it. But for ostree and live image build/install tests, the
installed system *should* include packages from the update, so
we should check and make sure that it does.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-07-22 19:22:19 +00:00
|
|
|
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/mnt/update_repo\', \'/mnt/update_repo\'))" >> /etc/mock/openqa.cfg';
|
|
|
|
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/mnt/workarounds_repo\', \'/mnt/workarounds_repo\'))" >> /etc/mock/openqa.cfg';
|
2019-01-29 14:56:01 +00:00
|
|
|
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/dev/' . $serialdev . '\', \'/dev/' . $serialdev . '\'))" >> /etc/mock/openqa.cfg';
|
2020-09-15 21:25:05 +00:00
|
|
|
# add the side repo and workarounds to the config
|
2022-12-10 17:25:29 +00:00
|
|
|
my $repos = 'config_opts[\'dnf.conf\'] += \"\"\"\n[advisory]\nname=Advisory repo\nbaseurl=file:///mnt/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n\n[workarounds]\nname=Workarounds repo\nbaseurl=file:///mnt/workarounds_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n';
|
|
|
|
# also the buildroot repo, for Rawhide
|
|
|
|
if ($version eq $rawrel) {
|
|
|
|
$repos .= '\n[koji-rawhide]\nname=Buildroot repo\nbaseurl=https://kojipkgs.fedoraproject.org/repos/rawhide/latest/\$basearch/\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n';
|
|
|
|
}
|
|
|
|
$repos .= '\"\"\"';
|
|
|
|
assert_script_run 'printf "' . $repos . '" >> /etc/mock/openqa.cfg';
|
2019-08-15 20:36:25 +00:00
|
|
|
# replace metalink with mirrorlist so we don't get slow mirrors
|
2022-12-10 17:25:29 +00:00
|
|
|
repos_mirrorlist("/etc/mock/templates/*.tpl");
|
2019-01-29 14:56:01 +00:00
|
|
|
# upload the config so we can check it's OK
|
|
|
|
upload_logs "/etc/mock/openqa.cfg";
|
|
|
|
# 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}";
|
|
|
|
# now add the side repo to the appropriate repo ks
|
Add tests to build a Silverblue installer image and install it
This is like the existing tests that build network install and
live images then install them, only for Silverblue. First we
build an ostree, using the standard configuration for the release
and subvariant but with the 'advisory' and 'workarounds' repos
included, so it will contain current stable packages plus the
packages from the update and any workarounds. Then we build an
ostree installer image with the ostree embedded, again including
advisory and workarounds repos in the installer build config so
packages from them will be included in the installer environment.
The image is uploaded, which completes the _ostree_build test.
Then an install_default_update_ostree test runs, which does a
standard install and boot from the installer image.
We do make a change that affects other tests, too. We now run
_advisory_post on live image install tests, as well as this new
ostree install image install test. It was skipped before because
of an exception that's really only needed for the netinst image
install test. In that test, packages from the update won't be
included in the installed system, so we can't run _advisory_post
on it. But for ostree and live image build/install tests, the
installed system *should* include packages from the update, so
we should check and make sure that it does.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-07-22 19:22:19 +00:00
|
|
|
assert_script_run 'echo "repo --name=advisory --baseurl=file:///mnt/update_repo" >> ' . $repoks;
|
2020-09-15 21:21:07 +00:00
|
|
|
# and the workarounds repo
|
Add tests to build a Silverblue installer image and install it
This is like the existing tests that build network install and
live images then install them, only for Silverblue. First we
build an ostree, using the standard configuration for the release
and subvariant but with the 'advisory' and 'workarounds' repos
included, so it will contain current stable packages plus the
packages from the update and any workarounds. Then we build an
ostree installer image with the ostree embedded, again including
advisory and workarounds repos in the installer build config so
packages from them will be included in the installer environment.
The image is uploaded, which completes the _ostree_build test.
Then an install_default_update_ostree test runs, which does a
standard install and boot from the installer image.
We do make a change that affects other tests, too. We now run
_advisory_post on live image install tests, as well as this new
ostree install image install test. It was skipped before because
of an exception that's really only needed for the netinst image
install test. In that test, packages from the update won't be
included in the installed system, so we can't run _advisory_post
on it. But for ostree and live image build/install tests, the
installed system *should* include packages from the update, so
we should check and make sure that it does.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2022-07-22 19:22:19 +00:00
|
|
|
assert_script_run 'echo "repo --name=workarounds --baseurl=file:///mnt/workarounds_repo" >> ' . $repoks;
|
2022-12-10 17:25:29 +00:00
|
|
|
# and the buildroot repo, for Rawhide
|
|
|
|
if ($version eq $rawrel) {
|
|
|
|
assert_script_run 'echo "repo --name=koji-rawhide --baseurl=https://kojipkgs.fedoraproject.org/repos/rawhide/latest/\$basearch/" >> ' . $repoks;
|
|
|
|
}
|
2023-05-18 16:26:58 +00:00
|
|
|
# FIXME: this is needed until the next Rawhide compose, with
|
|
|
|
# https://pagure.io/fedora-comps/pull-request/841 merged
|
|
|
|
assert_script_run 'sed -e "s,%packages,%packages\n-util-linux-user,g" fedora-kde-common.ks';
|
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";
|
2019-01-29 14:56:01 +00:00
|
|
|
# PULL SOME LEVERS! PULL SOME LEVERS!
|
2022-08-19 19:35:24 +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 FWL-${advortask} --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:
|