Make pre-release check a soft failure on osbuild images

osbuild is struggling with the pre-release warnings ATM:

https://pagure.io/fedora-iot/issue/57
https://github.com/osbuild/images/issues/515

Until that mess is cleaned up we can't really make sensible
assertions for osbuild images, so let's make the check a soft
failure for now (now we know about the bugs, we want to let
the rest of the tests run and not block them on this).

Note for IoT the behaviour has never really been correct (IoT
images never get pre-release warnings), but the logic in this
check matches the wrong behaviour (IoT composes always have
RC- labels even when they're clearly not RCs), so the test
didn't fail. While fixing this in osbuild we might try to get
'correct' behaviour for IoT, and then we'd need to tweak the
logic here.

While we're at it, tweak the implementation a bit; without this
tweak, implementing this 'soft fail if osbuild' behaviour is more
awkward and ugly.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2024-04-12 08:48:45 -07:00
parent b0bc18b187
commit 4938c0e5ae
1 changed files with 14 additions and 8 deletions

View File

@ -1483,14 +1483,20 @@ sub check_prerelease {
# really a big deal either way whether a nightly live image has
# the tags or not. So we don't.
# For all prerelease requiring ISOs, assert that prerelease is there.
if ($prerelease == 1) {
assert_screen "prerelease_note";
}
elsif ($prerelease == 0) {
# If the prerelease note is shown, where it should not be, die!
if (check_screen "prerelease_note") {
die "The PRERELEASE tag is shown, but it should NOT be.";
my $gotpr = 0;
# sigh, perl and booleans...
$gotpr = 1 if (check_screen "prerelease_note", 15);
my $msg = $prerelease ? "Pre-release warning not shown!" : "Pre-release warning shown when it should not be!";
unless ($prerelease == $gotpr) {
# FIXME we haven't got pre-release handling right with osbuild yet
# https://pagure.io/fedora-iot/issue/57
# https://github.com/osbuild/images/issues/515
my $flavor = get_var('FLAVOR');
if ($flavor =~ m/IoT|osbuild/) {
record_soft_failure $msg;
}
else {
die $msg;
}
}
}