From cced8f5428f6fa01ab80fbd93810fb69317a7294 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 18 Mar 2020 11:12:47 -0700 Subject: [PATCH] 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 --- tests/fedora_release.pm | 21 ++++++++++++--------- tests/os_release.pm | 9 ++++++--- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/fedora_release.pm b/tests/fedora_release.pm index 83160a24..eec7a746 100644 --- a/tests/fedora_release.pm +++ b/tests/fedora_release.pm @@ -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 }; } diff --git a/tests/os_release.pm b/tests/os_release.pm index 1b85c939..b5b9687f 100644 --- a/tests/os_release.pm +++ b/tests/os_release.pm @@ -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