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.
|
2019-05-16 13:01:52 +00:00
|
|
|
my $version = get_var('VERSION');
|
|
|
|
# Create a spelt form of the version number.
|
2019-08-21 19:15:59 +00:00
|
|
|
my $speltnum = spell_version_number($version);
|
|
|
|
|
2019-05-16 13:01:52 +00:00
|
|
|
if ($version eq "Rawhide") {
|
2019-08-21 19:15:59 +00:00
|
|
|
# this is the Rawhide release number, which we expect to see.
|
|
|
|
$version = get_var('RAWREL');
|
2019-05-16 13:01:52 +00:00
|
|
|
}
|
|
|
|
|
2019-10-22 21:32:09 +00:00
|
|
|
bypass_1691487;
|
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.
|
2019-08-21 19:15:59 +00:00
|
|
|
my $expected = "Fedora release $version ($speltnum)";
|
|
|
|
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:
|