mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2024-12-29 13:43:08 +00:00
Compare commits
No commits in common. "9c7fb06532fcd9a82fa3cef988f38b5863a6aef4" and "40f29759e86955bdbcb6233ca7a8c29758d2ed91" have entirely different histories.
9c7fb06532
...
40f29759e8
@ -1,9 +1,9 @@
|
|||||||
use base "installedtest";
|
use base "installedtest";
|
||||||
use strict;
|
use strict;
|
||||||
use JSON::PP;
|
|
||||||
use Time::Piece;
|
|
||||||
use testapi;
|
use testapi;
|
||||||
use utils;
|
use utils;
|
||||||
|
use IO::Socket::INET;
|
||||||
|
use JSON;
|
||||||
|
|
||||||
# This test checks that the descriptions in /etc/os-release file are correct and that they
|
# This test checks that the descriptions in /etc/os-release file are correct and that they
|
||||||
# match the current version.
|
# match the current version.
|
||||||
@ -14,58 +14,10 @@ sub strip_marks {
|
|||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub json_to_hash {
|
my get_fedora_schedule_version {
|
||||||
my $json = shift;
|
|
||||||
my $hash = JSON::PP->new->utf8->decode($json);
|
|
||||||
return $hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_bodhi_eol {
|
|
||||||
# This reads the Bodhi info file (downloaded in collect_web_data.pm),
|
|
||||||
# parses it and returns the EOL date from that file.
|
|
||||||
# As argument it takes the version number from which the EOL
|
|
||||||
# date should be returned.
|
|
||||||
my $ver = shift;
|
|
||||||
# The content of the downloaded file is a JSON string.
|
|
||||||
my $json = script_output("cat ~/version_data/bodhi-$ver.json");
|
|
||||||
my $bodhi = json_to_hash($json);
|
|
||||||
my $eol = $bodhi->{"eol"};
|
|
||||||
return $eol;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub get_schedule_eol {
|
|
||||||
# This reads the Fedora Schedule info file (downloaded
|
|
||||||
# previously in collect_web_data.pm), parses it and returns
|
|
||||||
# the EOL date from that file. As argument, it takes the version
|
|
||||||
# number from which the EOL date should be returned.
|
|
||||||
my $ver = shift;
|
|
||||||
my $json = script_output("cat ~/version_data/schedule-$ver.json");
|
|
||||||
my $schedule = json_to_hash($json);
|
|
||||||
my $eol;
|
|
||||||
# The format of the json is quite complicated, so we need to do
|
|
||||||
# quite a lot of magic to arrive at the correct date, so let's
|
|
||||||
# hope the format stays the same in the future.
|
|
||||||
foreach my $task (@{$json->{tasks}->[0]->{tasks}->[0]->{tasks}}) {
|
|
||||||
if ($task->{name} && $task->{name} =~ /End of Life/) {
|
|
||||||
$eol = $task->{end};
|
|
||||||
last;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# The EOL date is provided as an epoch, so just return it.
|
|
||||||
return $eol;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_current_date {
|
|
||||||
# This returns the current date in the required form
|
|
||||||
# YYYY-MM-DD which we need to see if the EOL is
|
|
||||||
# correctly set in the future.
|
|
||||||
my $time = localtime;
|
|
||||||
$time = $time->strftime('%Y-%m-%d');
|
|
||||||
return $time;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sub check_eol {
|
sub check_eol {
|
||||||
my $eol = shift;
|
my $eol = shift;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user