Merge pull request #210 from tcooper/beta_utils

Update pre-release logic for BETA testing
This commit is contained in:
Alan Marshall 2024-04-07 13:08:28 +01:00 committed by GitHub
commit b9ad97dce5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 88 additions and 98 deletions

View File

@ -107,6 +107,6 @@ These variables should be set when tests are scheduled (when running `isos post`
| `PREVREL` | the previous stable Rocky release at the time of the test run |
| `UP1REL` | the source release for "1-release" upgrade tests (usually but not always same as `CURRREL`) |
| `UP2REL` | the source release for "2-release" upgrade tests (currently always same as `PREVREL`) |
| `LOCATION` | contains Pungi base compose location (something like `https://kojipkgs.rockylinux.org/compose/branched/Rocky-8.4-20210801.n.0/compose/`) |
| `LOCATION` | Rocky doesn't replicate compose process used by upstream distribution. `LOCATION` has three general use cases: substitution value for `REPOSITORY_VARIATION` or `REPOSITORY_GRAPHICAL` in `templates.fif.json`, within `utils.pm` in `_repo_setup_compose` which is not valid for Rocky and within `support_server.pm` in `_pxe_setup` to pull the kernel and initrd used for PXE installs. |
| `DNF_CONTENTDIR` | the value to change `/etc/dnf/vars/contentdir` to (eg. `stg/rocky`) allowing repository reconfiguration to point at staging (usually but not always used with `DNF_RELEASEVER`) |
| `DNF_RELEASEVER` | the value to change `/etc/dnf/vars/releasever` to (eg. `8.8-Beta`) allowing repository reconfiguration to point at a specific release (usually but not always used with `DNF_CONTENTDIR`) |

View File

@ -8,7 +8,7 @@ use Exporter;
use feature "switch";
use lockapi;
use testapi;
our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type repo_setup setup_workaround_repo cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut lo_dismiss_tip disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number get_version_major get_code_name check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log click_unwanted_notifications repos_mirrorlist register_application get_registered_applications solidify_wallpaper/;
our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type repo_setup cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup anaconda_create_user check_desktop download_modularity_tests quit_firefox advisory_get_installed_packages advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut lo_dismiss_tip disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number get_version_major get_code_name check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log click_unwanted_notifications repos_mirrorlist register_application get_registered_applications solidify_wallpaper/;
# We introduce this global variable to hold the list of applications that have
# registered during the apps_startstop_test when they have sucessfully run.
@ -433,9 +433,12 @@ sub repos_mirrorlist {
# the infra repo is updated but mirrormanager metadata checksums
# have not been updated, and the infra repo is rejected as its
# metadata checksum isn't known to MM
# NOTE: For Rocky CURRREL is used to specify/select HDD1 for multi-host
# tests, for example *8.10-BETA*qcow2, and repo names are
# really tied to the major version in Rocky.
my $files = shift;
my $currentversion = get_var("CURRREL");
if ($currentversion eq '8') {
my $currentversion = get_var("VERSION");
if (get_version_major($currentversion) eq '8') {
$files ||= "/etc/yum.repos.d/Rocky*.repo";
}
else {
@ -450,60 +453,6 @@ sub cleanup_workaround_repo {
script_run "rm -f /etc/yum.repos.d/workarounds.repo";
}
sub setup_workaround_repo {
# doesn't work for Rocky
my $distri = get_var("DISTRI");
return if ($distri eq "rocky");
# we periodically need to pull an update from updates-testing in
# to fix some bug or other. so, here's an organized way to do it.
# we do this here so the workaround packages are in the repo data
# but *not* in the package lists generated above (those should
# only include packages from the update under test). we'll define
# a hash of releases and update IDs. if no workarounds are needed
# for any release, the hash can be empty and this will do nothing
my $version = shift || get_var("VERSION");
cleanup_workaround_repo;
script_run "dnf -y install bodhi-client createrepo", 300;
# write a repo config file, unless this is the support_server test
# and it is running on a different release than the update is for
# (in this case we need the repo to exist but do not want to use
# it on the actual support_server system)
unless (get_var("TEST") eq "support_server" && $version ne get_var("CURRREL")) {
assert_script_run 'printf "[workarounds]\nname=Workarounds repo\nbaseurl=file:///opt/workarounds_repo\nenabled=1\nmetadata_expire=1\ngpgcheck=0" > /etc/yum.repos.d/workarounds.repo';
}
assert_script_run "mkdir -p /opt/workarounds_repo";
assert_script_run "pushd /opt/workarounds_repo";
my %workarounds = (
"32" => [],
"33" => [],
"34" => ["FEDORA-2021-d7b1dc57fe"]
);
# then we'll download each update for our release:
my $advortasks = $workarounds{$version};
foreach my $advortask (@$advortasks) {
my $cmd = "bodhi updates download --updateid=$advortask";
if ($advortask =~ /^\d+$/) {
my $arch = get_var("ARCH");
$cmd = "koji download-task --arch=$arch --arch=noarch $advortask";
}
my $count = 3;
my $success = 0;
while ($count) {
if (script_run $cmd, 180) {
$count -= 1;
}
else {
$count = 0;
$success = 1;
}
}
die "Workaround update download failed!" unless $success;
}
# and create repo metadata
assert_script_run "createrepo .";
assert_script_run "popd";
}
sub _repo_setup_compose {
# doesn't work for Rocky
my $distri = get_var("DISTRI");
@ -561,8 +510,6 @@ sub _repo_setup_updates {
assert_script_run "dnf config-manager --set-disabled updates-testing-modular";
}
}
# set up the workaround repo
setup_workaround_repo;
# Set up an additional repo containing the update or task packages. We do
# this rather than simply running a one-time update because it may be the
@ -1233,16 +1180,11 @@ sub check_prerelease {
# defaults to False, but if the compose has a label and it's an
# 'RC' or 'Update' or 'SecurityFix' compose (see definition of
# SUPPORTED_MILESTONES in productmd.composeinfo), the default is
# True. AFAICS, Fedora's pungi configs don't explicitly set this,
# but rely on the heuristic. So for installer images, we expect
# isFinal to be True for RC candidate composes and post-release
# nightly Cloud, IoT etc. composes (these are also marked as 'RC'
# composes), but False for Rawhide and Branched nightly composes
# and Beta candidate composes. For installer images built by our
# own _installer_build test, we control whether --isfinal is set
# or not; we pass it if the update is for a stable release, we do
# not pass it if the update is for Branched. Live images do not
# have the buildstamp file.
# True. Not sure if Rocky's pungi configs explicitly set this,
# or rely on the heuristic. So for installer images, we expect
# isFinal to be True for RC candidate and final composes, but
# False for LookAhead and Beta candidate composes. Live images
# do not have the buildstamp file.
# 2. If there's no buildstamp file, the value of the environment
# variable ANACONDA_ISFINAL is used as `product.isFinal`, default
@ -1250,22 +1192,11 @@ sub check_prerelease {
# wrapper script sets ANACONDA_ISFINAL based on the release field
# of whatever package provides system-release: if it starts with
# "0.", it sets ANACONA_ISFINAL to "false", otherwise it sets it
# to "true". So for live images, we expect isFinal to be True
# unless the fedora-release-common package release starts with 0.
# to "true".
# 3. If `product.isFinal` is False, the pre-release warning and
# tags are shown; if it is False, they are not shown.
# We don't really need to check this stuff for update tests, as
# the only installer images we test on updates are ones we build
# ourselves; there's no value to this check for those really.
# For compose tests, we will expect to see the pre-release tags if
# the compose is Rawhide, or a Beta candidate, or it's a nightly
# and we're checking an installer image. If it's an RC or Updates
# candidate, or a respin release, we expect NOT to see the tags.
# If it's a nightly and we're checking a live image, we don't do
# the check.
# bail if this is an update test
return if (get_var("ADVISORY OR TASK"));
@ -1273,25 +1204,18 @@ sub check_prerelease {
# any other value means we don't care
my $prerelease = 10;
# if this is RC or update compose we absolutely *MUST NOT* see tags
# if this is RC we absolutely *MUST NOT* see tags
my $label = get_var("LABEL");
$prerelease = 0 if ($label =~ /^(RC|Update)-/);
$prerelease = 0 if ($label =~ /^RC/);
# if it's a Beta compose we *MUST* see tags
$prerelease = 1 if ($label =~ /^Beta-/);
my $version = get_var('VERSION');
# if it's Rawhide we *MUST* see tags
$prerelease = 1 if ($version eq "Rawhide");
$prerelease = 1 if ($label =~ /^(B(?i)eta(?-i))/);
my $build = get_var('BUILD');
# if it's a nightly installer image we should see tags
$prerelease = 1 if ($build =~ /\.n\.\d+/ && !get_var("LIVE"));
# if it's a respin compose we *MUST NOT* see tags
$prerelease = 0 if ($build =~ /Respin/);
# we *could* go to a console and parse fedora-release-common
# to decide if a nightly live image should have tags or not, but
# it seems absurd as we're almost reinventing the code that
# decides whether to show the tags, at that point, and it's not
# really a big deal either way whether a nightly live image has
# the tags or not. So we don't.
$prerelease = 1 if ($build =~ /\.t\.\d+/ && !get_var("LIVE"));
# check based on ISO name, does not work for 8.x boot-iso name(s) which must use
# LABEL
my $iso = get_var('ISO');
$prerelease = 1 if ($iso =~ /^Rocky-\d+\.\d+-(B(?i)eta(?-i)|LookAhead)-(x86_64|aarch64|ppc64le|s390x)-(boot|dvd\d?|minimal).iso/);
# For all prerelease requiring ISOs, assert that prerelease is there.
if ($prerelease == 1) {

View File

@ -0,0 +1,17 @@
{
"area": [
{
"ypos": 33,
"height": 19,
"type": "match",
"width": 145,
"xpos": 91
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-arabic",
"prerelease_note"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"type": "match",
"xpos": 734,
"width": 143,
"height": 19,
"ypos": 31
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-french",
"prerelease_note"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,17 @@
{
"area": [
{
"width": 159,
"xpos": 754,
"type": "match",
"ypos": 35,
"height": 24
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"LANGUAGE-japanese",
"prerelease_note"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,16 @@
{
"area": [
{
"ypos": 34,
"height": 27,
"width": 159,
"xpos": 754,
"type": "match"
}
],
"properties": [],
"tags": [
"ENV-DISTRI-rocky",
"prerelease_note"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -13,7 +13,6 @@ sub run {
if (index($testname, "upgrade_2") != -1) {
$version = get_var("UP2REL");
}
setup_workaround_repo $version;
assert_script_run 'dnf -y update --refresh', 1800;
script_run "reboot", 0;