mirror of
https://github.com/rocky-linux/os-autoinst-distri-rocky.git
synced 2024-12-18 09:08:29 +00:00
update logic and documentation of check_prerelease
This commit is contained in:
parent
12a9e8ec00
commit
69dfa89cc8
51
lib/utils.pm
51
lib/utils.pm
@ -1180,16 +1180,11 @@ sub check_prerelease {
|
|||||||
# defaults to False, but if the compose has a label and it's an
|
# defaults to False, but if the compose has a label and it's an
|
||||||
# 'RC' or 'Update' or 'SecurityFix' compose (see definition of
|
# 'RC' or 'Update' or 'SecurityFix' compose (see definition of
|
||||||
# SUPPORTED_MILESTONES in productmd.composeinfo), the default is
|
# SUPPORTED_MILESTONES in productmd.composeinfo), the default is
|
||||||
# True. AFAICS, Fedora's pungi configs don't explicitly set this,
|
# True. Not sure if Rocky's pungi configs explicitly set this,
|
||||||
# but rely on the heuristic. So for installer images, we expect
|
# or rely on the heuristic. So for installer images, we expect
|
||||||
# isFinal to be True for RC candidate composes and post-release
|
# isFinal to be True for RC candidate and final composes, but
|
||||||
# nightly Cloud, IoT etc. composes (these are also marked as 'RC'
|
# False for LookAhead and Beta candidate composes. Live images
|
||||||
# composes), but False for Rawhide and Branched nightly composes
|
# do not have the buildstamp file.
|
||||||
# and Beta candidate composes. For installer images built by our
|
|
||||||
# own _installer_build test, we control whether --isfinal is set
|
|
||||||
# or not; we pass it if the update is for a stable release, we do
|
|
||||||
# not pass it if the update is for Branched. Live images do not
|
|
||||||
# have the buildstamp file.
|
|
||||||
|
|
||||||
# 2. If there's no buildstamp file, the value of the environment
|
# 2. If there's no buildstamp file, the value of the environment
|
||||||
# variable ANACONDA_ISFINAL is used as `product.isFinal`, default
|
# variable ANACONDA_ISFINAL is used as `product.isFinal`, default
|
||||||
@ -1197,22 +1192,11 @@ sub check_prerelease {
|
|||||||
# wrapper script sets ANACONDA_ISFINAL based on the release field
|
# wrapper script sets ANACONDA_ISFINAL based on the release field
|
||||||
# of whatever package provides system-release: if it starts with
|
# of whatever package provides system-release: if it starts with
|
||||||
# "0.", it sets ANACONA_ISFINAL to "false", otherwise it sets it
|
# "0.", it sets ANACONA_ISFINAL to "false", otherwise it sets it
|
||||||
# to "true". So for live images, we expect isFinal to be True
|
# to "true".
|
||||||
# unless the fedora-release-common package release starts with 0.
|
|
||||||
|
|
||||||
# 3. If `product.isFinal` is False, the pre-release warning and
|
# 3. If `product.isFinal` is False, the pre-release warning and
|
||||||
# tags are shown; if it is False, they are not shown.
|
# tags are shown; if it is False, they are not shown.
|
||||||
|
|
||||||
# We don't really need to check this stuff for update tests, as
|
|
||||||
# the only installer images we test on updates are ones we build
|
|
||||||
# ourselves; there's no value to this check for those really.
|
|
||||||
# For compose tests, we will expect to see the pre-release tags if
|
|
||||||
# the compose is Rawhide, or a Beta candidate, or it's a nightly
|
|
||||||
# and we're checking an installer image. If it's an RC or Updates
|
|
||||||
# candidate, or a respin release, we expect NOT to see the tags.
|
|
||||||
# If it's a nightly and we're checking a live image, we don't do
|
|
||||||
# the check.
|
|
||||||
|
|
||||||
# bail if this is an update test
|
# bail if this is an update test
|
||||||
return if (get_var("ADVISORY OR TASK"));
|
return if (get_var("ADVISORY OR TASK"));
|
||||||
|
|
||||||
@ -1220,25 +1204,18 @@ sub check_prerelease {
|
|||||||
# any other value means we don't care
|
# any other value means we don't care
|
||||||
my $prerelease = 10;
|
my $prerelease = 10;
|
||||||
|
|
||||||
# if this is RC or update compose we absolutely *MUST NOT* see tags
|
# if this is RC we absolutely *MUST NOT* see tags
|
||||||
my $label = get_var("LABEL");
|
my $label = get_var("LABEL");
|
||||||
$prerelease = 0 if ($label =~ /^(RC|Update)-/);
|
$prerelease = 0 if ($label =~ /^RC/);
|
||||||
# if it's a Beta compose we *MUST* see tags
|
# if it's a Beta compose we *MUST* see tags
|
||||||
$prerelease = 1 if ($label =~ /^Beta-/);
|
$prerelease = 1 if ($label =~ /^(B(?i)eta(?-i))/);
|
||||||
my $version = get_var('VERSION');
|
|
||||||
# if it's Rawhide we *MUST* see tags
|
|
||||||
$prerelease = 1 if ($version eq "Rawhide");
|
|
||||||
my $build = get_var('BUILD');
|
my $build = get_var('BUILD');
|
||||||
# if it's a nightly installer image we should see tags
|
# if it's a nightly installer image we should see tags
|
||||||
$prerelease = 1 if ($build =~ /\.n\.\d+/ && !get_var("LIVE"));
|
$prerelease = 1 if ($build =~ /\.t\.\d+/ && !get_var("LIVE"));
|
||||||
# if it's a respin compose we *MUST NOT* see tags
|
# check based on ISO name, does not work for 8.x boot-iso name(s) which must use
|
||||||
$prerelease = 0 if ($build =~ /Respin/);
|
# LABEL
|
||||||
# we *could* go to a console and parse fedora-release-common
|
my $iso = get_var('ISO');
|
||||||
# to decide if a nightly live image should have tags or not, but
|
$prerelease = 1 if ($iso =~ /^Rocky-\d+\.\d+-(B(?i)eta(?-i)|LookAhead)-(x86_64|aarch64|ppc64le|s390x)-(boot|dvd\d?|minimal).iso/);
|
||||||
# it seems absurd as we're almost reinventing the code that
|
|
||||||
# decides whether to show the tags, at that point, and it's not
|
|
||||||
# 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.
|
# For all prerelease requiring ISOs, assert that prerelease is there.
|
||||||
if ($prerelease == 1) {
|
if ($prerelease == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user