Compare commits

...

8 Commits

Author SHA1 Message Date
Adam Williamson 56281a41bd Update a FIXME notice
The bug number is wrong and I can't find the right one, d'oh.
We could *probably* safely remove this right now but I'm not
100% sure, I think it should be fine when F38 is EOL.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-04-22 17:56:44 -07:00
Adam Williamson c6d808ed23 Revert "Give `systemctl stop ipa.service` longer due to RHBZ #2100282"
This reverts commit b203f41f55.
The bug has been worked around for some time with a downstream
patch. Dropping the extended timeout means we'll notice if the
workaround is dropped prematurely or stops working.
2024-04-22 17:29:44 -07:00
Adam Williamson 691e82b1f9 Drop workaround for RHBZ #1943943
This whole complicated loop looks like it's no longer needed for
current KDE. It seems like we always refresh, then we hit
"Update All", and from there we go straight to "Restart Now".
Clicking the button always seems to work, we never seem to need
to click "Refresh" again. So, let's drop it and simply expect to
see and click Restart Now.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-04-22 17:04:52 -07:00
Adam Williamson bdae22d7de Drop another config-manager fixme
Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-04-22 16:52:54 -07:00
Adam Williamson b614a38d6c Revert "Make evince test handle #2183356 (wrong save target on flatpak)"
This reverts commit 278b1e32b0.
The bug it worked around seems to have been fixed.
2024-04-22 16:52:05 -07:00
Adam Williamson ce2c511588 Revert "live_build: hack anaconda-webui out of kickstart on g-i-s update"
This reverts commit 0425be0d8e. We
only needed it for that one update and it went stable ages ago.
2024-04-22 16:33:47 -07:00
Adam Williamson 9f2d44a181 drop a FIXME on enabling/disabling repos with sed
dnf5 config-manager can now do this, but the syntax is different
to dnf4, and honestly, it seems easier to just stick with this
going forward than make it conditional on dnf version until
dnf4 goes away. So let's stop marking this as a FIXME.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-04-22 16:14:29 -07:00
Adam Williamson f4bd3c6f58 Add a container build test
This test, much like _live_build or _installer_build, builds a
container image in a way intended to be as similar as possible
to how official compose images are built. The purpose of the test
is to make sure updates do not break official container image
builds.

At the end of the test, we also check that the built container
is functional (at least, that we can run a 'hello world' command
in it). This can't really be rolled into podman.pm because that
test is more about testing podman itself, and it's just a one-
liner here anyway. We also run the 'if any packages from the
update are installed, are they the versions from the update?'
check inside the container, which required giving that check the
ability to 'wrap' the rpm commands to run inside a container.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2024-04-22 16:01:41 -07:00
8 changed files with 149 additions and 36 deletions

View File

@ -496,7 +496,8 @@ sub disable_updates_repos {
both => 0,
@_
);
# FIXME as of 2023-06-20 dnf5 doesn't have config-manager plugin yet :(
# we used to do this with config-manager, but the syntax differs
# on dnf 4 vs. dnf 5 and really sed is just as easy
assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/fedora-updates-testing.repo';
assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/fedora-updates.repo' if ($args{both});
unless (script_run 'test -f /etc/yum.repos.d/fedora-updates-testing-modular.repo') {
@ -1230,6 +1231,7 @@ sub advisory_check_nonmatching_packages {
# older version from the frozen release repo
my %args = (
fatal => 1,
wrapper => "",
@_
);
# can't do anything useful when testing a side tag
@ -1241,6 +1243,9 @@ sub advisory_check_nonmatching_packages {
# unnecessarily in post_fail_hook
return if (get_var("_ACNMP_DONE"));
script_run 'touch /tmp/installedupdatepkgs.txt';
my $rpmcmd = "rpm";
my $wrapper = $args{wrapper};
$rpmcmd = "$wrapper rpm" if ($wrapper);
# this creates /tmp/installedupdatepkgs.txt as a sorted list of installed
# packages with the same name as packages from the update, in the same form
# as /mnt/updatepkgs.txt. The '--last | head -1' tries to handle the
@ -1254,7 +1259,7 @@ sub advisory_check_nonmatching_packages {
# (we need four to reach bash, and half of them get eaten by perl or
# something along the way). Yes, it only works with *single* quotes. Yes,
# I hate escaping
script_run 'for pkg in $(cat /mnt/updatepkgnames.txt); do rpm -q $pkg && rpm -q $pkg --last | head -1 | cut -d" " -f1 | sed -e \'s,\^,\\\\\\\\^,g\' | xargs rpm -q --qf "%{SOURCERPM} %{NAME} %{EPOCHNUM} %{VERSION} %{RELEASE}\n" >> /tmp/installedupdatepkgs.txt; done', timeout => 180;
script_run 'for pkg in $(cat /mnt/updatepkgnames.txt); do ' . $rpmcmd . ' -q $pkg && ' . $rpmcmd . ' -q $pkg --last | head -1 | cut -d" " -f1 | sed -e \'s,\^,\\\\\\\\^,g\' | xargs ' . $rpmcmd . ' -q --qf "%{SOURCERPM} %{NAME} %{EPOCHNUM} %{VERSION} %{RELEASE}\n" >> /tmp/installedupdatepkgs.txt; done', timeout => 180;
script_run 'sort -u -o /tmp/installedupdatepkgs.txt /tmp/installedupdatepkgs.txt';
# for debugging, may as well always upload these, can't hurt anything
upload_logs "/tmp/installedupdatepkgs.txt", failok => 1;
@ -1274,7 +1279,7 @@ sub advisory_check_nonmatching_packages {
my $message = "Package(s) from update not installed when it should have been! See script output";
$message = "Script failed unexpectedly!" if ($ret == 1);
if ($args{fatal}) {
set_var("_ACNMP_DONE", "1");
set_var("_ACNMP_DONE", "1") unless $wrapper;
die $message;
}
else {

View File

@ -335,6 +335,21 @@
"fedora-updates-workstation-x86_64-*-64bit": 5
}
},
"container_build_kiwi": {
"profiles": {
"fedora-updates-container-x86_64-*-64bit": 5
},
"settings": {
"BOOTFROM": "c",
"HDD_1": "disk_f%VERSION%_minimal_4_%ARCH%.qcow2",
"HDDSIZEGB_3": "25",
"MAX_JOB_TIME": "10800",
"+NUMDISKS": "3",
"POSTINSTALL": "_container_build_kiwi",
"ROOT_PASSWORD": "weakpassword",
"USER_LOGIN": "false"
}
},
"desktop_background": {
"profiles": {
"fedora-updates-kde-x86_64-*-64bit": 5,

View File

@ -0,0 +1,124 @@
use base "installedtest";
use strict;
use testapi;
use utils;
sub run {
my $self = shift;
my $version = get_var("VERSION");
# we didn't use kiwi before F40, and I don't really want to write
# an imgfac test for a release that will be dead in 6 months
# FIXME drop when F39 is EOL
if ($version < 40) {
record_info('notvalid', "this test cannot be run on Fedora < 40");
return;
}
my $rawrel = get_var("RAWREL");
my $branch;
my $repoxml;
my $releasever;
my $mockver;
if ($version eq $rawrel) {
$branch = "main";
$repoxml = "repositories/core-rawhide.xml";
$releasever = "Rawhide";
$mockver = "rawhide";
}
else {
$branch = "f${version}";
$repoxml = "repositories/core-nonrawhide.xml";
$releasever = $version;
$mockver = $version;
}
my $arch = get_var("ARCH");
my $tag = get_var("TAG");
my $workarounds = get_workarounds;
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";
}
# install the tools we need
assert_script_run "dnf -y install mock git", 300;
# base mock config on original
assert_script_run "echo \"include('/etc/mock/fedora-${mockver}-${arch}.cfg')\" > /etc/mock/openqa.cfg";
# make the side and workarounds repos and the serial device available inside the mock root
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_enable\'] = True" >> /etc/mock/openqa.cfg';
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/mnt/update_repo\', \'/mnt/update_repo\'))" >> /etc/mock/openqa.cfg' unless ($tag);
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/mnt/workarounds_repo\', \'/mnt/workarounds_repo\'))" >> /etc/mock/openqa.cfg' if ($workarounds);
assert_script_run 'echo "config_opts[\'plugin_conf\'][\'bind_mount_opts\'][\'dirs\'].append((\'/dev/' . $serialdev . '\', \'/dev/' . $serialdev . '\'))" >> /etc/mock/openqa.cfg';
my $repos = 'config_opts[\'dnf.conf\'] += \"\"\"\n';
# add the update repo or tag repo to the config
$repos .= '[advisory]\nname=Advisory repo\nbaseurl=file:///mnt/update_repo\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n' unless ($tag);
$repos .= '[openqa-testtag]\nname=Tag test repo\nbaseurl=https://kojipkgs.fedoraproject.org/repos/' . "${tag}/latest/${arch}" . '\nenabled=1\nmetadata_expire=3600\ngpgcheck=0\n' if ($tag);
# 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) {
$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 .= '\"\"\"';
assert_script_run 'printf "' . $repos . '" >> /etc/mock/openqa.cfg';
# replace metalink with mirrorlist so we don't get slow mirrors
repos_mirrorlist "/etc/mock/templates/*.tpl";
# upload the config so we can check it's OK
upload_logs "/etc/mock/openqa.cfg";
# now check out the fedora kiwi descriptions
assert_script_run 'git clone https://pagure.io/fedora-kiwi-descriptions.git';
assert_script_run 'cd fedora-kiwi-descriptions';
assert_script_run "git checkout ${branch}";
# correct the GPG key paths in the repositories and swap metalink
# to mirrorlist
assert_script_run 'sed -i -e "s,/usr/share/distribution-gpg-keys/fedora,/etc/pki/rpm-gpg,g" ' . $repoxml;
repos_mirrorlist $repoxml;
# now add the side repo or tag repo to the appropriate repo XML
assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n <repository type=\"rpm-md\" alias=\"advisory\" sourcetype=\"baseurl\">\n <source path=\"file:///mnt/update_repo\"/>\n </repository>\n</image>\n" > ' . $repoxml unless ($tag);
assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n <repository type=\"rpm-md\" alias=\"openqa-testtag\" sourcetype=\"baseurl\">\n <source path=\"https://kojipkgs.fedoraproject.org/repos/' . "${tag}/latest/${arch}" . '\"/>\n </repository>\n</image>\n" > ' . $repoxml if ($tag);
# and the workarounds repo
assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n <repository type=\"rpm-md\" alias=\"workarounds\" sourcetype=\"baseurl\">\n <source path=\"file:///mnt/workarounds_repo\"/>\n </repository>\n</image>\n" > ' . $repoxml if ($workarounds);
# and the buildroot repo, for Rawhide
assert_script_run 'printf "$(head -n -1 ' . $repoxml . ')\n <repository type=\"rpm-md\" alias=\"koji-rawhide\" sourcetype=\"baseurl\">\n <source path=\"https://kojipkgs.fedoraproject.org/repos/f' . $version . '-build/latest/\$basearch/\"/>\n </repository>\n</image>\n" > ' . $repoxml if ($version eq $rawrel);
# upload the repositories XML so we can check it
# NOTE: koji kiwi plugin does much more futzing around with the XML
# it flattens includes, fiddles with the repos, and and messes with
# preferences a bit. see
# KiwiCreateImageTask.prepareDescription. but we do our own repo
# stuff above, the preference stuff is unnecessary on Fedora, and
# the flattening is unnecessary outside Koji
upload_logs "$repoxml";
assert_script_run "cd ..";
# now install the tools into the mock
assert_script_run "mock -r openqa --install kiwi-cli kiwi-systemdeps", 900;
# now copy the descriptions in
assert_script_run "mock -r openqa --isolation=simple --copyin fedora-kiwi-descriptions /fedora-kiwi-descriptions";
# PULL SOME LEVERS! PULL SOME LEVERS!
assert_script_run "mock -r openqa --enable-network --chroot \"kiwi-ng --profile Container-Base-Generic --debug --logfile /tmp/image-root.log system build --description /fedora-kiwi-descriptions/ --target-dir /builddir/result/image\"", 7200;
unless (script_run "mock -r openqa --isolation=simple --copyout /tmp/image-root.log .", 90) {
upload_logs "image-root.log";
}
assert_script_run "mock -r openqa --isolation=simple --copyout /builddir/result/image/Fedora.${arch}-${releasever}.oci.tar.xz .", 180;
upload_asset "./Fedora.${arch}-${releasever}.oci.tar.xz";
# load and test that we can use the built container
assert_script_run "podman load -i ./Fedora.${arch}-${releasever}.oci.tar.xz";
my $imgspec = "localhost/fedora:${mockver}";
validate_script_output "podman run ${imgspec} echo Hello-World", sub { m/Hello-World/ };
# do advisory_check_nonmatching_packages inside the container
advisory_check_nonmatching_packages(wrapper => "podman run ${imgspec}");
# wipe the temp file so it doesn't interfere with the same check
# on the host
assert_script_run "rm -f /tmp/installedupdatepkgs.txt";
}
sub test_flags {
return {fatal => 1};
}
1;
# vim: set sw=4 et:

View File

@ -79,11 +79,6 @@ sub run {
}
# now flatten the kickstart
assert_script_run "ksflatten -c fedora-live-${lcsubv}.ks -o openqa.ks";
# FIXME: we need to patch out anaconda-webui on the fly to test
# the g-i-s update that drops webui support, as we can't merge the
# kickstart change till that update is stable. remove when this
# little catch-22 is resolved
assert_script_run "sed -i -e '/anaconda-webui/d' openqa.ks" if ($advortask eq "FEDORA-2024-8b66f08f0b");
# upload the kickstart so we can check it
upload_logs "openqa.ks";
# now install the tools into the mock

View File

@ -19,13 +19,6 @@ sub run {
type_very_safely("alternative");
# Click on the Save button
if (get_var("CANNED")) {
# FIXME: as of 2023-03-30 on the flatpak version of evince, the save as
# default target dir is wrong:
# https://bugzilla.redhat.com/show_bug.cgi?id=2183356
# so we need to click into Documents first
assert_and_click("evince_documents", button => "left", timeout => 30);
}
assert_and_click("gnome_button_save_blue", button => "left", timeout => 30);
# Now the document is saved under a different name. We will switch to the

View File

@ -15,7 +15,6 @@ sub run {
# gnome-software will complain about things being unsigned even
# though the repo has gpgcheck=0
if (get_var("ADVISORY_OR_TASK") && get_var("VERSION") eq get_var("RAWREL")) {
# FIXME as of 2023-06-20 dnf5 doesn't have config-manager plugin yet :(
assert_script_run 'sed -i -e "s,enabled=1,enabled=0,g" /etc/yum.repos.d/koji-rawhide.repo';
}
prepare_test_packages;
@ -132,21 +131,6 @@ sub run {
boot_to_login_screen;
}
elsif ($desktop eq 'kde') {
# KDE does offline updates now, we have to trigger the reboot
# FIXME: also sometimes the update apply button just doesn't
# work, so keep clicking till it does:
# https://bugzilla.redhat.com/show_bug.cgi?id=1943943
for my $n (1 .. 10) {
sleep 2;
assert_screen ['kde_offline_update_reboot', 'desktop_package_tool_update_apply'];
# break out if we reached the reboot button
last if (match_has_tag 'kde_offline_update_reboot');
# otherwise, try refresh and apply or reboot
assert_and_click 'desktop_package_tool_update_refresh';
assert_screen ['kde_offline_update_reboot', 'desktop_package_tool_update_apply'];
last if (match_has_tag 'kde_offline_update_reboot');
click_lastmatch;
}
assert_and_click 'kde_offline_update_reboot';
boot_to_login_screen;
}

View File

@ -26,10 +26,7 @@ sub run {
# there are often cases where we need to see the logs (e.g. client
# test failed due to server issue)
$self->post_fail_hook();
# FIXME as of 2022-06-22, this is taking longer than expected on
# Rawhide due to RHBZ #2100282 . It's hard to do 'soft fail if
# this takes too long', so let's just give it more time
assert_script_run 'systemctl stop ipa.service', 120;
assert_script_run 'systemctl stop ipa.service';
# check server is stopped
assert_script_run '! systemctl is-active ipa.service';
# decommission the server

View File

@ -15,7 +15,7 @@ sub run {
repo_setup();
my $params = "-y --releasever=${relnum}";
if ($relnum > 38) {
# FIXME https://bugzilla.redhat.com/show_bug.cgi?id=2230720
# FIXME can probably be removed when F38 goes EOL
$params .= " --nogpgcheck --disablerepo=*modular*";
}