From 0668357dd70b37a8202df365844d2d801669cb02 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 14 Jul 2021 11:46:46 -0700 Subject: [PATCH] Fix os_release checks for name change to "Fedora Linux" A couple of the checks here need updating now we're calling it "Fedora Linux" not just "Fedora". Signed-off-by: Adam Williamson --- tests/os_release.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/os_release.pm b/tests/os_release.pm index 44e80f4f..5d53684e 100644 --- a/tests/os_release.pm +++ b/tests/os_release.pm @@ -59,6 +59,9 @@ sub run { $cannedtag = (split /-/, $build)[-1]; } my $name = ucfirst($id); + # from F35 onwards, $NAME is "Fedora Linux" not just "Fedora" + my $relnum = get_release_number; + my $fullname = $relnum > 34 ? $name . " Linux" : $name; 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 @@ -115,10 +118,10 @@ sub run { $version = "$cannedtag ($varstr)"; } my $platform_id = "platform:f$version_id"; - my $pretty = "$name $version_id ($varstr)"; + my $pretty = "$fullname $version_id ($varstr)"; # Same problem is when testing the PRETTY_NAME. if (get_var("CANNED")) { - $pretty = "$name $cannedtag ($varstr)"; + $pretty = "$fullname $cannedtag ($varstr)"; # ...and FCOS uses a different format, sigh if ($build =~ /^Fedora-CoreOS/) { $pretty = "Fedora CoreOS $cannedtag"; @@ -130,10 +133,11 @@ sub run { my $failref =\@fails; # Test for name - rec_log "NAME should be $name and is $content{'NAME'}", $content{'NAME'} eq $name, $failref; + my $strip = strip_marks($content{'NAME'}); + rec_log "NAME should be $fullname and is $strip", $strip eq $fullname, $failref; # Test for version. - my $strip = strip_marks($content{'VERSION'}); + $strip = strip_marks($content{'VERSION'}); rec_log "VERSION should be $version and is $strip", $strip eq $version, $failref; # Test for version_id