2019-05-16 13:01:52 +00:00
|
|
|
use base "installedtest";
|
|
|
|
use strict;
|
|
|
|
use testapi;
|
|
|
|
use utils;
|
|
|
|
|
|
|
|
# This test checks that Fedora release is correctly described in /etc/fedora-release file.
|
|
|
|
# The content of the file should be: "Fedora release <version> (<version_words>)"
|
|
|
|
# where "version" is a number of the current Fedora version and "version_words" is the number
|
|
|
|
# quoted in words, such as 31 = Thirty One.
|
|
|
|
# Before branching, the parenthesis contain the word "Rawhide".
|
|
|
|
|
|
|
|
sub run {
|
|
|
|
my $self = shift;
|
2019-08-21 19:15:59 +00:00
|
|
|
# Version as defined in the VERSION variable.
|
2020-03-18 18:12:47 +00:00
|
|
|
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");
|
2019-05-16 13:01:52 +00:00
|
|
|
# Create a spelt form of the version number.
|
2020-03-18 18:12:47 +00:00
|
|
|
my $speltnum = spell_version_number($tospell);
|
2019-08-21 19:15:59 +00:00
|
|
|
# Create the expected content of the release file
|
2019-05-16 13:01:52 +00:00
|
|
|
# and compare it with its real counterpart.
|
2020-03-18 18:12:47 +00:00
|
|
|
my $expected = "Fedora release $expectver ($speltnum)";
|
2019-08-21 19:15:59 +00:00
|
|
|
validate_script_output 'cat /etc/fedora-release', sub { $_ eq $expected };
|
2019-05-16 13:01:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub test_flags {
|
|
|
|
return {always_rollback => 1};
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: set sw=4 et:
|