Tweak release_identification for awkward IoT 33 branch

IoT created a branch that's basically Rawhide but is versioned
33. This causes the release_identification tests to fail. I don't
think they'll change this on their end, so let's just have the
test cope with it and expect branches versioned as the Rawhide
release number to behave as Rawhide does here.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2020-03-18 11:12:47 -07:00
parent c884842439
commit cced8f5428
2 changed files with 18 additions and 12 deletions

View File

@ -12,19 +12,22 @@ use utils;
sub run {
my $self = shift;
# Version as defined in the VERSION variable.
my $version = get_var('VERSION');
my $tospell = get_var('VERSION');
my $expectver = get_var('VERSION');
# Rawhide release number.
my $rawrel = get_var('RAWREL', '');
# IoT has a branch that acts more or less like Rawhide, but has
# its version as the Rawhide release number, not 'Rawhide'. This
# handles that
$tospell = 'Rawhide' if ($tospell eq $rawrel);
# this is the Rawhide release number, which we expect to see.
$expectver = $rawrel if ($expectver eq "Rawhide");
# Create a spelt form of the version number.
my $speltnum = spell_version_number($version);
if ($version eq "Rawhide") {
# this is the Rawhide release number, which we expect to see.
$version = get_var('RAWREL');
}
my $speltnum = spell_version_number($tospell);
bypass_1691487;
# Create the expected content of the release file
# and compare it with its real counterpart.
my $expected = "Fedora release $version ($speltnum)";
my $expected = "Fedora release $expectver ($speltnum)";
validate_script_output 'cat /etc/fedora-release', sub { $_ eq $expected };
}

View File

@ -53,12 +53,15 @@ sub run {
# that will contain both the version number and the build number.
my $cannedtag = "$cannedver.$cannednum";
my $name = ucfirst($id);
my $rawrel = get_var("RAWREL", '');
my $version_id = get_var("VERSION"); # Should be the version number or Rawhide.
# IoT has a branch that acts more or less like Rawhide, but has
# its version as the Rawhide release number, not 'Rawhide'. This
# handles that
$version_id = 'Rawhide' if ($version_id eq $rawrel);
my $varstr = spell_version_number($version_id);
my $target = lc($version_id);
if ($version_id eq "Rawhide") {
$version_id = get_var("RAWREL");
}
$version_id = $rawrel if ($version_id eq "Rawhide");
# the 'generic' os-release in fedora-release has no VARIANT or
# VARIANT_ID and the string used in values like VERSION, that in other