From 40f29759e86955bdbcb6233ca7a8c29758d2ed91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20R=C5=AF=C5=BEi=C4=8Dka?= Date: Tue, 26 Nov 2024 14:39:07 +0100 Subject: [PATCH] Add tests for the EOL records. --- templates.fif.json | 2 +- tests/collect_web_data.pm | 40 +++++++++++++++++++++++++++++++++++++++ tests/os_release.pm | 12 ++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/collect_web_data.pm diff --git a/templates.fif.json b/templates.fif.json index 82f02218..214891f2 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -2509,7 +2509,7 @@ }, "settings": { "BOOTFROM": "c", - "ENTRYPOINT": "text_login_gui fedora_release os_release", + "ENTRYPOINT": "text_login_gui collect_web_data fedora_release os_release", "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%", "USER_LOGIN": "false" diff --git a/tests/collect_web_data.pm b/tests/collect_web_data.pm new file mode 100644 index 00000000..f1c3c501 --- /dev/null +++ b/tests/collect_web_data.pm @@ -0,0 +1,40 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; + +sub run { + my $self = shift; + + # Let's get the $target release version. Most of the time, + # the version will point to a future release. On Rawhide, + # this will not be a number, so we need to convert it + # to a number. + my $target = get_var('VERSION'); + if (get_var('VERSION') eq 'Rawhide') { + $target = get_var('RAWREL'); + } + # The $current release version is the last stable release + # around that we want to compare. + my $current = get_var('CURRREL'); + + # Go to the home directory, create a new directory there + # and collect the data + assert_script_run('cd'); + assert_script_run('mkdir version_data'); + assert_script_run('cd version_data'); + + # We will fetch the version data from various locations. + # Download data from Bodhi for + assert_script_run("curl -o bodhi-$current.json https://bodhi.fedoraproject.org/releases/F$current"); + assert_script_run("curl -o bodhi-$target.json https://bodhi.fedoraproject.org/releases/F$target"); + # Download data from Fedora Schedule + assert_script_run("curl -o schedule-$current.json https://fedorapeople.org/groups/schedule/f-$current/f-$current-key.json"); + assert_script_run("curl -o schedule-$target.json https://fedorapeople.org/groups/schedule/f-$target/f-$target-key.json"); +} + +sub test_flags { + return {fatal => 1, milestone => 1}; +} +1; +# vim: set sw=4 et: diff --git a/tests/os_release.pm b/tests/os_release.pm index e82a75ab..6e7f8037 100644 --- a/tests/os_release.pm +++ b/tests/os_release.pm @@ -2,6 +2,8 @@ use base "installedtest"; use strict; use testapi; use utils; +use IO::Socket::INET; +use JSON; # This test checks that the descriptions in /etc/os-release file are correct and that they # match the current version. @@ -12,6 +14,14 @@ sub strip_marks { return $string; } +my get_fedora_schedule_version { + +} + +sub check_eol { + my $eol = shift; +} + sub run { # First, let us define some variables needed to run the program. my $self = shift; @@ -131,6 +141,8 @@ sub run { } } + # Check for the correct support day (a.k.a. EOL) + #Now. we can start testing the real values from the installed system. my @fails = (); my $failref = \@fails;