From 4938c0e5aea38728b873d79dc3481bdb8797549e Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 12 Apr 2024 08:48:45 -0700 Subject: [PATCH] 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 --- lib/utils.pm | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 972db9aa..3fa5b31f 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -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; } } }