forked from rpms/leapp-repository
Compare commits
No commits in common. "c8s" and "c8" have entirely different histories.
@ -1 +0,0 @@
|
||||
1
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,5 +1,2 @@
|
||||
SOURCES/deps-pkgs-9.tar.gz
|
||||
SOURCES/leapp-repository-0.18.0.tar.gz
|
||||
/deps-pkgs-9.tar.gz
|
||||
/deps-pkgs-10.tar.gz
|
||||
/leapp-repository-0.20.0.tar.gz
|
||||
SOURCES/deps-pkgs-13.tar.gz
|
||||
SOURCES/leapp-repository-0.23.0.tar.gz
|
||||
|
||||
2
.leapp-repository.metadata
Normal file
2
.leapp-repository.metadata
Normal file
@ -0,0 +1,2 @@
|
||||
3590b33b4a79ebe62f5cfa0eeca7efb41d526498 SOURCES/deps-pkgs-13.tar.gz
|
||||
b5b541cc0c0372ee476f0ab6073a62e67290d031 SOURCES/leapp-repository-0.23.0.tar.gz
|
||||
@ -1,251 +0,0 @@
|
||||
From 921c06892f7550a3a8e2b3fe941c6272bdacf88d Mon Sep 17 00:00:00 2001
|
||||
From: mhecko <mhecko@redhat.com>
|
||||
Date: Thu, 15 Feb 2024 09:56:27 +0100
|
||||
Subject: [PATCH 01/34] rhui: do not bootstrap target client on aws
|
||||
|
||||
Bootstrapping target RHUI client now requires installing the entire
|
||||
RHEL8 RPM stack. Threfore, do not try installing target client
|
||||
and instead rely only on the files from our leapp-rhui-aws package.
|
||||
---
|
||||
.../cloud/checkrhui/libraries/checkrhui.py | 6 +-
|
||||
.../libraries/userspacegen.py | 104 ++++++++++++++----
|
||||
.../system_upgrade/common/models/rhuiinfo.py | 7 ++
|
||||
3 files changed, 92 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
index 84ab40e3..e1c158c7 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
@@ -142,7 +142,11 @@ def customize_rhui_setup_for_aws(rhui_family, setup_info):
|
||||
|
||||
target_version = version.get_target_major_version()
|
||||
if target_version == '8':
|
||||
- return # The rhel8 plugin is packed into leapp-rhui-aws as we need python2 compatible client
|
||||
+ # RHEL8 rh-amazon-rhui-client depends on amazon-libdnf-plugin that depends
|
||||
+ # essentially on the entire RHEL8 RPM stack, so we cannot just swap the clients
|
||||
+ # The leapp-rhui-aws will provide all necessary files to access entire RHEL8 content
|
||||
+ setup_info.bootstrap_target_client = False
|
||||
+ return
|
||||
|
||||
amazon_plugin_copy_task = CopyFile(src='/usr/lib/python3.9/site-packages/dnf-plugins/amazon-id.py',
|
||||
dst='/usr/lib/python3.6/site-packages/dnf-plugins/')
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index d917bfd5..d60bc75f 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -853,9 +853,9 @@ def _get_rhui_available_repoids(context, cloud_repo):
|
||||
return set(repoids)
|
||||
|
||||
|
||||
-def get_copy_location_from_copy_in_task(context, copy_task):
|
||||
+def get_copy_location_from_copy_in_task(context_basepath, copy_task):
|
||||
basename = os.path.basename(copy_task.src)
|
||||
- dest_in_container = context.full_path(copy_task.dst)
|
||||
+ dest_in_container = os.path.join(context_basepath, copy_task.dst)
|
||||
if os.path.isdir(dest_in_container):
|
||||
return os.path.join(copy_task.dst, basename)
|
||||
return copy_task.dst
|
||||
@@ -871,7 +871,10 @@ def _get_rh_available_repoids(context, indata):
|
||||
|
||||
# If we are upgrading a RHUI system, check what repositories are provided by the (already installed) target clients
|
||||
if indata and indata.rhui_info:
|
||||
- files_provided_by_clients = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
+ setup_info = indata.rhui_info.target_client_setup_info
|
||||
+ target_content_access_files = set()
|
||||
+ if setup_info.bootstrap_target_client:
|
||||
+ target_content_access_files = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
|
||||
def is_repofile(path):
|
||||
return os.path.dirname(path) == '/etc/yum.repos.d' and os.path.basename(path).endswith('.repo')
|
||||
@@ -884,24 +887,33 @@ def _get_rh_available_repoids(context, indata):
|
||||
|
||||
yum_repos_d = context.full_path('/etc/yum.repos.d')
|
||||
all_repofiles = {os.path.join(yum_repos_d, path) for path in os.listdir(yum_repos_d) if path.endswith('.repo')}
|
||||
- client_repofiles = {context.full_path(path) for path in files_provided_by_clients if is_repofile(path)}
|
||||
+ api.current_logger().debug('(RHUI Setup) All available repofiles: {0}'.format(' '.join(all_repofiles)))
|
||||
+
|
||||
+ target_access_repofiles = {
|
||||
+ context.full_path(path) for path in target_content_access_files if is_repofile(path)
|
||||
+ }
|
||||
|
||||
# Exclude repofiles used to setup the target rhui access as on some platforms the repos provided by
|
||||
# the client are not sufficient to install the client into target userspace (GCP)
|
||||
rhui_setup_repofile_tasks = [task for task in setup_tasks if task.src.endswith('repo')]
|
||||
rhui_setup_repofiles = (
|
||||
- get_copy_location_from_copy_in_task(context, copy_task) for copy_task in rhui_setup_repofile_tasks
|
||||
+ get_copy_location_from_copy_in_task(context.base_dir, copy) for copy in rhui_setup_repofile_tasks
|
||||
)
|
||||
rhui_setup_repofiles = {context.full_path(repofile) for repofile in rhui_setup_repofiles}
|
||||
|
||||
- foreign_repofiles = all_repofiles - client_repofiles - rhui_setup_repofiles
|
||||
+ foreign_repofiles = all_repofiles - target_access_repofiles - rhui_setup_repofiles
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'The following repofiles are considered as unknown to'
|
||||
+ ' the target RHUI content setup and will be ignored: {0}'.format(' '.join(foreign_repofiles))
|
||||
+ )
|
||||
|
||||
# Rename non-client repofiles so they will not be recognized when running dnf repolist
|
||||
for foreign_repofile in foreign_repofiles:
|
||||
os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile))
|
||||
|
||||
try:
|
||||
- dnf_cmd = ['dnf', 'repolist', '--releasever', target_ver, '-v']
|
||||
+ dnf_cmd = ['dnf', 'repolist', '--releasever', target_ver, '-v', '--enablerepo', '*']
|
||||
repolist_result = context.call(dnf_cmd)['stdout']
|
||||
repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')]
|
||||
rhui_repoids = {extract_repoid_from_line(line) for line in repoid_lines}
|
||||
@@ -919,6 +931,9 @@ def _get_rh_available_repoids(context, indata):
|
||||
for foreign_repofile in foreign_repofiles:
|
||||
os.rename('{0}.back'.format(foreign_repofile), foreign_repofile)
|
||||
|
||||
+ api.current_logger().debug(
|
||||
+ 'The following repofiles are considered as provided by RedHat: {0}'.format(' '.join(rh_repoids))
|
||||
+ )
|
||||
return rh_repoids
|
||||
|
||||
|
||||
@@ -1086,7 +1101,7 @@ def _get_target_userspace():
|
||||
return constants.TARGET_USERSPACE.format(get_target_major_version())
|
||||
|
||||
|
||||
-def _create_target_userspace(context, packages, files, target_repoids):
|
||||
+def _create_target_userspace(context, indata, packages, files, target_repoids):
|
||||
"""Create the target userspace."""
|
||||
target_path = _get_target_userspace()
|
||||
prepare_target_userspace(context, target_path, target_repoids, list(packages))
|
||||
@@ -1096,12 +1111,57 @@ def _create_target_userspace(context, packages, files, target_repoids):
|
||||
_copy_files(target_context, files)
|
||||
dnfplugin.install(_get_target_userspace())
|
||||
|
||||
+ # If we used only repofiles from leapp-rhui-<provider> then remove these as they provide
|
||||
+ # duplicit definitions as the target clients already installed in the target container
|
||||
+ if indata.rhui_info:
|
||||
+ api.current_logger().debug(
|
||||
+ 'Target container should have access to content. '
|
||||
+ 'Removing repofiles from leapp-rhui-<provider> from the target..'
|
||||
+ )
|
||||
+ setup_info = indata.rhui_info.target_client_setup_info
|
||||
+ if not setup_info.bootstrap_target_client:
|
||||
+ target_userspace_path = _get_target_userspace()
|
||||
+ for copy in setup_info.preinstall_tasks.files_to_copy_into_overlay:
|
||||
+ dst_in_container = get_copy_location_from_copy_in_task(target_userspace_path, copy)
|
||||
+ dst_in_container = dst_in_container.strip('/')
|
||||
+ dst_in_host = os.path.join(target_userspace_path, dst_in_container)
|
||||
+ if os.path.isfile(dst_in_host) and dst_in_host.endswith('.repo'):
|
||||
+ api.current_logger().debug('Removing repofile: {0}'.format(dst_in_host))
|
||||
+ os.remove(dst_in_host)
|
||||
+
|
||||
# and do not forget to set the rhsm into the container mode again
|
||||
with mounting.NspawnActions(_get_target_userspace()) as target_context:
|
||||
rhsm.set_container_mode(target_context)
|
||||
|
||||
|
||||
-def install_target_rhui_client_if_needed(context, indata):
|
||||
+def _apply_rhui_access_preinstall_tasks(context, rhui_setup_info):
|
||||
+ if rhui_setup_info.preinstall_tasks:
|
||||
+ api.current_logger().debug('Applying RHUI preinstall tasks.')
|
||||
+ preinstall_tasks = rhui_setup_info.preinstall_tasks
|
||||
+
|
||||
+ for file_to_remove in preinstall_tasks.files_to_remove:
|
||||
+ api.current_logger().debug('Removing {0} from the scratch container.'.format(file_to_remove))
|
||||
+ context.remove(file_to_remove)
|
||||
+
|
||||
+ for copy_info in preinstall_tasks.files_to_copy_into_overlay:
|
||||
+ api.current_logger().debug(
|
||||
+ 'Copying {0} in {1} into the scratch container.'.format(copy_info.src, copy_info.dst)
|
||||
+ )
|
||||
+ context.makedirs(os.path.dirname(copy_info.dst), exists_ok=True)
|
||||
+ context.copy_to(copy_info.src, copy_info.dst)
|
||||
+
|
||||
+
|
||||
+def _apply_rhui_access_postinstall_tasks(context, rhui_setup_info):
|
||||
+ if rhui_setup_info.postinstall_tasks:
|
||||
+ api.current_logger().debug('Applying RHUI postinstall tasks.')
|
||||
+ for copy_info in rhui_setup_info.postinstall_tasks.files_to_copy:
|
||||
+ context.makedirs(os.path.dirname(copy_info.dst), exists_ok=True)
|
||||
+ debug_msg = 'Copying {0} to {1} (inside the scratch container).'
|
||||
+ api.current_logger().debug(debug_msg.format(copy_info.src, copy_info.dst))
|
||||
+ context.call(['cp', copy_info.src, copy_info.dst])
|
||||
+
|
||||
+
|
||||
+def setup_target_rhui_access_if_needed(context, indata):
|
||||
if not indata.rhui_info:
|
||||
return
|
||||
|
||||
@@ -1110,15 +1170,14 @@ def install_target_rhui_client_if_needed(context, indata):
|
||||
_create_target_userspace_directories(userspace_dir)
|
||||
|
||||
setup_info = indata.rhui_info.target_client_setup_info
|
||||
- if setup_info.preinstall_tasks:
|
||||
- preinstall_tasks = setup_info.preinstall_tasks
|
||||
+ _apply_rhui_access_preinstall_tasks(context, setup_info)
|
||||
|
||||
- for file_to_remove in preinstall_tasks.files_to_remove:
|
||||
- context.remove(file_to_remove)
|
||||
-
|
||||
- for copy_info in preinstall_tasks.files_to_copy_into_overlay:
|
||||
- context.makedirs(os.path.dirname(copy_info.dst), exists_ok=True)
|
||||
- context.copy_to(copy_info.src, copy_info.dst)
|
||||
+ if not setup_info.bootstrap_target_client:
|
||||
+ # Installation of the target RHUI client is not possible and we bundle all necessary
|
||||
+ # files into the leapp-rhui-<provider> packages.
|
||||
+ api.current_logger().debug('Bootstrapping target RHUI client is disabled, leapp will rely '
|
||||
+ 'only on files budled in leapp-rhui-<provider> package.')
|
||||
+ return
|
||||
|
||||
cmd = ['dnf', '-y']
|
||||
|
||||
@@ -1149,16 +1208,13 @@ def install_target_rhui_client_if_needed(context, indata):
|
||||
|
||||
context.call(cmd, callback_raw=utils.logging_handler, stdin='\n'.join(dnf_transaction_steps))
|
||||
|
||||
- if setup_info.postinstall_tasks:
|
||||
- for copy_info in setup_info.postinstall_tasks.files_to_copy:
|
||||
- context.makedirs(os.path.dirname(copy_info.dst), exists_ok=True)
|
||||
- context.call(['cp', copy_info.src, copy_info.dst])
|
||||
+ _apply_rhui_access_postinstall_tasks(context, setup_info)
|
||||
|
||||
# Do a cleanup so there are not duplicit repoids
|
||||
files_owned_by_clients = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
|
||||
for copy_task in setup_info.preinstall_tasks.files_to_copy_into_overlay:
|
||||
- dest = get_copy_location_from_copy_in_task(context, copy_task)
|
||||
+ dest = get_copy_location_from_copy_in_task(context.base_dir, copy_task)
|
||||
can_be_cleaned_up = copy_task.src not in setup_info.files_supporting_client_operation
|
||||
if dest not in files_owned_by_clients and can_be_cleaned_up:
|
||||
context.remove(dest)
|
||||
@@ -1184,10 +1240,10 @@ def perform():
|
||||
target_iso = next(api.consume(TargetOSInstallationImage), None)
|
||||
with mounting.mount_upgrade_iso_to_root_dir(overlay.target, target_iso):
|
||||
|
||||
- install_target_rhui_client_if_needed(context, indata)
|
||||
+ setup_target_rhui_access_if_needed(context, indata)
|
||||
|
||||
target_repoids = _gather_target_repositories(context, indata, prod_cert_path)
|
||||
- _create_target_userspace(context, indata.packages, indata.files, target_repoids)
|
||||
+ _create_target_userspace(context, indata, indata.packages, indata.files, target_repoids)
|
||||
# TODO: this is tmp solution as proper one needs significant refactoring
|
||||
target_repo_facts = repofileutils.get_parsed_repofiles(context)
|
||||
api.produce(TMPTargetRepositoriesFacts(repositories=target_repo_facts))
|
||||
diff --git a/repos/system_upgrade/common/models/rhuiinfo.py b/repos/system_upgrade/common/models/rhuiinfo.py
|
||||
index 3eaa4826..0a2e45af 100644
|
||||
--- a/repos/system_upgrade/common/models/rhuiinfo.py
|
||||
+++ b/repos/system_upgrade/common/models/rhuiinfo.py
|
||||
@@ -36,6 +36,13 @@ class TargetRHUISetupInfo(Model):
|
||||
files_supporting_client_operation = fields.List(fields.String(), default=[])
|
||||
"""A subset of files copied in preinstall tasks that should not be cleaned up."""
|
||||
|
||||
+ bootstrap_target_client = fields.Boolean(default=True)
|
||||
+ """
|
||||
+ Swap the current RHUI client for the target one to facilitate access to the target content.
|
||||
+
|
||||
+ When False, only files from the leapp-rhui-<provider> will be used to access target content.
|
||||
+ """
|
||||
+
|
||||
|
||||
class RHUIInfo(Model):
|
||||
"""
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,830 +0,0 @@
|
||||
From b875ae256cc61336c76ea83f5e40eb7895cab0fc Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Fri, 9 Feb 2024 13:00:16 +0100
|
||||
Subject: [PATCH 02/34] Packit: Drop tests for obsoleted upgrade paths +
|
||||
restructuralization
|
||||
|
||||
Dropping upgrade paths related to following releases: 8.6, 8.9, 9.0,
|
||||
9.3. See the previous commit for more info.
|
||||
|
||||
During the drop of these release, I've realized the current structure
|
||||
of tests is not suitable for such operations as current test/job
|
||||
definitions has been chained. So e.g. tests for 8.10 -> 9.4 depended
|
||||
on 8.9 -> 9.3, which depended on 8.8 -> 8.6, etc... Even going deeper,
|
||||
IPU 8->9 definitions have been based on 7 -> 8 definitions.
|
||||
|
||||
So I updated the structure, separating tests for IPU 7 -> 8 and 8 -> 9
|
||||
and also deps between all upgrade paths. Now, particular tests
|
||||
can inherit one of *abstract* jobs definitions, so dropping or removing
|
||||
tests for an upgrade path does not affect other tests.
|
||||
|
||||
Also fixed some incorrect definitions in tests, like a fixed label
|
||||
for `beaker-minimal-88to92` (orig "8.6to9.2").
|
||||
|
||||
Update welcome-PR bot msg to reflect changes in upgrade paths.
|
||||
|
||||
Jira: OAMG-10451
|
||||
---
|
||||
.github/workflows/pr-welcome-msg.yml | 11 +-
|
||||
.packit.yaml | 530 ++++++++++-----------------
|
||||
2 files changed, 191 insertions(+), 350 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/pr-welcome-msg.yml b/.github/workflows/pr-welcome-msg.yml
|
||||
index e791340e..e23c9bbb 100644
|
||||
--- a/.github/workflows/pr-welcome-msg.yml
|
||||
+++ b/.github/workflows/pr-welcome-msg.yml
|
||||
@@ -24,18 +24,15 @@ jobs:
|
||||
- **review please @oamg/developers** to notify leapp developers of the review request
|
||||
- **/packit copr-build** to submit a public copr build using packit
|
||||
|
||||
- Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp from PR#42, use `/packit test oamg/leapp#42`
|
||||
+ Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp, e.g. from PR#42, use `/packit test oamg/leapp#42`
|
||||
+ Note that first time contributors cannot run tests automatically - they will be started by a reviewer.
|
||||
|
||||
It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported, `beaker-minimal` and `kernel-rt`, both can be used to be run on all upgrade paths or just a couple of specific ones.
|
||||
To launch on-demand tests with packit:
|
||||
- **/packit test --labels kernel-rt** to schedule `kernel-rt` tests set for all upgrade paths
|
||||
- - **/packit test --labels beaker-minimal-8.9to9.3,kernel-rt-8.9to9.3** to schedule `kernel-rt` and `beaker-minimal` test sets for 8.9->9.3 upgrade path
|
||||
+ - **/packit test --labels beaker-minimal-8.10to9.4,kernel-rt-8.10to9.4** to schedule `kernel-rt` and `beaker-minimal` test sets for 8.10->9.4 upgrade path
|
||||
|
||||
- [Deprecated] To launch on-demand regression testing public members of oamg organization can leave the following comment:
|
||||
- - **/rerun** to schedule basic regression tests using this pr build and latest upstream leapp build as artifacts
|
||||
- - **/rerun 42** to schedule basic regression tests using this pr build and leapp\*PR42\* as artifacts
|
||||
- - **/rerun-sst** to schedule sst tests using this pr build and latest upstream leapp build as artifacts
|
||||
- - **/rerun-sst 42** to schedule sst tests using this pr build and leapp\*PR42\* as artifacts
|
||||
+ See other labels for particular jobs defined in the `.packit.yaml` file.
|
||||
|
||||
Please [open ticket](https://url.corp.redhat.com/oamg-ci-issue) in case you experience technical problem with the CI. (RH internal only)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 491b1450..bce97bad 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -85,18 +85,31 @@ jobs:
|
||||
# builds from master branch should start with 100 release, to have high priority
|
||||
- bash -c "sed -i \"s/1%{?dist}/100%{?dist}/g\" packaging/leapp-repository.spec"
|
||||
|
||||
-- &sanity-79to86
|
||||
+
|
||||
+# NOTE: to see what envars, targets, .. can be set in tests, see
|
||||
+# the configuration of tests here:
|
||||
+# https://gitlab.cee.redhat.com/oamg/leapp-tests/-/blob/main/config.yaml
|
||||
+# Available only to RH Employees.
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################### 7 TO 8 ############################### #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ### Abstract job definitions to make individual tests/jobs smaller ### #
|
||||
+# ###################################################################### #
|
||||
+- &sanity-abstract-7to8
|
||||
job: tests
|
||||
+ trigger: ignore
|
||||
fmf_url: "https://gitlab.cee.redhat.com/oamg/leapp-tests"
|
||||
fmf_ref: "main"
|
||||
use_internal_tf: True
|
||||
- trigger: pull_request
|
||||
labels:
|
||||
- sanity
|
||||
targets:
|
||||
epel-7-x86_64:
|
||||
distros: [RHEL-7.9-ZStream]
|
||||
- identifier: sanity-7.9to8.6
|
||||
+ identifier: sanity-abstract-7to8
|
||||
tmt_plan: ""
|
||||
tf_extra_params:
|
||||
test:
|
||||
@@ -110,20 +123,16 @@ jobs:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
- SOURCE_RELEASE: "7.9"
|
||||
- TARGET_RELEASE: "8.6"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-- &sanity-79to86-aws
|
||||
- <<: *sanity-79to86
|
||||
+- &sanity-abstract-7to8-aws
|
||||
+ <<: *sanity-abstract-7to8
|
||||
labels:
|
||||
- sanity
|
||||
- aws
|
||||
targets:
|
||||
epel-7-x86_64:
|
||||
distros: [RHEL-7.9-rhui]
|
||||
- identifier: sanity-7.9to8.6-aws
|
||||
+ identifier: sanity-abstract-7to8-aws
|
||||
# NOTE(ivasilev) Unfortunately to use yaml templates we need to rewrite the whole tf_extra_params dict
|
||||
# to use plan_filter (can't just specify one section test.tmt.plan_filter, need to specify environments.* as well)
|
||||
tf_extra_params:
|
||||
@@ -139,57 +148,14 @@ jobs:
|
||||
post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys; yum-config-manager --enable rhel-7-server-rhui-optional-rpms"
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
- SOURCE_RELEASE: "7.9"
|
||||
- TARGET_RELEASE: "8.6"
|
||||
- RHUI: "aws"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_NO_RHSM: "1"
|
||||
- USE_CUSTOM_REPOS: rhui
|
||||
-
|
||||
-- &sanity-79to88-aws
|
||||
- <<: *sanity-79to86-aws
|
||||
- identifier: sanity-7.9to8.8-aws
|
||||
- env:
|
||||
- SOURCE_RELEASE: "7.9"
|
||||
- TARGET_RELEASE: "8.8"
|
||||
- RHUI: "aws"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_NO_RHSM: "1"
|
||||
- USE_CUSTOM_REPOS: rhui
|
||||
-
|
||||
-- &sanity-79to89-aws
|
||||
- <<: *sanity-79to86-aws
|
||||
- identifier: sanity-7.9to8.9-aws
|
||||
- env:
|
||||
- SOURCE_RELEASE: "7.9"
|
||||
- TARGET_RELEASE: "8.9"
|
||||
- RHUI: "aws"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_NO_RHSM: "1"
|
||||
- USE_CUSTOM_REPOS: rhui
|
||||
-
|
||||
-# NOTE(mkluson) RHEL 8.10 content is not publicly available (via RHUI)
|
||||
-#- &sanity-79to810-aws
|
||||
-# <<: *sanity-79to86-aws
|
||||
-# identifier: sanity-7.9to8.10-aws
|
||||
-# env:
|
||||
-# SOURCE_RELEASE: "7.9"
|
||||
-# TARGET_RELEASE: "8.10"
|
||||
-# RHUI: "aws"
|
||||
-# LEAPPDATA_BRANCH: "upstream"
|
||||
-# LEAPP_NO_RHSM: "1"
|
||||
-# USE_CUSTOM_REPOS: rhui
|
||||
|
||||
# On-demand minimal beaker tests
|
||||
-- &beaker-minimal-79to86
|
||||
- <<: *sanity-79to86
|
||||
+- &beaker-minimal-7to8-abstract-ondemand
|
||||
+ <<: *sanity-abstract-7to8
|
||||
manual_trigger: True
|
||||
labels:
|
||||
- beaker-minimal
|
||||
- - beaker-minimal-7.9to8.6
|
||||
- - 7.9to8.6
|
||||
- identifier: sanity-7.9to8.6-beaker-minimal
|
||||
+ identifier: beaker-minimal-7to8-abstract-ondemand
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
@@ -204,13 +170,11 @@ jobs:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
-- &kernel-rt-79to86
|
||||
- <<: *beaker-minimal-79to86
|
||||
+- &kernel-rt-abstract-7to8-ondemand
|
||||
+ <<: *beaker-minimal-7to8-abstract-ondemand
|
||||
labels:
|
||||
- kernel-rt
|
||||
- - kernel-rt-7.9to8.6
|
||||
- - 7.9to8.6
|
||||
- identifier: sanity-7.9to8.6-kernel-rt
|
||||
+ identifier: sanity-7to8-kernel-rt-abstract-ondemand
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
@@ -224,114 +188,133 @@ jobs:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ######################### Individual tests ########################### #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+# Tests: 7.9 -> 8.8
|
||||
+- &sanity-79to88-aws
|
||||
+ <<: *sanity-abstract-7to8-aws
|
||||
+ trigger: pull_request
|
||||
+ identifier: sanity-7.9to8.8-aws
|
||||
+ env:
|
||||
+ SOURCE_RELEASE: "7.9"
|
||||
+ TARGET_RELEASE: "8.8"
|
||||
+ RHUI: "aws"
|
||||
+ LEAPPDATA_BRANCH: "upstream"
|
||||
+ LEAPP_NO_RHSM: "1"
|
||||
+ USE_CUSTOM_REPOS: rhui
|
||||
+
|
||||
- &sanity-79to88
|
||||
- <<: *sanity-79to86
|
||||
+ <<: *sanity-abstract-7to8
|
||||
+ trigger: pull_request
|
||||
identifier: sanity-7.9to8.8
|
||||
env:
|
||||
SOURCE_RELEASE: "7.9"
|
||||
TARGET_RELEASE: "8.8"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-# On-demand minimal beaker tests
|
||||
- &beaker-minimal-79to88
|
||||
- <<: *beaker-minimal-79to86
|
||||
+ <<: *beaker-minimal-7to8-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
labels:
|
||||
- beaker-minimal
|
||||
- beaker-minimal-7.9to8.8
|
||||
- 7.9to8.8
|
||||
- identifier: sanity-7.9to8.8-beaker-minimal
|
||||
+ identifier: sanity-7.9to8.8-beaker-minimal-ondemand
|
||||
env:
|
||||
SOURCE_RELEASE: "7.9"
|
||||
TARGET_RELEASE: "8.8"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-# On-demand kernel-rt tests
|
||||
- &kernel-rt-79to88
|
||||
- <<: *kernel-rt-79to86
|
||||
+ <<: *kernel-rt-abstract-7to8-ondemand
|
||||
+ trigger: pull_request
|
||||
labels:
|
||||
- kernel-rt
|
||||
- kernel-rt-7.9to8.8
|
||||
- 7.9to8.8
|
||||
- identifier: sanity-7.9to8.8-kernel-rt
|
||||
+ identifier: sanity-7.9to8.8-kernel-rt-ondemand
|
||||
env:
|
||||
SOURCE_RELEASE: "7.9"
|
||||
TARGET_RELEASE: "8.8"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-- &sanity-79to89
|
||||
- <<: *sanity-79to86
|
||||
- identifier: sanity-7.9to8.9
|
||||
- env:
|
||||
- SOURCE_RELEASE: "7.9"
|
||||
- TARGET_RELEASE: "8.9"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
-
|
||||
-# On-demand minimal beaker tests
|
||||
-- &beaker-minimal-79to89
|
||||
- <<: *beaker-minimal-79to86
|
||||
- labels:
|
||||
- - beaker-minimal
|
||||
- - beaker-minimal-7.9to8.9
|
||||
- - 7.9to8.9
|
||||
- identifier: sanity-7.9to8.9-beaker-minimal
|
||||
- env:
|
||||
- SOURCE_RELEASE: "7.9"
|
||||
- TARGET_RELEASE: "8.9"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
-
|
||||
-# On-demand kernel-rt tests
|
||||
-- &kernel-rt-79to89
|
||||
- <<: *kernel-rt-79to88
|
||||
- labels:
|
||||
- - kernel-rt
|
||||
- - kernel-rt-7.9to8.9
|
||||
- - 7.9to8.9
|
||||
- identifier: sanity-7.9to8.9-kernel-rt
|
||||
- env:
|
||||
- SOURCE_RELEASE: "7.9"
|
||||
- TARGET_RELEASE: "8.9"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
-
|
||||
+# Tests: 7.9 -> 8.10
|
||||
- &sanity-79to810
|
||||
- <<: *sanity-79to86
|
||||
+ <<: *sanity-abstract-7to8
|
||||
+ trigger: pull_request
|
||||
identifier: sanity-7.9to8.10
|
||||
env:
|
||||
SOURCE_RELEASE: "7.9"
|
||||
TARGET_RELEASE: "8.10"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-# On-demand minimal beaker tests
|
||||
+# NOTE(mkluson) RHEL 8.10 content is not publicly available (via RHUI)
|
||||
+#- &sanity-79to810-aws
|
||||
+# <<: *sanity-abstract-7to8-aws
|
||||
+# trigger: pull_request
|
||||
+# identifier: sanity-7.9to8.10-aws
|
||||
+# env:
|
||||
+# SOURCE_RELEASE: "7.9"
|
||||
+# TARGET_RELEASE: "8.10"
|
||||
+# RHUI: "aws"
|
||||
+# LEAPPDATA_BRANCH: "upstream"
|
||||
+# LEAPP_NO_RHSM: "1"
|
||||
+# USE_CUSTOM_REPOS: rhui
|
||||
+
|
||||
- &beaker-minimal-79to810
|
||||
- <<: *beaker-minimal-79to86
|
||||
+ <<: *beaker-minimal-7to8-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
labels:
|
||||
- beaker-minimal
|
||||
- beaker-minimal-7.9to8.10
|
||||
- 7.9to8.10
|
||||
- identifier: sanity-7.9to8.10-beaker-minimal
|
||||
+ identifier: sanity-7.9to8.10-beaker-minimal-ondemand
|
||||
env:
|
||||
SOURCE_RELEASE: "7.9"
|
||||
TARGET_RELEASE: "8.10"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-# On-demand kernel-rt tests
|
||||
- &kernel-rt-79to810
|
||||
- <<: *kernel-rt-79to88
|
||||
+ <<: *kernel-rt-abstract-7to8-ondemand
|
||||
+ trigger: pull_request
|
||||
labels:
|
||||
- kernel-rt
|
||||
- kernel-rt-7.9to8.10
|
||||
- 7.9to8.10
|
||||
- identifier: sanity-7.9to8.10-kernel-rt
|
||||
+ identifier: sanity-7.9to8.10-kernel-rt-ondemand
|
||||
env:
|
||||
SOURCE_RELEASE: "7.9"
|
||||
TARGET_RELEASE: "8.10"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-- &sanity-86to90
|
||||
- <<: *sanity-79to86
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################## 8 TO 10 ############################### #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ### Abstract job definitions to make individual tests/jobs smaller ### #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+#NOTE(pstodulk) putting default values in abstract jobs as from 8.10, as this
|
||||
+# is the last RHEL 8 release and all new future tests will start from this
|
||||
+# one release.
|
||||
+
|
||||
+- &sanity-abstract-8to9
|
||||
+ job: tests
|
||||
+ trigger: ignore
|
||||
+ fmf_url: "https://gitlab.cee.redhat.com/oamg/leapp-tests"
|
||||
+ fmf_ref: "main"
|
||||
+ use_internal_tf: True
|
||||
+ labels:
|
||||
+ - sanity
|
||||
targets:
|
||||
epel-8-x86_64:
|
||||
- distros: [RHEL-8.6.0-Nightly]
|
||||
- identifier: sanity-8.6to9.0
|
||||
+ distros: [RHEL-8.10.0-Nightly]
|
||||
+ identifier: sanity-abstract-8to9
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
@@ -339,28 +322,44 @@ jobs:
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
- distro: "rhel-8.6"
|
||||
+ distro: "rhel-8.10"
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
- SOURCE_RELEASE: "8.6"
|
||||
- TARGET_RELEASE: "9.0"
|
||||
- RHSM_REPOS_EUS: "eus"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-# On-demand minimal beaker tests
|
||||
-- &beaker-minimal-86to90
|
||||
- <<: *beaker-minimal-79to86
|
||||
+- &sanity-abstract-8to9-aws
|
||||
+ <<: *sanity-abstract-8to9
|
||||
+ labels:
|
||||
+ - sanity
|
||||
+ - aws
|
||||
+ targets:
|
||||
+ epel-8-x86_64:
|
||||
+ distros: [RHEL-8.10-rhui]
|
||||
+ identifier: sanity-abstract-8to9-aws
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:upgrade_happy_path & enabled:true'
|
||||
+ environments:
|
||||
+ - tmt:
|
||||
+ context:
|
||||
+ distro: "rhel-8.10"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+
|
||||
+- &beaker-minimal-8to9-abstract-ondemand
|
||||
+ <<: *sanity-abstract-8to9
|
||||
+ manual_trigger: True
|
||||
labels:
|
||||
- beaker-minimal
|
||||
- - beaker-minimal-8.6to9.0
|
||||
- - 8.6to9.0
|
||||
targets:
|
||||
epel-8-x86_64:
|
||||
- distros: [RHEL-8.6.0-Nightly]
|
||||
- identifier: sanity-8.6to9.0-beaker-minimal
|
||||
+ distros: [RHEL-8.10.0-Nightly]
|
||||
+ identifier: beaker-minimal-8to9-abstract-ondemand
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
@@ -368,25 +367,17 @@ jobs:
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
- distro: "rhel-8.6"
|
||||
+ distro: "rhel-8.10"
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
- SOURCE_RELEASE: "8.6"
|
||||
- TARGET_RELEASE: "9.0"
|
||||
- RHSM_REPOS_EUS: "eus"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
|
||||
-# On-demand kernel-rt tests
|
||||
-- &kernel-rt-86to90
|
||||
- <<: *beaker-minimal-86to90
|
||||
+- &kernel-rt-abstract-8to9-ondemand
|
||||
+ <<: *beaker-minimal-8to9-abstract-ondemand
|
||||
labels:
|
||||
- kernel-rt
|
||||
- - kernel-rt-8.6to9.0
|
||||
- - 8.6to9.0
|
||||
- identifier: sanity-8.6to9.0-kernel-rt
|
||||
+ identifier: sanity-8to9-kernel-rt-abstract-ondemand
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
@@ -394,14 +385,21 @@ jobs:
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
- distro: "rhel-8.6"
|
||||
+ distro: "rhel-8.10"
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ######################### Individual tests ########################### #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+# Tests: 8.8 -> 9.2
|
||||
- &sanity-88to92
|
||||
- <<: *sanity-86to90
|
||||
+ <<: *sanity-abstract-8to9
|
||||
+ trigger: pull_request
|
||||
targets:
|
||||
epel-8-x86_64:
|
||||
distros: [RHEL-8.8.0-Nightly]
|
||||
@@ -425,21 +423,18 @@ jobs:
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
LEAPP_DEVEL_TARGET_RELEASE: "9.2"
|
||||
|
||||
-# On-demand minimal beaker tests
|
||||
-- &beaker-minimal-88to92
|
||||
- <<: *beaker-minimal-86to90
|
||||
- labels:
|
||||
- - beaker-minimal
|
||||
- - beaker-minimal-8.8to9.2
|
||||
- - 8.6to9.2
|
||||
+- &sanity-88to92-aws
|
||||
+ <<: *sanity-abstract-8to9-aws
|
||||
+ trigger: pull_request
|
||||
targets:
|
||||
epel-8-x86_64:
|
||||
- distros: [RHEL-8.8.0-Nightly]
|
||||
- identifier: sanity-8.8to9.2-beaker-minimal
|
||||
+ distros: [RHEL-8.8-rhui]
|
||||
+ identifier: sanity-8.8to9.2-aws
|
||||
+ # NOTE(mkluson) Unfortunately to use yaml templates we need to rewrite the whole tf_extra_params dict
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:partitioning & tag:8to9 & enabled:true'
|
||||
+ plan_filter: 'tag:upgrade_happy_path & enabled:true'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -452,122 +447,77 @@ jobs:
|
||||
env:
|
||||
SOURCE_RELEASE: "8.8"
|
||||
TARGET_RELEASE: "9.2"
|
||||
+ RHSM_REPOS: "rhel-8-for-x86_64-appstream-eus-rpms,rhel-8-for-x86_64-baseos-eus-rpms"
|
||||
+ RHUI: "aws"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_DEVEL_TARGET_RELEASE: "9.2"
|
||||
+ LEAPP_NO_RHSM: "1"
|
||||
+ USE_CUSTOM_REPOS: rhui
|
||||
|
||||
-# On-demand kernel-rt tests
|
||||
-- &kernel-rt-88to92
|
||||
- <<: *beaker-minimal-88to92
|
||||
+- &beaker-minimal-88to92
|
||||
+ <<: *beaker-minimal-8to9-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
labels:
|
||||
- - kernel-rt
|
||||
- - kernel-rt-8.8to9.2
|
||||
+ - beaker-minimal
|
||||
+ - beaker-minimal-8.8to9.2
|
||||
- 8.8to9.2
|
||||
- identifier: sanity-8.8to9.2-kernel-rt
|
||||
- tf_extra_params:
|
||||
- test:
|
||||
- tmt:
|
||||
- plan_filter: 'tag:kernel-rt & tag:8to9 & enabled:true'
|
||||
- environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.8"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
-
|
||||
-- &sanity-89to93
|
||||
- <<: *sanity-88to92
|
||||
targets:
|
||||
epel-8-x86_64:
|
||||
- distros: [RHEL-8.9.0-Nightly]
|
||||
- identifier: sanity-8.9to9.3
|
||||
+ distros: [RHEL-8.8.0-Nightly]
|
||||
+ identifier: sanity-8.8to9.2-beaker-minimal-ondemand
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
|
||||
+ plan_filter: 'tag:partitioning & tag:8to9 & enabled:true'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
- distro: "rhel-8.9"
|
||||
+ distro: "rhel-8.8"
|
||||
settings:
|
||||
provisioning:
|
||||
+ post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.9"
|
||||
- TARGET_RELEASE: "9.3"
|
||||
+ SOURCE_RELEASE: "8.8"
|
||||
+ TARGET_RELEASE: "9.2"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_DEVEL_TARGET_RELEASE: "9.3"
|
||||
+ LEAPP_DEVEL_TARGET_RELEASE: "9.2"
|
||||
|
||||
-# On-demand minimal beaker tests
|
||||
-- &beaker-minimal-89to93
|
||||
- <<: *beaker-minimal-88to92
|
||||
+- &kernel-rt-88to92
|
||||
+ <<: *kernel-rt-abstract-8to9-ondemand
|
||||
+ trigger: pull_request
|
||||
labels:
|
||||
- - beaker-minimal
|
||||
- - beaker-minimal-8.9to9.3
|
||||
- - 8.9to9.3
|
||||
+ - kernel-rt
|
||||
+ - kernel-rt-8.8to9.2
|
||||
+ - 8.8to9.2
|
||||
+ identifier: sanity-8.8to9.2-kernel-rt-ondemand
|
||||
targets:
|
||||
epel-8-x86_64:
|
||||
- distros: [RHEL-8.9.0-Nightly]
|
||||
- identifier: sanity-8.9to9.3-beaker-minimal
|
||||
+ distros: [RHEL-8.8.0-Nightly]
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:partitioning & tag:8to9 & enabled:true'
|
||||
+ plan_filter: 'tag:kernel-rt & tag:8to9 & enabled:true'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
- distro: "rhel-8.9"
|
||||
+ distro: "rhel-8.8"
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.9"
|
||||
- TARGET_RELEASE: "9.3"
|
||||
+ SOURCE_RELEASE: "8.8"
|
||||
+ TARGET_RELEASE: "9.2"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_DEVEL_TARGET_RELEASE: "9.3"
|
||||
+ LEAPP_DEVEL_TARGET_RELEASE: "9.2"
|
||||
|
||||
-# On-demand kernel-rt tests
|
||||
-- &kernel-rt-89to93
|
||||
- <<: *beaker-minimal-89to93
|
||||
- labels:
|
||||
- - kernel-rt
|
||||
- - kernel-rt-8.9to9.3
|
||||
- - 8.9to9.3
|
||||
- identifier: sanity-8.9to9.3-kernel-rt
|
||||
- tf_extra_params:
|
||||
- test:
|
||||
- tmt:
|
||||
- plan_filter: 'tag:kernel-rt & tag:8to9 & enabled:true'
|
||||
- environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.9"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
+# Tests: 8.10 -> 9.4
|
||||
- &sanity-810to94
|
||||
- <<: *sanity-88to92
|
||||
- targets:
|
||||
- epel-8-x86_64:
|
||||
- distros: [RHEL-8.10.0-Nightly]
|
||||
+ <<: *sanity-abstract-8to9
|
||||
+ trigger: pull_request
|
||||
identifier: sanity-8.10to9.4
|
||||
- tf_extra_params:
|
||||
- test:
|
||||
- tmt:
|
||||
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
|
||||
- environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.4"
|
||||
@@ -576,27 +526,13 @@ jobs:
|
||||
|
||||
# On-demand minimal beaker tests
|
||||
- &beaker-minimal-810to94
|
||||
- <<: *beaker-minimal-88to92
|
||||
+ <<: *beaker-minimal-8to9-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
labels:
|
||||
- beaker-minimal
|
||||
- beaker-minimal-8.10to9.4
|
||||
- 8.10to9.4
|
||||
- targets:
|
||||
- epel-8-x86_64:
|
||||
- distros: [RHEL-8.10.0-Nightly]
|
||||
- identifier: sanity-8.10to9.4-beaker-minimal
|
||||
- tf_extra_params:
|
||||
- test:
|
||||
- tmt:
|
||||
- plan_filter: 'tag:partitioning & tag:8to9 & enabled:true'
|
||||
- environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ identifier: sanity-8.10to9.4-beaker-minimal-ondemand
|
||||
env:
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.4"
|
||||
@@ -604,107 +540,15 @@ jobs:
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to94
|
||||
- <<: *beaker-minimal-810to94
|
||||
+ <<: *kernel-rt-abstract-8to9-ondemand
|
||||
+ trigger: pull_request
|
||||
labels:
|
||||
- kernel-rt
|
||||
- kernel-rt-8.10to9.4
|
||||
- 8.10to9.4
|
||||
- identifier: sanity-8.10to9.4-kernel-rt
|
||||
- tf_extra_params:
|
||||
- test:
|
||||
- tmt:
|
||||
- plan_filter: 'tag:kernel-rt & tag:8to9 & enabled:true'
|
||||
- environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
-
|
||||
-- &sanity-86to90-aws
|
||||
- <<: *sanity-79to86-aws
|
||||
- targets:
|
||||
- epel-8-x86_64:
|
||||
- distros: [RHEL-8.6-rhui]
|
||||
- identifier: sanity-8.6to9.0-aws
|
||||
- tf_extra_params:
|
||||
- test:
|
||||
- tmt:
|
||||
- plan_filter: 'tag:upgrade_happy_path & enabled:true'
|
||||
- environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.6"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
- SOURCE_RELEASE: "8.6"
|
||||
- TARGET_RELEASE: "9.0"
|
||||
- RHSM_REPOS: "rhel-8-for-x86_64-appstream-eus-rpms,rhel-8-for-x86_64-baseos-eus-rpms"
|
||||
- RHUI: "aws"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_NO_RHSM: "1"
|
||||
- USE_CUSTOM_REPOS: rhui
|
||||
-
|
||||
-- &sanity-88to92-aws
|
||||
- <<: *sanity-86to90-aws
|
||||
- targets:
|
||||
- epel-8-x86_64:
|
||||
- distros: [RHEL-8.8-rhui]
|
||||
- identifier: sanity-8.8to9.2-aws
|
||||
- # NOTE(mkluson) Unfortunately to use yaml templates we need to rewrite the whole tf_extra_params dict
|
||||
- tf_extra_params:
|
||||
- test:
|
||||
- tmt:
|
||||
- plan_filter: 'tag:upgrade_happy_path & enabled:true'
|
||||
- environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.8"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ identifier: sanity-8.10to9.4-kernel-rt-ondemand
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.8"
|
||||
- TARGET_RELEASE: "9.2"
|
||||
- RHSM_REPOS: "rhel-8-for-x86_64-appstream-eus-rpms,rhel-8-for-x86_64-baseos-eus-rpms"
|
||||
- RHUI: "aws"
|
||||
- LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_NO_RHSM: "1"
|
||||
- USE_CUSTOM_REPOS: rhui
|
||||
-
|
||||
-- &sanity-89to93-aws
|
||||
- <<: *sanity-86to90-aws
|
||||
- targets:
|
||||
- epel-8-x86_64:
|
||||
- distros: [RHEL-8.9-rhui]
|
||||
- identifier: sanity-8.9to9.3-aws
|
||||
- # NOTE(mkluson) Unfortunately to use yaml templates we need to rewrite the whole tf_extra_params dict
|
||||
- tf_extra_params:
|
||||
- test:
|
||||
- tmt:
|
||||
- plan_filter: 'tag:upgrade_happy_path & enabled:true'
|
||||
- environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.9"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
- SOURCE_RELEASE: "8.9"
|
||||
- TARGET_RELEASE: "9.3"
|
||||
- RHSM_REPOS: "rhel-8-for-x86_64-appstream-rpms,rhel-8-for-x86_64-baseos-rpms"
|
||||
- RHUI: "aws"
|
||||
+ SOURCE_RELEASE: "8.10"
|
||||
+ TARGET_RELEASE: "9.4"
|
||||
+ RHSM_REPOS: "rhel-8-for-x86_64-appstream-beta-rpms,rhel-8-for-x86_64-baseos-beta-rpms"
|
||||
LEAPPDATA_BRANCH: "upstream"
|
||||
- LEAPP_NO_RHSM: "1"
|
||||
- USE_CUSTOM_REPOS: rhui
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From db8a0cf5c66ced0ed49990a40a45a08373b34af5 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Fri, 1 Mar 2024 20:30:04 +0100
|
||||
Subject: [PATCH 03/34] silence use-yield-from from pylint 3.1
|
||||
|
||||
yield from cannot be used until we require python3.3 or greater
|
||||
---
|
||||
.pylintrc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 57259bcb..f78c1c3f 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -57,6 +57,7 @@ disable=
|
||||
redundant-u-string-prefix, # still have py2 to support
|
||||
logging-format-interpolation,
|
||||
logging-not-lazy,
|
||||
+ use-yield-from, # yield from cannot be used until we require python 3.3 or greater
|
||||
too-many-lines # we do not want to take care about that one
|
||||
|
||||
[FORMAT]
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
From 214ed9b57c5e291cda5ff6baf7c7a790038fef34 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 11 Mar 2024 18:30:23 +0100
|
||||
Subject: [PATCH 04/34] rocescanner: Actually call process() in
|
||||
test_roce_notibmz test
|
||||
|
||||
---
|
||||
.../el8toel9/actors/rocescanner/tests/unit_test_rocescanner.py | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/rocescanner/tests/unit_test_rocescanner.py b/repos/system_upgrade/el8toel9/actors/rocescanner/tests/unit_test_rocescanner.py
|
||||
index a4889328..ee9e4498 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/rocescanner/tests/unit_test_rocescanner.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/rocescanner/tests/unit_test_rocescanner.py
|
||||
@@ -151,4 +151,5 @@ def test_roce_noibmz(monkeypatch, arch):
|
||||
monkeypatch.setattr(rocescanner.api, 'current_actor', CurrentActorMocked(arch=arch))
|
||||
monkeypatch.setattr(rocescanner.api.current_actor(), 'produce', mocked_produce)
|
||||
monkeypatch.setattr(rocescanner, 'get_roce_nics_lines', lambda: mocked_roce_lines)
|
||||
+ rocescanner.process()
|
||||
assert not mocked_produce.called
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,624 +0,0 @@
|
||||
From 050620eabe52a2184b40a7ac2818d927516d8b6d Mon Sep 17 00:00:00 2001
|
||||
From: David Kubek <dkubek@redhat.com>
|
||||
Date: Tue, 20 Feb 2024 20:54:16 +0100
|
||||
Subject: [PATCH 05/34] Fix incorrect parsing of `lscpu` output
|
||||
|
||||
Original solution expected always ``key: val`` pair on each line.
|
||||
However, it has not been expected that val could be actually empty
|
||||
string, which would lead to situation where the following line is
|
||||
interpreted as a value.
|
||||
|
||||
The new solution updates the parsing for output on RHEL 7, but also
|
||||
calls newly ``lscpu -J`` on RHEL 8+ to obtain data in the JSON format,
|
||||
which drops all possible parsing problems from our side.
|
||||
|
||||
Fixes #1182
|
||||
---
|
||||
.github/workflows/codespell.yml | 2 +-
|
||||
.../actors/scancpu/libraries/scancpu.py | 39 +++++----
|
||||
.../actors/scancpu/tests/files/json/invalid | 2 +
|
||||
.../scancpu/tests/files/json/lscpu_aarch64 | 29 +++++++
|
||||
.../scancpu/tests/files/json/lscpu_ppc64le | 19 +++++
|
||||
.../scancpu/tests/files/json/lscpu_s390x | 30 +++++++
|
||||
.../scancpu/tests/files/json/lscpu_x86_64 | 31 +++++++
|
||||
.../actors/scancpu/tests/files/lscpu_aarch64 | 26 ------
|
||||
.../actors/scancpu/tests/files/lscpu_ppc64le | 24 ------
|
||||
.../actors/scancpu/tests/files/lscpu_s390x | 38 ---------
|
||||
.../scancpu/tests/files/txt/lscpu_aarch64 | 25 ++++++
|
||||
.../scancpu/tests/files/txt/lscpu_empty_field | 4 +
|
||||
.../scancpu/tests/files/txt/lscpu_ppc64le | 15 ++++
|
||||
.../scancpu/tests/files/txt/lscpu_s390x | 26 ++++++
|
||||
.../tests/files/{ => txt}/lscpu_x86_64 | 0
|
||||
.../actors/scancpu/tests/test_scancpu.py | 82 ++++++++++++++++---
|
||||
16 files changed, 279 insertions(+), 113 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
create mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{ => txt}/lscpu_x86_64 (100%)
|
||||
|
||||
diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml
|
||||
index 24add3fb..4921bc90 100644
|
||||
--- a/.github/workflows/codespell.yml
|
||||
+++ b/.github/workflows/codespell.yml
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
./repos/system_upgrade/el8toel9/actors/xorgdrvfact/tests/files/journalctl-xorg-intel,\
|
||||
./repos/system_upgrade/el8toel9/actors/xorgdrvfact/tests/files/journalctl-xorg-qxl,\
|
||||
./repos/system_upgrade/el8toel9/actors/xorgdrvfact/tests/files/journalctl-xorg-without-qxl,\
|
||||
- ./repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x,\
|
||||
+ ./repos/system_upgrade/common/actors/scancpu/tests/files,\
|
||||
./etc/leapp/files/device_driver_deprecation_data.json,\
|
||||
./etc/leapp/files/pes-events.json,\
|
||||
./etc/leapp/files/repomap.json,\
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
index 9de50fae..7451066a 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
@@ -1,22 +1,41 @@
|
||||
+import json
|
||||
import re
|
||||
|
||||
from leapp.libraries.common.config import architecture
|
||||
+from leapp.libraries.common.config.version import get_source_major_version
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import CPUInfo, DetectedDeviceOrDriver, DeviceDriverDeprecationData
|
||||
|
||||
-LSCPU_NAME_VALUE = re.compile(r'(?P<name>[^:]+):\s+(?P<value>.+)\n?')
|
||||
+LSCPU_NAME_VALUE = re.compile(r'^(?P<name>[^:]+):[^\S\n]+(?P<value>.+)\n?', flags=re.MULTILINE)
|
||||
PPC64LE_MODEL = re.compile(r'\d+\.\d+ \(pvr (?P<family>[0-9a-fA-F]+) 0*[0-9a-fA-F]+\)')
|
||||
|
||||
|
||||
-def _get_lscpu_output():
|
||||
+def _get_lscpu_output(output_json=False):
|
||||
try:
|
||||
- result = run(['lscpu'])
|
||||
+ result = run(['lscpu', '-J' if output_json else ''])
|
||||
return result.get('stdout', '')
|
||||
except (OSError, CalledProcessError):
|
||||
api.current_logger().debug('Executing `lscpu` failed', exc_info=True)
|
||||
return ''
|
||||
|
||||
|
||||
+def _parse_lscpu_output():
|
||||
+ if get_source_major_version() == '7':
|
||||
+ return dict(LSCPU_NAME_VALUE.findall(_get_lscpu_output()))
|
||||
+
|
||||
+ lscpu = _get_lscpu_output(output_json=True)
|
||||
+ try:
|
||||
+ parsed_json = json.loads(lscpu)
|
||||
+ # The json contains one entry "lscpu" which is a list of dictionaries
|
||||
+ # with 2 keys "field" (name of the field from lscpu) and "data" (value
|
||||
+ # of the field).
|
||||
+ return dict((entry['field'].rstrip(':'), entry['data']) for entry in parsed_json['lscpu'])
|
||||
+ except ValueError:
|
||||
+ api.current_logger().debug('Failed to parse json output from `lscpu`. Got:\n{}'.format(lscpu))
|
||||
+
|
||||
+ return dict()
|
||||
+
|
||||
+
|
||||
def _get_cpu_flags(lscpu):
|
||||
flags = lscpu.get('Flags', '')
|
||||
return flags.split()
|
||||
@@ -128,24 +147,16 @@ def _find_deprecation_data_entries(lscpu):
|
||||
arch_prefix, is_detected = architecture.ARCH_ARM64, _is_detected_aarch64
|
||||
|
||||
if arch_prefix and is_detected:
|
||||
- return [
|
||||
- _to_detected_device(entry) for entry in _get_cpu_entries_for(arch_prefix)
|
||||
- if is_detected(lscpu, entry)
|
||||
- ]
|
||||
+ return [_to_detected_device(entry) for entry in _get_cpu_entries_for(arch_prefix) if is_detected(lscpu, entry)]
|
||||
|
||||
api.current_logger().warning('Unsupported platform could not detect relevant CPU information')
|
||||
return []
|
||||
|
||||
|
||||
def process():
|
||||
- lscpu = dict(LSCPU_NAME_VALUE.findall(_get_lscpu_output()))
|
||||
+ lscpu = _parse_lscpu_output()
|
||||
api.produce(*_find_deprecation_data_entries(lscpu))
|
||||
# Backwards compatibility
|
||||
machine_type = lscpu.get('Machine type')
|
||||
flags = _get_cpu_flags(lscpu)
|
||||
- api.produce(
|
||||
- CPUInfo(
|
||||
- machine_type=int(machine_type) if machine_type else None,
|
||||
- flags=flags
|
||||
- )
|
||||
- )
|
||||
+ api.produce(CPUInfo(machine_type=int(machine_type) if machine_type else None, flags=flags))
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid b/repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid
|
||||
new file mode 100644
|
||||
index 00000000..422c2b7a
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid
|
||||
@@ -0,0 +1,2 @@
|
||||
+a
|
||||
+b
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64
|
||||
new file mode 100644
|
||||
index 00000000..79186695
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64
|
||||
@@ -0,0 +1,29 @@
|
||||
+{
|
||||
+ "lscpu": [
|
||||
+ {"field": "Architecture:", "data": "aarch64"},
|
||||
+ {"field": "Byte Order:", "data": "Little Endian"},
|
||||
+ {"field": "CPU(s):", "data": "160"},
|
||||
+ {"field": "On-line CPU(s) list:", "data": "0-159"},
|
||||
+ {"field": "Thread(s) per core:", "data": "1"},
|
||||
+ {"field": "Core(s) per socket:", "data": "80"},
|
||||
+ {"field": "Socket(s):", "data": "2"},
|
||||
+ {"field": "NUMA node(s):", "data": "4"},
|
||||
+ {"field": "Vendor ID:", "data": "ARM"},
|
||||
+ {"field": "BIOS Vendor ID:", "data": "Ampere(R)"},
|
||||
+ {"field": "Model:", "data": "1"},
|
||||
+ {"field": "Model name:", "data": "Neoverse-N1"},
|
||||
+ {"field": "BIOS Model name:", "data": "Ampere(R) Altra(R) Processor"},
|
||||
+ {"field": "Stepping:", "data": "r3p1"},
|
||||
+ {"field": "CPU max MHz:", "data": "3000.0000"},
|
||||
+ {"field": "CPU min MHz:", "data": "1000.0000"},
|
||||
+ {"field": "BogoMIPS:", "data": "50.00"},
|
||||
+ {"field": "L1d cache:", "data": "64K"},
|
||||
+ {"field": "L1i cache:", "data": "64K"},
|
||||
+ {"field": "L2 cache:", "data": "1024K"},
|
||||
+ {"field": "NUMA node0 CPU(s):", "data": "0-79"},
|
||||
+ {"field": "NUMA node1 CPU(s):", "data": "80-159"},
|
||||
+ {"field": "NUMA node2 CPU(s):", "data": null},
|
||||
+ {"field": "NUMA node3 CPU(s):", "data": null},
|
||||
+ {"field": "Flags:", "data": "fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs"}
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le
|
||||
new file mode 100644
|
||||
index 00000000..cc51c4ac
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le
|
||||
@@ -0,0 +1,19 @@
|
||||
+{
|
||||
+ "lscpu": [
|
||||
+ {"field": "Architecture:", "data": "ppc64le"},
|
||||
+ {"field": "Byte Order:", "data": "Little Endian"},
|
||||
+ {"field": "CPU(s):", "data": "8"},
|
||||
+ {"field": "On-line CPU(s) list:", "data": "0-7"},
|
||||
+ {"field": "Thread(s) per core:", "data": "1"},
|
||||
+ {"field": "Core(s) per socket:", "data": "1"},
|
||||
+ {"field": "Socket(s):", "data": "8"},
|
||||
+ {"field": "NUMA node(s):", "data": "1"},
|
||||
+ {"field": "Model:", "data": "2.1 (pvr 004b 0201)"},
|
||||
+ {"field": "Model name:", "data": "POWER8E (raw), altivec supported"},
|
||||
+ {"field": "Hypervisor vendor:", "data": "KVM"},
|
||||
+ {"field": "Virtualization type:", "data": "para"},
|
||||
+ {"field": "L1d cache:", "data": "64K"},
|
||||
+ {"field": "L1i cache:", "data": "32K"},
|
||||
+ {"field": "NUMA node0 CPU(s):", "data": "0-7"}
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x
|
||||
new file mode 100644
|
||||
index 00000000..950da2de
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x
|
||||
@@ -0,0 +1,30 @@
|
||||
+{
|
||||
+ "lscpu": [
|
||||
+ {"field": "Architecture:", "data": "s390x"},
|
||||
+ {"field": "CPU op-mode(s):", "data": "32-bit, 64-bit"},
|
||||
+ {"field": "Byte Order:", "data": "Big Endian"},
|
||||
+ {"field": "CPU(s):", "data": "4"},
|
||||
+ {"field": "On-line CPU(s) list:", "data": "0-3"},
|
||||
+ {"field": "Thread(s) per core:", "data": "1"},
|
||||
+ {"field": "Core(s) per socket:", "data": "1"},
|
||||
+ {"field": "Socket(s) per book:", "data": "1"},
|
||||
+ {"field": "Book(s) per drawer:", "data": "1"},
|
||||
+ {"field": "Drawer(s):", "data": "4"},
|
||||
+ {"field": "NUMA node(s):", "data": "1"},
|
||||
+ {"field": "Vendor ID:", "data": "IBM/S390"},
|
||||
+ {"field": "Machine type:", "data": "3931"},
|
||||
+ {"field": "CPU dynamic MHz:", "data": "5200"},
|
||||
+ {"field": "CPU static MHz:", "data": "5200"},
|
||||
+ {"field": "BogoMIPS:", "data": "3331.00"},
|
||||
+ {"field": "Hypervisor:", "data": "KVM/Linux"},
|
||||
+ {"field": "Hypervisor vendor:", "data": "KVM"},
|
||||
+ {"field": "Virtualization type:", "data": "full"},
|
||||
+ {"field": "Dispatching mode:", "data": "horizontal"},
|
||||
+ {"field": "L1d cache:", "data": "128K"},
|
||||
+ {"field": "L1i cache:", "data": "128K"},
|
||||
+ {"field": "L2 cache:", "data": "32768K"},
|
||||
+ {"field": "L3 cache:", "data": "262144K"},
|
||||
+ {"field": "NUMA node0 CPU(s):", "data": "0-3"},
|
||||
+ {"field": "Flags:", "data": "esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt vxp2 nnpa sie"}
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64 b/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64
|
||||
new file mode 100644
|
||||
index 00000000..da75a3fa
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64
|
||||
@@ -0,0 +1,31 @@
|
||||
+{
|
||||
+ "lscpu": [
|
||||
+ {"field": "Architecture:", "data": "x86_64"},
|
||||
+ {"field": "CPU op-mode(s):", "data": "32-bit, 64-bit"},
|
||||
+ {"field": "Byte Order:", "data": "Little Endian"},
|
||||
+ {"field": "CPU(s):", "data": "2"},
|
||||
+ {"field": "On-line CPU(s) list:", "data": "0,1"},
|
||||
+ {"field": "Thread(s) per core:", "data": "1"},
|
||||
+ {"field": "Core(s) per socket:", "data": "1"},
|
||||
+ {"field": "Socket(s):", "data": "2"},
|
||||
+ {"field": "NUMA node(s):", "data": "1"},
|
||||
+ {"field": "Vendor ID:", "data": "GenuineIntel"},
|
||||
+ {"field": "BIOS Vendor ID:", "data": "QEMU"},
|
||||
+ {"field": "CPU family:", "data": "6"},
|
||||
+ {"field": "Model:", "data": "165"},
|
||||
+ {"field": "Model name:", "data": "Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz"},
|
||||
+ {"field": "BIOS Model name:", "data": "pc-i440fx-7.2"},
|
||||
+ {"field": "Stepping:", "data": "2"},
|
||||
+ {"field": "CPU MHz:", "data": "2712.006"},
|
||||
+ {"field": "BogoMIPS:", "data": "5424.01"},
|
||||
+ {"field": "Virtualization:", "data": "VT-x"},
|
||||
+ {"field": "Hypervisor vendor:", "data": "KVM"},
|
||||
+ {"field": "Virtualization type:", "data": "full"},
|
||||
+ {"field": "L1d cache:", "data": "32K"},
|
||||
+ {"field": "L1i cache:", "data": "32K"},
|
||||
+ {"field": "L2 cache:", "data": "4096K"},
|
||||
+ {"field": "L3 cache:", "data": "16384K"},
|
||||
+ {"field": "NUMA node0 CPU(s):", "data": "0,1"},
|
||||
+ {"field": "Flags:", "data": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d"}
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
deleted file mode 100644
|
||||
index 5b6c3470..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
+++ /dev/null
|
||||
@@ -1,26 +0,0 @@
|
||||
-Architecture: aarch64
|
||||
-CPU op-mode(s): 32-bit, 64-bit
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 5
|
||||
-On-line CPU(s) list: 0-4
|
||||
-Vendor ID: APM
|
||||
-Model name: -
|
||||
-Model: 2
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per cluster: 5
|
||||
-Socket(s): -
|
||||
-Cluster(s): 1
|
||||
-Stepping: 0x3
|
||||
-BogoMIPS: 80.00
|
||||
-Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
|
||||
-NUMA node(s): 1
|
||||
-NUMA node0 CPU(s): 0-4
|
||||
-Vulnerability Itlb multihit: Not affected
|
||||
-Vulnerability L1tf: Not affected
|
||||
-Vulnerability Mds: Not affected
|
||||
-Vulnerability Meltdown: Mitigation; PTI
|
||||
-Vulnerability Spec store bypass: Vulnerable
|
||||
-Vulnerability Spectre v1: Mitigation; __user pointer sanitization
|
||||
-Vulnerability Spectre v2: Vulnerable
|
||||
-Vulnerability Srbds: Not affected
|
||||
-Vulnerability Tsx async abort: Not affected
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
deleted file mode 100644
|
||||
index 259dd19d..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
+++ /dev/null
|
||||
@@ -1,24 +0,0 @@
|
||||
-Architecture: ppc64le
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 8
|
||||
-On-line CPU(s) list: 0-7
|
||||
-Model name: POWER9 (architected), altivec supported
|
||||
-Model: 2.2 (pvr 004e 1202)
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 1
|
||||
-Socket(s): 8
|
||||
-Hypervisor vendor: KVM
|
||||
-Virtualization type: para
|
||||
-L1d cache: 256 KiB (8 instances)
|
||||
-L1i cache: 256 KiB (8 instances)
|
||||
-NUMA node(s): 1
|
||||
-NUMA node0 CPU(s): 0-7
|
||||
-Vulnerability Itlb multihit: Not affected
|
||||
-Vulnerability L1tf: Mitigation; RFI Flush, L1D private per thread
|
||||
-Vulnerability Mds: Not affected
|
||||
-Vulnerability Meltdown: Mitigation; RFI Flush, L1D private per thread
|
||||
-Vulnerability Spec store bypass: Mitigation; Kernel entry/exit barrier (eieio)
|
||||
-Vulnerability Spectre v1: Mitigation; __user pointer sanitization, ori31 speculation barrier enabled
|
||||
-Vulnerability Spectre v2: Mitigation; Software count cache flush (hardware accelerated), Software link stack flush
|
||||
-Vulnerability Srbds: Not affected
|
||||
-Vulnerability Tsx async abort: Not affected
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
deleted file mode 100644
|
||||
index 3c0a0ac3..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
+++ /dev/null
|
||||
@@ -1,38 +0,0 @@
|
||||
-Architecture: s390x
|
||||
-CPU op-mode(s): 32-bit, 64-bit
|
||||
-Byte Order: Big Endian
|
||||
-CPU(s): 2
|
||||
-On-line CPU(s) list: 0,1
|
||||
-Vendor ID: IBM/S390
|
||||
-Model name: -
|
||||
-Machine type: 2827
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 1
|
||||
-Socket(s) per book: 1
|
||||
-Book(s) per drawer: 1
|
||||
-Drawer(s): 2
|
||||
-CPU dynamic MHz: 5200
|
||||
-CPU static MHz: 5200
|
||||
-BogoMIPS: 3241.00
|
||||
-Dispatching mode: horizontal
|
||||
-Flags: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt sie
|
||||
-Hypervisor: z/VM 7.2.0
|
||||
-Hypervisor vendor: IBM
|
||||
-Virtualization type: full
|
||||
-L1d cache: 256 KiB (2 instances)
|
||||
-L1i cache: 256 KiB (2 instances)
|
||||
-L2d cache: 8 MiB (2 instances)
|
||||
-L2i cache: 8 MiB (2 instances)
|
||||
-L3 cache: 256 MiB
|
||||
-L4 cache: 960 MiB
|
||||
-NUMA node(s): 1
|
||||
-NUMA node0 CPU(s): 0,1
|
||||
-Vulnerability Itlb multihit: Not affected
|
||||
-Vulnerability L1tf: Not affected
|
||||
-Vulnerability Mds: Not affected
|
||||
-Vulnerability Meltdown: Not affected
|
||||
-Vulnerability Spec store bypass: Not affected
|
||||
-Vulnerability Spectre v1: Mitigation; __user pointer sanitization
|
||||
-Vulnerability Spectre v2: Mitigation; etokens
|
||||
-Vulnerability Srbds: Not affected
|
||||
-Vulnerability Tsx async abort: Not affected
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
new file mode 100644
|
||||
index 00000000..3b9619ef
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
@@ -0,0 +1,25 @@
|
||||
+Architecture: aarch64
|
||||
+Byte Order: Little Endian
|
||||
+CPU(s): 160
|
||||
+On-line CPU(s) list: 0-159
|
||||
+Thread(s) per core: 1
|
||||
+Core(s) per socket: 80
|
||||
+Socket(s): 2
|
||||
+NUMA node(s): 4
|
||||
+Vendor ID: ARM
|
||||
+BIOS Vendor ID: Ampere(R)
|
||||
+Model: 1
|
||||
+Model name: Neoverse-N1
|
||||
+BIOS Model name: Ampere(R) Altra(R) Processor
|
||||
+Stepping: r3p1
|
||||
+CPU max MHz: 3000.0000
|
||||
+CPU min MHz: 1000.0000
|
||||
+BogoMIPS: 50.00
|
||||
+L1d cache: 64K
|
||||
+L1i cache: 64K
|
||||
+L2 cache: 1024K
|
||||
+NUMA node0 CPU(s): 0-79
|
||||
+NUMA node1 CPU(s): 80-159
|
||||
+NUMA node2 CPU(s):
|
||||
+NUMA node3 CPU(s):
|
||||
+Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
new file mode 100644
|
||||
index 00000000..f830b7fe
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
@@ -0,0 +1,4 @@
|
||||
+Empyt 1:
|
||||
+Empyt 2:
|
||||
+Empyt 3:
|
||||
+Flags: flag
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
new file mode 100644
|
||||
index 00000000..07d2ed65
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
@@ -0,0 +1,15 @@
|
||||
+Architecture: ppc64le
|
||||
+Byte Order: Little Endian
|
||||
+CPU(s): 8
|
||||
+On-line CPU(s) list: 0-7
|
||||
+Thread(s) per core: 1
|
||||
+Core(s) per socket: 1
|
||||
+Socket(s): 8
|
||||
+NUMA node(s): 1
|
||||
+Model: 2.1 (pvr 004b 0201)
|
||||
+Model name: POWER8E (raw), altivec supported
|
||||
+Hypervisor vendor: KVM
|
||||
+Virtualization type: para
|
||||
+L1d cache: 64K
|
||||
+L1i cache: 32K
|
||||
+NUMA node0 CPU(s): 0-7
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
new file mode 100644
|
||||
index 00000000..2c0de9f9
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
@@ -0,0 +1,26 @@
|
||||
+Architecture: s390x
|
||||
+CPU op-mode(s): 32-bit, 64-bit
|
||||
+Byte Order: Big Endian
|
||||
+CPU(s): 4
|
||||
+On-line CPU(s) list: 0-3
|
||||
+Thread(s) per core: 1
|
||||
+Core(s) per socket: 1
|
||||
+Socket(s) per book: 1
|
||||
+Book(s) per drawer: 1
|
||||
+Drawer(s): 4
|
||||
+NUMA node(s): 1
|
||||
+Vendor ID: IBM/S390
|
||||
+Machine type: 3931
|
||||
+CPU dynamic MHz: 5200
|
||||
+CPU static MHz: 5200
|
||||
+BogoMIPS: 3331.00
|
||||
+Hypervisor: KVM/Linux
|
||||
+Hypervisor vendor: KVM
|
||||
+Virtualization type: full
|
||||
+Dispatching mode: horizontal
|
||||
+L1d cache: 128K
|
||||
+L1i cache: 128K
|
||||
+L2 cache: 32768K
|
||||
+L3 cache: 262144K
|
||||
+NUMA node0 CPU(s): 0-3
|
||||
+Flags: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt vxp2 nnpa sie
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_x86_64 b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_x86_64
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
index 894fae08..dc9d1ffc 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
@@ -3,7 +3,6 @@ import os
|
||||
import pytest
|
||||
|
||||
from leapp.libraries.actor import scancpu
|
||||
-from leapp.libraries.common import testutils
|
||||
from leapp.libraries.common.config.architecture import (
|
||||
ARCH_ARM64,
|
||||
ARCH_PPC64LE,
|
||||
@@ -11,6 +10,7 @@ from leapp.libraries.common.config.architecture import (
|
||||
ARCH_SUPPORTED,
|
||||
ARCH_X86_64
|
||||
)
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import CPUInfo
|
||||
|
||||
@@ -18,8 +18,12 @@ CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
LSCPU = {
|
||||
ARCH_ARM64: {
|
||||
- "machine_type": None,
|
||||
- "flags": ['fp', 'asimd', 'evtstrm', 'aes', 'pmull', 'sha1', 'sha2', 'crc32', 'cpuid'],
|
||||
+ "machine_type":
|
||||
+ None,
|
||||
+ "flags": [
|
||||
+ 'fp', 'asimd', 'evtstrm', 'aes', 'pmull', 'sha1', 'sha2', 'crc32', 'atomics', 'fphp', 'asimdhp', 'cpuid',
|
||||
+ 'asimdrdm', 'lrcpc', 'dcpop', 'asimddp', 'ssbs'
|
||||
+ ]
|
||||
},
|
||||
ARCH_PPC64LE: {
|
||||
"machine_type": None,
|
||||
@@ -27,10 +31,10 @@ LSCPU = {
|
||||
},
|
||||
ARCH_S390X: {
|
||||
"machine_type":
|
||||
- 2827,
|
||||
+ 3931,
|
||||
"flags": [
|
||||
'esan3', 'zarch', 'stfle', 'msa', 'ldisp', 'eimm', 'dfp', 'edat', 'etf3eh', 'highgprs', 'te', 'vx', 'vxd',
|
||||
- 'vxe', 'gs', 'vxe2', 'vxp', 'sort', 'dflt', 'sie'
|
||||
+ 'vxe', 'gs', 'vxe2', 'vxp', 'sort', 'dflt', 'vxp2', 'nnpa', 'sie'
|
||||
]
|
||||
},
|
||||
ARCH_X86_64: {
|
||||
@@ -57,23 +61,34 @@ class mocked_get_cpuinfo(object):
|
||||
def __init__(self, filename):
|
||||
self.filename = filename
|
||||
|
||||
- def __call__(self):
|
||||
+ def __call__(self, output_json=False):
|
||||
"""
|
||||
Return lines of the self.filename test file located in the files directory.
|
||||
|
||||
Those files contain /proc/cpuinfo content from several machines.
|
||||
"""
|
||||
- with open(os.path.join(CUR_DIR, 'files', self.filename), 'r') as fp:
|
||||
+
|
||||
+ filename = self.filename
|
||||
+ if output_json:
|
||||
+ filename = os.path.join('json', filename)
|
||||
+ else:
|
||||
+ filename = os.path.join('txt', filename)
|
||||
+ filename = os.path.join(CUR_DIR, 'files', filename)
|
||||
+
|
||||
+ with open(filename, 'r') as fp:
|
||||
return '\n'.join(fp.read().splitlines())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("arch", ARCH_SUPPORTED)
|
||||
-def test_scancpu(monkeypatch, arch):
|
||||
+@pytest.mark.parametrize("version", ['7', '8'])
|
||||
+def test_scancpu(monkeypatch, arch, version):
|
||||
+
|
||||
+ monkeypatch.setattr('leapp.libraries.actor.scancpu.get_source_major_version', lambda: version)
|
||||
|
||||
mocked_cpuinfo = mocked_get_cpuinfo('lscpu_' + arch)
|
||||
monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
- monkeypatch.setattr(api, 'produce', testutils.produce_mocked())
|
||||
- current_actor = testutils.CurrentActorMocked(arch=arch)
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+ current_actor = CurrentActorMocked(arch=arch)
|
||||
monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
|
||||
scancpu.process()
|
||||
@@ -89,3 +104,50 @@ def test_scancpu(monkeypatch, arch):
|
||||
|
||||
# Did not produce anything extra
|
||||
assert expected == produced
|
||||
+
|
||||
+
|
||||
+def test_lscpu_with_empty_field(monkeypatch):
|
||||
+
|
||||
+ def mocked_cpuinfo(*args, **kwargs):
|
||||
+ return mocked_get_cpuinfo('lscpu_empty_field')(output_json=False)
|
||||
+
|
||||
+ monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+ current_actor = CurrentActorMocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
+
|
||||
+ scancpu.process()
|
||||
+
|
||||
+ expected = CPUInfo(machine_type=None, flags=['flag'])
|
||||
+ produced = api.produce.model_instances[0]
|
||||
+
|
||||
+ assert api.produce.called == 1
|
||||
+
|
||||
+ assert expected.machine_type == produced.machine_type
|
||||
+ assert sorted(expected.flags) == sorted(produced.flags)
|
||||
+
|
||||
+
|
||||
+def test_parse_invalid_json(monkeypatch):
|
||||
+
|
||||
+ monkeypatch.setattr('leapp.libraries.actor.scancpu.get_source_major_version', lambda: '8')
|
||||
+
|
||||
+ def mocked_cpuinfo(*args, **kwargs):
|
||||
+ return mocked_get_cpuinfo('invalid')(output_json=True)
|
||||
+
|
||||
+ monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+ current_actor = CurrentActorMocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
+
|
||||
+ scancpu.process()
|
||||
+
|
||||
+ assert api.produce.called == 1
|
||||
+
|
||||
+ assert any('Failed to parse json output' in msg for msg in api.current_logger().dbgmsg)
|
||||
+
|
||||
+ expected = CPUInfo(machine_type=None, flags=[])
|
||||
+ produced = api.produce.model_instances[0]
|
||||
+
|
||||
+ assert expected.machine_type == produced.machine_type
|
||||
+ assert sorted(expected.flags) == sorted(produced.flags)
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,254 +0,0 @@
|
||||
From b65ef94be64f16eacb79a55d1185e37aa401832e Mon Sep 17 00:00:00 2001
|
||||
From: tomasfratrik <tomasfratrik8@gmail.com>
|
||||
Date: Mon, 4 Mar 2024 09:10:02 +0100
|
||||
Subject: [PATCH 06/34] Add unit tests for actor udevamdinfo
|
||||
|
||||
* Move actor's process to its library
|
||||
* Add check for run in process
|
||||
* Create file with short output of 'udevamd info -e' for testing
|
||||
purposes
|
||||
* Add unit tests for actor
|
||||
|
||||
Jira: OAMG-1277
|
||||
---
|
||||
.../common/actors/udev/udevadminfo/actor.py | 5 +-
|
||||
.../udev/udevadminfo/libraries/udevadminfo.py | 19 +++
|
||||
.../udevadminfo/tests/files/udevadm_database | 134 ++++++++++++++++++
|
||||
.../udevadminfo/tests/test_udevadminfo.py | 40 ++++++
|
||||
4 files changed, 195 insertions(+), 3 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/udev/udevadminfo/libraries/udevadminfo.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/udev/udevadminfo/tests/files/udevadm_database
|
||||
create mode 100644 repos/system_upgrade/common/actors/udev/udevadminfo/tests/test_udevadminfo.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/udev/udevadminfo/actor.py b/repos/system_upgrade/common/actors/udev/udevadminfo/actor.py
|
||||
index b674e56c..ac702914 100644
|
||||
--- a/repos/system_upgrade/common/actors/udev/udevadminfo/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/udev/udevadminfo/actor.py
|
||||
@@ -1,5 +1,5 @@
|
||||
from leapp.actors import Actor
|
||||
-from leapp.libraries.stdlib import run
|
||||
+from leapp.libraries.actor import udevadminfo
|
||||
from leapp.models import UdevAdmInfoData
|
||||
from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
|
||||
@@ -15,5 +15,4 @@ class UdevAdmInfo(Actor):
|
||||
tags = (IPUWorkflowTag, FactsPhaseTag,)
|
||||
|
||||
def process(self):
|
||||
- out = run(['udevadm', 'info', '-e'])['stdout']
|
||||
- self.produce(UdevAdmInfoData(db=out))
|
||||
+ udevadminfo.process()
|
||||
diff --git a/repos/system_upgrade/common/actors/udev/udevadminfo/libraries/udevadminfo.py b/repos/system_upgrade/common/actors/udev/udevadminfo/libraries/udevadminfo.py
|
||||
new file mode 100644
|
||||
index 00000000..dabe49e0
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/udev/udevadminfo/libraries/udevadminfo.py
|
||||
@@ -0,0 +1,19 @@
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
+from leapp.models import UdevAdmInfoData
|
||||
+
|
||||
+
|
||||
+def process():
|
||||
+ try:
|
||||
+ out = run(['udevadm', 'info', '-e'])['stdout']
|
||||
+ except (CalledProcessError, OSError) as err:
|
||||
+ raise StopActorExecutionError(
|
||||
+ message=(
|
||||
+ "Unable to gather information about the system devices"
|
||||
+ ),
|
||||
+ details={
|
||||
+ 'details': 'Failed to execute `udevadm info -e` command.',
|
||||
+ 'error': str(err)
|
||||
+ }
|
||||
+ )
|
||||
+ api.produce(UdevAdmInfoData(db=out))
|
||||
diff --git a/repos/system_upgrade/common/actors/udev/udevadminfo/tests/files/udevadm_database b/repos/system_upgrade/common/actors/udev/udevadminfo/tests/files/udevadm_database
|
||||
new file mode 100644
|
||||
index 00000000..219fb574
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/udev/udevadminfo/tests/files/udevadm_database
|
||||
@@ -0,0 +1,134 @@
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:LNXCPU:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1698543
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:01
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:01
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:LNXCPU:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1698839
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0103:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0103:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:PNP0103:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1697906
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:PNP0A03:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1698109
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/PNP0A06:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/PNP0A06:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:PNP0A06:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1702939
|
||||
+P: /devices/LNXSYSTM:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:LNXSYSTM:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1694509
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXPWRBN:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXPWRBN:00
|
||||
+E: DRIVER=button
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:LNXPWRBN:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1695034
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
|
||||
+E: EV=3
|
||||
+E: ID_FOR_SEAT=input-acpi-LNXPWRBN_00
|
||||
+E: ID_INPUT=1
|
||||
+E: ID_INPUT_KEY=1
|
||||
+E: ID_PATH=acpi-LNXPWRBN:00
|
||||
+E: ID_PATH_TAG=acpi-LNXPWRBN_00
|
||||
+E: KEY=10000000000000 0
|
||||
+E: MODALIAS=input:b0019v0000p0001e0000-e0,1,k74,ramlsfw
|
||||
+E: NAME="Power Button"
|
||||
+E: PHYS="LNXPWRBN/button/input0"
|
||||
+E: PRODUCT=19/0/1/0
|
||||
+E: PROP=0
|
||||
+E: SUBSYSTEM=input
|
||||
+E: TAGS=:seat:
|
||||
+E: USEC_INITIALIZED=1697068
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0/event0
|
||||
+N: input/event0
|
||||
+E: DEVNAME=/dev/input/event0
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0/event0
|
||||
+E: ID_INPUT=1
|
||||
+E: ID_INPUT_KEY=1
|
||||
+E: ID_PATH=acpi-LNXPWRBN:00
|
||||
+E: ID_PATH_TAG=acpi-LNXPWRBN_00
|
||||
+E: MAJOR=13
|
||||
+E: MINOR=64
|
||||
+E: SUBSYSTEM=input
|
||||
+E: TAGS=:power-switch:
|
||||
+E: USEC_INITIALIZED=1744996
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXPWRBN:00/wakeup/wakeup10
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXPWRBN:00/wakeup/wakeup10
|
||||
+E: SUBSYSTEM=wakeup
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:LNXSYBUS:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1695925
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:ACPI0010:PNP0A05:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1698058
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:LNXCPU:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1698543
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:01
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:01
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:LNXCPU:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1698839
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0103:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0103:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:PNP0103:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1697906
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:PNP0A03:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1698109
|
||||
+
|
||||
+P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/PNP0A06:00
|
||||
+E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/PNP0A06:00
|
||||
+E: ID_VENDOR_FROM_DATABASE=The Linux Foundation
|
||||
+E: MODALIAS=acpi:PNP0A06:
|
||||
+E: SUBSYSTEM=acpi
|
||||
+E: USEC_INITIALIZED=1702939
|
||||
+
|
||||
diff --git a/repos/system_upgrade/common/actors/udev/udevadminfo/tests/test_udevadminfo.py b/repos/system_upgrade/common/actors/udev/udevadminfo/tests/test_udevadminfo.py
|
||||
new file mode 100644
|
||||
index 00000000..f465d6f6
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/udev/udevadminfo/tests/test_udevadminfo.py
|
||||
@@ -0,0 +1,40 @@
|
||||
+import os
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.actor import udevadminfo
|
||||
+from leapp.libraries.common import testutils
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.models import UdevAdmInfoData
|
||||
+
|
||||
+CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
+
|
||||
+
|
||||
+def _raise_call_error(*args):
|
||||
+ raise CalledProcessError(
|
||||
+ message='A Leapp Command Error occurred.',
|
||||
+ command=args,
|
||||
+ result={'signal': None, 'exit_code': 1, 'pid': 0, 'stdout': 'fake', 'stderr': 'fake'}
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def test_failed_run(monkeypatch):
|
||||
+ monkeypatch.setattr(api, 'produce', testutils.produce_mocked())
|
||||
+ monkeypatch.setattr(udevadminfo, 'run', _raise_call_error)
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError):
|
||||
+ udevadminfo.process()
|
||||
+
|
||||
+
|
||||
+def test_udevadminfo(monkeypatch):
|
||||
+
|
||||
+ with open(os.path.join(CUR_DIR, 'files', 'udevadm_database'), 'r') as fp:
|
||||
+ mocked_data = fp.read()
|
||||
+ monkeypatch.setattr(api, 'produce', testutils.produce_mocked())
|
||||
+ monkeypatch.setattr(udevadminfo, 'run', lambda *args: {'stdout': mocked_data})
|
||||
+ udevadminfo.process()
|
||||
+
|
||||
+ assert api.produce.called == 1
|
||||
+ assert isinstance(api.produce.model_instances[0], UdevAdmInfoData)
|
||||
+ assert api.produce.model_instances[0].db == mocked_data
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,166 +0,0 @@
|
||||
From 3066cad4e7a2a440a93f01fd0c0cbec84bb5485f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Fr=C3=A1trik?=
|
||||
<93993694+tomasfratrik@users.noreply.github.com>
|
||||
Date: Thu, 11 Apr 2024 13:48:31 +0200
|
||||
Subject: [PATCH 07/34] Add unit tests for scansourcefiles actor (#1190)
|
||||
|
||||
Jira: OAMG-10367
|
||||
---
|
||||
.../tests/unit_test_scansourcefiles.py | 147 +++++++++++++++++-
|
||||
1 file changed, 142 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/scansourcefiles/tests/unit_test_scansourcefiles.py b/repos/system_upgrade/common/actors/scansourcefiles/tests/unit_test_scansourcefiles.py
|
||||
index 6a6b009a..40ae2408 100644
|
||||
--- a/repos/system_upgrade/common/actors/scansourcefiles/tests/unit_test_scansourcefiles.py
|
||||
+++ b/repos/system_upgrade/common/actors/scansourcefiles/tests/unit_test_scansourcefiles.py
|
||||
@@ -1,5 +1,142 @@
|
||||
-def test_scansourcefiles():
|
||||
- # TODO(pstodulk): keeping unit tests for later after I check the idea
|
||||
- # of this actor with the team.
|
||||
- # JIRA: OAMG-10367
|
||||
- pass
|
||||
+import os
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import scansourcefiles
|
||||
+from leapp.libraries.common import testutils
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.models import FileInfo, TrackedFilesInfoSource
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ ('run_output', 'expected_output_is_modified'),
|
||||
+ (
|
||||
+ ({'exit_code': 0}, False),
|
||||
+ ({'exit_code': 1, 'stdout': 'missing /boot/efi/EFI (Permission denied)'}, True),
|
||||
+ ({'exit_code': 1, 'stdout': 'S.5...... c /etc/openldap/ldap.conf'}, True),
|
||||
+ ({'exit_code': 1, 'stdout': '..?...... c /etc/libaudit.conf'}, False),
|
||||
+ ({'exit_code': 1, 'stdout': '.....UG.. g /var/run/avahi-daemon'}, False),
|
||||
+ )
|
||||
+)
|
||||
+def test_is_modified(monkeypatch, run_output, expected_output_is_modified):
|
||||
+ input_file = '/file'
|
||||
+
|
||||
+ def mocked_run(cmd, *args, **kwargs):
|
||||
+ assert cmd == ['rpm', '-Vf', '--nomtime', input_file]
|
||||
+ return run_output
|
||||
+
|
||||
+ monkeypatch.setattr(scansourcefiles, 'run', mocked_run)
|
||||
+ assert scansourcefiles.is_modified(input_file) == expected_output_is_modified
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ 'run_output',
|
||||
+ [
|
||||
+ {'stdout': ['']},
|
||||
+ {'stdout': ['rpm']},
|
||||
+ {'stdout': ['rpm1', 'rpm2']},
|
||||
+ ]
|
||||
+)
|
||||
+def test_get_rpm_name(monkeypatch, run_output):
|
||||
+ input_file = '/file'
|
||||
+
|
||||
+ def mocked_run(cmd, *args, **kwargs):
|
||||
+ assert cmd == ['rpm', '-qf', '--queryformat', r'%{NAME}\n', input_file]
|
||||
+ return run_output
|
||||
+
|
||||
+ monkeypatch.setattr(scansourcefiles, 'run', mocked_run)
|
||||
+ monkeypatch.setattr(api, 'current_logger', testutils.logger_mocked())
|
||||
+ assert scansourcefiles._get_rpm_name(input_file) == run_output['stdout'][0]
|
||||
+
|
||||
+ if len(run_output['stdout']) > 1:
|
||||
+ expected_warnmsg = ('The {} file is owned by multiple rpms: {}.'
|
||||
+ .format(input_file, ', '.join(run_output['stdout'])))
|
||||
+ assert api.current_logger.warnmsg == [expected_warnmsg]
|
||||
+
|
||||
+
|
||||
+def test_get_rpm_name_error(monkeypatch):
|
||||
+ input_file = '/file'
|
||||
+
|
||||
+ def mocked_run(cmd, *args, **kwargs):
|
||||
+ assert cmd == ['rpm', '-qf', '--queryformat', r'%{NAME}\n', input_file]
|
||||
+ raise CalledProcessError("mocked error", cmd, "result")
|
||||
+
|
||||
+ monkeypatch.setattr(scansourcefiles, 'run', mocked_run)
|
||||
+ assert scansourcefiles._get_rpm_name(input_file) == ''
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ ('input_file', 'exists', 'rpm_name', 'is_modified'),
|
||||
+ (
|
||||
+ ('/not_existing_file', False, '', False),
|
||||
+ ('/not_existing_file_rpm_owned', False, 'rpm', False),
|
||||
+ ('/not_existing_file_rpm_owned_modified', False, 'rpm', True),
|
||||
+ ('/existing_file_not_modified', True, '', False),
|
||||
+ ('/existing_file_owned_by_rpm_not_modified', True, 'rpm', False),
|
||||
+ ('/existing_file_owned_by_rpm_modified', True, 'rpm', True),
|
||||
+ )
|
||||
+)
|
||||
+def test_scan_file(monkeypatch, input_file, exists, rpm_name, is_modified):
|
||||
+ monkeypatch.setattr(scansourcefiles, 'is_modified', lambda _: is_modified)
|
||||
+ monkeypatch.setattr(scansourcefiles, '_get_rpm_name', lambda _: rpm_name)
|
||||
+ monkeypatch.setattr(os.path, 'exists', lambda _: exists)
|
||||
+
|
||||
+ expected_model_output = FileInfo(path=input_file, exists=exists, rpm_name=rpm_name, is_modified=is_modified)
|
||||
+ assert scansourcefiles.scan_file(input_file) == expected_model_output
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ ('input_files'),
|
||||
+ (
|
||||
+ ([]),
|
||||
+ (['/file1']),
|
||||
+ (['/file1', '/file2']),
|
||||
+ )
|
||||
+)
|
||||
+def test_scan_files(monkeypatch, input_files):
|
||||
+ base_data = {
|
||||
+ 'exists': False,
|
||||
+ 'rpm_name': '',
|
||||
+ 'is_modified': False
|
||||
+ }
|
||||
+
|
||||
+ def scan_file_mocked(input_file):
|
||||
+ return FileInfo(path=input_file, **base_data)
|
||||
+
|
||||
+ monkeypatch.setattr(scansourcefiles, 'scan_file', scan_file_mocked)
|
||||
+ expected_output_list = [FileInfo(path=input_file, **base_data) for input_file in input_files]
|
||||
+ assert scansourcefiles.scan_files(input_files) == expected_output_list
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ 'rhel_major_version', ['8', '9']
|
||||
+)
|
||||
+def test_tracked_files(monkeypatch, rhel_major_version):
|
||||
+ TRACKED_FILES_MOCKED = {
|
||||
+ 'common': [
|
||||
+ '/file1',
|
||||
+ ],
|
||||
+ '8': [
|
||||
+ '/file2',
|
||||
+ ],
|
||||
+ '9': [
|
||||
+ '/file3',
|
||||
+ ],
|
||||
+ }
|
||||
+
|
||||
+ def scan_files_mocked(files):
|
||||
+ return [FileInfo(path=file_path, exists=False, rpm_name='', is_modified=False) for file_path in files]
|
||||
+
|
||||
+ monkeypatch.setattr(api, 'produce', testutils.produce_mocked())
|
||||
+ monkeypatch.setattr(scansourcefiles, 'TRACKED_FILES', TRACKED_FILES_MOCKED)
|
||||
+ monkeypatch.setattr(scansourcefiles, 'get_source_major_version', lambda: rhel_major_version)
|
||||
+ monkeypatch.setattr(scansourcefiles, 'scan_files', scan_files_mocked)
|
||||
+
|
||||
+ scansourcefiles.process()
|
||||
+
|
||||
+ tracked_files_model = api.produce.model_instances[0]
|
||||
+ assert api.produce.called == 1
|
||||
+ assert isinstance(tracked_files_model, TrackedFilesInfoSource)
|
||||
+ # assert only 1 common and 1 version file were scanned
|
||||
+ assert len(tracked_files_model.files) == 2
|
||||
+ assert all(isinstance(files_list_item, FileInfo) for files_list_item in tracked_files_model.files)
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
From 82070789813ae64f8fadc31a5096bf8df4124f75 Mon Sep 17 00:00:00 2001
|
||||
From: mhecko <mhecko@redhat.com>
|
||||
Date: Tue, 2 Apr 2024 11:24:49 +0200
|
||||
Subject: [PATCH 08/34] pes_events_scanner: overwrite repositories when
|
||||
applying an event
|
||||
|
||||
The Package class has custom __hash__ and __eq__ methods in order to
|
||||
achieve a straightforward presentation via set manipulation. However,
|
||||
this causes problems, e.g., when applying split events. For example:
|
||||
Applying the event Split(in={(A, repo1)}, out={(A, repo2), (B, repo2)})
|
||||
to the package state {(A, repo1), (B, repo1)} results in the following:
|
||||
{(A, repo1), (B, repo1)} --apply--> {(A, repo2), (B, repo1)}
|
||||
which is undesired as repo1 is a source system repository. Such
|
||||
a package will get reported to the user as potentially removed during
|
||||
the upgrade. This patch addresses this unwanted behavior.
|
||||
---
|
||||
.../peseventsscanner/libraries/pes_events_scanner.py | 9 ++++++++-
|
||||
.../peseventsscanner/tests/test_pes_event_scanner.py | 9 +++++++++
|
||||
2 files changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/peseventsscanner/libraries/pes_events_scanner.py b/repos/system_upgrade/common/actors/peseventsscanner/libraries/pes_events_scanner.py
|
||||
index f9411dfe..f5cb2613 100644
|
||||
--- a/repos/system_upgrade/common/actors/peseventsscanner/libraries/pes_events_scanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/peseventsscanner/libraries/pes_events_scanner.py
|
||||
@@ -139,8 +139,11 @@ def compute_pkg_changes_between_consequent_releases(source_installed_pkgs,
|
||||
if event.action == Action.PRESENT:
|
||||
for pkg in event.in_pkgs:
|
||||
if pkg in seen_pkgs:
|
||||
+ # First remove the package with the old repository and add it back, but now with the new
|
||||
+ # repository. As the Package class has a custom __hash__ and __eq__ comparing only name
|
||||
+ # and modulestream, the pkg.repository field is ignore and therefore the add() call
|
||||
+ # does not update the entry.
|
||||
if pkg in target_pkgs:
|
||||
- # Remove the package with the old repository, add the one with the new one
|
||||
target_pkgs.remove(pkg)
|
||||
target_pkgs.add(pkg)
|
||||
elif event.action == Action.DEPRECATED:
|
||||
@@ -163,7 +166,11 @@ def compute_pkg_changes_between_consequent_releases(source_installed_pkgs,
|
||||
event.id, event.action, removed_pkgs_str, added_pkgs_str)
|
||||
|
||||
# In pkgs are present, event can be applied
|
||||
+ # Note: We do a .difference(event.out_packages) followed by an .union(event.out_packages) to overwrite
|
||||
+ # # repositories of the packages (Package has overwritten __hash__ and __eq__, ignoring
|
||||
+ # # the repository field)
|
||||
target_pkgs = target_pkgs.difference(event.in_pkgs)
|
||||
+ target_pkgs = target_pkgs.difference(event.out_pkgs)
|
||||
target_pkgs = target_pkgs.union(event.out_pkgs)
|
||||
|
||||
pkgs_to_demodularize = pkgs_to_demodularize.difference(event.in_pkgs)
|
||||
diff --git a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
index 7cdcf820..80ece770 100644
|
||||
--- a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
@@ -123,6 +123,15 @@ def pkgs_into_tuples(pkgs):
|
||||
[(8, 0)],
|
||||
{Package('renamed-out', 'rhel8-repo', None)}
|
||||
),
|
||||
+ (
|
||||
+ {Package('A', 'rhel7-repo', None), Package('B', 'rhel7-repo', None)},
|
||||
+ [
|
||||
+ Event(1, Action.SPLIT, {Package('A', 'rhel7-repo', None)},
|
||||
+ {Package('A', 'rhel8-repo', None), Package('B', 'rhel8-repo', None)}, (7, 6), (8, 0), [])
|
||||
+ ],
|
||||
+ [(8, 0)],
|
||||
+ {Package('A', 'rhel8-repo', None), Package('B', 'rhel8-repo', None)}
|
||||
+ ),
|
||||
)
|
||||
)
|
||||
def test_event_application_fundamentals(monkeypatch, installed_pkgs, events, releases, expected_target_pkgs):
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
From 1f8b8f3259d7daff63dff0a4d630b36e615e416d Mon Sep 17 00:00:00 2001
|
||||
From: David Kubek <dkubek@redhat.com>
|
||||
Date: Wed, 10 Apr 2024 12:08:23 +0200
|
||||
Subject: [PATCH 09/34] Modify upgrade not terminate after lockfile detected
|
||||
|
||||
Previously, when the upgrade failed in the initram the file
|
||||
/sysroot/root/tmp_leapp_py3/.leapp_upgrade_failed has been generated and
|
||||
upon detecting this file leapp triggered an emergency shell. This caused
|
||||
the original failure to be hidden from the customer.
|
||||
|
||||
With this commit, we no longer crash immediately upon detecting the file
|
||||
but rather continue and "wait" for the underlying issue and error to
|
||||
emerge.
|
||||
|
||||
RHEL-24148
|
||||
---
|
||||
.../files/dracut/85sys-upgrade-redhat/do-upgrade.sh | 13 +++++++++----
|
||||
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/do-upgrade.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/do-upgrade.sh
|
||||
index 4a6f7b62..56a94b5d 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/do-upgrade.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/do-upgrade.sh
|
||||
@@ -282,6 +282,11 @@ do_upgrade() {
|
||||
local dirname
|
||||
dirname="$("$NEWROOT/bin/dirname" "$NEWROOT$LEAPP_FAILED_FLAG_FILE")"
|
||||
[ -d "$dirname" ] || mkdir "$dirname"
|
||||
+
|
||||
+ echo >&2 "Creating file $NEWROOT$LEAPP_FAILED_FLAG_FILE"
|
||||
+ echo >&2 "Warning: Leapp upgrade failed and there is an issue blocking the upgrade."
|
||||
+ echo >&2 "Please file a support case with /var/log/leapp/leapp-upgrade.log attached"
|
||||
+
|
||||
"$NEWROOT/bin/touch" "$NEWROOT$LEAPP_FAILED_FLAG_FILE"
|
||||
fi
|
||||
|
||||
@@ -358,10 +363,10 @@ mount -o "remount,rw" "$NEWROOT"
|
||||
# check if leapp previously failed in the initramfs, if it did return to the emergency shell
|
||||
[ -f "$NEWROOT$LEAPP_FAILED_FLAG_FILE" ] && {
|
||||
echo >&2 "Found file $NEWROOT$LEAPP_FAILED_FLAG_FILE"
|
||||
- echo >&2 "Error: Leapp previously failed and cannot continue, returning back to emergency shell"
|
||||
- echo >&2 "Please file a support case with $NEWROOT/var/log/leapp/leapp-upgrade.log attached"
|
||||
- echo >&2 "To rerun the upgrade upon exiting the dracut shell remove the $NEWROOT$LEAPP_FAILED_FLAG_FILE file"
|
||||
- exit 1
|
||||
+ echo >&2 "Warning: Leapp failed on a previous execution and something might be blocking the upgrade."
|
||||
+ echo >&2 "Continuing with the upgrade anyway. Note that any subsequent error might be potentially misleading due to a previous failure."
|
||||
+ echo >&2 "A log file will be generated at $NEWROOT/var/log/leapp/leapp-upgrade.log."
|
||||
+ echo >&2 "In case of persisting failure, if possible, try to boot to the original system and file a support case with /var/log/leapp/leapp-upgrade.log attached."
|
||||
}
|
||||
|
||||
[ ! -x "$NEWROOT$LEAPPBIN" ] && {
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
From 1fb7e78bfa86163c27c309d6244298d4b3075762 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 2 Feb 2024 12:32:15 +0100
|
||||
Subject: [PATCH 10/34] Make the reboot required text more visible in the
|
||||
console output
|
||||
|
||||
The "A reboot is required to continue. Please reboot your system."
|
||||
message is printed before the reports summary and thus is easily
|
||||
overlooked by users.
|
||||
|
||||
This patch adds a second such message after the report summary to
|
||||
improve this.
|
||||
|
||||
Jira: RHEL-22736
|
||||
---
|
||||
commands/upgrade/__init__.py | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py
|
||||
index c42b7cba..cc5fe647 100644
|
||||
--- a/commands/upgrade/__init__.py
|
||||
+++ b/commands/upgrade/__init__.py
|
||||
@@ -113,6 +113,11 @@ def upgrade(args, breadcrumbs):
|
||||
|
||||
if workflow.failure:
|
||||
sys.exit(1)
|
||||
+ elif not args.resume:
|
||||
+ sys.stdout.write(
|
||||
+ 'Reboot the system to continue with the upgrade.'
|
||||
+ ' This might take a while depending on the system configuration.\n'
|
||||
+ )
|
||||
|
||||
|
||||
def register(base_command):
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,176 +0,0 @@
|
||||
From 8fe2a2d35395a43b8449354d68479d8339ef49ab Mon Sep 17 00:00:00 2001
|
||||
From: mhecko <mhecko@redhat.com>
|
||||
Date: Sun, 21 Apr 2024 22:40:38 +0200
|
||||
Subject: [PATCH 11/34] check_grub_legacy: inhibit when GRUB legacy is present
|
||||
|
||||
Adds a new actor checking for whether any of the GRUB devices
|
||||
have the old GRUB Legacy installed. If any of such devices
|
||||
is detected, the upgrade is inhibited. The GRUB Legacy is detected
|
||||
by searching for the string 'GRUB version 0.94' in `file -s`
|
||||
of the device.
|
||||
---
|
||||
.../el7toel8/actors/checklegacygrub/actor.py | 20 ++++++
|
||||
.../libraries/check_legacy_grub.py | 71 +++++++++++++++++++
|
||||
.../tests/test_check_legacy_grub.py | 45 ++++++++++++
|
||||
3 files changed, 136 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/checklegacygrub/actor.py
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/checklegacygrub/libraries/check_legacy_grub.py
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/checklegacygrub/tests/test_check_legacy_grub.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checklegacygrub/actor.py b/repos/system_upgrade/el7toel8/actors/checklegacygrub/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..1fc7dde4
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checklegacygrub/actor.py
|
||||
@@ -0,0 +1,20 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import check_legacy_grub as check_legacy_grub_lib
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class CheckLegacyGrub(Actor):
|
||||
+ """
|
||||
+ Check whether GRUB Legacy is installed in the MBR.
|
||||
+
|
||||
+ GRUB Legacy is deprecated since RHEL 7 in favour of GRUB2.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_grub_legacy'
|
||||
+ consumes = ()
|
||||
+ produces = (Report,)
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ check_legacy_grub_lib.check_grub_disks_for_legacy_grub()
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checklegacygrub/libraries/check_legacy_grub.py b/repos/system_upgrade/el7toel8/actors/checklegacygrub/libraries/check_legacy_grub.py
|
||||
new file mode 100644
|
||||
index 00000000..d02c14f9
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checklegacygrub/libraries/check_legacy_grub.py
|
||||
@@ -0,0 +1,71 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.exceptions import StopActorExecution
|
||||
+from leapp.libraries.common import grub as grub_lib
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
+from leapp.reporting import create_report
|
||||
+
|
||||
+# There is no grub legacy package on RHEL7, therefore, the system must have been upgraded from RHEL6
|
||||
+MIGRATION_TO_GRUB2_GUIDE_URL = 'https://access.redhat.com/solutions/2643721'
|
||||
+
|
||||
+
|
||||
+def has_legacy_grub(device):
|
||||
+ try:
|
||||
+ output = run(['file', '-s', device])
|
||||
+ except CalledProcessError as err:
|
||||
+ msg = 'Failed to determine the file type for the special device `{0}`. Full error: `{1}`'
|
||||
+ api.current_logger().warning(msg.format(device, str(err)))
|
||||
+
|
||||
+ # According to `file` manpage, the exit code > 0 iff the file does not exists (meaning)
|
||||
+ # that grub_lib.get_grub_devices() is unreliable for some reason (better stop the upgrade),
|
||||
+ # or because the file type could not be determined. However, its manpage directly gives examples
|
||||
+ # of file -s being used on block devices, so this should be unlikely - especially if one would
|
||||
+ # consider that get_grub_devices was able to determine that it is a grub device.
|
||||
+ raise StopActorExecution()
|
||||
+
|
||||
+ grub_legacy_version_string = 'GRUB version 0.94'
|
||||
+ return grub_legacy_version_string in output['stdout']
|
||||
+
|
||||
+
|
||||
+def check_grub_disks_for_legacy_grub():
|
||||
+ # Both GRUB2 and Grub Legacy are recognized by `get_grub_devices`
|
||||
+ grub_devices = grub_lib.get_grub_devices()
|
||||
+
|
||||
+ legacy_grub_devices = []
|
||||
+ for device in grub_devices:
|
||||
+ if has_legacy_grub(device):
|
||||
+ legacy_grub_devices.append(device)
|
||||
+
|
||||
+ if legacy_grub_devices:
|
||||
+ details = (
|
||||
+ 'Leapp detected GRUB Legacy to be installed on the system. '
|
||||
+ 'The GRUB Legacy bootloader is unsupported on RHEL7 and GRUB2 must be used instead. '
|
||||
+ 'The presence of GRUB Legacy is possible on systems that have been upgraded from RHEL 6 in the past, '
|
||||
+ 'but required manual post-upgrade steps have not been performed. '
|
||||
+ 'Note that the in-place upgrade from RHEL 6 to RHEL 7 systems is in such a case '
|
||||
+ 'considered as unfinished.\n\n'
|
||||
+
|
||||
+ 'GRUB Legacy has been detected on following devices:\n'
|
||||
+ '{block_devices_fmt}\n'
|
||||
+ )
|
||||
+
|
||||
+ hint = (
|
||||
+ 'Migrate to the GRUB2 bootloader on the reported devices. '
|
||||
+ 'Also finish other post-upgrade steps related to the previous in-place upgrade, the majority of which '
|
||||
+ 'is a part of the related preupgrade report for upgrades from RHEL 6 to RHEL 7.'
|
||||
+ 'If you are not sure whether all previously required post-upgrade steps '
|
||||
+ 'have been performed, consider a clean installation of the RHEL 8 system instead. '
|
||||
+ 'Note that the in-place upgrade to RHEL 8 can fail in various ways '
|
||||
+ 'if the RHEL 7 system is misconfigured.'
|
||||
+ )
|
||||
+
|
||||
+ block_devices_fmt = '\n'.join(legacy_grub_devices)
|
||||
+ create_report([
|
||||
+ reporting.Title("GRUB Legacy is used on the system"),
|
||||
+ reporting.Summary(details.format(block_devices_fmt=block_devices_fmt)),
|
||||
+ reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Groups([reporting.Groups.BOOT]),
|
||||
+ reporting.Remediation(hint=hint),
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
+ reporting.ExternalLink(url=MIGRATION_TO_GRUB2_GUIDE_URL,
|
||||
+ title='How to install GRUB2 after a RHEL6 to RHEL7 upgrade'),
|
||||
+ ])
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checklegacygrub/tests/test_check_legacy_grub.py b/repos/system_upgrade/el7toel8/actors/checklegacygrub/tests/test_check_legacy_grub.py
|
||||
new file mode 100644
|
||||
index 00000000..d6e5008e
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checklegacygrub/tests/test_check_legacy_grub.py
|
||||
@@ -0,0 +1,45 @@
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import check_legacy_grub as check_legacy_grub_lib
|
||||
+from leapp.libraries.common import grub as grub_lib
|
||||
+from leapp.libraries.common.testutils import create_report_mocked
|
||||
+from leapp.utils.report import is_inhibitor
|
||||
+
|
||||
+VDA_WITH_LEGACY_GRUB = (
|
||||
+ '/dev/vda: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, '
|
||||
+ 'stage2 address 0x2000, stage2 segment 0x200, GRUB version 0.94; partition 1: ID=0x83, '
|
||||
+ 'active, starthead 32, startsector 2048, 1024000 sectors; partition 2: ID=0x83, starthead 221, '
|
||||
+ 'startsector 1026048, 19945472 sectors, code offset 0x48\n'
|
||||
+)
|
||||
+
|
||||
+NVME0N1_VDB_WITH_GRUB = (
|
||||
+ '/dev/nvme0n1: x86 boot sector; partition 1: ID=0x83, active, starthead 32, startsector 2048, 6291456 sectors; '
|
||||
+ 'partition 2: ID=0x83, starthead 191, startsector 6293504, 993921024 sectors, code offset 0x63'
|
||||
+)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ ('grub_device_to_file_output', 'should_inhibit'),
|
||||
+ [
|
||||
+ ({'/dev/vda': VDA_WITH_LEGACY_GRUB}, True),
|
||||
+ ({'/dev/nvme0n1': NVME0N1_VDB_WITH_GRUB}, False),
|
||||
+ ({'/dev/vda': VDA_WITH_LEGACY_GRUB, '/dev/nvme0n1': NVME0N1_VDB_WITH_GRUB}, True)
|
||||
+ ]
|
||||
+)
|
||||
+def test_check_legacy_grub(monkeypatch, grub_device_to_file_output, should_inhibit):
|
||||
+
|
||||
+ def file_cmd_mock(cmd, *args, **kwargs):
|
||||
+ assert cmd[:2] == ['file', '-s']
|
||||
+ return {'stdout': grub_device_to_file_output[cmd[2]]}
|
||||
+
|
||||
+ monkeypatch.setattr(check_legacy_grub_lib, 'create_report', create_report_mocked())
|
||||
+ monkeypatch.setattr(grub_lib, 'get_grub_devices', lambda: list(grub_device_to_file_output.keys()))
|
||||
+ monkeypatch.setattr(check_legacy_grub_lib, 'run', file_cmd_mock)
|
||||
+
|
||||
+ check_legacy_grub_lib.check_grub_disks_for_legacy_grub()
|
||||
+
|
||||
+ assert bool(check_legacy_grub_lib.create_report.called) == should_inhibit
|
||||
+ if should_inhibit:
|
||||
+ assert len(check_legacy_grub_lib.create_report.reports) == 1
|
||||
+ report = check_legacy_grub_lib.create_report.reports[0]
|
||||
+ assert is_inhibitor(report)
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From a4e3906fff5d11e0fb94f5dbe10ed653dc2d0bee Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Matej=20Matu=C5=A1ka?= <mmatuska@redhat.com>
|
||||
Date: Tue, 23 Apr 2024 23:56:57 +0200
|
||||
Subject: [PATCH 12/34] Default channel to GA is not specified otherwise
|
||||
(#1205)
|
||||
|
||||
Originally we tried to map by default repositories from particular channels on the source system to their equivalents on the target system. IOW:
|
||||
|
||||
* eus -> eus
|
||||
* aus -> aus
|
||||
* e4s -> e4s
|
||||
* "ga" -> "ga"
|
||||
...
|
||||
|
||||
However, it has been revealed this logic should not apply on minor releases for which these non-ga (premium) repositories do not exist. So doing upgrade e.g. to 8.9, 8.10 , 9.3 for which specific eus, etc.. repositories are not defined lead to 404 error.
|
||||
|
||||
Discussing this deeply between stakeholders, it has been decided to drop this logic and target always to "ga" repositories unless the leapp is executed with instructions to choose a different channel (using envars, --channel .. option). To prevent this issue.
|
||||
|
||||
It's still possible to require mistakenly e.g. "eus" channel for the target release for which the related repositories are not defined. e.g.:
|
||||
> leapp upgrade --channel eus --target 8.10
|
||||
|
||||
In such a case, the previous errors (404 Not found) can be hit again. But it will not happen by default. In this case, we expect and request people to understand what they want when they use the option.
|
||||
|
||||
@pirat89 : Updated commit msg
|
||||
|
||||
jira: RHEL-24720
|
||||
---
|
||||
commands/upgrade/util.py | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/commands/upgrade/util.py b/commands/upgrade/util.py
|
||||
index b11265ee..9eff0ad1 100644
|
||||
--- a/commands/upgrade/util.py
|
||||
+++ b/commands/upgrade/util.py
|
||||
@@ -207,6 +207,8 @@ def prepare_configuration(args):
|
||||
|
||||
if args.channel:
|
||||
os.environ['LEAPP_TARGET_PRODUCT_CHANNEL'] = args.channel
|
||||
+ elif 'LEAPP_TARGET_PRODUCT_CHANNEL' not in os.environ:
|
||||
+ os.environ['LEAPP_TARGET_PRODUCT_CHANNEL'] = 'ga'
|
||||
|
||||
if args.iso:
|
||||
os.environ['LEAPP_TARGET_ISO'] = args.iso
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
From 6d05575efdd6c3c728e784add3017d072eda4d5e Mon Sep 17 00:00:00 2001
|
||||
From: Toshio Kuratomi <tkuratom@redhat.com>
|
||||
Date: Tue, 23 Apr 2024 14:03:44 -0700
|
||||
Subject: [PATCH 13/34] Enhance grub2 install failure message.
|
||||
|
||||
The new message informs the useir will happen (they will boot into the old RHEL's kernel) so they
|
||||
understand why they need to run the remediation.
|
||||
|
||||
jira: https://issues.redhat.com/browse/RHEL-29683
|
||||
---
|
||||
.../common/actors/checkgrubcore/actor.py | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkgrubcore/actor.py b/repos/system_upgrade/common/actors/checkgrubcore/actor.py
|
||||
index ae9e53ef..662c4d64 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkgrubcore/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkgrubcore/actor.py
|
||||
@@ -46,11 +46,15 @@ class CheckGrubCore(Actor):
|
||||
reporting.Title('Leapp could not identify where GRUB2 core is located'),
|
||||
reporting.Summary(
|
||||
'We assumed GRUB2 core is located on the same device(s) as /boot, '
|
||||
- 'however Leapp could not detect GRUB2 on the device(s). '
|
||||
- 'GRUB2 core needs to be updated maually on legacy (BIOS) systems. '
|
||||
+ 'however Leapp could not detect GRUB2 on those device(s). '
|
||||
+ 'This means GRUB2 core will not be updated during the upgrade process and '
|
||||
+ 'the system will probably ' 'boot into the old kernel after the upgrade. '
|
||||
+ 'GRUB2 core needs to be updated manually on legacy (BIOS) systems to '
|
||||
+ 'fix this.'
|
||||
),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.BOOT]),
|
||||
reporting.Remediation(
|
||||
- hint='Please run "grub2-install <GRUB_DEVICE> command manually after the upgrade'),
|
||||
+ hint='Please run the "grub2-install <GRUB_DEVICE>" command manually '
|
||||
+ 'after the upgrade'),
|
||||
])
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,388 +0,0 @@
|
||||
From ea6cd7912ce650f033a972921a2b29636ac304db Mon Sep 17 00:00:00 2001
|
||||
From: mhecko <mhecko@redhat.com>
|
||||
Date: Tue, 2 Apr 2024 19:29:16 +0200
|
||||
Subject: [PATCH 14/34] boot: check first partition offset on GRUB devices
|
||||
|
||||
Check that the first partition starts at least at 1MiB (2048 cylinders),
|
||||
as too small first-partition offsets lead to failures when doing
|
||||
grub2-install. The limit (1MiB) has been chosen as it is a common
|
||||
value set by the disk formatting tools nowadays.
|
||||
|
||||
jira: https://issues.redhat.com/browse/RHEL-3341
|
||||
---
|
||||
.../actors/checkfirstpartitionoffset/actor.py | 24 ++++++
|
||||
.../libraries/check_first_partition_offset.py | 52 +++++++++++++
|
||||
.../test_check_first_partition_offset.py | 51 ++++++++++++
|
||||
.../scangrubdevpartitionlayout/actor.py | 18 +++++
|
||||
.../libraries/scan_layout.py | 64 +++++++++++++++
|
||||
.../tests/test_scan_partition_layout.py | 78 +++++++++++++++++++
|
||||
.../el7toel8/models/partitionlayout.py | 28 +++++++
|
||||
7 files changed, 315 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/actor.py
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/libraries/check_first_partition_offset.py
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/tests/test_check_first_partition_offset.py
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/actor.py
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py
|
||||
create mode 100644 repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py
|
||||
create mode 100644 repos/system_upgrade/el7toel8/models/partitionlayout.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/actor.py b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..cde27c2a
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/actor.py
|
||||
@@ -0,0 +1,24 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import check_first_partition_offset
|
||||
+from leapp.models import FirmwareFacts, GRUBDevicePartitionLayout
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class CheckFirstPartitionOffset(Actor):
|
||||
+ """
|
||||
+ Check whether the first partition starts at the offset >=1MiB.
|
||||
+
|
||||
+ The alignment of the first partition plays role in disk access speeds. Older tools placed the start of the first
|
||||
+ partition at cylinder 63 (due to historical reasons connected to the INT13h BIOS API). However, grub core
|
||||
+ binary is placed before the start of the first partition, meaning that not enough space causes bootloader
|
||||
+ installation to fail. Modern partitioning tools place the first partition at >= 1MiB (cylinder 2048+).
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_first_partition_offset'
|
||||
+ consumes = (FirmwareFacts, GRUBDevicePartitionLayout,)
|
||||
+ produces = (Report,)
|
||||
+ tags = (ChecksPhaseTag, IPUWorkflowTag,)
|
||||
+
|
||||
+ def process(self):
|
||||
+ check_first_partition_offset.check_first_partition_offset()
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/libraries/check_first_partition_offset.py b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/libraries/check_first_partition_offset.py
|
||||
new file mode 100644
|
||||
index 00000000..fbd4e178
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/libraries/check_first_partition_offset.py
|
||||
@@ -0,0 +1,52 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.common.config import architecture
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import FirmwareFacts, GRUBDevicePartitionLayout
|
||||
+
|
||||
+SAFE_OFFSET_BYTES = 1024*1024 # 1MiB
|
||||
+
|
||||
+
|
||||
+def check_first_partition_offset():
|
||||
+ if architecture.matches_architecture(architecture.ARCH_S390X):
|
||||
+ return
|
||||
+
|
||||
+ for fact in api.consume(FirmwareFacts):
|
||||
+ if fact.firmware == 'efi':
|
||||
+ return # Skip EFI system
|
||||
+
|
||||
+ problematic_devices = []
|
||||
+ for grub_dev in api.consume(GRUBDevicePartitionLayout):
|
||||
+ first_partition = min(grub_dev.partitions, key=lambda partition: partition.start_offset)
|
||||
+ if first_partition.start_offset < SAFE_OFFSET_BYTES:
|
||||
+ problematic_devices.append(grub_dev.device)
|
||||
+
|
||||
+ if problematic_devices:
|
||||
+ summary = (
|
||||
+ 'On the system booting by using BIOS, the in-place upgrade fails '
|
||||
+ 'when upgrading the GRUB2 bootloader if the boot disk\'s embedding area '
|
||||
+ 'does not contain enough space for the core image installation. '
|
||||
+ 'This results in a broken system, and can occur when the disk has been '
|
||||
+ 'partitioned manually, for example using the RHEL 6 fdisk utility.\n\n'
|
||||
+
|
||||
+ 'The list of devices with small embedding area:\n'
|
||||
+ '{0}.'
|
||||
+ )
|
||||
+ problematic_devices_fmt = ['- {0}'.format(dev) for dev in problematic_devices]
|
||||
+
|
||||
+ hint = (
|
||||
+ 'We recommend to perform a fresh installation of the RHEL 8 system '
|
||||
+ 'instead of performing the in-place upgrade.\n'
|
||||
+ 'Another possibility is to reformat the devices so that there is '
|
||||
+ 'at least {0} kiB space before the first partition. '
|
||||
+ 'Note that this operation is not supported and does not have to be '
|
||||
+ 'always possible.'
|
||||
+ )
|
||||
+
|
||||
+ reporting.create_report([
|
||||
+ reporting.Title('Found GRUB devices with too little space reserved before the first partition'),
|
||||
+ reporting.Summary(summary.format('\n'.join(problematic_devices_fmt))),
|
||||
+ reporting.Remediation(hint=hint.format(SAFE_OFFSET_BYTES // 1024)),
|
||||
+ reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Groups([reporting.Groups.BOOT]),
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
+ ])
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/tests/test_check_first_partition_offset.py b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/tests/test_check_first_partition_offset.py
|
||||
new file mode 100644
|
||||
index 00000000..e349ff7d
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/tests/test_check_first_partition_offset.py
|
||||
@@ -0,0 +1,51 @@
|
||||
+import pytest
|
||||
+
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.actor import check_first_partition_offset
|
||||
+from leapp.libraries.common import grub
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import FirmwareFacts, GRUBDevicePartitionLayout, PartitionInfo
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.utils.report import is_inhibitor
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ ('devices', 'should_report'),
|
||||
+ [
|
||||
+ (
|
||||
+ [
|
||||
+ GRUBDevicePartitionLayout(device='/dev/vda',
|
||||
+ partitions=[PartitionInfo(part_device='/dev/vda1', start_offset=32256)])
|
||||
+ ],
|
||||
+ True
|
||||
+ ),
|
||||
+ (
|
||||
+ [
|
||||
+ GRUBDevicePartitionLayout(device='/dev/vda',
|
||||
+ partitions=[PartitionInfo(part_device='/dev/vda1', start_offset=1024*1025)])
|
||||
+ ],
|
||||
+ False
|
||||
+ ),
|
||||
+ (
|
||||
+ [
|
||||
+ GRUBDevicePartitionLayout(device='/dev/vda',
|
||||
+ partitions=[PartitionInfo(part_device='/dev/vda1', start_offset=1024*1024)])
|
||||
+ ],
|
||||
+ False
|
||||
+ )
|
||||
+ ]
|
||||
+)
|
||||
+def test_bad_offset_reported(monkeypatch, devices, should_report):
|
||||
+ def consume_mocked(model_cls):
|
||||
+ if model_cls == FirmwareFacts:
|
||||
+ return [FirmwareFacts(firmware='bios')]
|
||||
+ return devices
|
||||
+
|
||||
+ monkeypatch.setattr(api, 'consume', consume_mocked)
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ check_first_partition_offset.check_first_partition_offset()
|
||||
+
|
||||
+ assert bool(reporting.create_report.called) == should_report
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/actor.py b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..0db93aba
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/actor.py
|
||||
@@ -0,0 +1,18 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import scan_layout as scan_layout_lib
|
||||
+from leapp.models import GRUBDevicePartitionLayout, GrubInfo
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class ScanGRUBDevicePartitionLayout(Actor):
|
||||
+ """
|
||||
+ Scan all identified GRUB devices for their partition layout.
|
||||
+ """
|
||||
+
|
||||
+ name = 'scan_grub_device_partition_layout'
|
||||
+ consumes = (GrubInfo,)
|
||||
+ produces = (GRUBDevicePartitionLayout,)
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag,)
|
||||
+
|
||||
+ def process(self):
|
||||
+ scan_layout_lib.scan_grub_device_partition_layout()
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py
|
||||
new file mode 100644
|
||||
index 00000000..bb2e6d9e
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py
|
||||
@@ -0,0 +1,64 @@
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
+from leapp.models import GRUBDevicePartitionLayout, GrubInfo, PartitionInfo
|
||||
+
|
||||
+SAFE_OFFSET_BYTES = 1024*1024 # 1MiB
|
||||
+
|
||||
+
|
||||
+def split_on_space_segments(line):
|
||||
+ fragments = (fragment.strip() for fragment in line.split(' '))
|
||||
+ return [fragment for fragment in fragments if fragment]
|
||||
+
|
||||
+
|
||||
+def get_partition_layout(device):
|
||||
+ try:
|
||||
+ partition_table = run(['fdisk', '-l', '-u=sectors', device], split=True)['stdout']
|
||||
+ except CalledProcessError as err:
|
||||
+ # Unlikely - if the disk has no partition table, `fdisk` terminates with 0 (no err). Fdisk exits with an err
|
||||
+ # when the device does not exists, or if it is too small to contain a partition table.
|
||||
+
|
||||
+ err_msg = 'Failed to run `fdisk` to obtain the partition table of the device {0}. Full error: \'{1}\''
|
||||
+ api.current_logger().error(err_msg.format(device, str(err)))
|
||||
+ return None
|
||||
+
|
||||
+ table_iter = iter(partition_table)
|
||||
+
|
||||
+ for line in table_iter:
|
||||
+ if not line.startswith('Units'):
|
||||
+ # We are still reading general device information and not the table itself
|
||||
+ continue
|
||||
+
|
||||
+ unit = line.split('=')[2].strip() # Contains '512 bytes'
|
||||
+ unit = int(unit.split(' ')[0].strip())
|
||||
+ break # First line of the partition table header
|
||||
+
|
||||
+ for line in table_iter:
|
||||
+ line = line.strip()
|
||||
+ if not line.startswith('Device'):
|
||||
+ continue
|
||||
+
|
||||
+ part_all_attrs = split_on_space_segments(line)
|
||||
+ break
|
||||
+
|
||||
+ partitions = []
|
||||
+ for partition_line in table_iter:
|
||||
+ # Fields: Device Boot Start End Sectors Size Id Type
|
||||
+ # The line looks like: `/dev/vda1 * 2048 2099199 2097152 1G 83 Linux`
|
||||
+ part_info = split_on_space_segments(partition_line)
|
||||
+
|
||||
+ # If the partition is not bootable, the Boot column might be empty
|
||||
+ part_device = part_info[0]
|
||||
+ part_start = int(part_info[2]) if len(part_info) == len(part_all_attrs) else int(part_info[1])
|
||||
+ partitions.append(PartitionInfo(part_device=part_device, start_offset=part_start*unit))
|
||||
+
|
||||
+ return GRUBDevicePartitionLayout(device=device, partitions=partitions)
|
||||
+
|
||||
+
|
||||
+def scan_grub_device_partition_layout():
|
||||
+ grub_devices = next(api.consume(GrubInfo), None)
|
||||
+ if not grub_devices:
|
||||
+ return
|
||||
+
|
||||
+ for device in grub_devices.orig_devices:
|
||||
+ dev_info = get_partition_layout(device)
|
||||
+ if dev_info:
|
||||
+ api.produce(dev_info)
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py
|
||||
new file mode 100644
|
||||
index 00000000..37bb5bcf
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py
|
||||
@@ -0,0 +1,78 @@
|
||||
+from collections import namedtuple
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import scan_layout as scan_layout_lib
|
||||
+from leapp.libraries.common import grub
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, produce_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import GRUBDevicePartitionLayout, GrubInfo
|
||||
+from leapp.utils.report import is_inhibitor
|
||||
+
|
||||
+Device = namedtuple('Device', ['name', 'partitions', 'sector_size'])
|
||||
+Partition = namedtuple('Partition', ['name', 'start_offset'])
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ 'devices',
|
||||
+ [
|
||||
+ (
|
||||
+ Device(name='/dev/vda', sector_size=512,
|
||||
+ partitions=[Partition(name='/dev/vda1', start_offset=63),
|
||||
+ Partition(name='/dev/vda2', start_offset=1000)]),
|
||||
+ Device(name='/dev/vdb', sector_size=1024,
|
||||
+ partitions=[Partition(name='/dev/vdb1', start_offset=100),
|
||||
+ Partition(name='/dev/vdb2', start_offset=20000)])
|
||||
+ ),
|
||||
+ (
|
||||
+ Device(name='/dev/vda', sector_size=512,
|
||||
+ partitions=[Partition(name='/dev/vda1', start_offset=111),
|
||||
+ Partition(name='/dev/vda2', start_offset=1000)]),
|
||||
+ )
|
||||
+ ]
|
||||
+)
|
||||
+def test_get_partition_layout(monkeypatch, devices):
|
||||
+ device_to_fdisk_output = {}
|
||||
+ for device in devices:
|
||||
+ fdisk_output = [
|
||||
+ 'Disk {0}: 42.9 GB, 42949672960 bytes, 83886080 sectors'.format(device.name),
|
||||
+ 'Units = sectors of 1 * {sector_size} = {sector_size} bytes'.format(sector_size=device.sector_size),
|
||||
+ 'Sector size (logical/physical): 512 bytes / 512 bytes',
|
||||
+ 'I/O size (minimum/optimal): 512 bytes / 512 bytes',
|
||||
+ 'Disk label type: dos',
|
||||
+ 'Disk identifier: 0x0000000da',
|
||||
+ '',
|
||||
+ ' Device Boot Start End Blocks Id System',
|
||||
+ ]
|
||||
+ for part in device.partitions:
|
||||
+ part_line = '{0} * {1} 2099199 1048576 83 Linux'.format(part.name, part.start_offset)
|
||||
+ fdisk_output.append(part_line)
|
||||
+
|
||||
+ device_to_fdisk_output[device.name] = fdisk_output
|
||||
+
|
||||
+ def mocked_run(cmd, *args, **kwargs):
|
||||
+ assert cmd[:3] == ['fdisk', '-l', '-u=sectors']
|
||||
+ device = cmd[3]
|
||||
+ output = device_to_fdisk_output[device]
|
||||
+ return {'stdout': output}
|
||||
+
|
||||
+ def consume_mocked(*args, **kwargs):
|
||||
+ yield GrubInfo(orig_devices=[device.name for device in devices])
|
||||
+
|
||||
+ monkeypatch.setattr(scan_layout_lib, 'run', mocked_run)
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+ monkeypatch.setattr(api, 'consume', consume_mocked)
|
||||
+
|
||||
+ scan_layout_lib.scan_grub_device_partition_layout()
|
||||
+
|
||||
+ assert api.produce.called == len(devices)
|
||||
+
|
||||
+ dev_name_to_desc = {dev.name: dev for dev in devices}
|
||||
+
|
||||
+ for message in api.produce.model_instances:
|
||||
+ assert isinstance(message, GRUBDevicePartitionLayout)
|
||||
+ dev = dev_name_to_desc[message.device]
|
||||
+
|
||||
+ expected_part_name_to_start = {part.name: part.start_offset*dev.sector_size for part in dev.partitions}
|
||||
+ actual_part_name_to_start = {part.part_device: part.start_offset for part in message.partitions}
|
||||
+ assert expected_part_name_to_start == actual_part_name_to_start
|
||||
diff --git a/repos/system_upgrade/el7toel8/models/partitionlayout.py b/repos/system_upgrade/el7toel8/models/partitionlayout.py
|
||||
new file mode 100644
|
||||
index 00000000..c6483283
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el7toel8/models/partitionlayout.py
|
||||
@@ -0,0 +1,28 @@
|
||||
+from leapp.models import fields, Model
|
||||
+from leapp.topics import SystemInfoTopic
|
||||
+
|
||||
+
|
||||
+class PartitionInfo(Model):
|
||||
+ """
|
||||
+ Information about a single partition.
|
||||
+ """
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ part_device = fields.String()
|
||||
+ """ Partition device """
|
||||
+
|
||||
+ start_offset = fields.Integer()
|
||||
+ """ Partition start - offset from the start of the block device in bytes """
|
||||
+
|
||||
+
|
||||
+class GRUBDevicePartitionLayout(Model):
|
||||
+ """
|
||||
+ Information about partition layout of a GRUB device.
|
||||
+ """
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ device = fields.String()
|
||||
+ """ GRUB device """
|
||||
+
|
||||
+ partitions = fields.List(fields.Model(PartitionInfo))
|
||||
+ """ List of partitions present on the device """
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,138 +0,0 @@
|
||||
From 683176dbeeeff32cc6b04410b4f7e4715a3de8e0 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Wed, 24 Apr 2024 01:09:51 +0200
|
||||
Subject: [PATCH 15/34] boot: Skip checks of first partition offset for for gpt
|
||||
partition table
|
||||
|
||||
This is extension of the previous commit. The original problem that
|
||||
we are trying to resolve is to be sure the embedding area (MBR gap)
|
||||
has expected size. This is irrelevant in case of GPT partition table
|
||||
is used on a device. The fdisk output format is in case of GPT
|
||||
disk label different, which breaks the parsing, resulting in empty
|
||||
list of partitions in related GRUBDevicePartitionLayout msg.
|
||||
|
||||
For now, let's skip produce of msgs for "GPT devices". As a seatbelt,
|
||||
ignore processing of messages with empty partitions field, expecting
|
||||
that such a device does not contain MBR. We want to prevent false
|
||||
positive inhibitors (and FP blocking errors). We expect that total
|
||||
number of machines with small embedding area is very minor in total
|
||||
numbers, so even if we would miss something (which is not expected
|
||||
now to our best knowledge) it's still good trade-off as the major
|
||||
goal is to reduce number of machines that have problems with the
|
||||
in-place upgrade.
|
||||
|
||||
The solution can be updated in future if there is a reason for it.
|
||||
---
|
||||
.../libraries/check_first_partition_offset.py | 7 +++++
|
||||
.../test_check_first_partition_offset.py | 16 +++++++++++
|
||||
.../libraries/scan_layout.py | 28 +++++++++++++++++++
|
||||
.../tests/test_scan_partition_layout.py | 5 ++++
|
||||
4 files changed, 56 insertions(+)
|
||||
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/libraries/check_first_partition_offset.py b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/libraries/check_first_partition_offset.py
|
||||
index fbd4e178..fca9c3ff 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/libraries/check_first_partition_offset.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/libraries/check_first_partition_offset.py
|
||||
@@ -16,6 +16,13 @@ def check_first_partition_offset():
|
||||
|
||||
problematic_devices = []
|
||||
for grub_dev in api.consume(GRUBDevicePartitionLayout):
|
||||
+ if not grub_dev.partitions:
|
||||
+ # NOTE(pstodulk): In case of empty partition list we have nothing to do.
|
||||
+ # This can could happen when the fdisk output is different then expected.
|
||||
+ # E.g. when GPT partition table is used on the disk. We are right now
|
||||
+ # interested strictly about MBR only, so ignoring these cases.
|
||||
+ # This is seatbelt, as the msg should not be produced for GPT at all.
|
||||
+ continue
|
||||
first_partition = min(grub_dev.partitions, key=lambda partition: partition.start_offset)
|
||||
if first_partition.start_offset < SAFE_OFFSET_BYTES:
|
||||
problematic_devices.append(grub_dev.device)
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/tests/test_check_first_partition_offset.py b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/tests/test_check_first_partition_offset.py
|
||||
index e349ff7d..f925f7d4 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/tests/test_check_first_partition_offset.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checkfirstpartitionoffset/tests/test_check_first_partition_offset.py
|
||||
@@ -20,6 +20,16 @@ from leapp.utils.report import is_inhibitor
|
||||
],
|
||||
True
|
||||
),
|
||||
+ (
|
||||
+ [
|
||||
+ GRUBDevicePartitionLayout(device='/dev/vda',
|
||||
+ partitions=[
|
||||
+ PartitionInfo(part_device='/dev/vda2', start_offset=1024*1025),
|
||||
+ PartitionInfo(part_device='/dev/vda1', start_offset=32256)
|
||||
+ ])
|
||||
+ ],
|
||||
+ True
|
||||
+ ),
|
||||
(
|
||||
[
|
||||
GRUBDevicePartitionLayout(device='/dev/vda',
|
||||
@@ -33,6 +43,12 @@ from leapp.utils.report import is_inhibitor
|
||||
partitions=[PartitionInfo(part_device='/dev/vda1', start_offset=1024*1024)])
|
||||
],
|
||||
False
|
||||
+ ),
|
||||
+ (
|
||||
+ [
|
||||
+ GRUBDevicePartitionLayout(device='/dev/vda', partitions=[])
|
||||
+ ],
|
||||
+ False
|
||||
)
|
||||
]
|
||||
)
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py
|
||||
index bb2e6d9e..f51bcda4 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/libraries/scan_layout.py
|
||||
@@ -31,6 +31,34 @@ def get_partition_layout(device):
|
||||
unit = int(unit.split(' ')[0].strip())
|
||||
break # First line of the partition table header
|
||||
|
||||
+ # Discover disk label type: dos | gpt
|
||||
+ for line in table_iter:
|
||||
+ line = line.strip()
|
||||
+ if not line.startswith('Disk label type'):
|
||||
+ continue
|
||||
+ disk_type = line.split(':')[1].strip()
|
||||
+ break
|
||||
+
|
||||
+ if disk_type == 'gpt':
|
||||
+ api.current_logger().info(
|
||||
+ 'Detected GPT partition table. Skipping produce of GRUBDevicePartitionLayout message.'
|
||||
+ )
|
||||
+ # NOTE(pstodulk): The GPT table has a different output format than
|
||||
+ # expected below, example (ignore start/end lines):
|
||||
+ # --------------------------- start ----------------------------------
|
||||
+ # # Start End Size Type Name
|
||||
+ # 1 2048 4095 1M BIOS boot
|
||||
+ # 2 4096 2101247 1G Microsoft basic
|
||||
+ # 3 2101248 41940991 19G Linux LVM
|
||||
+ # ---------------------------- end -----------------------------------
|
||||
+ # But mainly, in case of GPT, we have nothing to actually check as
|
||||
+ # we are gathering this data now mainly to get information about the
|
||||
+ # actual size of embedding area (MBR gap). In case of GPT, there is
|
||||
+ # bios boot / prep boot partition, which has always 1 MiB and fulfill
|
||||
+ # our expectations. So skip in this case another processing and generation
|
||||
+ # of the msg. Let's improve it in future if we find a reason for it.
|
||||
+ return None
|
||||
+
|
||||
for line in table_iter:
|
||||
line = line.strip()
|
||||
if not line.startswith('Device'):
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py
|
||||
index 37bb5bcf..54025379 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/scangrubdevpartitionlayout/tests/test_scan_partition_layout.py
|
||||
@@ -76,3 +76,8 @@ def test_get_partition_layout(monkeypatch, devices):
|
||||
expected_part_name_to_start = {part.name: part.start_offset*dev.sector_size for part in dev.partitions}
|
||||
actual_part_name_to_start = {part.part_device: part.start_offset for part in message.partitions}
|
||||
assert expected_part_name_to_start == actual_part_name_to_start
|
||||
+
|
||||
+
|
||||
+def test_get_partition_layout_gpt(monkeypatch):
|
||||
+ # TODO(pstodulk): skipping for now, due to time pressure. Testing for now manually.
|
||||
+ pass
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,152 +0,0 @@
|
||||
From 8d84c02b92f3a7a7d74a272aa31d5b0a0f24faea Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 11 Apr 2024 15:56:51 +0200
|
||||
Subject: [PATCH 16/34] repomapping: Add RHEL7 ELS repos
|
||||
|
||||
RHEL-21891
|
||||
---
|
||||
etc/leapp/files/repomap.json | 60 ++++++++++++++++++-
|
||||
.../common/models/repositoriesmap.py | 2 +-
|
||||
2 files changed, 59 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/etc/leapp/files/repomap.json b/etc/leapp/files/repomap.json
|
||||
index 57cab1ad..1ee6c56a 100644
|
||||
--- a/etc/leapp/files/repomap.json
|
||||
+++ b/etc/leapp/files/repomap.json
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
- "datetime": "202401261328Z",
|
||||
- "version_format": "1.2.0",
|
||||
+ "datetime": "202404091246Z",
|
||||
+ "version_format": "1.2.1",
|
||||
"mapping": [
|
||||
{
|
||||
"source_major_version": "7",
|
||||
@@ -303,6 +303,13 @@
|
||||
"channel": "beta",
|
||||
"repo_type": "rpm"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "7",
|
||||
+ "repoid": "rhel-7-for-system-z-els-rpms",
|
||||
+ "arch": "s390x",
|
||||
+ "channel": "els",
|
||||
+ "repo_type": "rpm"
|
||||
+ },
|
||||
{
|
||||
"major_version": "7",
|
||||
"repoid": "rhel-7-for-system-z-eus-rpms",
|
||||
@@ -346,6 +353,13 @@
|
||||
"channel": "e4s",
|
||||
"repo_type": "rpm"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "7",
|
||||
+ "repoid": "rhel-7-server-els-rpms",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "els",
|
||||
+ "repo_type": "rpm"
|
||||
+ },
|
||||
{
|
||||
"major_version": "7",
|
||||
"repoid": "rhel-7-server-eus-rpms",
|
||||
@@ -486,6 +500,13 @@
|
||||
"channel": "ga",
|
||||
"repo_type": "rpm"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "7",
|
||||
+ "repoid": "rhel-7-for-system-z-els-optional-rpms",
|
||||
+ "arch": "s390x",
|
||||
+ "channel": "els",
|
||||
+ "repo_type": "rpm"
|
||||
+ },
|
||||
{
|
||||
"major_version": "7",
|
||||
"repoid": "rhel-7-for-system-z-eus-optional-rpms",
|
||||
@@ -529,6 +550,13 @@
|
||||
"channel": "e4s",
|
||||
"repo_type": "rpm"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "7",
|
||||
+ "repoid": "rhel-7-server-els-optional-rpms",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "els",
|
||||
+ "repo_type": "rpm"
|
||||
+ },
|
||||
{
|
||||
"major_version": "7",
|
||||
"repoid": "rhel-7-server-eus-optional-rpms",
|
||||
@@ -892,6 +920,13 @@
|
||||
"channel": "beta",
|
||||
"repo_type": "rpm"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "7",
|
||||
+ "repoid": "rhel-sap-for-rhel-7-for-system-z-els-rpms",
|
||||
+ "arch": "s390x",
|
||||
+ "channel": "els",
|
||||
+ "repo_type": "rpm"
|
||||
+ },
|
||||
{
|
||||
"major_version": "7",
|
||||
"repoid": "rhel-sap-for-rhel-7-for-system-z-eus-rpms",
|
||||
@@ -920,6 +955,13 @@
|
||||
"channel": "e4s",
|
||||
"repo_type": "rpm"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "7",
|
||||
+ "repoid": "rhel-sap-for-rhel-7-server-els-rpms",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "els",
|
||||
+ "repo_type": "rpm"
|
||||
+ },
|
||||
{
|
||||
"major_version": "7",
|
||||
"repoid": "rhel-sap-for-rhel-7-server-eus-rhui-rpms",
|
||||
@@ -1022,6 +1064,13 @@
|
||||
"channel": "e4s",
|
||||
"repo_type": "rpm"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "7",
|
||||
+ "repoid": "rhel-sap-hana-for-rhel-7-server-els-rpms",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "els",
|
||||
+ "repo_type": "rpm"
|
||||
+ },
|
||||
{
|
||||
"major_version": "7",
|
||||
"repoid": "rhel-sap-hana-for-rhel-7-server-eus-rhui-rpms",
|
||||
@@ -1125,6 +1174,13 @@
|
||||
"channel": "e4s",
|
||||
"repo_type": "rpm"
|
||||
},
|
||||
+ {
|
||||
+ "major_version": "7",
|
||||
+ "repoid": "rhel-ha-for-rhel-7-server-els-rpms",
|
||||
+ "arch": "x86_64",
|
||||
+ "channel": "els",
|
||||
+ "repo_type": "rpm"
|
||||
+ },
|
||||
{
|
||||
"major_version": "7",
|
||||
"repoid": "rhel-ha-for-rhel-7-server-eus-rhui-rpms",
|
||||
diff --git a/repos/system_upgrade/common/models/repositoriesmap.py b/repos/system_upgrade/common/models/repositoriesmap.py
|
||||
index 7ef0bdb4..7192a60d 100644
|
||||
--- a/repos/system_upgrade/common/models/repositoriesmap.py
|
||||
+++ b/repos/system_upgrade/common/models/repositoriesmap.py
|
||||
@@ -61,7 +61,7 @@ class PESIDRepositoryEntry(Model):
|
||||
too.
|
||||
"""
|
||||
|
||||
- channel = fields.StringEnum(['ga', 'e4s', 'eus', 'aus', 'beta'])
|
||||
+ channel = fields.StringEnum(['ga', 'e4s', 'eus', 'aus', 'beta', 'els'])
|
||||
"""
|
||||
The 'channel' of the repository.
|
||||
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From f154c6566a2fbeb4fe64405794b6777c156cabcb Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 15 Apr 2024 17:13:03 +0200
|
||||
Subject: [PATCH 17/34] bump required repomap version
|
||||
|
||||
---
|
||||
.../actors/repositoriesmapping/libraries/repositoriesmapping.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py b/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py
|
||||
index 8045634e..58089195 100644
|
||||
--- a/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py
|
||||
+++ b/repos/system_upgrade/common/actors/repositoriesmapping/libraries/repositoriesmapping.py
|
||||
@@ -17,7 +17,7 @@ REPOMAP_FILE = 'repomap.json'
|
||||
|
||||
|
||||
class RepoMapData(object):
|
||||
- VERSION_FORMAT = '1.2.0'
|
||||
+ VERSION_FORMAT = '1.2.1'
|
||||
|
||||
def __init__(self):
|
||||
self.repositories = []
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
From 6dc1621c4395412724d8cccf7a2694013fb4f5f0 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 15 Apr 2024 17:25:07 +0200
|
||||
Subject: [PATCH 18/34] fixup! bump required repomap version
|
||||
|
||||
---
|
||||
.../actors/repositoriesmapping/tests/files/repomap_example.json | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/repositoriesmapping/tests/files/repomap_example.json b/repos/system_upgrade/common/actors/repositoriesmapping/tests/files/repomap_example.json
|
||||
index 5e95f5fe..a5fc5fe1 100644
|
||||
--- a/repos/system_upgrade/common/actors/repositoriesmapping/tests/files/repomap_example.json
|
||||
+++ b/repos/system_upgrade/common/actors/repositoriesmapping/tests/files/repomap_example.json
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"datetime": "202107141655Z",
|
||||
- "version_format": "1.2.0",
|
||||
+ "version_format": "1.2.1",
|
||||
"mapping": [
|
||||
{
|
||||
"source_major_version": "7",
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
From a5bd2546f748ddac4240b3a34b168e422ef78c99 Mon Sep 17 00:00:00 2001
|
||||
From: David Kubek <dkubek@redhat.com>
|
||||
Date: Wed, 24 Apr 2024 11:05:32 +0200
|
||||
Subject: [PATCH 19/34] Fix incorrect command formulation
|
||||
|
||||
Mitigation of an error where instead of no argument an "empty argument"
|
||||
was passed to `lscpu`
|
||||
|
||||
lscpu ''
|
||||
|
||||
vs.
|
||||
|
||||
lscpu
|
||||
---
|
||||
repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
index 7451066a..db3f92d4 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
@@ -12,7 +12,7 @@ PPC64LE_MODEL = re.compile(r'\d+\.\d+ \(pvr (?P<family>[0-9a-fA-F]+) 0*[0-9a-fA-
|
||||
|
||||
def _get_lscpu_output(output_json=False):
|
||||
try:
|
||||
- result = run(['lscpu', '-J' if output_json else ''])
|
||||
+ result = run(['lscpu'] + (['-J'] if output_json else []))
|
||||
return result.get('stdout', '')
|
||||
except (OSError, CalledProcessError):
|
||||
api.current_logger().debug('Executing `lscpu` failed', exc_info=True)
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
From 5e51626069dd7d5e38f36cafdd45f14cfb213e5d Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Thu, 25 Apr 2024 14:59:55 +0200
|
||||
Subject: [PATCH 20/34] mention `Report` in produces of
|
||||
transitionsystemdservicesstates (#1210)
|
||||
|
||||
fixes upgrade warnings:
|
||||
|
||||
leapp.workflow.Applications.transition_systemd_services_states: Actor is trying to produce a message of type "<class 'leapp.reporting.Report'>" without mentioning it explicitely in the actor's "produces" tuple. The message will be ignored
|
||||
---
|
||||
.../actors/systemd/transitionsystemdservicesstates/actor.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/actor.py b/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/actor.py
|
||||
index 139f9f6b..d2863e09 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/actor.py
|
||||
@@ -7,6 +7,7 @@ from leapp.models import (
|
||||
SystemdServicesPresetInfoTarget,
|
||||
SystemdServicesTasks
|
||||
)
|
||||
+from leapp.reporting import Report
|
||||
from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag
|
||||
|
||||
|
||||
@@ -46,7 +47,7 @@ class TransitionSystemdServicesStates(Actor):
|
||||
SystemdServicesPresetInfoSource,
|
||||
SystemdServicesPresetInfoTarget
|
||||
)
|
||||
- produces = (SystemdServicesTasks,)
|
||||
+ produces = (Report, SystemdServicesTasks)
|
||||
tags = (ApplicationsPhaseTag, IPUWorkflowTag)
|
||||
|
||||
def process(self):
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
From 346b741209553b9aeb96f2f728480e740a25e0af Mon Sep 17 00:00:00 2001
|
||||
From: Inessa Vasilevskaya <ivasilev@redhat.com>
|
||||
Date: Thu, 25 Apr 2024 13:25:56 +0200
|
||||
Subject: [PATCH 21/34] Update packit config after tier redefinition
|
||||
|
||||
Now for basic sanity test verification in upstream tests
|
||||
tagged by 'tier0' will be used instead of 'sanity'.
|
||||
|
||||
RHELMISC-3211
|
||||
---
|
||||
.packit.yaml | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index bce97bad..ed6412dc 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:sanity & enabled:true'
|
||||
+ plan_filter: 'tag:tier0 & enabled:true'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -318,7 +318,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
|
||||
+ plan_filter: 'tag:tier0 & tag:8to9 & enabled:true'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -407,7 +407,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
|
||||
+ plan_filter: 'tag:tier0 & tag:8to9 & enabled:true'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
From 0d904126f785ae785e29165bf83a493d8f837fbe Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Fri, 26 Apr 2024 14:45:06 +0200
|
||||
Subject: [PATCH 22/34] Update reboot msg: Note the console access
|
||||
|
||||
Some users hasn't read the upgrade documentation and are not aware
|
||||
that after the reboot the actual upgrade is processing. As they wait
|
||||
just for the ssh connection, they think that something is wrong and
|
||||
sometimes reboot the machine, interrupting the entire process, making
|
||||
the machine broken in some cases.
|
||||
|
||||
Adding info that they need a console access in case they want to watch
|
||||
the upgrade progress.
|
||||
|
||||
Jira: https://issues.redhat.com/browse/RHEL-27231
|
||||
---
|
||||
commands/upgrade/__init__.py | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py
|
||||
index cc5fe647..1e15b59c 100644
|
||||
--- a/commands/upgrade/__init__.py
|
||||
+++ b/commands/upgrade/__init__.py
|
||||
@@ -117,6 +117,7 @@ def upgrade(args, breadcrumbs):
|
||||
sys.stdout.write(
|
||||
'Reboot the system to continue with the upgrade.'
|
||||
' This might take a while depending on the system configuration.\n'
|
||||
+ 'Make sure you have console access to view the actual upgrade process.\n'
|
||||
)
|
||||
|
||||
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,435 +0,0 @@
|
||||
From 2b27cfbbed1059d8af1add3a209d919901897e47 Mon Sep 17 00:00:00 2001
|
||||
From: Toshio Kuratomi <tkuratom@redhat.com>
|
||||
Date: Tue, 30 Apr 2024 07:28:35 -0700
|
||||
Subject: [PATCH 23/34] Fix kernel cmdline args we add not being propogated to
|
||||
newly installed kernels. (#1193)
|
||||
|
||||
On some upgrades, any kernel commandline args that we were adding were added to the default kernel
|
||||
but once the user installed a new kernel, those args were not propogated to the new kernel. This
|
||||
was happening on S390x and on RHEL7=>8 upgrades.
|
||||
|
||||
To fix this, we add the kernel commandline args to both the default kernel and to the defaults for
|
||||
all kernels.
|
||||
|
||||
On S390x and upgrades to RHEL9 or greater, this is done by placing the kernel cmdline arguments into
|
||||
the /etc/kernel/cmdline file.
|
||||
|
||||
On upgrades to RHEL <= 8 for all architectures other than S390x, this is done by having
|
||||
grub2-editenv modify the /boot/grub2/grubenv file.
|
||||
|
||||
Jira: RHEL-26840, OAMG-10424
|
||||
---
|
||||
.../actors/kernelcmdlineconfig/actor.py | 3 +-
|
||||
.../libraries/kernelcmdlineconfig.py | 166 +++++++++++++++++-
|
||||
.../tests/test_kernelcmdlineconfig.py | 116 ++++++++++--
|
||||
3 files changed, 261 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/kernelcmdlineconfig/actor.py b/repos/system_upgrade/common/actors/kernelcmdlineconfig/actor.py
|
||||
index 13c47113..b44fd835 100644
|
||||
--- a/repos/system_upgrade/common/actors/kernelcmdlineconfig/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/kernelcmdlineconfig/actor.py
|
||||
@@ -29,4 +29,5 @@ class KernelCmdlineConfig(Actor):
|
||||
|
||||
if ff.firmware == 'bios' and os.path.ismount('/boot/efi'):
|
||||
configs = ['/boot/grub2/grub.cfg', '/boot/efi/EFI/redhat/grub.cfg']
|
||||
- kernelcmdlineconfig.modify_kernel_args_in_boot_cfg(configs)
|
||||
+
|
||||
+ kernelcmdlineconfig.entrypoint(configs)
|
||||
diff --git a/repos/system_upgrade/common/actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py b/repos/system_upgrade/common/actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py
|
||||
index f98e8168..ad59eb22 100644
|
||||
--- a/repos/system_upgrade/common/actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py
|
||||
@@ -1,9 +1,27 @@
|
||||
+import re
|
||||
+
|
||||
+from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries import stdlib
|
||||
-from leapp.libraries.common.config import architecture
|
||||
+from leapp.libraries.common.config import architecture, version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import InstalledTargetKernelInfo, KernelCmdlineArg, TargetKernelCmdlineArgTasks
|
||||
|
||||
+KERNEL_CMDLINE_FILE = "/etc/kernel/cmdline"
|
||||
+
|
||||
+
|
||||
+class ReadOfKernelArgsError(Exception):
|
||||
+ """
|
||||
+ Failed to retrieve the kernel command line arguments
|
||||
+ """
|
||||
+
|
||||
+
|
||||
+def use_cmdline_file():
|
||||
+ if (architecture.matches_architecture(architecture.ARCH_S390X) or
|
||||
+ version.matches_target_version('>= 9.0')):
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
|
||||
def run_grubby_cmd(cmd):
|
||||
try:
|
||||
@@ -15,6 +33,9 @@ def run_grubby_cmd(cmd):
|
||||
stdlib.run(['/usr/sbin/zipl'])
|
||||
|
||||
except (OSError, stdlib.CalledProcessError) as e:
|
||||
+ # In most cases we don't raise StopActorExecutionError in post-upgrade
|
||||
+ # actors.
|
||||
+ #
|
||||
raise StopActorExecutionError(
|
||||
"Failed to append extra arguments to kernel command line.",
|
||||
details={"details": str(e)})
|
||||
@@ -31,22 +52,36 @@ def format_kernelarg_msgs_for_grubby_cmd(kernelarg_msgs):
|
||||
return ' '.join(kernel_args)
|
||||
|
||||
|
||||
-def modify_kernel_args_in_boot_cfg(configs_to_modify_explicitly=None):
|
||||
- kernel_info = next(api.consume(InstalledTargetKernelInfo), None)
|
||||
- if not kernel_info:
|
||||
- return
|
||||
+def set_default_kernel_args(kernel_args):
|
||||
+ if use_cmdline_file():
|
||||
+ # Put kernel_args into /etc/kernel/cmdline
|
||||
+ with open(KERNEL_CMDLINE_FILE, 'w') as f:
|
||||
+ f.write(kernel_args)
|
||||
+ else:
|
||||
+ # Use grub2-editenv to put the kernel args into /boot/grub2/grubenv
|
||||
+ stdlib.run(['grub2-editenv', '-', 'set', 'kernelopts={}'.format(kernel_args)])
|
||||
|
||||
- # Collect desired kernelopt modifications
|
||||
+
|
||||
+def retrieve_arguments_to_modify():
|
||||
+ """
|
||||
+ Retrieve the arguments other actors would like to add or remove from the kernel cmdline.
|
||||
+ """
|
||||
kernelargs_msgs_to_add = list(api.consume(KernelCmdlineArg))
|
||||
kernelargs_msgs_to_remove = []
|
||||
+
|
||||
for target_kernel_arg_task in api.consume(TargetKernelCmdlineArgTasks):
|
||||
kernelargs_msgs_to_add.extend(target_kernel_arg_task.to_add)
|
||||
kernelargs_msgs_to_remove.extend(target_kernel_arg_task.to_remove)
|
||||
|
||||
- if not kernelargs_msgs_to_add and not kernelargs_msgs_to_remove:
|
||||
- return # There is no work to do
|
||||
+ return kernelargs_msgs_to_add, kernelargs_msgs_to_remove
|
||||
+
|
||||
|
||||
- grubby_modify_kernelargs_cmd = ['grubby', '--update-kernel={0}'.format(kernel_info.kernel_img_path)]
|
||||
+def modify_args_for_default_kernel(kernel_info,
|
||||
+ kernelargs_msgs_to_add,
|
||||
+ kernelargs_msgs_to_remove,
|
||||
+ configs_to_modify_explicitly=None):
|
||||
+ grubby_modify_kernelargs_cmd = ['grubby',
|
||||
+ '--update-kernel={0}'.format(kernel_info.kernel_img_path)]
|
||||
|
||||
if kernelargs_msgs_to_add:
|
||||
grubby_modify_kernelargs_cmd += [
|
||||
@@ -64,3 +99,116 @@ def modify_kernel_args_in_boot_cfg(configs_to_modify_explicitly=None):
|
||||
run_grubby_cmd(cmd)
|
||||
else:
|
||||
run_grubby_cmd(grubby_modify_kernelargs_cmd)
|
||||
+
|
||||
+
|
||||
+def _extract_grubby_value(record):
|
||||
+ data = record.split('=', 1)[1]
|
||||
+ matches = re.match(r'^([\'"]?)(.*)\1$', data)
|
||||
+ return matches.group(2)
|
||||
+
|
||||
+
|
||||
+def retrieve_args_for_default_kernel(kernel_info):
|
||||
+ # Copy the args for the default kernel to all kernels.
|
||||
+ kernel_args = None
|
||||
+ kernel_root = None
|
||||
+ cmd = ['grubby', '--info', kernel_info.kernel_img_path]
|
||||
+ output = stdlib.run(cmd, split=False)
|
||||
+ for record in output['stdout'].splitlines():
|
||||
+ # This could be done with one regex but it's cleaner to parse it as
|
||||
+ # structured data.
|
||||
+ if record.startswith('args='):
|
||||
+ temp_kernel_args = _extract_grubby_value(record)
|
||||
+
|
||||
+ if kernel_args:
|
||||
+ api.current_logger().warning('Grubby output is malformed:'
|
||||
+ ' `args=` is listed more than once.')
|
||||
+ if kernel_args != temp_kernel_args:
|
||||
+ raise ReadOfKernelArgsError('Grubby listed `args=` multiple'
|
||||
+ ' times with different values.')
|
||||
+ kernel_args = _extract_grubby_value(record)
|
||||
+ elif record.startswith('root='):
|
||||
+ api.current_logger().warning('Grubby output is malformed:'
|
||||
+ ' `root=` is listed more than once.')
|
||||
+ if kernel_root:
|
||||
+ raise ReadOfKernelArgsError('Grubby listed `root=` multiple'
|
||||
+ ' times with different values')
|
||||
+ kernel_root = _extract_grubby_value(record)
|
||||
+
|
||||
+ if not kernel_args or not kernel_root:
|
||||
+ raise ReadOfKernelArgsError(
|
||||
+ 'Failed to retrieve kernel command line to save for future installed'
|
||||
+ ' kernels: root={}, args={}'.format(kernel_root, kernel_args)
|
||||
+ )
|
||||
+
|
||||
+ return kernel_root, kernel_args
|
||||
+
|
||||
+
|
||||
+def modify_kernel_args_in_boot_cfg(configs_to_modify_explicitly=None):
|
||||
+ kernel_info = next(api.consume(InstalledTargetKernelInfo), None)
|
||||
+ if not kernel_info:
|
||||
+ return
|
||||
+
|
||||
+ # Collect desired kernelopt modifications
|
||||
+ kernelargs_msgs_to_add, kernelargs_msgs_to_remove = retrieve_arguments_to_modify()
|
||||
+ if not kernelargs_msgs_to_add and not kernelargs_msgs_to_remove:
|
||||
+ # Nothing to do
|
||||
+ return
|
||||
+
|
||||
+ # Modify the kernel cmdline for the default kernel
|
||||
+ modify_args_for_default_kernel(kernel_info,
|
||||
+ kernelargs_msgs_to_add,
|
||||
+ kernelargs_msgs_to_remove,
|
||||
+ configs_to_modify_explicitly)
|
||||
+
|
||||
+ # Copy kernel params from the default kernel to all the kernels
|
||||
+ kernel_root, kernel_args = retrieve_args_for_default_kernel(kernel_info)
|
||||
+ complete_kernel_args = 'root={} {}'.format(kernel_root, kernel_args)
|
||||
+ set_default_kernel_args(complete_kernel_args)
|
||||
+
|
||||
+
|
||||
+def entrypoint(configs=None):
|
||||
+ try:
|
||||
+ modify_kernel_args_in_boot_cfg(configs)
|
||||
+ except ReadOfKernelArgsError as e:
|
||||
+ api.current_logger().error(str(e))
|
||||
+
|
||||
+ if use_cmdline_file():
|
||||
+ report_hint = reporting.Hints(
|
||||
+ 'After the system has been rebooted into the new version of RHEL, you'
|
||||
+ ' should take the kernel cmdline arguments from /proc/cmdline (Everything'
|
||||
+ ' except the BOOT_IMAGE entry and initrd entries) and copy them into'
|
||||
+ ' /etc/kernel/cmdline before installing any new kernels.'
|
||||
+ )
|
||||
+ else:
|
||||
+ report_hint = reporting.Hints(
|
||||
+ 'After the system has been rebooted into the new version of RHEL, you'
|
||||
+ ' should take the kernel cmdline arguments from /proc/cmdline (Everything'
|
||||
+ ' except the BOOT_IMAGE entry and initrd entries) and then use the'
|
||||
+ ' grub2-editenv command to make them the default kernel args. For example,'
|
||||
+ ' if /proc/cmdline contains:\n\n'
|
||||
+ ' BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-425.3.1.el8.x86_64'
|
||||
+ ' root=/dev/mapper/rhel_ibm--root ro console=tty0'
|
||||
+ ' console=ttyS0,115200 rd_NO_PLYMOUTH\n\n'
|
||||
+ ' then run the following grub2-editenv command:\n\n'
|
||||
+ ' # grub2-editenv - set "kernelopts=root=/dev/mapper/rhel_ibm--root'
|
||||
+ ' ro console=tty0 console=ttyS0,115200 rd_NO_PLYMOUTH"'
|
||||
+ )
|
||||
+
|
||||
+ reporting.create_report([
|
||||
+ reporting.Title('Could not set the kernel arguments for future kernels'),
|
||||
+ reporting.Summary(
|
||||
+ 'During the upgrade we needed to modify the kernel command line arguments.'
|
||||
+ ' We were able to change the arguments for the default kernel but we were'
|
||||
+ ' not able to set the arguments as the default for kernels installed in'
|
||||
+ ' the future.'
|
||||
+ ),
|
||||
+ report_hint,
|
||||
+ reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Groups([
|
||||
+ reporting.Groups.BOOT,
|
||||
+ reporting.Groups.KERNEL,
|
||||
+ reporting.Groups.POST,
|
||||
+ ]),
|
||||
+ reporting.RelatedResource('file', '/etc/kernel/cmdline'),
|
||||
+ reporting.RelatedResource('file', '/proc/cmdline'),
|
||||
+ ])
|
||||
diff --git a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
index 3f9b2e5e..ffe4b046 100644
|
||||
--- a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
@@ -1,7 +1,10 @@
|
||||
+from __future__ import division
|
||||
+
|
||||
from collections import namedtuple
|
||||
|
||||
import pytest
|
||||
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries import stdlib
|
||||
from leapp.libraries.actor import kernelcmdlineconfig
|
||||
from leapp.libraries.common.config import architecture
|
||||
@@ -11,14 +14,44 @@ from leapp.models import InstalledTargetKernelInfo, KernelCmdlineArg, TargetKern
|
||||
|
||||
TARGET_KERNEL_NEVRA = 'kernel-core-1.2.3-4.x86_64.el8.x64_64'
|
||||
|
||||
+# pylint: disable=E501
|
||||
+SAMPLE_KERNEL_ARGS = ('ro rootflags=subvol=root'
|
||||
+ ' resume=/dev/mapper/luks-2c0df999-81ec-4a35-a1f9-b93afee8c6ad'
|
||||
+ ' rd.luks.uuid=luks-90a6412f-c588-46ca-9118-5aca35943d25'
|
||||
+ ' rd.luks.uuid=luks-2c0df999-81ec-4a35-a1f9-b93afee8c6ad rhgb quiet'
|
||||
+ )
|
||||
+SAMPLE_KERNEL_ROOT = 'UUID=1aa15850-2685-418d-95a6-f7266a2de83a'
|
||||
+TEMPLATE_GRUBBY_INFO_OUTPUT = """index=0
|
||||
+kernel="/boot/vmlinuz-6.5.13-100.fc37.x86_64"
|
||||
+args="{0}"
|
||||
+root="{1}"
|
||||
+initrd="/boot/initramfs-6.5.13-100.fc37.x86_64.img"
|
||||
+title="Fedora Linux (6.5.13-100.fc37.x86_64) 37 (Thirty Seven)"
|
||||
+id="a3018267cdd8451db7c77bb3e5b1403d-6.5.13-100.fc37.x86_64"
|
||||
+""" # noqa: E501
|
||||
+SAMPLE_GRUBBY_INFO_OUTPUT = TEMPLATE_GRUBBY_INFO_OUTPUT.format(SAMPLE_KERNEL_ARGS, SAMPLE_KERNEL_ROOT)
|
||||
+# pylint: enable=E501
|
||||
+
|
||||
|
||||
class MockedRun(object):
|
||||
- def __init__(self):
|
||||
+ def __init__(self, outputs=None):
|
||||
+ """
|
||||
+ Mock stdlib.run().
|
||||
+
|
||||
+ If outputs is given, it is a dictionary mapping a cmd to output as stdout.
|
||||
+ """
|
||||
self.commands = []
|
||||
+ self.outputs = outputs or {}
|
||||
|
||||
def __call__(self, cmd, *args, **kwargs):
|
||||
self.commands.append(cmd)
|
||||
- return {}
|
||||
+ return {
|
||||
+ "stdout": self.outputs.get(" ".join(cmd), ""),
|
||||
+ "stderr": "",
|
||||
+ "signal": None,
|
||||
+ "exit_code": 0,
|
||||
+ "pid": 1234,
|
||||
+ }
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
@@ -50,7 +83,7 @@ class MockedRun(object):
|
||||
),
|
||||
]
|
||||
)
|
||||
-def test_kernelcmdline_config_valid_msgs(monkeypatch, msgs, expected_grubby_kernelopt_args):
|
||||
+def test_kernelcmdline_config_valid_msgs(monkeypatch, tmpdir, msgs, expected_grubby_kernelopt_args):
|
||||
kernel_img_path = '/boot/vmlinuz-X'
|
||||
kernel_info = InstalledTargetKernelInfo(pkg_nevra=TARGET_KERNEL_NEVRA,
|
||||
uname_r='',
|
||||
@@ -61,18 +94,28 @@ def test_kernelcmdline_config_valid_msgs(monkeypatch, msgs, expected_grubby_kern
|
||||
grubby_base_cmd = ['grubby', '--update-kernel={}'.format(kernel_img_path)]
|
||||
expected_grubby_cmd = grubby_base_cmd + expected_grubby_kernelopt_args
|
||||
|
||||
- mocked_run = MockedRun()
|
||||
+ mocked_run = MockedRun(
|
||||
+ outputs={" ".join(("grubby", "--info", kernel_img_path)): SAMPLE_GRUBBY_INFO_OUTPUT}
|
||||
+ )
|
||||
monkeypatch.setattr(stdlib, 'run', mocked_run)
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(architecture.ARCH_X86_64, msgs=msgs))
|
||||
+ monkeypatch.setattr(api, 'current_actor',
|
||||
+ CurrentActorMocked(architecture.ARCH_X86_64,
|
||||
+ dst_ver="8.1",
|
||||
+ msgs=msgs)
|
||||
+ )
|
||||
kernelcmdlineconfig.modify_kernel_args_in_boot_cfg()
|
||||
- assert mocked_run.commands and len(mocked_run.commands) == 1
|
||||
- assert expected_grubby_cmd == mocked_run.commands.pop()
|
||||
+ assert mocked_run.commands and len(mocked_run.commands) == 3
|
||||
+ assert expected_grubby_cmd == mocked_run.commands.pop(0)
|
||||
|
||||
- mocked_run = MockedRun()
|
||||
+ mocked_run = MockedRun(
|
||||
+ outputs={" ".join(("grubby", "--info", kernel_img_path)): SAMPLE_GRUBBY_INFO_OUTPUT}
|
||||
+ )
|
||||
monkeypatch.setattr(stdlib, 'run', mocked_run)
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(architecture.ARCH_S390X, msgs=msgs))
|
||||
+ monkeypatch.setattr(kernelcmdlineconfig, 'KERNEL_CMDLINE_FILE', str(tmpdir / 'cmdline'))
|
||||
+
|
||||
kernelcmdlineconfig.modify_kernel_args_in_boot_cfg()
|
||||
- assert mocked_run.commands and len(mocked_run.commands) == 2
|
||||
+ assert mocked_run.commands and len(mocked_run.commands) == 3
|
||||
assert expected_grubby_cmd == mocked_run.commands.pop(0)
|
||||
assert ['/usr/sbin/zipl'] == mocked_run.commands.pop(0)
|
||||
|
||||
@@ -86,9 +129,17 @@ def test_kernelcmdline_explicit_configs(monkeypatch):
|
||||
initramfs_path='/boot/initramfs-X')
|
||||
msgs = [kernel_info, TargetKernelCmdlineArgTasks(to_remove=[KernelCmdlineArg(key='key1', value='value1')])]
|
||||
|
||||
- mocked_run = MockedRun()
|
||||
+ grubby_cmd_info = ["grubby", "--info", kernel_img_path]
|
||||
+ mocked_run = MockedRun(
|
||||
+ outputs={" ".join(grubby_cmd_info): SAMPLE_GRUBBY_INFO_OUTPUT}
|
||||
+ )
|
||||
monkeypatch.setattr(stdlib, 'run', mocked_run)
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(architecture.ARCH_X86_64, msgs=msgs))
|
||||
+ monkeypatch.setattr(api, 'current_actor',
|
||||
+ CurrentActorMocked(architecture.ARCH_X86_64,
|
||||
+ dst_ver="8.1",
|
||||
+ msgs=msgs
|
||||
+ )
|
||||
+ )
|
||||
|
||||
configs = ['/boot/grub2/grub.cfg', '/boot/efi/EFI/redhat/grub.cfg']
|
||||
kernelcmdlineconfig.modify_kernel_args_in_boot_cfg(configs_to_modify_explicitly=configs)
|
||||
@@ -97,19 +148,27 @@ def test_kernelcmdline_explicit_configs(monkeypatch):
|
||||
'--remove-args', 'key1=value1']
|
||||
expected_cmds = [
|
||||
grubby_cmd_without_config + ['-c', '/boot/grub2/grub.cfg'],
|
||||
- grubby_cmd_without_config + ['-c', '/boot/efi/EFI/redhat/grub.cfg']
|
||||
+ grubby_cmd_without_config + ['-c', '/boot/efi/EFI/redhat/grub.cfg'],
|
||||
+ grubby_cmd_info,
|
||||
+ ["grub2-editenv", "-", "set", "kernelopts=root={} {}".format(
|
||||
+ SAMPLE_KERNEL_ROOT, SAMPLE_KERNEL_ARGS)],
|
||||
]
|
||||
|
||||
assert mocked_run.commands == expected_cmds
|
||||
|
||||
|
||||
def test_kernelcmdline_config_no_args(monkeypatch):
|
||||
+ kernel_img_path = '/boot/vmlinuz-X'
|
||||
kernel_info = InstalledTargetKernelInfo(pkg_nevra=TARGET_KERNEL_NEVRA,
|
||||
uname_r='',
|
||||
- kernel_img_path='/boot/vmlinuz-X',
|
||||
+ kernel_img_path=kernel_img_path,
|
||||
initramfs_path='/boot/initramfs-X')
|
||||
|
||||
- mocked_run = MockedRun()
|
||||
+ mocked_run = MockedRun(
|
||||
+ outputs={" ".join(("grubby", "--info", kernel_img_path)):
|
||||
+ TEMPLATE_GRUBBY_INFO_OUTPUT.format("", "")
|
||||
+ }
|
||||
+ )
|
||||
monkeypatch.setattr(stdlib, 'run', mocked_run)
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(architecture.ARCH_S390X, msgs=[kernel_info]))
|
||||
kernelcmdlineconfig.modify_kernel_args_in_boot_cfg()
|
||||
@@ -122,3 +181,32 @@ def test_kernelcmdline_config_no_version(monkeypatch):
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(architecture.ARCH_S390X))
|
||||
kernelcmdlineconfig.modify_kernel_args_in_boot_cfg()
|
||||
assert not mocked_run.commands
|
||||
+
|
||||
+
|
||||
+def test_kernelcmdline_config_malformed_args(monkeypatch):
|
||||
+ kernel_img_path = '/boot/vmlinuz-X'
|
||||
+ kernel_info = InstalledTargetKernelInfo(pkg_nevra=TARGET_KERNEL_NEVRA,
|
||||
+ uname_r='',
|
||||
+ kernel_img_path=kernel_img_path,
|
||||
+ initramfs_path='/boot/initramfs-X')
|
||||
+
|
||||
+ # For this test, we need to check we get the proper error if grubby --info
|
||||
+ # doesn't output any args information at all.
|
||||
+ grubby_info_output = "\n".join(line for line in SAMPLE_GRUBBY_INFO_OUTPUT.splitlines()
|
||||
+ if not line.startswith("args="))
|
||||
+ mocked_run = MockedRun(
|
||||
+ outputs={" ".join(("grubby", "--info", kernel_img_path)): grubby_info_output,
|
||||
+ }
|
||||
+ )
|
||||
+ msgs = [kernel_info,
|
||||
+ TargetKernelCmdlineArgTasks(to_remove=[
|
||||
+ KernelCmdlineArg(key='key1', value='value1')])
|
||||
+ ]
|
||||
+ monkeypatch.setattr(stdlib, 'run', mocked_run)
|
||||
+ monkeypatch.setattr(api, 'current_actor',
|
||||
+ CurrentActorMocked(architecture.ARCH_S390X, msgs=msgs))
|
||||
+
|
||||
+ with pytest.raises(kernelcmdlineconfig.ReadOfKernelArgsError,
|
||||
+ match="Failed to retrieve kernel command line to save for future"
|
||||
+ " installed kernels."):
|
||||
+ kernelcmdlineconfig.modify_kernel_args_in_boot_cfg()
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
From 0869ab168780f4fa10f37f34aaf51342a88c0e5c Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Tue, 30 Apr 2024 16:42:26 +0200
|
||||
Subject: [PATCH 24/34] kernelcmdlineconfig: add newline in /etc/kernel/cmdline
|
||||
|
||||
Previous solution created the file without adding the newline
|
||||
in the end of the file. The original solution worked, but to stay
|
||||
on the safe side, adding the expected new line.
|
||||
|
||||
Jira: RHEL-26840, OAMG-10424
|
||||
---
|
||||
.../actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py b/repos/system_upgrade/common/actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py
|
||||
index ad59eb22..238a8aa6 100644
|
||||
--- a/repos/system_upgrade/common/actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/kernelcmdlineconfig/libraries/kernelcmdlineconfig.py
|
||||
@@ -57,6 +57,8 @@ def set_default_kernel_args(kernel_args):
|
||||
# Put kernel_args into /etc/kernel/cmdline
|
||||
with open(KERNEL_CMDLINE_FILE, 'w') as f:
|
||||
f.write(kernel_args)
|
||||
+ # new line is expected in the EOF (POSIX).
|
||||
+ f.write('\n')
|
||||
else:
|
||||
# Use grub2-editenv to put the kernel args into /boot/grub2/grubenv
|
||||
stdlib.run(['grub2-editenv', '-', 'set', 'kernelopts={}'.format(kernel_args)])
|
||||
--
|
||||
2.42.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,110 +0,0 @@
|
||||
From 88126ef33db2094b89fc17ad9e9a3962a9bb7d65 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Mon, 19 Feb 2024 12:09:05 +0100
|
||||
Subject: [PATCH 27/34] Move common Satellite Upgrade code to "common"
|
||||
|
||||
This allows the re-use of the code in the el8toel9 upgrade.
|
||||
---
|
||||
.../satellite_upgrade_services/actor.py | 35 +++++++++++++++++++
|
||||
.../actors/satellite_upgrader/actor.py | 0
|
||||
.../tests/unit_test_satellite_upgrader.py | 0
|
||||
.../{el7toel8 => common}/models/satellite.py | 0
|
||||
.../satellite_upgrade_data_migration/actor.py | 15 +-------
|
||||
5 files changed, 36 insertions(+), 14 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/satellite_upgrade_services/actor.py
|
||||
rename repos/system_upgrade/{el7toel8 => common}/actors/satellite_upgrader/actor.py (100%)
|
||||
rename repos/system_upgrade/{el7toel8 => common}/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py (100%)
|
||||
rename repos/system_upgrade/{el7toel8 => common}/models/satellite.py (100%)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/satellite_upgrade_services/actor.py b/repos/system_upgrade/common/actors/satellite_upgrade_services/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..3cda49a9
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/satellite_upgrade_services/actor.py
|
||||
@@ -0,0 +1,35 @@
|
||||
+import glob
|
||||
+import os
|
||||
+
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.models import SatelliteFacts
|
||||
+from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+SYSTEMD_WANTS_BASE = '/etc/systemd/system/multi-user.target.wants/'
|
||||
+SERVICES_TO_DISABLE = ['dynflow-sidekiq@*', 'foreman', 'foreman-proxy',
|
||||
+ 'httpd', 'postgresql', 'pulpcore-api', 'pulpcore-content',
|
||||
+ 'pulpcore-worker@*', 'tomcat', 'redis']
|
||||
+
|
||||
+
|
||||
+class SatelliteUpgradeServices(Actor):
|
||||
+ """
|
||||
+ Reconfigure Satellite services
|
||||
+ """
|
||||
+
|
||||
+ name = 'satellite_upgrade_services'
|
||||
+ consumes = (SatelliteFacts,)
|
||||
+ produces = ()
|
||||
+ tags = (IPUWorkflowTag, ApplicationsPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ facts = next(self.consume(SatelliteFacts), None)
|
||||
+ if not facts or not facts.has_foreman:
|
||||
+ return
|
||||
+
|
||||
+ # disable services, will be re-enabled by the installer
|
||||
+ for service_name in SERVICES_TO_DISABLE:
|
||||
+ for service in glob.glob(os.path.join(SYSTEMD_WANTS_BASE, '{}.service'.format(service_name))):
|
||||
+ try:
|
||||
+ os.unlink(service)
|
||||
+ except OSError as e:
|
||||
+ self.log.warning('Failed disabling service {}: {}'.format(service, e))
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrader/actor.py b/repos/system_upgrade/common/actors/satellite_upgrader/actor.py
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/el7toel8/actors/satellite_upgrader/actor.py
|
||||
rename to repos/system_upgrade/common/actors/satellite_upgrader/actor.py
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py b/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/el7toel8/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
||||
rename to repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
||||
diff --git a/repos/system_upgrade/el7toel8/models/satellite.py b/repos/system_upgrade/common/models/satellite.py
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/el7toel8/models/satellite.py
|
||||
rename to repos/system_upgrade/common/models/satellite.py
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_data_migration/actor.py b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_data_migration/actor.py
|
||||
index 0cf66970..1dd52691 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_data_migration/actor.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_data_migration/actor.py
|
||||
@@ -11,15 +11,10 @@ POSTGRESQL_SCL_DATA_PATH = '/var/opt/rh/rh-postgresql12/lib/pgsql/data/'
|
||||
POSTGRESQL_USER = 'postgres'
|
||||
POSTGRESQL_GROUP = 'postgres'
|
||||
|
||||
-SYSTEMD_WANTS_BASE = '/etc/systemd/system/multi-user.target.wants/'
|
||||
-SERVICES_TO_DISABLE = ['dynflow-sidekiq@*', 'foreman', 'foreman-proxy',
|
||||
- 'httpd', 'postgresql', 'pulpcore-api', 'pulpcore-content',
|
||||
- 'pulpcore-worker@*', 'tomcat']
|
||||
-
|
||||
|
||||
class SatelliteUpgradeDataMigration(Actor):
|
||||
"""
|
||||
- Reconfigure Satellite services and migrate PostgreSQL data
|
||||
+ Migrate Satellite PostgreSQL data
|
||||
"""
|
||||
|
||||
name = 'satellite_upgrade_data_migration'
|
||||
@@ -32,14 +27,6 @@ class SatelliteUpgradeDataMigration(Actor):
|
||||
if not facts or not facts.has_foreman:
|
||||
return
|
||||
|
||||
- # disable services, will be re-enabled by the installer
|
||||
- for service_name in SERVICES_TO_DISABLE:
|
||||
- for service in glob.glob(os.path.join(SYSTEMD_WANTS_BASE, '{}.service'.format(service_name))):
|
||||
- try:
|
||||
- os.unlink(service)
|
||||
- except Exception as e: # pylint: disable=broad-except
|
||||
- self.log.warning('Failed disabling service {}: {}'.format(service, e))
|
||||
-
|
||||
if facts.postgresql.local_postgresql and os.path.exists(POSTGRESQL_SCL_DATA_PATH):
|
||||
# we can assume POSTGRESQL_DATA_PATH exists and is empty
|
||||
# move PostgreSQL data to the new home
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,252 +0,0 @@
|
||||
From 0f70dbf229c04b5374d767eeab25ad3fa32e0d8f Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Mon, 19 Feb 2024 12:23:28 +0100
|
||||
Subject: [PATCH 28/34] Add el8toel9 upgrade facts for Satellite
|
||||
|
||||
This adds the el8toel9 specific fact scanner/generator for Satellite
|
||||
upgrades. The result of this actor is what drives the actual upgrade
|
||||
actions.
|
||||
---
|
||||
.../actors/satellite_upgrade_facts/actor.py | 71 ++++++++
|
||||
.../unit_test_satellite_upgrade_facts.py | 151 ++++++++++++++++++
|
||||
2 files changed, 222 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/actor.py
|
||||
create mode 100644 repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/actor.py b/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..2dc78cce
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/actor.py
|
||||
@@ -0,0 +1,71 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.common.config import architecture
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.models import (
|
||||
+ InstalledRPM,
|
||||
+ RepositoriesSetupTasks,
|
||||
+ RpmTransactionTasks,
|
||||
+ SatelliteFacts,
|
||||
+ SatellitePostgresqlFacts,
|
||||
+ UsedRepositories
|
||||
+)
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+RELATED_PACKAGES = ('foreman', 'foreman-selinux', 'foreman-proxy', 'katello', 'katello-selinux',
|
||||
+ 'candlepin', 'candlepin-selinux', 'pulpcore-selinux', 'satellite', 'satellite-capsule')
|
||||
+RELATED_PACKAGE_PREFIXES = ('rubygem-hammer', 'rubygem-foreman', 'rubygem-katello',
|
||||
+ 'rubygem-smart_proxy', 'python3.11-pulp', 'foreman-installer',
|
||||
+ 'satellite-installer')
|
||||
+
|
||||
+
|
||||
+class SatelliteUpgradeFacts(Actor):
|
||||
+ """
|
||||
+ Report which Satellite packages require updates and how to handle PostgreSQL data
|
||||
+ """
|
||||
+
|
||||
+ name = 'satellite_upgrade_facts'
|
||||
+ consumes = (InstalledRPM, UsedRepositories)
|
||||
+ produces = (RepositoriesSetupTasks, RpmTransactionTasks, SatelliteFacts)
|
||||
+ tags = (IPUWorkflowTag, FactsPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ if not architecture.matches_architecture(architecture.ARCH_X86_64):
|
||||
+ return
|
||||
+
|
||||
+ has_foreman = has_package(InstalledRPM, 'foreman') or has_package(InstalledRPM, 'foreman-proxy')
|
||||
+ if not has_foreman:
|
||||
+ return
|
||||
+
|
||||
+ local_postgresql = has_package(InstalledRPM, 'postgresql-server')
|
||||
+
|
||||
+ to_install = ['rubygem-foreman_maintain']
|
||||
+
|
||||
+ for rpm_pkgs in self.consume(InstalledRPM):
|
||||
+ for pkg in rpm_pkgs.items:
|
||||
+ if pkg.name in RELATED_PACKAGES or pkg.name.startswith(RELATED_PACKAGE_PREFIXES):
|
||||
+ to_install.append(pkg.name)
|
||||
+
|
||||
+ if local_postgresql:
|
||||
+ to_install.extend(['postgresql', 'postgresql-server'])
|
||||
+ if has_package(InstalledRPM, 'postgresql-contrib'):
|
||||
+ to_install.append('postgresql-contrib')
|
||||
+ if has_package(InstalledRPM, 'postgresql-evr'):
|
||||
+ to_install.append('postgresql-evr')
|
||||
+
|
||||
+ self.produce(SatelliteFacts(
|
||||
+ has_foreman=has_foreman,
|
||||
+ has_katello_installer=False,
|
||||
+ postgresql=SatellitePostgresqlFacts(
|
||||
+ local_postgresql=local_postgresql,
|
||||
+ ),
|
||||
+ ))
|
||||
+
|
||||
+ repositories_to_enable = []
|
||||
+ for used_repos in self.consume(UsedRepositories):
|
||||
+ for used_repo in used_repos.repositories:
|
||||
+ if used_repo.repository.startswith(('satellite-6', 'satellite-capsule-6', 'satellite-maintenance-6')):
|
||||
+ repositories_to_enable.append(used_repo.repository.replace('for-rhel-8', 'for-rhel-9'))
|
||||
+ if repositories_to_enable:
|
||||
+ self.produce(RepositoriesSetupTasks(to_enable=repositories_to_enable))
|
||||
+
|
||||
+ self.produce(RpmTransactionTasks(to_install=to_install))
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py b/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py
|
||||
new file mode 100644
|
||||
index 00000000..b0e44c46
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py
|
||||
@@ -0,0 +1,151 @@
|
||||
+from leapp.libraries.common.config import mock_configs
|
||||
+from leapp.models import (
|
||||
+ InstalledRPM,
|
||||
+ RepositoriesSetupTasks,
|
||||
+ RPM,
|
||||
+ RpmTransactionTasks,
|
||||
+ SatelliteFacts,
|
||||
+ UsedRepositories,
|
||||
+ UsedRepository
|
||||
+)
|
||||
+
|
||||
+RH_PACKAGER = 'Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>'
|
||||
+
|
||||
+
|
||||
+def fake_package(pkg_name):
|
||||
+ return RPM(name=pkg_name, version='0.1', release='1.sm01', epoch='1', packager=RH_PACKAGER, arch='noarch',
|
||||
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51')
|
||||
+
|
||||
+
|
||||
+FOREMAN_RPM = fake_package('foreman')
|
||||
+FOREMAN_PROXY_RPM = fake_package('foreman-proxy')
|
||||
+KATELLO_INSTALLER_RPM = fake_package('foreman-installer-katello')
|
||||
+KATELLO_RPM = fake_package('katello')
|
||||
+RUBYGEM_KATELLO_RPM = fake_package('rubygem-katello')
|
||||
+RUBYGEM_FOREMAN_PUPPET_RPM = fake_package('rubygem-foreman_puppet')
|
||||
+POSTGRESQL_RPM = fake_package('postgresql-server')
|
||||
+SATELLITE_RPM = fake_package('satellite')
|
||||
+SATELLITE_CAPSULE_RPM = fake_package('satellite-capsule')
|
||||
+
|
||||
+SATELLITE_REPOSITORY = UsedRepository(repository='satellite-6.99-for-rhel-8-x86_64-rpms')
|
||||
+CAPSULE_REPOSITORY = UsedRepository(repository='satellite-capsule-6.99-for-rhel-8-x86_64-rpms')
|
||||
+MAINTENANCE_REPOSITORY = UsedRepository(repository='satellite-maintenance-6.99-for-rhel-8-x86_64-rpms')
|
||||
+
|
||||
+
|
||||
+def test_no_satellite_present(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ message = current_actor_context.consume(SatelliteFacts)
|
||||
+ assert not message
|
||||
+
|
||||
+
|
||||
+def test_satellite_present(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ message = current_actor_context.consume(SatelliteFacts)[0]
|
||||
+ assert message.has_foreman
|
||||
+
|
||||
+
|
||||
+def test_wrong_arch(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG_S390X)
|
||||
+ message = current_actor_context.consume(SatelliteFacts)
|
||||
+ assert not message
|
||||
+
|
||||
+
|
||||
+def test_satellite_capsule_present(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_PROXY_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ message = current_actor_context.consume(SatelliteFacts)[0]
|
||||
+ assert message.has_foreman
|
||||
+
|
||||
+
|
||||
+def test_no_katello_installer_present(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ message = current_actor_context.consume(SatelliteFacts)[0]
|
||||
+ assert not message.has_katello_installer
|
||||
+
|
||||
+
|
||||
+def test_katello_installer_present(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM, KATELLO_INSTALLER_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ message = current_actor_context.consume(SatelliteFacts)[0]
|
||||
+ # while the katello installer rpm is present, we do not want this to be true
|
||||
+ # as the version in EL8 doesn't have the system checks we skip with this flag
|
||||
+ assert not message.has_katello_installer
|
||||
+
|
||||
+
|
||||
+def test_installs_related_package(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM, KATELLO_RPM, RUBYGEM_KATELLO_RPM,
|
||||
+ RUBYGEM_FOREMAN_PUPPET_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ message = current_actor_context.consume(RpmTransactionTasks)[0]
|
||||
+ assert 'katello' in message.to_install
|
||||
+ assert 'rubygem-katello' in message.to_install
|
||||
+ assert 'rubygem-foreman_puppet' in message.to_install
|
||||
+
|
||||
+
|
||||
+def test_installs_satellite_package(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM, SATELLITE_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ message = current_actor_context.consume(RpmTransactionTasks)[0]
|
||||
+ assert 'satellite' in message.to_install
|
||||
+ assert 'satellite-capsule' not in message.to_install
|
||||
+
|
||||
+
|
||||
+def test_installs_satellite_capsule_package(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_PROXY_RPM, SATELLITE_CAPSULE_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ message = current_actor_context.consume(RpmTransactionTasks)[0]
|
||||
+ assert 'satellite-capsule' in message.to_install
|
||||
+ assert 'satellite' not in message.to_install
|
||||
+
|
||||
+
|
||||
+def test_detects_local_postgresql(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM, POSTGRESQL_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+
|
||||
+ satellitemsg = current_actor_context.consume(SatelliteFacts)[0]
|
||||
+ assert satellitemsg.postgresql.local_postgresql
|
||||
+
|
||||
+
|
||||
+def test_detects_remote_postgresql(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+
|
||||
+ satellitemsg = current_actor_context.consume(SatelliteFacts)[0]
|
||||
+ assert not satellitemsg.postgresql.local_postgresql
|
||||
+
|
||||
+
|
||||
+def test_enables_right_repositories_on_satellite(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM, SATELLITE_RPM]))
|
||||
+ current_actor_context.feed(UsedRepositories(repositories=[SATELLITE_REPOSITORY, MAINTENANCE_REPOSITORY]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+
|
||||
+ rpmmessage = current_actor_context.consume(RepositoriesSetupTasks)[0]
|
||||
+
|
||||
+ assert 'satellite-maintenance-6.99-for-rhel-9-x86_64-rpms' in rpmmessage.to_enable
|
||||
+ assert 'satellite-6.99-for-rhel-9-x86_64-rpms' in rpmmessage.to_enable
|
||||
+ assert 'satellite-capsule-6.99-for-rhel-9-x86_64-rpms' not in rpmmessage.to_enable
|
||||
+
|
||||
+
|
||||
+def test_enables_right_repositories_on_capsule(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_PROXY_RPM, SATELLITE_CAPSULE_RPM]))
|
||||
+ current_actor_context.feed(UsedRepositories(repositories=[CAPSULE_REPOSITORY, MAINTENANCE_REPOSITORY]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+
|
||||
+ rpmmessage = current_actor_context.consume(RepositoriesSetupTasks)[0]
|
||||
+
|
||||
+ assert 'satellite-maintenance-6.99-for-rhel-9-x86_64-rpms' in rpmmessage.to_enable
|
||||
+ assert 'satellite-6.99-for-rhel-9-x86_64-rpms' not in rpmmessage.to_enable
|
||||
+ assert 'satellite-capsule-6.99-for-rhel-9-x86_64-rpms' in rpmmessage.to_enable
|
||||
+
|
||||
+
|
||||
+def test_enables_right_repositories_on_upstream(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+
|
||||
+ message = current_actor_context.consume(RepositoriesSetupTasks)
|
||||
+
|
||||
+ assert not message
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,112 +0,0 @@
|
||||
From 720bb13c5eb411469e8bf825b93aeefdc771f039 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Wed, 24 Apr 2024 13:58:39 +0200
|
||||
Subject: [PATCH 29/34] Refresh collation version if pulp-ansible is present
|
||||
|
||||
When migrating to a new OS, we REINDEX all databases.
|
||||
pulp_ansible ships with an own collation (using ICU), which needs a
|
||||
version refresh after the REINDEX has been done.
|
||||
---
|
||||
.../common/actors/satellite_upgrader/actor.py | 4 ++++
|
||||
.../tests/unit_test_satellite_upgrader.py | 18 ++++++++++++++++++
|
||||
.../system_upgrade/common/models/satellite.py | 2 ++
|
||||
.../actors/satellite_upgrade_facts/actor.py | 1 +
|
||||
.../tests/unit_test_satellite_upgrade_facts.py | 9 +++++++++
|
||||
5 files changed, 34 insertions(+)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/satellite_upgrader/actor.py b/repos/system_upgrade/common/actors/satellite_upgrader/actor.py
|
||||
index f498f2fa..2e0290ae 100644
|
||||
--- a/repos/system_upgrade/common/actors/satellite_upgrader/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/satellite_upgrader/actor.py
|
||||
@@ -25,6 +25,10 @@ class SatelliteUpgrader(Actor):
|
||||
run(['sed', '-i', '/data_directory/d', '/var/lib/pgsql/data/postgresql.conf'])
|
||||
run(['systemctl', 'start', 'postgresql'])
|
||||
run(['runuser', '-u', 'postgres', '--', 'reindexdb', '-a'])
|
||||
+ if facts.postgresql.has_pulp_ansible_semver:
|
||||
+ run(['runuser', '-c',
|
||||
+ 'echo "ALTER COLLATION pulp_ansible_semver REFRESH VERSION;" | psql pulpcore',
|
||||
+ 'postgres'])
|
||||
except CalledProcessError as e:
|
||||
api.current_logger().error('Failed to reindex the database: {}'.format(str(e)))
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py b/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
||||
index 2f3509f3..55896c75 100644
|
||||
--- a/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
||||
+++ b/repos/system_upgrade/common/actors/satellite_upgrader/tests/unit_test_satellite_upgrader.py
|
||||
@@ -48,3 +48,21 @@ def test_run_reindexdb(monkeypatch, current_actor_context):
|
||||
assert mocked_run.commands[1] == ['systemctl', 'start', 'postgresql']
|
||||
assert mocked_run.commands[2] == ['runuser', '-u', 'postgres', '--', 'reindexdb', '-a']
|
||||
assert mocked_run.commands[3] == ['foreman-installer', '--disable-system-checks']
|
||||
+
|
||||
+
|
||||
+def test_run_reindexdb_with_pulp_ansible(monkeypatch, current_actor_context):
|
||||
+ mocked_run = MockedRun()
|
||||
+ monkeypatch.setattr('leapp.libraries.stdlib.run', mocked_run)
|
||||
+ current_actor_context.feed(SatelliteFacts(has_foreman=True,
|
||||
+ postgresql=SatellitePostgresqlFacts(local_postgresql=True,
|
||||
+ has_pulp_ansible_semver=True)))
|
||||
+ current_actor_context.run()
|
||||
+ assert mocked_run.commands
|
||||
+ assert len(mocked_run.commands) == 5
|
||||
+ assert mocked_run.commands[0] == ['sed', '-i', '/data_directory/d', '/var/lib/pgsql/data/postgresql.conf']
|
||||
+ assert mocked_run.commands[1] == ['systemctl', 'start', 'postgresql']
|
||||
+ assert mocked_run.commands[2] == ['runuser', '-u', 'postgres', '--', 'reindexdb', '-a']
|
||||
+ assert mocked_run.commands[3] == ['runuser', '-c',
|
||||
+ 'echo "ALTER COLLATION pulp_ansible_semver REFRESH VERSION;" | psql pulpcore',
|
||||
+ 'postgres']
|
||||
+ assert mocked_run.commands[4] == ['foreman-installer', '--disable-system-checks']
|
||||
diff --git a/repos/system_upgrade/common/models/satellite.py b/repos/system_upgrade/common/models/satellite.py
|
||||
index b4282790..532f6a3a 100644
|
||||
--- a/repos/system_upgrade/common/models/satellite.py
|
||||
+++ b/repos/system_upgrade/common/models/satellite.py
|
||||
@@ -15,6 +15,8 @@ class SatellitePostgresqlFacts(Model):
|
||||
""" How many bytes are required on the target partition """
|
||||
space_available = fields.Nullable(fields.Integer())
|
||||
""" How many bytes are available on the target partition """
|
||||
+ has_pulp_ansible_semver = fields.Boolean(default=False)
|
||||
+ """ Whether the DB has the pulp_ansible_semver collation """
|
||||
|
||||
|
||||
class SatelliteFacts(Model):
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/actor.py b/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/actor.py
|
||||
index 2dc78cce..46612876 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/actor.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/actor.py
|
||||
@@ -57,6 +57,7 @@ class SatelliteUpgradeFacts(Actor):
|
||||
has_katello_installer=False,
|
||||
postgresql=SatellitePostgresqlFacts(
|
||||
local_postgresql=local_postgresql,
|
||||
+ has_pulp_ansible_semver=has_package(InstalledRPM, 'python3.11-pulp-ansible'),
|
||||
),
|
||||
))
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py b/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py
|
||||
index b0e44c46..e7ca512e 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/satellite_upgrade_facts/tests/unit_test_satellite_upgrade_facts.py
|
||||
@@ -26,6 +26,7 @@ RUBYGEM_FOREMAN_PUPPET_RPM = fake_package('rubygem-foreman_puppet')
|
||||
POSTGRESQL_RPM = fake_package('postgresql-server')
|
||||
SATELLITE_RPM = fake_package('satellite')
|
||||
SATELLITE_CAPSULE_RPM = fake_package('satellite-capsule')
|
||||
+PULP_ANSIBLE_RPM = fake_package('python3.11-pulp-ansible')
|
||||
|
||||
SATELLITE_REPOSITORY = UsedRepository(repository='satellite-6.99-for-rhel-8-x86_64-rpms')
|
||||
CAPSULE_REPOSITORY = UsedRepository(repository='satellite-capsule-6.99-for-rhel-8-x86_64-rpms')
|
||||
@@ -118,6 +119,14 @@ def test_detects_remote_postgresql(current_actor_context):
|
||||
assert not satellitemsg.postgresql.local_postgresql
|
||||
|
||||
|
||||
+def test_detects_pulp_ansible(current_actor_context):
|
||||
+ current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM, POSTGRESQL_RPM, PULP_ANSIBLE_RPM]))
|
||||
+ current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+
|
||||
+ satellitemsg = current_actor_context.consume(SatelliteFacts)[0]
|
||||
+ assert satellitemsg.postgresql.has_pulp_ansible_semver
|
||||
+
|
||||
+
|
||||
def test_enables_right_repositories_on_satellite(current_actor_context):
|
||||
current_actor_context.feed(InstalledRPM(items=[FOREMAN_RPM, SATELLITE_RPM]))
|
||||
current_actor_context.feed(UsedRepositories(repositories=[SATELLITE_REPOSITORY, MAINTENANCE_REPOSITORY]))
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,90 +0,0 @@
|
||||
From bad2fb2e446246dc80807b078c80e0c98fd72fe5 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Fri, 26 Apr 2024 09:08:58 +0200
|
||||
Subject: [PATCH 30/34] Refactor satellite_upgrade_services to use
|
||||
SystemdServicesTasks
|
||||
|
||||
We used to just delete the symlinks in /etc/systemd, but with the new
|
||||
systemd actors this doesn't work anymore as they will restore the
|
||||
pre-delete state because they by default aim at having source and
|
||||
target systems match in terms of services. By using SystemdServicesTasks
|
||||
we can explicitly turn those services off and inform all interested
|
||||
parties about this.
|
||||
---
|
||||
.../satellite_upgrade_services/actor.py | 15 ++++++------
|
||||
.../unit_test_satellite_upgrade_services.py | 24 +++++++++++++++++++
|
||||
2 files changed, 31 insertions(+), 8 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/satellite_upgrade_services/tests/unit_test_satellite_upgrade_services.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/satellite_upgrade_services/actor.py b/repos/system_upgrade/common/actors/satellite_upgrade_services/actor.py
|
||||
index 3cda49a9..d14edfb7 100644
|
||||
--- a/repos/system_upgrade/common/actors/satellite_upgrade_services/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/satellite_upgrade_services/actor.py
|
||||
@@ -2,8 +2,8 @@ import glob
|
||||
import os
|
||||
|
||||
from leapp.actors import Actor
|
||||
-from leapp.models import SatelliteFacts
|
||||
-from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag
|
||||
+from leapp.models import SatelliteFacts, SystemdServicesTasks
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
|
||||
SYSTEMD_WANTS_BASE = '/etc/systemd/system/multi-user.target.wants/'
|
||||
SERVICES_TO_DISABLE = ['dynflow-sidekiq@*', 'foreman', 'foreman-proxy',
|
||||
@@ -18,8 +18,8 @@ class SatelliteUpgradeServices(Actor):
|
||||
|
||||
name = 'satellite_upgrade_services'
|
||||
consumes = (SatelliteFacts,)
|
||||
- produces = ()
|
||||
- tags = (IPUWorkflowTag, ApplicationsPhaseTag)
|
||||
+ produces = (SystemdServicesTasks,)
|
||||
+ tags = (IPUWorkflowTag, FactsPhaseTag)
|
||||
|
||||
def process(self):
|
||||
facts = next(self.consume(SatelliteFacts), None)
|
||||
@@ -27,9 +27,8 @@ class SatelliteUpgradeServices(Actor):
|
||||
return
|
||||
|
||||
# disable services, will be re-enabled by the installer
|
||||
+ services_to_disable = []
|
||||
for service_name in SERVICES_TO_DISABLE:
|
||||
for service in glob.glob(os.path.join(SYSTEMD_WANTS_BASE, '{}.service'.format(service_name))):
|
||||
- try:
|
||||
- os.unlink(service)
|
||||
- except OSError as e:
|
||||
- self.log.warning('Failed disabling service {}: {}'.format(service, e))
|
||||
+ services_to_disable.append(os.path.basename(service))
|
||||
+ self.produce(SystemdServicesTasks(to_disable=services_to_disable))
|
||||
diff --git a/repos/system_upgrade/common/actors/satellite_upgrade_services/tests/unit_test_satellite_upgrade_services.py b/repos/system_upgrade/common/actors/satellite_upgrade_services/tests/unit_test_satellite_upgrade_services.py
|
||||
new file mode 100644
|
||||
index 00000000..f41621ab
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/satellite_upgrade_services/tests/unit_test_satellite_upgrade_services.py
|
||||
@@ -0,0 +1,24 @@
|
||||
+import glob
|
||||
+
|
||||
+from leapp.models import SatelliteFacts, SatellitePostgresqlFacts, SystemdServicesTasks
|
||||
+
|
||||
+
|
||||
+def test_disable_httpd(monkeypatch, current_actor_context):
|
||||
+ def mock_glob():
|
||||
+ orig_glob = glob.glob
|
||||
+
|
||||
+ def mocked_glob(pathname):
|
||||
+ if pathname == '/etc/systemd/system/multi-user.target.wants/httpd.service':
|
||||
+ return [pathname]
|
||||
+ return orig_glob(pathname)
|
||||
+
|
||||
+ return mocked_glob
|
||||
+
|
||||
+ monkeypatch.setattr('glob.glob', mock_glob())
|
||||
+
|
||||
+ current_actor_context.feed(SatelliteFacts(has_foreman=True,
|
||||
+ postgresql=SatellitePostgresqlFacts(local_postgresql=False)))
|
||||
+ current_actor_context.run()
|
||||
+
|
||||
+ message = current_actor_context.consume(SystemdServicesTasks)[0]
|
||||
+ assert 'httpd.service' in message.to_disable
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,144 +0,0 @@
|
||||
From 64e2c58ac3bd97cbb09daf4c861204705c69ec97 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Fri, 3 May 2024 14:44:51 +0200
|
||||
Subject: [PATCH 31/34] mount /usr: Implement try-sleep loop - add time for
|
||||
storage initialisation
|
||||
|
||||
This problem is typical for SAN + FC when the storage needs sometimes
|
||||
more time for the initialisation. Implemented try-sleep loop.
|
||||
Retry the activation of the storage + /usr mounting in 15s.
|
||||
The loop can be repeated 10 times, so total time is 150s right now
|
||||
for the activation.
|
||||
|
||||
Note that this is not proper solution for the storage initialisation,
|
||||
however we have discovered some obstacles in the bootup process to
|
||||
be able to do it correctly as we would like to. Regarding limited
|
||||
time, we are going to deliver this solution, that should improve
|
||||
the experience and should be safe to not cause regressions for already
|
||||
working functionality. We expect to provide better solution for
|
||||
newer upgrades paths in future (IPU 8->9 and newer).
|
||||
|
||||
jira: https://issues.redhat.com/browse/RHEL-3344
|
||||
---
|
||||
.../dracut/85sys-upgrade-redhat/mount_usr.sh | 95 +++++++++++++++----
|
||||
1 file changed, 79 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
index 3c52652f..db065d87 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
@@ -22,6 +22,18 @@ filtersubvol() {
|
||||
|
||||
mount_usr()
|
||||
{
|
||||
+ #
|
||||
+ # mount_usr [true | false]
|
||||
+ # Expected a "true" value for the last attempt to mount /usr. On the last
|
||||
+ # attempt, in case of failure drop to shell.
|
||||
+ #
|
||||
+ # Return 0 when everything is all right
|
||||
+ # In case of failure and /usr has been detected:
|
||||
+ # return 2 when $1 is "true" (drop to shell invoked)
|
||||
+ # (note: possibly it's nonsense, but to be sure..)
|
||||
+ # return 1 otherwise
|
||||
+ #
|
||||
+ _last_attempt="$1"
|
||||
# check, if we have to mount the /usr filesystem
|
||||
while read -r _dev _mp _fs _opts _freq _passno; do
|
||||
[ "${_dev%%#*}" != "$_dev" ] && continue
|
||||
@@ -60,25 +72,76 @@ mount_usr()
|
||||
fi
|
||||
done < "${NEWROOT}/etc/fstab" >> /etc/fstab
|
||||
|
||||
- if [ "$_usr_found" != "" ]; then
|
||||
- info "Mounting /usr with -o $_opts"
|
||||
- mount "${NEWROOT}/usr" 2>&1 | vinfo
|
||||
- mount -o remount,rw "${NEWROOT}/usr"
|
||||
+ if [ "$_usr_found" = "" ]; then
|
||||
+ # nothing to do
|
||||
+ return 0
|
||||
+ fi
|
||||
|
||||
- if ! ismounted "${NEWROOT}/usr"; then
|
||||
- warn "Mounting /usr to ${NEWROOT}/usr failed"
|
||||
- warn "*** Dropping you to a shell; the system will continue"
|
||||
- warn "*** when you leave the shell."
|
||||
- action_on_fail
|
||||
- fi
|
||||
+ info "Mounting /usr with -o $_opts"
|
||||
+ mount "${NEWROOT}/usr" 2>&1 | vinfo
|
||||
+ mount -o remount,rw "${NEWROOT}/usr"
|
||||
+
|
||||
+ if ismounted "${NEWROOT}/usr"; then
|
||||
+ # success!!
|
||||
+ return 0
|
||||
+ fi
|
||||
+
|
||||
+ if [ "$_last_attempt" = "true" ]; then
|
||||
+ warn "Mounting /usr to ${NEWROOT}/usr failed"
|
||||
+ warn "*** Dropping you to a shell; the system will continue"
|
||||
+ warn "*** when you leave the shell."
|
||||
+ action_on_fail
|
||||
+ return 2
|
||||
fi
|
||||
+
|
||||
+ return 1
|
||||
}
|
||||
|
||||
-if [ -f "${NEWROOT}/etc/fstab" ]; then
|
||||
- # In case we have the LVM command available try make it activate all partitions
|
||||
- if command -v lvm 2>/dev/null 1>/dev/null; then
|
||||
- lvm vgchange -a y
|
||||
+
|
||||
+try_to_mount_usr() {
|
||||
+ _last_attempt="$1"
|
||||
+ if [ ! -f "${NEWROOT}/etc/fstab" ]; then
|
||||
+ warn "File ${NEWROOT}/etc/fstab doesn't exist."
|
||||
+ return 1
|
||||
+ fi
|
||||
+
|
||||
+ # In case we have the LVM command available try make it activate all partitions
|
||||
+ if command -v lvm 2>/dev/null 1>/dev/null; then
|
||||
+ lvm vgchange -a y || {
|
||||
+ warn "Detected problem when tried to activate LVM VG."
|
||||
+ if [ "$_last_attempt" != "true" ]; then
|
||||
+ # this is not last execution, retry
|
||||
+ return 1
|
||||
+ fi
|
||||
+ # NOTE(pstodulk):
|
||||
+ # last execution, so call mount_usr anyway
|
||||
+ # I am not 100% about lvm vgchange exit codes and I am aware of
|
||||
+ # possible warnings, in this last run, let's keep it on mount_usr
|
||||
+ # anyway..
|
||||
+ }
|
||||
+ fi
|
||||
+
|
||||
+ mount_usr "$1"
|
||||
+}
|
||||
+
|
||||
+_sleep_timeout=15
|
||||
+_last_attempt="false"
|
||||
+for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
|
||||
+ if [ $i -eq 11 ]; then
|
||||
+ _last_attempt="true"
|
||||
fi
|
||||
+ try_to_mount_usr "$_last_attempt" && break
|
||||
+
|
||||
+ # something is wrong. In some cases, storage needs more time for the
|
||||
+ # initialisation - especially in case of SAN.
|
||||
+
|
||||
+ if [ "$_last_attempt" = "true" ]; then
|
||||
+ warn "The last attempt to initialize storage has not been successful."
|
||||
+ warn "Unknown state of the storage. It is possible that upgrade will be stopped."
|
||||
+ break
|
||||
+ fi
|
||||
+
|
||||
+ warn "Failed attempt to initialize the storage. Retry in $_sleep_timeout seconds. Attempt: $i of 10"
|
||||
+ sleep $_sleep_timeout
|
||||
+done
|
||||
|
||||
- mount_usr
|
||||
-fi
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,374 +0,0 @@
|
||||
From 3cb522d3a682365dae5d8745056f4671bdd5e41b Mon Sep 17 00:00:00 2001
|
||||
From: Michal Reznik <mreznik@redhat.com>
|
||||
Date: Fri, 3 May 2024 13:47:49 +0200
|
||||
Subject: [PATCH 32/34] Add additional KB resources
|
||||
|
||||
add aditional KB resources in a form of ExternalLink or
|
||||
error details as requested by support
|
||||
---
|
||||
.../libraries/checkbootavailspace.py | 4 ++++
|
||||
.../common/actors/checkcifs/libraries/checkcifs.py | 5 +++++
|
||||
.../libraries/checkdddd.py | 10 ++++++++++
|
||||
.../common/actors/checkmemory/libraries/checkmemory.py | 5 +++++
|
||||
repos/system_upgrade/common/actors/checknfs/actor.py | 4 ++++
|
||||
.../common/actors/checkrootsymlinks/actor.py | 5 +++++
|
||||
.../libraries/checkyumpluginsenabled.py | 4 ++++
|
||||
.../libraries/checkinstalledkernels.py | 5 +++++
|
||||
.../missinggpgkeysinhibitor/libraries/missinggpgkey.py | 5 ++++-
|
||||
.../common/actors/opensshpermitrootlogincheck/actor.py | 5 +++++
|
||||
.../common/actors/persistentnetnamesdisable/actor.py | 5 +++++
|
||||
.../targetuserspacecreator/libraries/userspacegen.py | 9 +++++++++
|
||||
.../actors/verifydialogs/libraries/verifydialogs.py | 5 +++++
|
||||
repos/system_upgrade/common/libraries/rhsm.py | 3 ++-
|
||||
.../system_upgrade/el7toel8/actors/checkbtrfs/actor.py | 4 ++++
|
||||
.../actors/checkhacluster/libraries/checkhacluster.py | 4 ++++
|
||||
.../el7toel8/actors/checkremovedpammodules/actor.py | 4 ++++
|
||||
.../libraries/checkinstalleddevelkernels.py | 4 ++++
|
||||
.../libraries/satellite_upgrade_check.py | 5 +++++
|
||||
.../actors/checkifcfg/libraries/checkifcfg_ifcfg.py | 5 +++++
|
||||
.../actors/firewalldcheckallowzonedrifting/actor.py | 5 +++++
|
||||
21 files changed, 103 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkbootavailspace/libraries/checkbootavailspace.py b/repos/system_upgrade/common/actors/checkbootavailspace/libraries/checkbootavailspace.py
|
||||
index 7380f335..0cc4cf7d 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkbootavailspace/libraries/checkbootavailspace.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkbootavailspace/libraries/checkbootavailspace.py
|
||||
@@ -32,6 +32,10 @@ def inhibit_upgrade(avail_bytes):
|
||||
'/boot needs additional {0} MiB to be able to accommodate the upgrade initramfs and new kernel.'.format(
|
||||
additional_mib_needed)
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/298263',
|
||||
+ title='Why does kernel cannot be upgraded due to insufficient space in /boot ?'
|
||||
+ ),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.FILESYSTEM]),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
diff --git a/repos/system_upgrade/common/actors/checkcifs/libraries/checkcifs.py b/repos/system_upgrade/common/actors/checkcifs/libraries/checkcifs.py
|
||||
index b3ae146f..fc26ea70 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkcifs/libraries/checkcifs.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkcifs/libraries/checkcifs.py
|
||||
@@ -18,6 +18,11 @@ def checkcifs(storage_info):
|
||||
reporting.Groups.NETWORK
|
||||
]),
|
||||
reporting.Remediation(hint='Comment out CIFS entries to proceed with the upgrade.'),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/6964304',
|
||||
+ title='Leapp upgrade failed with error '
|
||||
+ '"Inhibitor: Use of CIFS detected. Upgrade cannot proceed"'
|
||||
+ ),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
reporting.RelatedResource('file', '/etc/fstab')
|
||||
])
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdetecteddevicesanddrivers/libraries/checkdddd.py b/repos/system_upgrade/common/actors/checkdetecteddevicesanddrivers/libraries/checkdddd.py
|
||||
index df431c0e..defe3f9a 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkdetecteddevicesanddrivers/libraries/checkdddd.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkdetecteddevicesanddrivers/libraries/checkdddd.py
|
||||
@@ -35,6 +35,16 @@ def create_inhibitors(inhibiting_entries):
|
||||
source=get_source_major_version(),
|
||||
)
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/6971716',
|
||||
+ title='Leapp preupgrade getting "Inhibitor: Detected loaded kernel drivers which have been '
|
||||
+ 'removed in RHEL 8. Upgrade cannot proceed." '
|
||||
+ ),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/5436131',
|
||||
+ title='Leapp upgrade fail with error "Inhibitor: Detected loaded kernel drivers which '
|
||||
+ 'have been removed in RHEL 8. Upgrade cannot proceed."'
|
||||
+ ),
|
||||
reporting.Audience('sysadmin'),
|
||||
reporting.Groups([reporting.Groups.KERNEL, reporting.Groups.DRIVERS]),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
index 25012273..808c9662 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
@@ -42,6 +42,11 @@ def process():
|
||||
reporting.Summary(summary),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.SANITY, reporting.Groups.INHIBITOR]),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7014179',
|
||||
+ title='Leapp upgrade fail with error"Minimum memory requirements '
|
||||
+ 'for RHEL 8 are not met"Upgrade cannot proceed'
|
||||
+ ),
|
||||
reporting.ExternalLink(
|
||||
url='https://access.redhat.com/articles/rhel-limits',
|
||||
title='Red Hat Enterprise Linux Technology Capabilities and Limits'
|
||||
diff --git a/repos/system_upgrade/common/actors/checknfs/actor.py b/repos/system_upgrade/common/actors/checknfs/actor.py
|
||||
index 208c5dd9..94c5e606 100644
|
||||
--- a/repos/system_upgrade/common/actors/checknfs/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checknfs/actor.py
|
||||
@@ -61,6 +61,10 @@ class CheckNfs(Actor):
|
||||
reporting.Groups.NETWORK
|
||||
]),
|
||||
reporting.Remediation(hint='Disable NFS temporarily for the upgrade if possible.'),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/6964006',
|
||||
+ title='Why does leapp upgrade fail on detecting NFS during upgrade?'
|
||||
+ ),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
] + fstab_related_resource
|
||||
)
|
||||
diff --git a/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py b/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
index 2769b7c1..c35272b2 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
@@ -37,6 +37,11 @@ class CheckRootSymlinks(Actor):
|
||||
'point to absolute paths.\n'
|
||||
'Please change these links to relative ones.'
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/6989732',
|
||||
+ title='leapp upgrade stops with Inhibitor "Upgrade requires links in root '
|
||||
+ 'directory to be relative"'
|
||||
+ ),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR])]
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py b/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
index 48f38d0a..5522af9c 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
@@ -63,6 +63,10 @@ def check_required_yum_plugins_enabled(pkg_manager_info):
|
||||
# Provide all commands as one due to problems with satellites
|
||||
commands=[['bash', '-c', '"{0}"'.format('; '.join(remediation_commands))]]
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7028063',
|
||||
+ title='Why is Leapp preupgrade generating "Inhibitor: Required YUM plugins are not being loaded."'
|
||||
+ ),
|
||||
reporting.RelatedResource('file', pkg_manager_config_path),
|
||||
reporting.RelatedResource('file', subscription_manager_plugin_conf),
|
||||
reporting.RelatedResource('file', product_id_plugin_conf),
|
||||
diff --git a/repos/system_upgrade/common/actors/kernel/checkinstalledkernels/libraries/checkinstalledkernels.py b/repos/system_upgrade/common/actors/kernel/checkinstalledkernels/libraries/checkinstalledkernels.py
|
||||
index 95882d29..4573354b 100644
|
||||
--- a/repos/system_upgrade/common/actors/kernel/checkinstalledkernels/libraries/checkinstalledkernels.py
|
||||
+++ b/repos/system_upgrade/common/actors/kernel/checkinstalledkernels/libraries/checkinstalledkernels.py
|
||||
@@ -103,5 +103,10 @@ def process():
|
||||
reporting.Groups([reporting.Groups.KERNEL, reporting.Groups.BOOT]),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
reporting.Remediation(hint=remediation),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7014134',
|
||||
+ title='Leapp upgrade fail with error "Inhibitor:Newest installed kernel '
|
||||
+ 'not in use" Upgrade cannot proceed'
|
||||
+ ),
|
||||
reporting.RelatedResource('package', 'kernel')
|
||||
])
|
||||
diff --git a/repos/system_upgrade/common/actors/missinggpgkeysinhibitor/libraries/missinggpgkey.py b/repos/system_upgrade/common/actors/missinggpgkeysinhibitor/libraries/missinggpgkey.py
|
||||
index 9a806ca2..4b93e741 100644
|
||||
--- a/repos/system_upgrade/common/actors/missinggpgkeysinhibitor/libraries/missinggpgkey.py
|
||||
+++ b/repos/system_upgrade/common/actors/missinggpgkeysinhibitor/libraries/missinggpgkey.py
|
||||
@@ -65,7 +65,10 @@ def _consume_data():
|
||||
used_target_repos = next(api.consume(UsedTargetRepositories)).repos
|
||||
except StopIteration:
|
||||
raise StopActorExecutionError(
|
||||
- 'Could not check for valid GPG keys', details={'details': 'No UsedTargetRepositories facts'}
|
||||
+ 'Could not check for valid GPG keys', details={
|
||||
+ 'details': 'No UsedTargetRepositories facts',
|
||||
+ 'link': 'https://access.redhat.com/solutions/7061850'
|
||||
+ }
|
||||
)
|
||||
|
||||
try:
|
||||
diff --git a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
index 2ac4ec8f..7a49622f 100644
|
||||
--- a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
@@ -135,6 +135,11 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
'sshd_config next to the "PermitRootLogin yes" directive '
|
||||
'to prevent rpm replacing it during the upgrade.'
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7003083',
|
||||
+ title='Why Leapp Preupgrade for RHEL 8 to 9 getting '
|
||||
+ '"Possible problems with remote login using root account" ?'
|
||||
+ ),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
] + COMMON_RESOURCES)
|
||||
# If the configuration is modified and contains any directive allowing
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
index 0e13c139..1f7f1413 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
@@ -50,6 +50,11 @@ class PersistentNetNamesDisable(Actor):
|
||||
title='How to perform an in-place upgrade to RHEL 8 when using kernel NIC names on RHEL 7',
|
||||
url='https://access.redhat.com/solutions/4067471'
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ title='RHEL 8 to RHEL 9: inplace upgrade fails at '
|
||||
+ '"Network configuration for unsupported device types detected"',
|
||||
+ url='https://access.redhat.com/solutions/7009239'
|
||||
+ ),
|
||||
reporting.Remediation(
|
||||
hint='Rename all ethX network interfaces following the attached KB solution article.'
|
||||
),
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index d60bc75f..dc93c9a0 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -828,6 +828,10 @@ def _get_rhsm_available_repoids(context):
|
||||
' to set up Satellite and the system properly.'
|
||||
|
||||
).format(target_major_version)),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/5392811',
|
||||
+ title='RHEL 7 to RHEL 8 LEAPP Upgrade Failing When Using Red Hat Satellite'
|
||||
+ ),
|
||||
reporting.ExternalLink(
|
||||
# https://red.ht/preparing-for-upgrade-to-rhel8
|
||||
# https://red.ht/preparing-for-upgrade-to-rhel9
|
||||
@@ -1007,6 +1011,11 @@ def gather_target_repositories(context, indata):
|
||||
# https://red.ht/preparing-for-upgrade-to-rhel10
|
||||
url='https://red.ht/preparing-for-upgrade-to-rhel{}'.format(target_major_version),
|
||||
title='Preparing for the upgrade'),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7001181',
|
||||
+ title='LEAPP Upgrade Failing from RHEL 7 to RHEL 8 when system is '
|
||||
+ 'registered to custromer portal'
|
||||
+ ),
|
||||
reporting.RelatedResource("file", "/etc/leapp/files/repomap.json"),
|
||||
reporting.RelatedResource("file", "/etc/yum.repos.d/")
|
||||
])
|
||||
diff --git a/repos/system_upgrade/common/actors/verifydialogs/libraries/verifydialogs.py b/repos/system_upgrade/common/actors/verifydialogs/libraries/verifydialogs.py
|
||||
index a6dbe6eb..a79079b1 100644
|
||||
--- a/repos/system_upgrade/common/actors/verifydialogs/libraries/verifydialogs.py
|
||||
+++ b/repos/system_upgrade/common/actors/verifydialogs/libraries/verifydialogs.py
|
||||
@@ -20,5 +20,10 @@ def check_dialogs(inhibit_if_no_userchoice=True):
|
||||
reporting.Summary(summary.format('\n'.join(sections))),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR] if inhibit_if_no_userchoice else []),
|
||||
reporting.Remediation(hint=dialogs_remediation, commands=cmd_remediation),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7035321',
|
||||
+ title='Leapp upgrade fail with error "Inhibitor: Missing required answers '
|
||||
+ 'in the answer file."'
|
||||
+ ),
|
||||
reporting.Key(dialog.key)]
|
||||
reporting.create_report(report_data + dialog_resources)
|
||||
diff --git a/repos/system_upgrade/common/libraries/rhsm.py b/repos/system_upgrade/common/libraries/rhsm.py
|
||||
index eb388829..74f6aeb1 100644
|
||||
--- a/repos/system_upgrade/common/libraries/rhsm.py
|
||||
+++ b/repos/system_upgrade/common/libraries/rhsm.py
|
||||
@@ -85,7 +85,8 @@ def _handle_rhsm_exceptions(hint=None):
|
||||
details={
|
||||
'details': str(e),
|
||||
'stderr': e.stderr,
|
||||
- 'hint': hint or _def_hint
|
||||
+ 'hint': hint or _def_hint,
|
||||
+ 'link': 'https://access.redhat.com/solutions/6138372'
|
||||
}
|
||||
)
|
||||
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checkbtrfs/actor.py b/repos/system_upgrade/el7toel8/actors/checkbtrfs/actor.py
|
||||
index c1b07f8d..a3848957 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/checkbtrfs/actor.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checkbtrfs/actor.py
|
||||
@@ -41,6 +41,10 @@ class CheckBtrfs(Actor):
|
||||
title='How do I prevent a kernel module from loading automatically?',
|
||||
url='https://access.redhat.com/solutions/41278'
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ title='Leapp upgrade fail with error "Inhibitor: Btrfs has been removed from RHEL8"',
|
||||
+ url='https://access.redhat.com/solutions/7020130'
|
||||
+ ),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
reporting.Groups([reporting.Groups.FILESYSTEM]),
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checkhacluster/libraries/checkhacluster.py b/repos/system_upgrade/el7toel8/actors/checkhacluster/libraries/checkhacluster.py
|
||||
index 870cf8a9..115867d2 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/checkhacluster/libraries/checkhacluster.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checkhacluster/libraries/checkhacluster.py
|
||||
@@ -25,6 +25,10 @@ def inhibit(node_type):
|
||||
" to a RHEL High Availability or Resilient Storage Cluster"
|
||||
),
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7049940',
|
||||
+ title='Leapp upgrade from RHEL 7 to RHEL 8 fails for pacemaker cluster'
|
||||
+ ),
|
||||
reporting.Remediation(
|
||||
hint=(
|
||||
"Destroy the existing HA cluster"
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/checkremovedpammodules/actor.py b/repos/system_upgrade/el7toel8/actors/checkremovedpammodules/actor.py
|
||||
index 503f6149..d2e92398 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/checkremovedpammodules/actor.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/checkremovedpammodules/actor.py
|
||||
@@ -59,6 +59,10 @@ class CheckRemovedPamModules(Actor):
|
||||
'please remove the pam module(s) from all the files '
|
||||
'under /etc/pam.d/.'.format(', '.join(replacements))
|
||||
),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7004774',
|
||||
+ title='Leapp preupgrade fails with: The pam_tally2 pam module(s) no longer available'
|
||||
+ ),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
] + [reporting.RelatedResource('pam', r) for r in replacements | found_modules])
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/kernel/checkinstalleddevelkernels/checkinstalleddevelkernels/libraries/checkinstalleddevelkernels.py b/repos/system_upgrade/el7toel8/actors/kernel/checkinstalleddevelkernels/checkinstalleddevelkernels/libraries/checkinstalleddevelkernels.py
|
||||
index 0ff4489f..fa49092c 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/kernel/checkinstalleddevelkernels/checkinstalleddevelkernels/libraries/checkinstalleddevelkernels.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/kernel/checkinstalleddevelkernels/checkinstalleddevelkernels/libraries/checkinstalleddevelkernels.py
|
||||
@@ -38,5 +38,9 @@ def process():
|
||||
reporting.Groups([reporting.Groups.KERNEL]),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
reporting.Remediation(hint=hint, commands=commands),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/4723671',
|
||||
+ title='leapp upgrade fails on kernel-devel packages'
|
||||
+ ),
|
||||
reporting.RelatedResource('package', 'kernel-devel')
|
||||
])
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_check/libraries/satellite_upgrade_check.py b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_check/libraries/satellite_upgrade_check.py
|
||||
index 6954dd50..82148ef3 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_check/libraries/satellite_upgrade_check.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_check/libraries/satellite_upgrade_check.py
|
||||
@@ -53,6 +53,11 @@ def satellite_upgrade_check(facts):
|
||||
reporting.create_report([
|
||||
reporting.Title(title),
|
||||
reporting.Summary(summary),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/6794671',
|
||||
+ title='Leapp preupgrade of Red Hat Satellite 6 fails on '
|
||||
+ 'Old PostgreSQL data found in /var/lib/pgsql/data'
|
||||
+ ),
|
||||
reporting.Severity(severity),
|
||||
reporting.Groups([]),
|
||||
reporting.Groups(flags)
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkifcfg/libraries/checkifcfg_ifcfg.py b/repos/system_upgrade/el8toel9/actors/checkifcfg/libraries/checkifcfg_ifcfg.py
|
||||
index 946841df..ed666350 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkifcfg/libraries/checkifcfg_ifcfg.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkifcfg/libraries/checkifcfg_ifcfg.py
|
||||
@@ -88,6 +88,11 @@ def process():
|
||||
reporting.Title(title),
|
||||
reporting.Summary(summary),
|
||||
reporting.Remediation(hint=remediation),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/7009239',
|
||||
+ title='RHEL 8 to RHEL 9: inplace upgrade fails at '
|
||||
+ '"Network configuration for unsupported device types detected"'
|
||||
+ ),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.NETWORK, reporting.Groups.SERVICES]),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/firewalldcheckallowzonedrifting/actor.py b/repos/system_upgrade/el8toel9/actors/firewalldcheckallowzonedrifting/actor.py
|
||||
index b7eb5806..0002f6aa 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/firewalldcheckallowzonedrifting/actor.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/firewalldcheckallowzonedrifting/actor.py
|
||||
@@ -44,6 +44,11 @@ class FirewalldCheckAllowZoneDrifting(Actor):
|
||||
reporting.ExternalLink(
|
||||
url='https://access.redhat.com/articles/4855631',
|
||||
title='Changes in firewalld related to Zone Drifting'),
|
||||
+ reporting.ExternalLink(
|
||||
+ url='https://access.redhat.com/solutions/6969130',
|
||||
+ title='Leapp Preupgrade check fails with error - '
|
||||
+ '"Inhibitor: Firewalld Configuration AllowZoneDrifting Is Unsupported".'
|
||||
+ ),
|
||||
reporting.Remediation(
|
||||
hint='Set AllowZoneDrifting=no in /etc/firewalld/firewalld.conf',
|
||||
commands=[['sed', '-i', 's/^AllowZoneDrifting=.*/AllowZoneDrifting=no/',
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
From da5ce33f51b2607c372acfc0e9bb28bf5270ef65 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Sat, 4 May 2024 10:07:14 +0200
|
||||
Subject: [PATCH 33/34] storage initialisation: apply sleep always
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Based on feedback from @rmetrich¹ the sleep period should be applied
|
||||
always as the problem with initialisation is happening also on systems
|
||||
with higher than few number of LVs where /usr is not on dedicated
|
||||
volume.
|
||||
|
||||
1: https://github.com/oamg/leapp-repository/pull/1218#issuecomment-2093303020
|
||||
---
|
||||
.../files/dracut/85sys-upgrade-redhat/mount_usr.sh | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
index db065d87..84f4857d 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
@@ -127,6 +127,8 @@ try_to_mount_usr() {
|
||||
_sleep_timeout=15
|
||||
_last_attempt="false"
|
||||
for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
|
||||
+ info "Storage initialisation: Attempt $i of 11. Wait $_sleep_timeout seconds."
|
||||
+ sleep $_sleep_timeout
|
||||
if [ $i -eq 11 ]; then
|
||||
_last_attempt="true"
|
||||
fi
|
||||
@@ -141,7 +143,6 @@ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
|
||||
break
|
||||
fi
|
||||
|
||||
- warn "Failed attempt to initialize the storage. Retry in $_sleep_timeout seconds. Attempt: $i of 10"
|
||||
- sleep $_sleep_timeout
|
||||
+ warn "Failed attempt to initialize the storage. Retry..."
|
||||
done
|
||||
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
From ce8dfff52c067fc334511c9773759eca8bff8b61 Mon Sep 17 00:00:00 2001
|
||||
From: Rodolfo Olivieri <rolivier@redhat.com>
|
||||
Date: Tue, 7 May 2024 09:38:41 -0300
|
||||
Subject: [PATCH 34/34] Add renovate to track github-actions deps
|
||||
|
||||
The renovate bot will track and automatically update the github actions
|
||||
dependencies in the project.
|
||||
---
|
||||
.github/renovate.json | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
create mode 100644 .github/renovate.json
|
||||
|
||||
diff --git a/.github/renovate.json b/.github/renovate.json
|
||||
new file mode 100644
|
||||
index 00000000..f55d8081
|
||||
--- /dev/null
|
||||
+++ b/.github/renovate.json
|
||||
@@ -0,0 +1,8 @@
|
||||
+{
|
||||
+ "extends": [
|
||||
+ "config:base"
|
||||
+ ],
|
||||
+ "enabledManagers": [
|
||||
+ "github-actions"
|
||||
+ ]
|
||||
+}
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.42.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 82b20e29da6c05bfb385c44eed2dc9af72c36148 Mon Sep 17 00:00:00 2001
|
||||
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Date: Sat, 11 May 2024 14:59:13 +0000
|
||||
Subject: [PATCH 35/49] chore(deps): update
|
||||
redhat-plumbers-in-action/differential-shellcheck action to v5
|
||||
|
||||
---
|
||||
.github/workflows/differential-shellcheck.yml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml
|
||||
index 4af99f8d..f643f054 100644
|
||||
--- a/.github/workflows/differential-shellcheck.yml
|
||||
+++ b/.github/workflows/differential-shellcheck.yml
|
||||
@@ -24,6 +24,6 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Differential ShellCheck
|
||||
- uses: redhat-plumbers-in-action/differential-shellcheck@v3
|
||||
+ uses: redhat-plumbers-in-action/differential-shellcheck@v5
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
From 821a387628e935e1aa9a74af153cd7598c8038c1 Mon Sep 17 00:00:00 2001
|
||||
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Date: Wed, 8 May 2024 12:45:11 +0000
|
||||
Subject: [PATCH 36/49] chore(deps): update actions/checkout action to v4
|
||||
|
||||
---
|
||||
.github/workflows/codespell.yml | 2 +-
|
||||
.github/workflows/differential-shellcheck.yml | 2 +-
|
||||
.github/workflows/reuse-copr-build.yml | 4 ++--
|
||||
.github/workflows/unit-tests.yml | 2 +-
|
||||
4 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml
|
||||
index 4921bc90..c0ec20d6 100644
|
||||
--- a/.github/workflows/codespell.yml
|
||||
+++ b/.github/workflows/codespell.yml
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- - uses: actions/checkout@v3
|
||||
+ - uses: actions/checkout@v4
|
||||
- uses: codespell-project/actions-codespell@master
|
||||
with:
|
||||
ignore_words_list: ro,fo,couldn,repositor
|
||||
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml
|
||||
index f643f054..f1ed5f6a 100644
|
||||
--- a/.github/workflows/differential-shellcheck.yml
|
||||
+++ b/.github/workflows/differential-shellcheck.yml
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Repository checkout
|
||||
- uses: actions/checkout@v3
|
||||
+ uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
diff --git a/.github/workflows/reuse-copr-build.yml b/.github/workflows/reuse-copr-build.yml
|
||||
index 093e0c1a..c742db50 100644
|
||||
--- a/.github/workflows/reuse-copr-build.yml
|
||||
+++ b/.github/workflows/reuse-copr-build.yml
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
# TODO: The correct way to checkout would be to use similar approach as in get_commit_by_timestamp function of
|
||||
# the github gluetool module (i.e. do not use HEAD but the last commit before comment).
|
||||
id: checkout
|
||||
- uses: actions/checkout@v2
|
||||
+ uses: actions/checkout@v4
|
||||
with:
|
||||
ref: "refs/pull/${{ steps.pr_nr.outputs.pr_nr }}/head"
|
||||
|
||||
@@ -105,7 +105,7 @@ jobs:
|
||||
- name: Checkout leapp
|
||||
id: checkout_leapp
|
||||
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }}
|
||||
- uses: actions/checkout@v2
|
||||
+ uses: actions/checkout@v4
|
||||
with:
|
||||
repository: "oamg/leapp"
|
||||
ref: "refs/pull/${{ steps.leapp_pr.outputs.leapp_pr }}/head"
|
||||
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
|
||||
index 107a1fc0..e4b4d173 100644
|
||||
--- a/.github/workflows/unit-tests.yml
|
||||
+++ b/.github/workflows/unit-tests.yml
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- uses: actions/checkout@v2
|
||||
+ uses: actions/checkout@v4
|
||||
with:
|
||||
# NOTE(ivasilev) fetch-depth 0 is critical here as leapp deps discovery depends on specific substring in
|
||||
# commit message and default 1 option will get us just merge commit which has an unrelevant message.
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From d7ad5d7da691f1425a3eba59e1f74392948a98e3 Mon Sep 17 00:00:00 2001
|
||||
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Date: Fri, 10 May 2024 05:33:55 +0000
|
||||
Subject: [PATCH 37/49] chore(deps): update dependency ubuntu to v22
|
||||
|
||||
---
|
||||
.github/workflows/reuse-copr-build.yml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.github/workflows/reuse-copr-build.yml b/.github/workflows/reuse-copr-build.yml
|
||||
index c742db50..6bf71226 100644
|
||||
--- a/.github/workflows/reuse-copr-build.yml
|
||||
+++ b/.github/workflows/reuse-copr-build.yml
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
reusable_workflow_copr_build_job:
|
||||
# This job only runs for '/rerun' pull request comments by owner, member, or collaborator of the repo/organization.
|
||||
name: Build copr builds for tft tests
|
||||
- runs-on: ubuntu-20.04
|
||||
+ runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
artifacts: ${{ steps.gen_artifacts.outputs.artifacts }}
|
||||
if: |
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,119 +0,0 @@
|
||||
From 96346a5400a6e9741566e5070024a7918a6a9323 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Tue, 14 May 2024 15:24:43 +0200
|
||||
Subject: [PATCH 38/49] Fix E0606 errors reported by pylint
|
||||
|
||||
E0606 -> possibly-used-before-assignement
|
||||
|
||||
Note that in case of checktargetrepos actor we are introducing
|
||||
https://red.ht/upgrading-rhel9-to-rhel10-main-official-doc
|
||||
for IPU 9 -> 10. However, this shortened URL must be defined yet later.
|
||||
---
|
||||
.../actors/checktargetrepos/libraries/checktargetrepos.py | 2 ++
|
||||
.../tests/unit_test_upgradeinitramfsgenerator.py | 1 +
|
||||
.../common/actors/scantargetiso/tests/test_scan_target_iso.py | 1 +
|
||||
.../tests/unit_test_selinuxcontentscanner.py | 2 ++
|
||||
.../selinux/selinuxprepare/tests/unit_test_selinuxprepare.py | 1 +
|
||||
repos/system_upgrade/common/libraries/tests/test_grub.py | 3 +++
|
||||
repos/system_upgrade/common/libraries/tests/test_mdraid.py | 2 ++
|
||||
7 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
index 6d5a2f65..c286ed4f 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
@@ -33,6 +33,8 @@ def process():
|
||||
ipu_doc_url = 'https://red.ht/upgrading-rhel7-to-rhel8-main-official-doc'
|
||||
elif target_major_version == '9':
|
||||
ipu_doc_url = 'https://red.ht/upgrading-rhel8-to-rhel9-main-official-doc'
|
||||
+ else:
|
||||
+ ipu_doc_url = 'https://red.ht/upgrading-rhel9-to-rhel10-main-official-doc'
|
||||
|
||||
rhui_info = next(api.consume(RHUIInfo), None)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
index 8068e177..7397b82b 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
@@ -354,6 +354,7 @@ def test_copy_modules_fail(monkeypatch, kind):
|
||||
|
||||
module_class = None
|
||||
copy_fn = None
|
||||
+ dst_path = None
|
||||
if kind == 'dracut':
|
||||
module_class = DracutModule
|
||||
copy_fn = upgradeinitramfsgenerator.copy_dracut_modules
|
||||
diff --git a/repos/system_upgrade/common/actors/scantargetiso/tests/test_scan_target_iso.py b/repos/system_upgrade/common/actors/scantargetiso/tests/test_scan_target_iso.py
|
||||
index 4dd0a125..8e235c6d 100644
|
||||
--- a/repos/system_upgrade/common/actors/scantargetiso/tests/test_scan_target_iso.py
|
||||
+++ b/repos/system_upgrade/common/actors/scantargetiso/tests/test_scan_target_iso.py
|
||||
@@ -201,6 +201,7 @@ def test_iso_repository_detection(monkeypatch, repodirs_in_iso, expected_repoids
|
||||
|
||||
produced_custom_repo_msgs = []
|
||||
target_iso_msg = None
|
||||
+ target_iso = None
|
||||
for produced_msg in produced_msgs:
|
||||
if isinstance(produced_msg, CustomTargetRepository):
|
||||
produced_custom_repo_msgs.append(produced_msg)
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/unit_test_selinuxcontentscanner.py b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/unit_test_selinuxcontentscanner.py
|
||||
index 1837c245..830eeac5 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/unit_test_selinuxcontentscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/unit_test_selinuxcontentscanner.py
|
||||
@@ -33,6 +33,8 @@ class run_mocked(object):
|
||||
"port -a -t http_port_t -p udp 81",
|
||||
"fcontext -a -f a -t httpd_sys_content_t '/web(/.*)?'",
|
||||
"fcontext -a -f a -t cgdcbxd_exec_t '/ganesha(/.*)?'"]
|
||||
+ else:
|
||||
+ assert False, 'run_mocked: Called unexpected cmd not covered by test: {}'.format(self.args)
|
||||
|
||||
return {'stdout': stdout}
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/unit_test_selinuxprepare.py b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/unit_test_selinuxprepare.py
|
||||
index 7d975dda..c1ad06c5 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/unit_test_selinuxprepare.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/unit_test_selinuxprepare.py
|
||||
@@ -24,6 +24,7 @@ class run_mocked(object):
|
||||
self.removed_modules.add(self.args[idx + 1])
|
||||
else:
|
||||
self.non_semodule_calls += 1
|
||||
+ stdout = []
|
||||
|
||||
return {'stdout': stdout}
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_grub.py b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
index 5a4f3f63..6f13538c 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
@@ -40,6 +40,7 @@ class RunMocked(object):
|
||||
def __call__(self, args, encoding=None):
|
||||
self.called += 1
|
||||
self.args = args
|
||||
+ stdout = ''
|
||||
if self.raise_err:
|
||||
raise_call_error(args)
|
||||
|
||||
@@ -50,6 +51,8 @@ class RunMocked(object):
|
||||
stdout = BOOT_DEVICE
|
||||
elif self.args[:-1] == ['lsblk', '-spnlo', 'name']:
|
||||
stdout = self.args[-1][:-1]
|
||||
+ else:
|
||||
+ assert False, 'RunMockedError: Called unexpected cmd not covered by test: {}'.format(self.args)
|
||||
|
||||
return {'stdout': stdout}
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_mdraid.py b/repos/system_upgrade/common/libraries/tests/test_mdraid.py
|
||||
index cb7c1059..d536beec 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_mdraid.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_mdraid.py
|
||||
@@ -42,6 +42,8 @@ class RunMocked(object):
|
||||
stdout = 'ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 name=localhost.localdomain:0 UUID=c4acea6e:d56e1598:91822e3f:fb26832c\n devices=/dev/sda1,/dev/sdb1' # noqa: E501; pylint: disable=line-too-long
|
||||
elif self.args == ['mdadm', '--detail', '--verbose', '--brief', NOT_MD_DEVICE]:
|
||||
stdout = 'mdadm: /dev/sda does not appear to be an md device'
|
||||
+ else:
|
||||
+ assert False, 'RunMockedError: Called unexpected cmd not covered by test: {}'.format(self.args)
|
||||
|
||||
return {'stdout': stdout}
|
||||
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
From 35e667c33dc186292a27efe2dceb2f71a20a5e13 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Tue, 14 May 2024 16:14:20 +0200
|
||||
Subject: [PATCH 39/49] Fix W0135 reported by pylint
|
||||
|
||||
W0135 -> contextmanager-generator-missing-cleanup
|
||||
|
||||
Expects try-finally around `yield`. Checked reported functions,
|
||||
usually it's FP. In one case I changed the code to make it clear.
|
||||
---
|
||||
repos/system_upgrade/common/libraries/dnfplugin.py | 3 +++
|
||||
.../system_upgrade/common/libraries/overlaygen.py | 14 ++++++++++----
|
||||
2 files changed, 13 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/dnfplugin.py b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
index fbd58246..e59168ef 100644
|
||||
--- a/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
+++ b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
@@ -460,6 +460,9 @@ def perform_transaction_install(target_userspace_info, storage_info, used_repos,
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _prepare_perform(used_repos, target_userspace_info, xfs_info, storage_info, target_iso=None):
|
||||
+ # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
+ # implicitly
|
||||
reserve_space = overlaygen.get_recommended_leapp_free_space(target_userspace_info.path)
|
||||
with _prepare_transaction(used_repos=used_repos,
|
||||
target_userspace_info=target_userspace_info
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index 6b0ff97d..4bcbf32b 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -296,6 +296,9 @@ def _prepare_required_mounts(scratch_dir, mounts_dir, storage_info, scratch_rese
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _build_overlay_mount(root_mount, mounts):
|
||||
+ # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
+ # implicitly
|
||||
if not root_mount:
|
||||
raise StopActorExecutionError('Root mount point has not been prepared for overlayfs.')
|
||||
if not mounts:
|
||||
@@ -519,6 +522,9 @@ def _mount_dnf_cache(overlay_target):
|
||||
"""
|
||||
Convenience context manager to ensure bind mounted /var/cache/dnf and removal of the mount.
|
||||
"""
|
||||
+ # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
+ # implicitly
|
||||
with mounting.BindMount(
|
||||
source='/var/cache/dnf',
|
||||
target=os.path.join(overlay_target, 'var', 'cache', 'dnf')) as cache_mount:
|
||||
@@ -570,6 +576,9 @@ def create_source_overlay(mounts_dir, scratch_dir, xfs_info, storage_info, mount
|
||||
:type scratch_reserve: Optional[int]
|
||||
:rtype: mounting.BindMount or mounting.NullMount
|
||||
"""
|
||||
+ # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
+ # implicitly
|
||||
api.current_logger().debug('Creating source overlay in {scratch_dir} with mounts in {mounts_dir}'.format(
|
||||
scratch_dir=scratch_dir, mounts_dir=mounts_dir))
|
||||
try:
|
||||
@@ -589,11 +598,8 @@ def create_source_overlay(mounts_dir, scratch_dir, xfs_info, storage_info, mount
|
||||
with _build_overlay_mount(root_overlay, mounts) as overlay:
|
||||
with _mount_dnf_cache(overlay.target):
|
||||
yield overlay
|
||||
- except Exception:
|
||||
+ finally:
|
||||
cleanup_scratch(scratch_dir, mounts_dir)
|
||||
- raise
|
||||
- # cleanup always now
|
||||
- cleanup_scratch(scratch_dir, mounts_dir)
|
||||
|
||||
|
||||
# #############################################################################
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
From d14423e2de7f6aeec921fd9cf0aad85101f6a65d Mon Sep 17 00:00:00 2001
|
||||
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Date: Thu, 16 May 2024 08:11:44 +0200
|
||||
Subject: [PATCH 40/49] chore(deps): update
|
||||
peter-evans/create-or-update-comment digest to v4 (#1222)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Update peter-evans/create-or-update-comment digest to v4 to use versioned (released) content instead of updating it per each new commit change.
|
||||
|
||||
---------
|
||||
|
||||
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Co-authored-by: Petr Stodůlka <pstodulk@redhat.com>
|
||||
---
|
||||
.github/workflows/pr-welcome-msg.yml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.github/workflows/pr-welcome-msg.yml b/.github/workflows/pr-welcome-msg.yml
|
||||
index e23c9bbb..c6527da4 100644
|
||||
--- a/.github/workflows/pr-welcome-msg.yml
|
||||
+++ b/.github/workflows/pr-welcome-msg.yml
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create comment
|
||||
- uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
|
||||
+ uses: peter-evans/create-or-update-comment@v4
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body: |
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
From c68bc5ef0f277a5878802566dc5517a1f98feac6 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Thu, 16 May 2024 11:08:47 +0200
|
||||
Subject: [PATCH 41/49] properly indent the list of supported OSes
|
||||
|
||||
before:
|
||||
```
|
||||
Risk Factor: high (inhibitor)
|
||||
Title: The installed OS version is not supported for the in-place upgrade to the target RHEL version
|
||||
Summary: The supported OS releases for the upgrade process:
|
||||
RHEL 8.8
|
||||
RHEL 8.10
|
||||
RHEL-SAPHANA 8.8
|
||||
RHEL-SAPHANA 8.10
|
||||
```
|
||||
|
||||
after:
|
||||
```
|
||||
Risk Factor: high (inhibitor)
|
||||
Title: The installed OS version is not supported for the in-place upgrade to the target RHEL version
|
||||
Summary: The supported OS releases for the upgrade process:
|
||||
- RHEL 8.8
|
||||
- RHEL 8.10
|
||||
- RHEL-SAPHANA 8.8
|
||||
- RHEL-SAPHANA 8.10
|
||||
```
|
||||
---
|
||||
.../common/actors/checkosrelease/libraries/checkosrelease.py | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py b/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
index e57ba1a7..bbc6b5ae 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
@@ -4,6 +4,7 @@ from leapp import reporting
|
||||
from leapp.libraries.common.config import version
|
||||
|
||||
COMMON_REPORT_TAGS = [reporting.Groups.SANITY]
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
|
||||
related = [reporting.RelatedResource('file', '/etc/os-release')]
|
||||
|
||||
@@ -34,8 +35,8 @@ def check_os_version():
|
||||
'The installed OS version is not supported for the in-place upgrade to the target RHEL version'
|
||||
),
|
||||
reporting.Summary(
|
||||
- 'The supported OS releases for the upgrade process:\n'
|
||||
- ' {}'.format('\n'.join(supported_releases))
|
||||
+ 'The supported OS releases for the upgrade process:'
|
||||
+ '{}{}'.format(FMT_LIST_SEPARATOR, FMT_LIST_SEPARATOR.join(supported_releases))
|
||||
),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups(COMMON_REPORT_TAGS),
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
From 8ad024515ed4b9e3df05157c67938d700eee5fa8 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Thu, 16 May 2024 11:54:17 +0200
|
||||
Subject: [PATCH 42/49] report which OS release was detected as unsupported
|
||||
|
||||
---
|
||||
.../common/actors/checkosrelease/libraries/checkosrelease.py | 5 ++++-
|
||||
.../actors/checkosrelease/tests/test_checkosrelease.py | 1 +
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py b/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
index bbc6b5ae..1ee6e6ab 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
@@ -30,13 +30,16 @@ def check_os_version():
|
||||
for rel in version.SUPPORTED_VERSIONS:
|
||||
for ver in version.SUPPORTED_VERSIONS[rel]:
|
||||
supported_releases.append(rel.upper() + ' ' + ver)
|
||||
+ current_release = ' '.join(version.current_version()).upper()
|
||||
reporting.create_report([
|
||||
reporting.Title(
|
||||
'The installed OS version is not supported for the in-place upgrade to the target RHEL version'
|
||||
),
|
||||
reporting.Summary(
|
||||
'The supported OS releases for the upgrade process:'
|
||||
- '{}{}'.format(FMT_LIST_SEPARATOR, FMT_LIST_SEPARATOR.join(supported_releases))
|
||||
+ '{}{}\n\nThe detected OS release is: {}'.format(FMT_LIST_SEPARATOR,
|
||||
+ FMT_LIST_SEPARATOR.join(supported_releases),
|
||||
+ current_release)
|
||||
),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups(COMMON_REPORT_TAGS),
|
||||
diff --git a/repos/system_upgrade/common/actors/checkosrelease/tests/test_checkosrelease.py b/repos/system_upgrade/common/actors/checkosrelease/tests/test_checkosrelease.py
|
||||
index 99d19832..aa0fd636 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkosrelease/tests/test_checkosrelease.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkosrelease/tests/test_checkosrelease.py
|
||||
@@ -28,6 +28,7 @@ def test_no_skip_check(monkeypatch):
|
||||
def test_not_supported_release(monkeypatch):
|
||||
monkeypatch.setattr(version, "is_supported_version", lambda: False)
|
||||
monkeypatch.setattr(version, "get_source_major_version", lambda: '7')
|
||||
+ monkeypatch.setattr(version, "current_version", lambda: ('bad', '7'))
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
|
||||
checkosrelease.check_os_version()
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 8c22562662078459abe3e0690d2f7a3120e62809 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Kluson <mkluson@redhat.com>
|
||||
Date: Mon, 20 May 2024 16:33:03 +0200
|
||||
Subject: [PATCH 43/49] Fix typo in .packit.yaml
|
||||
|
||||
---
|
||||
.packit.yaml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index ed6412dc..dc9b9431 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -292,7 +292,7 @@ jobs:
|
||||
|
||||
|
||||
# ###################################################################### #
|
||||
-# ############################## 8 TO 10 ############################### #
|
||||
+# ############################## 8 TO 9 ################################ #
|
||||
# ###################################################################### #
|
||||
|
||||
# ###################################################################### #
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,55 +0,0 @@
|
||||
From a7893092361d93a34c57b3cb2f05cc4e1db418b9 Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Thu, 16 May 2024 10:24:30 +0200
|
||||
Subject: [PATCH 44/49] drop unused packager field from distro metadata
|
||||
|
||||
The actor was refactored to accept any `gpg-key` package, regardless of
|
||||
the value in the packager field, but the data was never drop from the
|
||||
JSON files.
|
||||
|
||||
Fixes: 4968bec73947fb83aeb2d89fe7e919fba2ca2776
|
||||
---
|
||||
.../libraries/distributionsignedrpmscanner.py | 1 -
|
||||
.../common/files/distro/centos/gpg-signatures.json | 3 +--
|
||||
.../common/files/distro/rhel/gpg-signatures.json | 3 +--
|
||||
3 files changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/distributionsignedrpmscanner/libraries/distributionsignedrpmscanner.py b/repos/system_upgrade/common/actors/distributionsignedrpmscanner/libraries/distributionsignedrpmscanner.py
|
||||
index 0bc71bfa..7898453b 100644
|
||||
--- a/repos/system_upgrade/common/actors/distributionsignedrpmscanner/libraries/distributionsignedrpmscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/distributionsignedrpmscanner/libraries/distributionsignedrpmscanner.py
|
||||
@@ -16,7 +16,6 @@ def get_distribution_data(distribution):
|
||||
with open(distribution_config) as distro_config_file:
|
||||
distro_config_json = json.load(distro_config_file)
|
||||
distro_keys = distro_config_json.get('keys', [])
|
||||
- # distro_packager = distro_config_json.get('packager', 'not-available')
|
||||
else:
|
||||
raise StopActorExecutionError(
|
||||
'Cannot find distribution signature configuration.',
|
||||
diff --git a/repos/system_upgrade/common/files/distro/centos/gpg-signatures.json b/repos/system_upgrade/common/files/distro/centos/gpg-signatures.json
|
||||
index 30e329ee..cf7f819d 100644
|
||||
--- a/repos/system_upgrade/common/files/distro/centos/gpg-signatures.json
|
||||
+++ b/repos/system_upgrade/common/files/distro/centos/gpg-signatures.json
|
||||
@@ -3,6 +3,5 @@
|
||||
"24c6a8a7f4a80eb5",
|
||||
"05b555b38483c65d",
|
||||
"4eb84e71f2ee9d55"
|
||||
- ],
|
||||
- "packager": "CentOS"
|
||||
+ ]
|
||||
}
|
||||
diff --git a/repos/system_upgrade/common/files/distro/rhel/gpg-signatures.json b/repos/system_upgrade/common/files/distro/rhel/gpg-signatures.json
|
||||
index eccf0106..64d9ed12 100644
|
||||
--- a/repos/system_upgrade/common/files/distro/rhel/gpg-signatures.json
|
||||
+++ b/repos/system_upgrade/common/files/distro/rhel/gpg-signatures.json
|
||||
@@ -5,6 +5,5 @@
|
||||
"938a80caf21541eb",
|
||||
"fd372689897da07a",
|
||||
"45689c882fa658e0"
|
||||
- ],
|
||||
- "packager": "Red Hat, Inc."
|
||||
+ ]
|
||||
}
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
From ae387bc31826e76c220f0b5fdd1f8fab4b36a5a3 Mon Sep 17 00:00:00 2001
|
||||
From: David Kubek <dkubek@redhat.com>
|
||||
Date: Tue, 21 Nov 2023 13:54:41 +0100
|
||||
Subject: [PATCH 45/49] Add environment information to leappdb
|
||||
|
||||
Related to changes extending the information stored in the leapp db.
|
||||
After this comment, the command line arguments as well as the
|
||||
environment variables modifying the leapp execution (env vars starting
|
||||
with `LEAPP_`) will be stored in the database.
|
||||
|
||||
Works on: OAMG-8402
|
||||
---
|
||||
commands/upgrade/util.py | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/commands/upgrade/util.py b/commands/upgrade/util.py
|
||||
index 9eff0ad1..b20c316d 100644
|
||||
--- a/commands/upgrade/util.py
|
||||
+++ b/commands/upgrade/util.py
|
||||
@@ -3,6 +3,7 @@ import itertools
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
+import sys
|
||||
import tarfile
|
||||
from datetime import datetime
|
||||
|
||||
@@ -235,6 +236,8 @@ def prepare_configuration(args):
|
||||
'debug': os.getenv('LEAPP_DEBUG', '0'),
|
||||
'verbose': os.getenv('LEAPP_VERBOSE', '0'),
|
||||
'whitelist_experimental': args.whitelist_experimental or (),
|
||||
+ 'environment': {env: os.getenv(env) for env in os.environ if env.startswith('LEAPP_')},
|
||||
+ 'cmd': sys.argv,
|
||||
}
|
||||
return configuration
|
||||
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
From 3173d1a43eaf7d5353cd3cc753c4ba904a6f50d1 Mon Sep 17 00:00:00 2001
|
||||
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Date: Fri, 10 May 2024 05:33:51 +0000
|
||||
Subject: [PATCH 46/49] chore(deps): update actions/github-script action to v7
|
||||
|
||||
---
|
||||
.github/workflows/reuse-copr-build.yml | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/reuse-copr-build.yml b/.github/workflows/reuse-copr-build.yml
|
||||
index 6bf71226..3cf06254 100644
|
||||
--- a/.github/workflows/reuse-copr-build.yml
|
||||
+++ b/.github/workflows/reuse-copr-build.yml
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
- name: Add comment with copr build url
|
||||
# TODO: Create comment when copr build fails.
|
||||
id: link_copr
|
||||
- uses: actions/github-script@v4
|
||||
+ uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
@@ -145,7 +145,7 @@ jobs:
|
||||
# TODO: Create comment when copr build fails.
|
||||
id: link_copr_leapp
|
||||
if: ${{ steps.leapp_pr_regex_match.outputs.match != '' }}
|
||||
- uses: actions/github-script@v4
|
||||
+ uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
From 1fab8273744b3dba9c2acf927e6b87417d25f77b Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Mon, 27 May 2024 11:51:43 +0200
|
||||
Subject: [PATCH 47/49] fix some typos spotted by codespell
|
||||
|
||||
also add `zeor` to the ignore list as that's part of an email address at
|
||||
`zeor.simegen.com`
|
||||
---
|
||||
.github/workflows/codespell.yml | 2 +-
|
||||
.../common/actors/selinux/selinuxapplycustom/actor.py | 2 +-
|
||||
repos/system_upgrade/common/libraries/overlaygen.py | 2 +-
|
||||
.../checkcustomnetworkscripts/libraries/customnetworkscripts.py | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml
|
||||
index c0ec20d6..002d3774 100644
|
||||
--- a/.github/workflows/codespell.yml
|
||||
+++ b/.github/workflows/codespell.yml
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: codespell-project/actions-codespell@master
|
||||
with:
|
||||
- ignore_words_list: ro,fo,couldn,repositor
|
||||
+ ignore_words_list: ro,fo,couldn,repositor,zeor
|
||||
skip: "./repos/system_upgrade/common/actors/storagescanner/tests/files/mounts,\
|
||||
./repos/system_upgrade/el7toel8/actors/networkmanagerreadconfig/tests/files/nm_cfg_file_error,\
|
||||
./repos/system_upgrade/el8toel9/actors/xorgdrvfact/tests/files/journalctl-xorg-intel,\
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
index b7f8376f..55c64c3e 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
@@ -26,7 +26,7 @@ class SELinuxApplyCustom(Actor):
|
||||
tags = (ApplicationsPhaseTag, IPUWorkflowTag)
|
||||
|
||||
def process(self):
|
||||
- # save progress for repoting purposes
|
||||
+ # save progress for reporting purposes
|
||||
failed_modules = []
|
||||
failed_custom = []
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index 4bcbf32b..1132cde1 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -274,7 +274,7 @@ def _prepare_required_mounts(scratch_dir, mounts_dir, storage_info, scratch_rese
|
||||
space_needed = scratch_reserve + _MAGICAL_CONSTANT_OVL_SIZE * len(mount_points)
|
||||
_ensure_enough_diskimage_space(space_needed, scratch_dir)
|
||||
|
||||
- # free space required on this partition should not be affected by durin the
|
||||
+ # free space required on this partition should not be affected by during the
|
||||
# upgrade transaction execution by space consumed on creation of disk images
|
||||
# as disk images are cleaned in the end of this functions,
|
||||
# but we want to reserve some space in advance.
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkcustomnetworkscripts/libraries/customnetworkscripts.py b/repos/system_upgrade/el8toel9/actors/checkcustomnetworkscripts/libraries/customnetworkscripts.py
|
||||
index c3a6ffd1..2947aa27 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkcustomnetworkscripts/libraries/customnetworkscripts.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkcustomnetworkscripts/libraries/customnetworkscripts.py
|
||||
@@ -28,7 +28,7 @@ def generate_report(existing_custom_network_scripts):
|
||||
reporting.Remediation(
|
||||
hint=(
|
||||
"Migrate the custom network-scripts to NetworkManager dispatcher"
|
||||
- " scripts manually before the ugprade. Follow instructions in the"
|
||||
+ " scripts manually before the upgrade. Follow instructions in the"
|
||||
" official documentation."
|
||||
)
|
||||
),
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
From 8b1fd71d209f37005d7858768d211ee1cb07a30c Mon Sep 17 00:00:00 2001
|
||||
From: Evgeni Golov <evgeni@golov.de>
|
||||
Date: Mon, 27 May 2024 12:49:04 +0200
|
||||
Subject: [PATCH 48/49] BZ#2283067 - don't remove Tomcat during Satellite 7to8
|
||||
upgrade
|
||||
|
||||
This was previously added to workaround issues with the packages in RHEL
|
||||
8.8/8.9, but now that 8.10 is released it's not required anymore and
|
||||
actually breaks the upgrade.
|
||||
---
|
||||
.../actors/satellite_upgrade_facts/actor.py | 13 +++++++------
|
||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py
|
||||
index 3cd9d9da..cfba0503 100644
|
||||
--- a/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py
|
||||
+++ b/repos/system_upgrade/el7toel8/actors/satellite_upgrade_facts/actor.py
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
|
||||
from leapp.actors import Actor
|
||||
-from leapp.libraries.common.config import architecture
|
||||
+from leapp.libraries.common.config import architecture, version
|
||||
from leapp.libraries.common.rpms import has_package
|
||||
from leapp.libraries.stdlib import run
|
||||
from leapp.models import (
|
||||
@@ -55,11 +55,12 @@ class SatelliteUpgradeFacts(Actor):
|
||||
# enable modules that are needed for Pulpcore
|
||||
modules_to_enable.append(Module(name='python38', stream='3.8'))
|
||||
to_install.append('katello')
|
||||
- # Force removal of tomcat
|
||||
- # PES data indicates tomcat.el7 can be upgraded to tomcat.el8 since EL 8.8,
|
||||
- # but we need pki-servlet-engine from the module instead which will be pulled in via normal
|
||||
- # package dependencies
|
||||
- to_remove.extend(['tomcat', 'tomcat-lib'])
|
||||
+ if version.matches_target_version('8.8', '8.9'):
|
||||
+ # Force removal of tomcat
|
||||
+ # PES data indicates tomcat.el7 can be upgraded to tomcat.el8 since EL 8.8,
|
||||
+ # but we need pki-servlet-engine from the module instead which will be pulled in via normal
|
||||
+ # package dependencies
|
||||
+ to_remove.extend(['tomcat', 'tomcat-lib'])
|
||||
|
||||
if has_package(InstalledRPM, 'rh-redis5-redis'):
|
||||
modules_to_enable.append(Module(name='redis', stream='5'))
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -1,373 +0,0 @@
|
||||
From 061504d4b7748e11a8d6258021b6ac9d281cc63c Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Tue, 28 May 2024 14:23:44 +0200
|
||||
Subject: [PATCH 49/49] Add product certs and target for 9.5
|
||||
|
||||
---
|
||||
.../common/files/prod-certs/9.5/279.pem | 35 ++++++++++++++++++
|
||||
.../common/files/prod-certs/9.5/362.pem | 36 +++++++++++++++++++
|
||||
.../common/files/prod-certs/9.5/363.pem | 35 ++++++++++++++++++
|
||||
.../common/files/prod-certs/9.5/419.pem | 35 ++++++++++++++++++
|
||||
.../common/files/prod-certs/9.5/433.pem | 35 ++++++++++++++++++
|
||||
.../common/files/prod-certs/9.5/479.pem | 35 ++++++++++++++++++
|
||||
.../common/files/prod-certs/9.5/486.pem | 35 ++++++++++++++++++
|
||||
.../common/files/prod-certs/9.5/72.pem | 35 ++++++++++++++++++
|
||||
.../common/files/upgrade_paths.json | 4 +--
|
||||
9 files changed, 283 insertions(+), 2 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.5/279.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.5/362.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.5/363.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.5/419.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.5/433.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.5/479.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.5/486.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.5/72.pem
|
||||
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.5/279.pem b/repos/system_upgrade/common/files/prod-certs/9.5/279.pem
|
||||
new file mode 100644
|
||||
index 00000000..2257a543
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.5/279.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJTCCBA2gAwIBAgIJALDxRLt/tVPfMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI0MDExNjE1MzAyMFoXDTQ0MDEx
|
||||
+NjE1MzAyMFowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs1OWY4YmIz
|
||||
+My0wZjU2LTQ2N2UtYTE1ZC1hZmQxMjUzMTYzN2NdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrjCBqzAJBgNVHRMEAjAAMEMGDCsGAQQBkggJAYIXAQQzDDFSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuMBUGDCsG
|
||||
+AQQBkggJAYIXAgQFDAM5LjUwGQYMKwYBBAGSCAkBghcDBAkMB3BwYzY0bGUwJwYM
|
||||
+KwYBBAGSCAkBghcEBBcMFXJoZWwtOSxyaGVsLTktcHBjNjRsZTANBgkqhkiG9w0B
|
||||
+AQsFAAOCAgEAii9ffFWGZCeIaaI6EXmBK6s4uCryT72DsqL9xPUj6J1lm/9Xf4Nq
|
||||
+h0I+4zEEaPqI4XzUmw+LuVLpZAC79daKRiZRRPoIrR74Ca0KfvCPY72ZCIXYUmHZ
|
||||
+wgjrw4q6ZUSz4wYxPv/A8Q02oWlkHF7s7r8JNrq4B6IvOfdLFeVQGXtNtf7EIrH0
|
||||
+YKV/RRIPMKPEuc14EhmK8z9+lpySmZ7+4/cZh1DIqFjd6XGo7UeuON7atqEsHZ8e
|
||||
+PHlgw0Rl/HtCHBEHquZtuMoIF5f1C/qXGgMfIHzbHnCa42k7Vjx2/+UKxsmYmDRp
|
||||
+RGfBoZJL5DHla7+JOhmN70rTuKnwhPmP3b80Ax18uvrYPgzGxhb0jd7XvlZl+bSD
|
||||
+7aVhq/XK9rFjN9hf3wVwg01nIHIxMZPXZ1Eml/Af7ZzttcIxuOWTh1/TFw8XSUx/
|
||||
+kS8Z0tJpH+AiTCr93JLuh88ryKK5jZ5gGSWMOIpoSWE0wqTgODGcYAAeJJ034ogb
|
||||
+pbsPihjhxACkQhky+F1KJH2HE9pIKxaJNnCGWn1StX8DA9sngVSGl4YmLlZfEyUz
|
||||
+K2nJeUB9DPbtyHZHXw4N6Ep17CjUPZIY2jQSMBNkhAOpkIgvtVEMYQtXu6OVLbnu
|
||||
+O2sGXqV3LBUg3L00WxR9QAIG/n54z5afF3mxl3zJEcZoUwp4OHxkn84=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.5/362.pem b/repos/system_upgrade/common/files/prod-certs/9.5/362.pem
|
||||
new file mode 100644
|
||||
index 00000000..aa60c216
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.5/362.pem
|
||||
@@ -0,0 +1,36 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGNDCCBBygAwIBAgIJALDxRLt/tVPJMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI0MDExNjE1Mjk1OVoXDTQ0MDEx
|
||||
+NjE1Mjk1OVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs4OTA1ZDA0
|
||||
+MC04ZGY5LTQ3ZjAtODdhZi0yZDE1ZTYwNzgxZjVdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBvTCBujAJBgNVHRMEAjAAMEgGDCsGAQQBkggJAYJqAQQ4DDZSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuIEJldGEw
|
||||
+GgYMKwYBBAGSCAkBgmoCBAoMCDkuNSBCZXRhMBkGDCsGAQQBkggJAYJqAwQJDAdw
|
||||
+cGM2NGxlMCwGDCsGAQQBkggJAYJqBAQcDBpyaGVsLTkscmhlbC05LWJldGEtcHBj
|
||||
+NjRsZTANBgkqhkiG9w0BAQsFAAOCAgEAgx5sfDsgXS0GiE9tBa2VUDDcQ82EgPdV
|
||||
+vR8SUcrhuYv0c0XtKcYw3qwm03QRHLu8zv3f9HMT2SLQGqIPVYAjIk6IR2n9jsIW
|
||||
+ssbgpkZPaypgRadgS0abapCOSDFh+67FmV3YJR9kHQSrTwMLhqGphidapfN9Si4i
|
||||
+THn6sc9sy/iyXP8FDgqXehPutoWCvMA1kf6ek50v3121P860XPhhMHXQsLB6y+GV
|
||||
+G3fy2QAezSpJTA0PwrIWz+ZZiZ9oH5Fpvo2hMGnPclgfsN9/Ge13IE39vBgmznum
|
||||
+mlkwtArIYajjYDk4ADXFWmhY04zMBldLrR6PIrBNxRZv0a1hazcEP1LJPu2YLWgW
|
||||
+eV9/FNnzUySfL0a+hkTQvDfs2Ojeb72fDvaDXMzJoT8vdjlAilVsgU98JRXEg2Wq
|
||||
+5NYlLmkFpJGEvlejqGH8H73R7nFgu5aYeHetScXZmKW7itTiJoECxqX0Yqr/NQLa
|
||||
+9fSsuRxs0TQUVVKlMoAVokstvrW4v8rtxIU9UqfktOUs3U/kq0GCFwASSwdeGPW4
|
||||
+oWfeLK2W9TEICSoW6P38+/vNqXTe7N9x7M6wyfc8HrGM0uYiZrPSodID6yvkJtBv
|
||||
+wqS9vw9mlczrBF2m55o1dehZbWuncj6CO0Jc/xC8HqpnP8BLNb7/TyPyQrISeQjN
|
||||
+2LqCFq1dAdQ=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.5/363.pem b/repos/system_upgrade/common/files/prod-certs/9.5/363.pem
|
||||
new file mode 100644
|
||||
index 00000000..8c15335b
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.5/363.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJjCCBA6gAwIBAgIJALDxRLt/tVPIMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI0MDExNjE1Mjk1OFoXDTQ0MDEx
|
||||
+NjE1Mjk1OFowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtkNWEyNjZi
|
||||
+MC0zMzUwLTQxYTMtYmRmZC1kZmIyNmJmZDdmMDFdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrzCBrDAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYJrAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NCBCZXRhMBoGDCsGAQQBkggJAYJr
|
||||
+AgQKDAg5LjUgQmV0YTAZBgwrBgEEAZIICQGCawMECQwHYWFyY2g2NDAsBgwrBgEE
|
||||
+AZIICQGCawQEHAwacmhlbC05LHJoZWwtOS1iZXRhLWFhcmNoNjQwDQYJKoZIhvcN
|
||||
+AQELBQADggIBAM+fiLd/oETC0reNeAtlG0W+FcBdMm3Bl78L7X6Yj4cFLNjfk0PO
|
||||
+1E8EVGUjw+nx9ZwPlxAdP15Sh90oPztwRgQB2SwyBugYvvQAVY/0VsGvcsq8VyHD
|
||||
+IDd/mcPMjtFf+ZUqwhy3l1pbxXFiV+sMQtpltdboM5uIVEhZ6+C9hCAawHrQRcOM
|
||||
+z9usjgqzxjA2jcg0QX0A0ICKmbL4r9dwnX/Wpjo1P7CJUn5gNmJcoMcVYnUmFZ3I
|
||||
+oVlf+cLOWoex6BzK/QHr+UV+jnPj0d8EmS5vXgzE8Afj31iPn33JavOtsUfdr1hK
|
||||
+rrdJcHGbKj/lukUIzWBbxr/snq3iC2/hn0AW57GUCpbu9eeNH2pP7G5dNPXK0CpQ
|
||||
+/ThqyYdvht9HV89YqtLT+bUNjjAe8xhFCSkyBtheOBtG4zR3ctJvRCAb7kmqhTeo
|
||||
+DzDNcuf0vhWV5m2g4VQ0hbUnJCt1c0eLyF7aFA6oi8xMH7CaIrwrcoO7XbQCdtW6
|
||||
+uHuxNo8QQHgql6VQdNhlZpXjR/4F66WYzprs1+TITZqGXkZk1NTCjCGtWJBp/In+
|
||||
+HaDSbe+w4eZ/g6OaLyTOw3X7nPz+2j/2eJnNG9FpZt7mhiSfKwgQpTB7sCkiLg+C
|
||||
+YEKJL0NUBfag6Ahkjqdh/Ptldm8H+hjwzrMX0JtsyD/tJpVMb7LlkGi7
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.5/419.pem b/repos/system_upgrade/common/files/prod-certs/9.5/419.pem
|
||||
new file mode 100644
|
||||
index 00000000..3dd6f54b
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.5/419.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFzCCA/+gAwIBAgIJALDxRLt/tVPeMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI0MDExNjE1MzAyMFoXDTQ0MDEx
|
||||
+NjE1MzAyMFowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs1Yjk4YWE3
|
||||
+Mi1jODQ4LTQ3M2UtOGQ2Ni1lMGU1NzQ1OGYwMDddMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBoDCBnTAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYMjAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NDAVBgwrBgEEAZIICQGDIwIEBQwD
|
||||
+OS41MBkGDCsGAQQBkggJAYMjAwQJDAdhYXJjaDY0MCcGDCsGAQQBkggJAYMjBAQX
|
||||
+DBVyaGVsLTkscmhlbC05LWFhcmNoNjQwDQYJKoZIhvcNAQELBQADggIBAL680KfM
|
||||
+f4EeH2dvDkjsgTcRbSvkp08PUG671wLnVfIK0Ay9aLvExwoZK6a0hc1U3eLOrrlT
|
||||
+Kq6MTNhpkeE7RLtGaBMZMNICGrC+Gh1r0uR0a59xAjWly5QodQ05znSjXbdaGkBU
|
||||
+8vxtGm+ho9dJguEOn1d0Y8racomdK84+mivtLyc6pK3712nHTYmwQX/gzQ3dM/hm
|
||||
+gB+btQo+crObv2OfjUiN+W5k2eX+DRPsgu9bIpXQaHY4l+CvoZR3/Ww7Xzut4CQE
|
||||
+aAOpDbv/xAWPkWJ4CdSJp8jN6xGN05Grfw6xeBsTY+XFuoWlW4/9RsY3Qd8tjhTl
|
||||
+wsIUGOUxxuDDjKq4MoEvbm+w/B0rZHOcMbE0sPi0YFRsRB5/REYJZ0fnOOikEZOw
|
||||
+GC7EA38HITdkugveWL/NRkwg0AvNNt7ILNYXLVbskTBqw7QnWTy/vgxb/a2lyQuQ
|
||||
+E+j/NfINlDMXbitb5Nymg45Yl3XDkmeuEQKY2TUKdWype6NRDfJpHBNeeWNWZxrG
|
||||
+8u+/biqhXbYODlHp1VYRItz7BbTf+YCz7wFnCXBJA7gNPJDCwirIvJm9B15A3Hu3
|
||||
+0gd0f0TciKQH1PPnKZicxsEGI9C1sf5LRv+QuVGRvWDnF4GeS5r6OnCz06hndwyj
|
||||
+cuuGz2+UpjGvrPb9BtkDK2vUML0yaqj+pY7i
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.5/433.pem b/repos/system_upgrade/common/files/prod-certs/9.5/433.pem
|
||||
new file mode 100644
|
||||
index 00000000..de388174
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.5/433.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKTCCBBGgAwIBAgIJALDxRLt/tVPKMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI0MDExNjE1Mjk1OVoXDTQ0MDEx
|
||||
+NjE1Mjk1OVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtmNjQ4ZjZk
|
||||
+ZC0xZDhjLTQ2ZWYtOTZjYy02NWQ4NzA1MTNlMmFdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsjCBrzAJBgNVHRMEAjAAMEEGDCsGAQQBkggJAYMxAQQxDC9SZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIElCTSB6IFN5c3RlbXMgQmV0YTAaBgwrBgEE
|
||||
+AZIICQGDMQIECgwIOS41IEJldGEwFwYMKwYBBAGSCAkBgzEDBAcMBXMzOTB4MCoG
|
||||
+DCsGAQQBkggJAYMxBAQaDBhyaGVsLTkscmhlbC05LWJldGEtczM5MHgwDQYJKoZI
|
||||
+hvcNAQELBQADggIBAIdymcUPQMVEtwFpOCTyUArt1qx5pzoHmQvsGEBaGbeyiXmQ
|
||||
+4/5Nv5YgTyefrDR/uyu3ubg8BSTV8zgqqISpq3bVz2qWHTD024IqszhIvXYihHjR
|
||||
+aqzhgfbd7u+OfkZGa5WqFKFCNgQ93UBmp6g2dkR1gaF63kI9aal6fhNV6wBJitND
|
||||
+WXb+lGykB/i3X+HFuhXFYcFWCDvVNEpf3pyWLbXLDXsdP8+nkLFKGNnBwxRdARx8
|
||||
+sPz3HxStVBnf1mdhp+uGz8j14a5/psjhaqB4Vf9pCuOVLb6d+XdxJhVBTtD7C01a
|
||||
+Yp/e6He7tcEFHV7YU6qFN49kGk2eDBrMrE8svQ/StSJwHXarquq0z3QKjf4amLz5
|
||||
+DUvy0H0dxWUiYiiBx7mD68f5ng/lrsTl91frhQHRo5yLKrG9NQhfWe8wW8dVI8un
|
||||
+kzfesD5aDImYz0ClQAYROjzBXnMTJlVwGklSa3mrF7r8mKwsWmfvx2W8wGEF/Y27
|
||||
+BpYOVLvP22lhbuNZuSxnsTEAF5tzLcRI/nwox0Xsjb0ieS5J/7+0CGe24DpmQI0b
|
||||
+Dg0sSQhVzhYQkW6fwsTxZa+U2L7UcT/hojUMwji5t2n150LWcadcrtjTNnA7KJpu
|
||||
+8DGVW89eCmtJI9dEoQzG49GzOQ8iCmfsxWp3Epsbv8wCXtj9pvLmU7ioizSp
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.5/479.pem b/repos/system_upgrade/common/files/prod-certs/9.5/479.pem
|
||||
new file mode 100644
|
||||
index 00000000..3352d4a8
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.5/479.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFTCCA/2gAwIBAgIJALDxRLt/tVPhMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI0MDExNjE1MzAyMVoXDTQ0MDEx
|
||||
+NjE1MzAyMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFszYWQ2NDlj
|
||||
+NS1jOTNjLTQ2NjItYWIxMy1iNzE4ODNmNWVmNzJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBnjCBmzAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYNfAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NDAVBgwrBgEEAZIICQGDXwIEBQwD
|
||||
+OS41MBgGDCsGAQQBkggJAYNfAwQIDAZ4ODZfNjQwJgYMKwYBBAGSCAkBg18EBBYM
|
||||
+FHJoZWwtOSxyaGVsLTkteDg2XzY0MA0GCSqGSIb3DQEBCwUAA4ICAQBwU1eipuYq
|
||||
+/N0j9MiytX8Lvm/+xwPsg+/vpG1o2ro1Dts9U1xZDFt/Fg8+9wnApOMO2reS2aEG
|
||||
+f/ZJX+R/xWdlhlQTE9z5QTk3k3b7H79b8xWfJcbQU1ZwlaSrIba4FgmHx2h2PN3r
|
||||
+GNpswVsdXyCjfitBWG/uQlWi2RKDU+B5zD+8HBC3io9qPLYRybTGjfmQ/GlEINxA
|
||||
+NtnkoE+rDLGSMZNlUpmpjccK8nCLgf70csRloen8MbRH4j4kkVfmjHn75lLk0epb
|
||||
+zojsGHBRGvtwZzS3X7M03OB+uDoNGUKcD5RUq4zo2Rnlu9Xh0rhvG6wF9KeU2q30
|
||||
+hMR6eXJ4blMhpmCBWhvIAqVm68zUnWxPPFWa1hZzECaVuarGd0ncgrm21NiT+mE2
|
||||
+ZkrNBBmmZ7Hckv5QP83ynOXr4SkNEf/50rmPhcWaAD3MZr3mgOK5sg0E/diBbVmz
|
||||
+ZNw1jJ59HvNvKlxeqJqsFW4MkCDBccVPGDna3P4NXSXW5RYGgF0txNfQZc1briuz
|
||||
+bO+U3NAQocEdqUwflId5v97g0YElVliPdsM8b8xixrCCZT1pOXU46UXBP8+Nri70
|
||||
+apME6luow+D4f4ZWqMWg3KJV3FmlYPmn04WMo6EvFv5hvmlu5n6OheBqyzv/Zc1I
|
||||
+SVE+LwwzANJjNHA8PejmIqLbqzqHYrFbHg==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.5/486.pem b/repos/system_upgrade/common/files/prod-certs/9.5/486.pem
|
||||
new file mode 100644
|
||||
index 00000000..a0c7c085
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.5/486.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJDCCBAygAwIBAgIJALDxRLt/tVPLMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI0MDExNjE1Mjk1OVoXDTQ0MDEx
|
||||
+NjE1Mjk1OVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtiYjI5ZDU3
|
||||
+NC0yNDM5LTRmYTktOWI2Zi1lOWE1NzVkZDU0ZGJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrTCBqjAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYNmAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NCBCZXRhMBoGDCsGAQQBkggJAYNm
|
||||
+AgQKDAg5LjUgQmV0YTAYBgwrBgEEAZIICQGDZgMECAwGeDg2XzY0MCsGDCsGAQQB
|
||||
+kggJAYNmBAQbDBlyaGVsLTkscmhlbC05LWJldGEteDg2XzY0MA0GCSqGSIb3DQEB
|
||||
+CwUAA4ICAQC26JzDoY4bAGS+1o4L9vWLAk8zeaFWRCzXmTnEEQk6jyIP+I1lS0rH
|
||||
+8QWMu8bnnqeSOkb6qhSuiffwvd2TiYtapMf4rZ6vXQ+zTzuAO9/wRAVsQt2ElBf0
|
||||
+dU0Ghym9Xz/oUWP8TxZNjYuk/uRRTH9y/fVQWJ2PCP7BT3m3arMhpkyB9sNgoQDS
|
||||
+Yjb/d5wHgFyIW0ZOjJrM/ThR4xj8wXWFmjidDGXbn8V0Md8NUTo2QDZuoGwH4UKA
|
||||
+RlF1hjnw2uSr81RvXdWhXeG1XNjW0mJerR2v1T9dCK/QOtYJLIFX8opG05axeJ6y
|
||||
+FHwbuPi9uCvL2WlWXlfsofgVax9LUPWsN0pwL3B38h2m29nWjRi8g8ob10yGmapA
|
||||
+ksLACBur0QXKVUGfU0gI5Kd1CpKQMRHXXW3D+i77mfKJF+uLcle4tF2mzxuXmuxn
|
||||
+3WD+2mmjVWnn5Hx/6A8nELdD5oD4qRN4fydUp2r7UDpVZLqggzvwydhoR1eJvm1K
|
||||
+1ompaqRTXG5rwpEkqIz1gyJZqTt/35G8XXgwIr6gYSJzcQfFnt6VqYI/tdSu7tAh
|
||||
++qN6v3nBrASsHjIMO3qldwk3BTPfzTorzDrDi7240B2JLqdd+SeqkAcANDPcWIeZ
|
||||
+p/JQSedJCYKf0UZ7ry+sJmjhdWLi5ooLq7RPUbXd7kdLCqj2Y8llNg==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.5/72.pem b/repos/system_upgrade/common/files/prod-certs/9.5/72.pem
|
||||
new file mode 100644
|
||||
index 00000000..38c94ef7
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.5/72.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFjCCA/6gAwIBAgIJALDxRLt/tVPgMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI0MDExNjE1MzAyMVoXDTQ0MDEx
|
||||
+NjE1MzAyMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs3NTNmOWU4
|
||||
+ZS00ZDdhLTRiZjAtOTgzMi1mYjUzOTFiNWJjNmZdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBnzCBnDAJBgNVHRMEAjAAMDsGCysGAQQBkggJAUgBBCwMKlJlZCBIYXQg
|
||||
+RW50ZXJwcmlzZSBMaW51eCBmb3IgSUJNIHogU3lzdGVtczAUBgsrBgEEAZIICQFI
|
||||
+AgQFDAM5LjUwFgYLKwYBBAGSCAkBSAMEBwwFczM5MHgwJAYLKwYBBAGSCAkBSAQE
|
||||
+FQwTcmhlbC05LHJoZWwtOS1zMzkweDANBgkqhkiG9w0BAQsFAAOCAgEAu5Ud+Lr+
|
||||
+ymSvv1ZmDgjZmECL254g+TJ9mqYKpZNELZJwUHbfiFETGD1k6nK6NwHIFJae0CIb
|
||||
+LbeQ3bIYdbO5/RgcCIL8QUIiksYi7XzfsnJGegMOiYImoqNunQH2YTD3PRHAPy1k
|
||||
+cji1k0VLISCh/4Qh8m6fT1W/fb1B2+y+Rfkzob4LewdwhfvXkh6uTEj/XKK5itiX
|
||||
+GdHkahr/eE7ooQM9gty7vOX4hXRsVDgf/zjqko+2wCcO6peh6uqU8e9dZ2oqchMy
|
||||
+pJlGaGMQ+I0x8XJ2dlt61mHYTgrbjcvXMEN/Kus0LFAp2mxvlhSStFkwvXfZBqTa
|
||||
+e+qnKDdNLgQcxdlK7p6mwz37XjfPdpMsh4SC4o/e+HVSb5L84nn9SSDp5l+gsNXf
|
||||
+4XpV+v/dYSS/cB5x4kjcACACPWSobpJc7FJ/NXCp1L0V/mvrQijSQoX9TqzJtgbv
|
||||
+btKHUTrwgLpvQMEjfv8ZvNGhCCAl/IM02ACTg+GG2oNTwJKc1ogXFfP5WYVW9vEZ
|
||||
+yYDQbT9mtjfiyqI/nJXvfBbnqxUHgD3lcKs8PpnE0khIkYHoAjs+c7PFfntE08Sa
|
||||
+UdS/tVQ3Swwu2WczaDiVSwqfssWisHGjkIG6Fv5kmM3PNFCPpNCYnabMs+maaeyV
|
||||
+jd/FZrkWz+0TLseJ8xeo0MajgW4IjRqBxwg=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/upgrade_paths.json b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
index 880595c0..43bd049a 100644
|
||||
--- a/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
+++ b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
@@ -2,9 +2,9 @@
|
||||
"default": {
|
||||
"7.9": ["8.8", "8.10"],
|
||||
"8.8": ["9.2"],
|
||||
- "8.10": ["9.4"],
|
||||
+ "8.10": ["9.4", "9.5"],
|
||||
"7": ["8.8", "8.10"],
|
||||
- "8": ["9.2", "9.4"]
|
||||
+ "8": ["9.2", "9.4", "9.5"]
|
||||
},
|
||||
"saphana": {
|
||||
"7.9": ["8.10", "8.8"],
|
||||
--
|
||||
2.44.0
|
||||
|
||||
@ -0,0 +1,333 @@
|
||||
From dcf53c28ea9c3fdd03277abcdeb1d124660f7f8e Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 19 Aug 2025 09:48:11 +0200
|
||||
Subject: [PATCH 01/55] Add upgrade inhibitor for custom DNF pluginpath
|
||||
configuration
|
||||
|
||||
Implements detection and inhibition of the upgrade when DNF
|
||||
pluginpath is configured in /etc/dnf/dnf.conf:
|
||||
- Add DnfPluginPathDetected model to communicate detection results
|
||||
- Add ScanDnfPluginPath actor (FactsPhase) to scan DNF configuration
|
||||
- Add CheckDnfPluginPath actor (ChecksPhase) to create inhibitor report
|
||||
- Add related unit tests
|
||||
|
||||
Localisation of dnf plugins is not constant between system releases
|
||||
which can cause issues with the upgrade, so the user should remove
|
||||
this option or comment it out.
|
||||
|
||||
Jira: RHEL-69601
|
||||
---
|
||||
.../common/actors/checkdnfpluginpath/actor.py | 22 ++++++++
|
||||
.../libraries/checkdnfpluginpath.py | 35 ++++++++++++
|
||||
.../tests/test_checkdnfpluginpath.py | 34 ++++++++++++
|
||||
.../common/actors/scandnfpluginpath/actor.py | 21 ++++++++
|
||||
.../libraries/scandnfpluginpath.py | 30 +++++++++++
|
||||
.../files/dnf_config_incorrect_pluginpath | 7 +++
|
||||
.../tests/files/dnf_config_no_pluginpath | 6 +++
|
||||
.../tests/files/dnf_config_with_pluginpath | 7 +++
|
||||
.../tests/test_scandnfpluginpath.py | 53 +++++++++++++++++++
|
||||
.../common/models/dnfpluginpathdetected.py | 14 +++++
|
||||
10 files changed, 229 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..34055886
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
@@ -0,0 +1,22 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.checkdnfpluginpath import perform_check
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class CheckDnfPluginPath(Actor):
|
||||
+ """
|
||||
+ Inhibits the upgrade if a custom DNF plugin path is configured.
|
||||
+
|
||||
+ This actor checks whether the pluginpath option is configured in /etc/dnf/dnf.conf and produces a report if it is.
|
||||
+ If the option is detected with any value, the upgrade is inhibited.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_dnf_pluginpath'
|
||||
+ consumes = (DnfPluginPathDetected,)
|
||||
+ produces = (Report,)
|
||||
+ tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ perform_check()
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..ce705361
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
@@ -0,0 +1,35 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+DNF_CONFIG_PATH = '/etc/dnf/dnf.conf'
|
||||
+
|
||||
+
|
||||
+def check_dnf_pluginpath(dnf_pluginpath_detected):
|
||||
+ """Create an inhibitor when pluginpath is detected in DNF configuration."""
|
||||
+ if not dnf_pluginpath_detected.is_pluginpath_detected:
|
||||
+ return
|
||||
+ reporting.create_report([
|
||||
+ reporting.Title('Detected specified pluginpath in DNF configuration.'),
|
||||
+ reporting.Summary(
|
||||
+ 'The "pluginpath" option is set in the {} file. The path to DNF plugins differs between '
|
||||
+ 'system major releases due to different versions of Python. '
|
||||
+ 'This breaks the in-place upgrades if defined explicitly as DNF plugins '
|
||||
+ 'are stored on a different path on the new system.'
|
||||
+ .format(DNF_CONFIG_PATH)
|
||||
+ ),
|
||||
+ reporting.Remediation(
|
||||
+ hint='Remove or comment out the pluginpath option in the DNF '
|
||||
+ 'configuration file to be able to upgrade the system',
|
||||
+ commands=[['sed', '-i', '\'s/^pluginpath[[:space:]]*=/#pluginpath=/\'', DNF_CONFIG_PATH]],
|
||||
+ ),
|
||||
+ reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
+ reporting.RelatedResource('file', DNF_CONFIG_PATH),
|
||||
+ ])
|
||||
+
|
||||
+
|
||||
+def perform_check():
|
||||
+ dnf_pluginpath_detected = next(api.consume(DnfPluginPathDetected), None)
|
||||
+ if dnf_pluginpath_detected:
|
||||
+ check_dnf_pluginpath(dnf_pluginpath_detected)
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..7dd8bbf2
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
@@ -0,0 +1,34 @@
|
||||
+import pytest
|
||||
+
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.actor.checkdnfpluginpath import check_dnf_pluginpath, perform_check
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.utils.report import is_inhibitor
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('is_detected', [False, True])
|
||||
+def test_check_dnf_pluginpath(monkeypatch, is_detected):
|
||||
+ actor_reports = create_report_mocked()
|
||||
+ msg = DnfPluginPathDetected(is_pluginpath_detected=is_detected)
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[msg]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', actor_reports)
|
||||
+
|
||||
+ perform_check()
|
||||
+
|
||||
+ assert bool(actor_reports.called) == is_detected
|
||||
+
|
||||
+ if is_detected:
|
||||
+ assert is_inhibitor(actor_reports.report_fields)
|
||||
+
|
||||
+
|
||||
+def test_perform_check_no_message_available(monkeypatch):
|
||||
+ """Test perform_check when no DnfPluginPathDetected message is available."""
|
||||
+ actor_reports = create_report_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(reporting, 'create_report', actor_reports)
|
||||
+
|
||||
+ perform_check()
|
||||
+
|
||||
+ assert not actor_reports.called
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py b/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..e43a691e
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.scandnfpluginpath import scan_dnf_pluginpath
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class ScanDnfPluginPath(Actor):
|
||||
+ """
|
||||
+ Scans DNF configuration for custom pluginpath option.
|
||||
+
|
||||
+ This actor collects information about whether the pluginpath option is configured in DNF configuration
|
||||
+ and produces a DnfPluginPathDetected message, containing the information.
|
||||
+ """
|
||||
+
|
||||
+ name = 'scan_dnf_pluginpath'
|
||||
+ consumes = ()
|
||||
+ produces = (DnfPluginPathDetected,)
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ scan_dnf_pluginpath()
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py b/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..818f7700
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
@@ -0,0 +1,30 @@
|
||||
+import os
|
||||
+
|
||||
+from six.moves import configparser
|
||||
+
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+DNF_CONFIG_PATH = '/etc/dnf/dnf.conf'
|
||||
+
|
||||
+
|
||||
+def _is_pluginpath_set(config_path):
|
||||
+ """Check if pluginpath option is set in DNF configuration file."""
|
||||
+ if not os.path.isfile(config_path):
|
||||
+ api.current_logger().warning('The %s file is missing.', config_path)
|
||||
+ return False
|
||||
+
|
||||
+ parser = configparser.ConfigParser()
|
||||
+
|
||||
+ try:
|
||||
+ parser.read(config_path)
|
||||
+ return parser.has_option('main', 'pluginpath')
|
||||
+ except (configparser.Error, IOError) as e:
|
||||
+ api.current_logger().warning('The DNF config file %s couldn\'t be parsed: %s', config_path, e)
|
||||
+ return False
|
||||
+
|
||||
+
|
||||
+def scan_dnf_pluginpath():
|
||||
+ """Scan DNF configuration and produce DnfPluginPathDetected message."""
|
||||
+ is_detected = _is_pluginpath_set(DNF_CONFIG_PATH)
|
||||
+ api.produce(DnfPluginPathDetected(is_pluginpath_detected=is_detected))
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..aa29db09
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
@@ -0,0 +1,7 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
+pluginpathincorrect=/usr/lib/python3.6/site-packages/dnf-plugins
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..3d08d075
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
@@ -0,0 +1,6 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..09a81e64
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
@@ -0,0 +1,7 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
+pluginpath=/usr/lib/python3.6/site-packages/dnf-plugins
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..fefb9d3f
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
@@ -0,0 +1,53 @@
|
||||
+import os
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import scandnfpluginpath
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('is_detected', [False, True])
|
||||
+def test_scan_detects_pluginpath(monkeypatch, is_detected):
|
||||
+ mocked_producer = produce_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(api, 'produce', mocked_producer)
|
||||
+
|
||||
+ monkeypatch.setattr(scandnfpluginpath, '_is_pluginpath_set',
|
||||
+ lambda path: is_detected)
|
||||
+
|
||||
+ scandnfpluginpath.scan_dnf_pluginpath()
|
||||
+
|
||||
+ assert mocked_producer.called == 1
|
||||
+ assert mocked_producer.model_instances[0].is_pluginpath_detected is is_detected
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(('config_file', 'result'), [
|
||||
+ ('files/dnf_config_no_pluginpath', False),
|
||||
+ ('files/dnf_config_with_pluginpath', True),
|
||||
+ ('files/dnf_config_incorrect_pluginpath', False),
|
||||
+ ('files/not_existing_file.conf', False)
|
||||
+])
|
||||
+def test_is_pluginpath_set(config_file, result):
|
||||
+ CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
+
|
||||
+ assert scandnfpluginpath._is_pluginpath_set(os.path.join(CUR_DIR, config_file)) == result
|
||||
+
|
||||
+
|
||||
+def test_scan_no_config_file(monkeypatch):
|
||||
+ mocked_producer = produce_mocked()
|
||||
+ logger = logger_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(api, 'produce', mocked_producer)
|
||||
+ monkeypatch.setattr(api, 'current_logger', lambda: logger)
|
||||
+
|
||||
+ filename = 'files/not_existing_file.conf'
|
||||
+ monkeypatch.setattr(scandnfpluginpath, 'DNF_CONFIG_PATH', filename)
|
||||
+ scandnfpluginpath.scan_dnf_pluginpath()
|
||||
+
|
||||
+ assert mocked_producer.called == 1
|
||||
+ assert mocked_producer.model_instances[0].is_pluginpath_detected is False
|
||||
+
|
||||
+ assert 'The %s file is missing.' in logger.warnmsg
|
||||
+ assert filename in logger.warnmsg
|
||||
diff --git a/repos/system_upgrade/common/models/dnfpluginpathdetected.py b/repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
new file mode 100644
|
||||
index 00000000..c5474857
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
@@ -0,0 +1,14 @@
|
||||
+from leapp.models import fields, Model
|
||||
+from leapp.topics import SystemInfoTopic
|
||||
+
|
||||
+
|
||||
+class DnfPluginPathDetected(Model):
|
||||
+ """
|
||||
+ This model contains information about whether DNF pluginpath option is configured in /etc/dnf/dnf.conf.
|
||||
+ """
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ is_pluginpath_detected = fields.Boolean()
|
||||
+ """
|
||||
+ True if pluginpath option is found in /etc/dnf/dnf.conf, False otherwise.
|
||||
+ """
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,245 @@
|
||||
From 004cec5bd33025412df84f07590b6c5452d70ab6 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Wed, 17 Apr 2024 09:58:00 +0200
|
||||
Subject: [PATCH 02/55] Upgrade dracut module: Update /usr mounting solution
|
||||
|
||||
Originally we had implemented our own mount_usr.sh script, which
|
||||
took care about mounting the /usr when it is present on separate
|
||||
partition / mountpoint. It took care also about LVM activation.
|
||||
|
||||
However, it has been problematic in various cases (e.g. when device
|
||||
needed more time for initialisation - e.g. when connected using FC).
|
||||
Let's use instead existing system solutions, starting
|
||||
the upgrade.target after initrd-fs.target (instead of just
|
||||
basic.target). IOW, let's get as close to the standard booting
|
||||
procedure when speaking about the storage, as possible.
|
||||
|
||||
Note that the booting is still broken in this commit and needs
|
||||
additional changes made in followup commits. But due to complexity
|
||||
of the solution, keeping this separated.
|
||||
|
||||
jira: RHEL-3344, RHEL-35446
|
||||
---
|
||||
.../85sys-upgrade-redhat/module-setup.sh | 1 -
|
||||
.../dracut/85sys-upgrade-redhat/mount_usr.sh | 148 ------------------
|
||||
.../initrd-cleanup-override.conf | 3 +
|
||||
.../dracut/90sys-upgrade/module-setup.sh | 11 ++
|
||||
.../files/dracut/90sys-upgrade/upgrade.target | 4 +-
|
||||
5 files changed, 16 insertions(+), 151 deletions(-)
|
||||
delete mode 100755 repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
create mode 100644 repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
index d73060cb..45f98148 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
@@ -102,7 +102,6 @@ install() {
|
||||
inst_binary grep
|
||||
|
||||
# script to actually run the upgrader binary
|
||||
- inst_hook upgrade 49 "$_moddir/mount_usr.sh"
|
||||
inst_hook upgrade 50 "$_moddir/do-upgrade.sh"
|
||||
|
||||
#NOTE: some clean up?.. ideally, everything should be inside the leapp*
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
deleted file mode 100755
|
||||
index 9366ac13..00000000
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
+++ /dev/null
|
||||
@@ -1,148 +0,0 @@
|
||||
-#!/bin/sh
|
||||
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
-# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
-
|
||||
-type info >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
-
|
||||
-export NEWROOT=${NEWROOT:-"/sysroot"}
|
||||
-
|
||||
-filtersubvol() {
|
||||
- _oldifs="$IFS"
|
||||
- IFS=","
|
||||
- set "$@"
|
||||
- IFS="$_oldifs"
|
||||
- while [ $# -gt 0 ]; do
|
||||
- case $1 in
|
||||
- subvol=*) :;;
|
||||
- *) printf '%s' "${1}," ;;
|
||||
- esac
|
||||
- shift
|
||||
- done
|
||||
-}
|
||||
-
|
||||
-mount_usr()
|
||||
-{
|
||||
- #
|
||||
- # mount_usr [true | false]
|
||||
- # Expected a "true" value for the last attempt to mount /usr. On the last
|
||||
- # attempt, in case of failure drop to shell.
|
||||
- #
|
||||
- # Return 0 when everything is all right
|
||||
- # In case of failure and /usr has been detected:
|
||||
- # return 2 when $1 is "true" (drop to shell invoked)
|
||||
- # (note: possibly it's nonsense, but to be sure..)
|
||||
- # return 1 otherwise
|
||||
- #
|
||||
- _last_attempt="$1"
|
||||
- # check, if we have to mount the /usr filesystem
|
||||
- while read -r _dev _mp _fs _opts _freq _passno; do
|
||||
- [ "${_dev%%#*}" != "$_dev" ] && continue
|
||||
- if [ "$_mp" = "/usr" ]; then
|
||||
- case "$_dev" in
|
||||
- LABEL=*)
|
||||
- _dev="$(echo "$_dev" | sed 's,/,\\x2f,g')"
|
||||
- _dev="/dev/disk/by-label/${_dev#LABEL=}"
|
||||
- ;;
|
||||
- UUID=*)
|
||||
- _dev="${_dev#block:}"
|
||||
- _dev="/dev/disk/by-uuid/${_dev#UUID=}"
|
||||
- ;;
|
||||
- esac
|
||||
-
|
||||
- # shellcheck disable=SC2154 # Variable root is assigned by dracut
|
||||
- _root_dev=${root#block:}
|
||||
-
|
||||
- if strstr "$_opts" "subvol=" && \
|
||||
- [ "$(stat -c '%D:%i' "$_root_dev")" = "$(stat -c '%D:%i' "$_dev")" ] && \
|
||||
- [ -n "$rflags" ]; then
|
||||
- # for btrfs subvolumes we have to mount /usr with the same rflags
|
||||
- rflags=$(filtersubvol "$rflags")
|
||||
- rflags=${rflags%%,}
|
||||
- _opts="${_opts:+${_opts},}${rflags}"
|
||||
- elif getargbool 0 ro; then
|
||||
- # if "ro" is specified, we want /usr to be mounted read-only
|
||||
- _opts="${_opts:+${_opts},}ro"
|
||||
- elif getargbool 0 rw; then
|
||||
- # if "rw" is specified, we want /usr to be mounted read-write
|
||||
- _opts="${_opts:+${_opts},}rw"
|
||||
- fi
|
||||
- echo "$_dev ${NEWROOT}${_mp} $_fs ${_opts} $_freq $_passno"
|
||||
- _usr_found="1"
|
||||
- break
|
||||
- fi
|
||||
- done < "${NEWROOT}/etc/fstab" >> /etc/fstab
|
||||
-
|
||||
- if [ "$_usr_found" = "" ]; then
|
||||
- # nothing to do
|
||||
- return 0
|
||||
- fi
|
||||
-
|
||||
- info "Mounting /usr with -o $_opts"
|
||||
- mount "${NEWROOT}/usr" 2>&1 | vinfo
|
||||
- mount -o remount,rw "${NEWROOT}/usr"
|
||||
-
|
||||
- if ismounted "${NEWROOT}/usr"; then
|
||||
- # success!!
|
||||
- return 0
|
||||
- fi
|
||||
-
|
||||
- if [ "$_last_attempt" = "true" ]; then
|
||||
- warn "Mounting /usr to ${NEWROOT}/usr failed"
|
||||
- warn "*** Dropping you to a shell; the system will continue"
|
||||
- warn "*** when you leave the shell."
|
||||
- action_on_fail
|
||||
- return 2
|
||||
- fi
|
||||
-
|
||||
- return 1
|
||||
-}
|
||||
-
|
||||
-
|
||||
-try_to_mount_usr() {
|
||||
- _last_attempt="$1"
|
||||
- if [ ! -f "${NEWROOT}/etc/fstab" ]; then
|
||||
- warn "File ${NEWROOT}/etc/fstab doesn't exist."
|
||||
- return 1
|
||||
- fi
|
||||
-
|
||||
- # In case we have the LVM command available try make it activate all partitions
|
||||
- if command -v lvm 2>/dev/null 1>/dev/null; then
|
||||
- lvm vgchange --sysinit -a y || {
|
||||
- warn "Detected problem when tried to activate LVM VG."
|
||||
- if [ "$_last_attempt" != "true" ]; then
|
||||
- # this is not last execution, retry
|
||||
- return 1
|
||||
- fi
|
||||
- # NOTE(pstodulk):
|
||||
- # last execution, so call mount_usr anyway
|
||||
- # I am not 100% about lvm vgchange exit codes and I am aware of
|
||||
- # possible warnings, in this last run, let's keep it on mount_usr
|
||||
- # anyway..
|
||||
- }
|
||||
- fi
|
||||
-
|
||||
- mount_usr "$1"
|
||||
-}
|
||||
-
|
||||
-_sleep_timeout=15
|
||||
-_last_attempt="false"
|
||||
-for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
|
||||
- info "Storage initialisation: Attempt $i of 11. Wait $_sleep_timeout seconds."
|
||||
- sleep $_sleep_timeout
|
||||
- if [ $i -eq 11 ]; then
|
||||
- _last_attempt="true"
|
||||
- fi
|
||||
- try_to_mount_usr "$_last_attempt" && break
|
||||
-
|
||||
- # something is wrong. In some cases, storage needs more time for the
|
||||
- # initialisation - especially in case of SAN.
|
||||
-
|
||||
- if [ "$_last_attempt" = "true" ]; then
|
||||
- warn "The last attempt to initialize storage has not been successful."
|
||||
- warn "Unknown state of the storage. It is possible that upgrade will be stopped."
|
||||
- break
|
||||
- fi
|
||||
-
|
||||
- warn "Failed attempt to initialize the storage. Retry..."
|
||||
-done
|
||||
-
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
new file mode 100644
|
||||
index 00000000..d24e0ef0
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
@@ -0,0 +1,3 @@
|
||||
+[Service]
|
||||
+ExecStart=
|
||||
+ExecStart=-/usr/bin/true
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
index 06479fb5..30ae57b3 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
@@ -54,6 +54,17 @@ install() {
|
||||
ln -sf "../${s}.service" "$upgrade_wantsdir"
|
||||
done
|
||||
|
||||
+ # Setup modified initrd-cleanup.service in the upgrade initramfs to enable
|
||||
+ # storage initialisation using systemd-fstab-generator. We want to run the
|
||||
+ # initrd-parse-etc.service but this one triggers also the initrd-cleanup.service
|
||||
+ # which triggers the switch-root and isolated actions that basically kills
|
||||
+ # the original upgrade service when used.
|
||||
+ # The initrd-parse-etc.service has different content across RHEL systems,
|
||||
+ # so we override rather initrd-cleanup.service instead as we do not need
|
||||
+ # that one for the upgrade process.
|
||||
+ mkdir -p "${unitdir}/initrd-cleanup.service.d"
|
||||
+ inst_simple "${_moddir}/initrd-cleanup-override.conf" "${unitdir}/initrd-cleanup.service.d/initrd-cleanup-override.conf"
|
||||
+
|
||||
# just try : set another services into the wantsdir
|
||||
# sysroot.mount \
|
||||
# dracut-mount \
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
index 366b5cab..d2bf7313 100644
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
@@ -2,7 +2,7 @@
|
||||
Description=System Upgrade
|
||||
Documentation=man:upgrade.target(7)
|
||||
# ##sysinit.target sockets.target initrd-root-fs.target initrd-root-device.target initrd-fs.target
|
||||
-Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target
|
||||
+Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target initrd-parse-etc.service
|
||||
Requires=basic.target sysroot.mount
|
||||
-After=basic.target sysroot.mount
|
||||
+After=basic.target sysroot.mount initrd-fs.target
|
||||
AllowIsolate=yes
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,132 @@
|
||||
From 04a2ec2574da233a41d32f70eab780b6c305ff31 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Thu, 19 Dec 2024 10:33:24 +0100
|
||||
Subject: [PATCH 03/55] feat(lvm_autoactivation): add lvm autoactivation
|
||||
|
||||
Add LVM autoactivation mechanism to the upgrade initramfs. The core
|
||||
of the mechanism is based on a special udev rule that is triggered
|
||||
when a new device is detected. The rule then calls two lvm binaries
|
||||
(which are also included into the upgrade initrams) to activate
|
||||
the volume groups and logical volumes.
|
||||
---
|
||||
.../enable_lvm_autoactivation/actor.py | 21 ++++++++
|
||||
.../libraries/enable_lvm_autoactivation.py | 21 ++++++++
|
||||
.../test_lvm_autoactivation_enablement.py | 50 +++++++++++++++++++
|
||||
3 files changed, 92 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..aba60645
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import enable_lvm_autoactivation as enable_lvm_autoactivation_lib
|
||||
+from leapp.models import DistributionSignedRPM, UpgradeInitramfsTasks
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class EnableLVMAutoactivation(Actor):
|
||||
+ """
|
||||
+ Enable LVM autoactivation in upgrade initramfs.
|
||||
+
|
||||
+ Produce instructions for upgrade initramfs generation that will result in LVM
|
||||
+ autoactivation in the initramfs.
|
||||
+ """
|
||||
+
|
||||
+ name = 'enable_lvm_autoactivation'
|
||||
+ consumes = (DistributionSignedRPM,)
|
||||
+ produces = (UpgradeInitramfsTasks, )
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ enable_lvm_autoactivation_lib.emit_lvm_autoactivation_instructions()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
new file mode 100644
|
||||
index 00000000..e312277b
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def emit_lvm_autoactivation_instructions():
|
||||
+ if not has_package(DistributionSignedRPM, 'lvm2'):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Upgrade initramfs will not autoenable LVM devices - `lvm2` RPM is not installed.'
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ # the 69-dm-lvm.rules trigger pvscan and vgchange when LVM device is detected
|
||||
+ files_to_include = [
|
||||
+ '/usr/sbin/pvscan',
|
||||
+ '/usr/sbin/vgchange',
|
||||
+ '/usr/lib/udev/rules.d/69-dm-lvm.rules'
|
||||
+ ]
|
||||
+ lvm_autoactivation_instructions = UpgradeInitramfsTasks(include_files=files_to_include)
|
||||
+
|
||||
+ api.produce(lvm_autoactivation_instructions)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
new file mode 100644
|
||||
index 00000000..c5150aea
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
@@ -0,0 +1,50 @@
|
||||
+from leapp.libraries.actor import enable_lvm_autoactivation
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, produce_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM, RPM, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def test_emit_lvm_autoactivation_instructions_produces_correct_message(monkeypatch):
|
||||
+ """Test that emit_lvm_autoactivation_instructions produces UpgradeInitramfsTasks with correct files."""
|
||||
+ lvm_package = RPM(
|
||||
+ name='lvm2',
|
||||
+ version='2',
|
||||
+ release='1',
|
||||
+ epoch='1',
|
||||
+ packager='',
|
||||
+ arch='x86_64',
|
||||
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51'
|
||||
+ )
|
||||
+
|
||||
+ msgs = [
|
||||
+ DistributionSignedRPM(items=[lvm_package])
|
||||
+ ]
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ enable_lvm_autoactivation.emit_lvm_autoactivation_instructions()
|
||||
+
|
||||
+ assert api.produce.called == 1
|
||||
+
|
||||
+ produced_msg = api.produce.model_instances[0]
|
||||
+
|
||||
+ assert isinstance(produced_msg, UpgradeInitramfsTasks)
|
||||
+
|
||||
+ expected_files = [
|
||||
+ '/usr/sbin/pvscan',
|
||||
+ '/usr/sbin/vgchange',
|
||||
+ '/usr/lib/udev/rules.d/69-dm-lvm.rules'
|
||||
+ ]
|
||||
+ assert produced_msg.include_files == expected_files
|
||||
+
|
||||
+
|
||||
+def test_no_action_if_lvm_rpm_missing(monkeypatch):
|
||||
+ msgs = [
|
||||
+ DistributionSignedRPM(items=[])
|
||||
+ ]
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ enable_lvm_autoactivation.emit_lvm_autoactivation_instructions()
|
||||
+
|
||||
+ assert api.produce.called == 0
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,658 @@
|
||||
From 47fce173e75408d9a7a26225d389161caf72e244 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Sun, 31 Aug 2025 23:49:57 +0200
|
||||
Subject: [PATCH 04/55] feat(mount_unit_gen): generate mount units for the
|
||||
upgrade initramfs
|
||||
|
||||
Run systemd-fstab-generator to produce mount units that correspond to
|
||||
the content of source system's fstab. The generated mount units are then
|
||||
modified to mount /target into /sysroot/target, to reflect that the root
|
||||
of the source system is mounted as /sysroot. These mount units are made
|
||||
dependencies of local-fs.target, and, therefore, will be triggered by
|
||||
systemd before the upgrade.
|
||||
|
||||
Assisted-by: Cursor (Claude Sonnet 4)
|
||||
Jira-ref: RHEL-35446
|
||||
|
||||
@pstodulk:
|
||||
Updated the code to cover also other systemd targets that can be
|
||||
covered by systemd-fstab-generator. Also cover the situation when
|
||||
a directory with systemd target (requires, wants) already exists.
|
||||
Tests have been updated.
|
||||
|
||||
Note that there are still possible issues hidden in the generate
|
||||
mount unit files as we update at this moment just the `Where` clause
|
||||
however we are not touching anything else. (Before, After,
|
||||
RequiresMountsFor, ...). But keeping that for future development and
|
||||
testing. The call for `mount -a` is still present, we expect followup
|
||||
PRs at this point.
|
||||
|
||||
Co-authored-by: Petr Stodulka <pstodulk@redhat.com>
|
||||
---
|
||||
.../initramfs/mount_units_generator/actor.py | 22 ++
|
||||
.../libraries/mount_unit_generator.py | 307 ++++++++++++++++++
|
||||
.../tests/test_mount_unit_generation.py | 269 +++++++++++++++
|
||||
3 files changed, 598 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..5fe25515
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -0,0 +1,22 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class MountUnitGenerator(Actor):
|
||||
+ """
|
||||
+ Sets up storage initialization using systemd's mount units in the upgrade container.
|
||||
+ """
|
||||
+
|
||||
+ name = 'mount_unit_generator'
|
||||
+ consumes = (
|
||||
+ TargetUserSpaceInfo,
|
||||
+ )
|
||||
+ produces = (
|
||||
+ UpgradeInitramfsTasks,
|
||||
+ )
|
||||
+ tags = (IPUWorkflowTag, InterimPreparationPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ mount_unit_generator_lib.setup_storage_initialization()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
new file mode 100644
|
||||
index 00000000..e1060559
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -0,0 +1,307 @@
|
||||
+import os
|
||||
+import shutil
|
||||
+import tempfile
|
||||
+
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.common import mounting
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def run_systemd_fstab_generator(output_directory):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Generating mount units for the source system into {}'.format(output_directory)
|
||||
+ )
|
||||
+
|
||||
+ try:
|
||||
+ generator_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_directory,
|
||||
+ output_directory,
|
||||
+ output_directory
|
||||
+ ]
|
||||
+ run(generator_cmd)
|
||||
+ except CalledProcessError as error:
|
||||
+ api.current_logger().error(
|
||||
+ 'Failed to generate mount units using systemd-fstab-generator. Error: {}'.format(error)
|
||||
+ )
|
||||
+ details = {'details': str(error)}
|
||||
+ raise StopActorExecutionError(
|
||||
+ 'Failed to generate mount units using systemd-fstab-generator',
|
||||
+ details
|
||||
+ )
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Mount units successfully generated into {}'.format(output_directory)
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def _read_unit_file_lines(unit_file_path): # Encapsulate IO for tests
|
||||
+ with open(unit_file_path) as unit_file:
|
||||
+ return unit_file.readlines()
|
||||
+
|
||||
+
|
||||
+def _write_unit_file_lines(unit_file_path, lines): # Encapsulate IO for tests
|
||||
+ with open(unit_file_path, 'w') as unit_file:
|
||||
+ unit_file.write('\n'.join(lines) + '\n')
|
||||
+
|
||||
+
|
||||
+def _delete_file(file_path):
|
||||
+ os.unlink(file_path)
|
||||
+
|
||||
+
|
||||
+def _prefix_mount_unit_with_sysroot(mount_unit_path, new_unit_destination):
|
||||
+ """
|
||||
+ Prefix the mount target with /sysroot as expected in the upgrade initramfs.
|
||||
+
|
||||
+ A new mount unit file is written to new_unit_destination.
|
||||
+ """
|
||||
+ # NOTE(pstodulk): Note that right now we update just the 'Where' key, however
|
||||
+ # what about RequiresMountsFor, .. there could be some hidden dragons.
|
||||
+ # In case of issues, investigate these values in generated unit files.
|
||||
+ api.current_logger().debug(
|
||||
+ 'Prefixing {}\'s mount target with /sysroot. Output will be written to {}'.format(
|
||||
+ mount_unit_path,
|
||||
+ new_unit_destination
|
||||
+ )
|
||||
+ )
|
||||
+ unit_lines = _read_unit_file_lines(mount_unit_path)
|
||||
+
|
||||
+ output_lines = []
|
||||
+ for line in unit_lines:
|
||||
+ line = line.strip()
|
||||
+ if not line.startswith('Where='):
|
||||
+ output_lines.append(line)
|
||||
+ continue
|
||||
+
|
||||
+ _, destination = line.split('=', 1)
|
||||
+ new_destination = os.path.join('/sysroot', destination.lstrip('/'))
|
||||
+
|
||||
+ output_lines.append('Where={}'.format(new_destination))
|
||||
+
|
||||
+ _write_unit_file_lines(new_unit_destination, output_lines)
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Done. Modified mount unit successfully written to {}'.format(new_unit_destination)
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def prefix_all_mount_units_with_sysroot(dir_containing_units):
|
||||
+ for unit_file_path in os.listdir(dir_containing_units):
|
||||
+ # systemd requires mount path to be in the unit name
|
||||
+ modified_unit_destination = 'sysroot-{}'.format(unit_file_path)
|
||||
+ modified_unit_destination = os.path.join(dir_containing_units, modified_unit_destination)
|
||||
+
|
||||
+ unit_file_path = os.path.join(dir_containing_units, unit_file_path)
|
||||
+
|
||||
+ if not unit_file_path.endswith('.mount'):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Skipping {} when prefixing mount units with /sysroot - not a mount unit.'.format(
|
||||
+ unit_file_path
|
||||
+ )
|
||||
+ )
|
||||
+ continue
|
||||
+
|
||||
+ _prefix_mount_unit_with_sysroot(unit_file_path, modified_unit_destination)
|
||||
+
|
||||
+ _delete_file(unit_file_path)
|
||||
+ api.current_logger().debug('Original mount unit {} removed.'.format(unit_file_path))
|
||||
+
|
||||
+
|
||||
+def _fix_symlinks_in_dir(dir_containing_mount_units, target_dir):
|
||||
+ """
|
||||
+ Fix broken symlinks in given target_dir due to us modifying (renaming) the mount units.
|
||||
+
|
||||
+ The target_dir contains symlinks to the (mount) units that are required
|
||||
+ in order for the local-fs.target to be reached. However, we renamed these units to reflect
|
||||
+ that we have changed their mount destinations by prefixing the mount destination with /sysroot.
|
||||
+ Hence, we regenerate the symlinks.
|
||||
+ """
|
||||
+
|
||||
+ target_dir_path = os.path.join(dir_containing_mount_units, target_dir)
|
||||
+ if not os.path.exists(target_dir_path):
|
||||
+ api.current_logger().debug(
|
||||
+ 'The {} directory does not exist. Skipping'
|
||||
+ .format(target_dir)
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Removing the old {} directory from {}.'
|
||||
+ .format(target_dir, dir_containing_mount_units)
|
||||
+ )
|
||||
+
|
||||
+ shutil.rmtree(target_dir_path)
|
||||
+ os.mkdir(target_dir_path)
|
||||
+
|
||||
+ api.current_logger().debug('Populating {} with new symlinks.'.format(target_dir))
|
||||
+
|
||||
+ for unit_file in os.listdir(dir_containing_mount_units):
|
||||
+ if not unit_file.endswith('.mount'):
|
||||
+ continue
|
||||
+
|
||||
+ place_fastlink_at = os.path.join(target_dir_path, unit_file)
|
||||
+ fastlink_points_to = os.path.join('../', unit_file)
|
||||
+ try:
|
||||
+ run(['ln', '-s', fastlink_points_to, place_fastlink_at])
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Dependency on {} created.'.format(unit_file)
|
||||
+ )
|
||||
+ except CalledProcessError as err:
|
||||
+ err_descr = (
|
||||
+ 'Failed to create required unit dependencies under {} for the upgrade initramfs.'
|
||||
+ .format(target_dir)
|
||||
+ )
|
||||
+ details = {'details': str(err)}
|
||||
+ raise StopActorExecutionError(err_descr, details=details)
|
||||
+
|
||||
+
|
||||
+def fix_symlinks_in_targets(dir_containing_mount_units):
|
||||
+ """
|
||||
+ Fix broken symlinks in *.target.* directories caused by earlier modified mount units.
|
||||
+
|
||||
+ Generated mount unit files are part of one of systemd targets (list below),
|
||||
+ which means that a symlink from a systemd target to exists for each of
|
||||
+ them. Based on this, systemd knows when (local or remote file systems?)
|
||||
+ they must (".requires" suffix") or could (".wants" suffix) be mounted.
|
||||
+ See the man 5 systemd.mount for more details how mount units are split into
|
||||
+ these targets.
|
||||
+
|
||||
+ The list of possible target directories where these mount units could end:
|
||||
+ * local-fs.target.requires
|
||||
+ * local-fs.target.wants
|
||||
+ * local-fs-pre.target.requires
|
||||
+ * local-fs-pre.target.wants
|
||||
+ * remote-fs.target.requires
|
||||
+ * remote-fs.target.wants
|
||||
+ * remote-fs-pre.target.requires
|
||||
+ * remote-fs-pre.target.wants
|
||||
+ Most likely, unit files are not generated for "*pre*" targets, but to be
|
||||
+ sure really. Longer list does not cause any issues in this code.
|
||||
+
|
||||
+ In most cases, "local-fs.target.requires" is the only important directory
|
||||
+ for us during the upgrade. But in some (sometimes common) cases we will
|
||||
+ need some of the others as well.
|
||||
+
|
||||
+ These directories do not have to necessarily exists if there are no mount
|
||||
+ unit files that could be put there. But most likely "local-fs.target.requires"
|
||||
+ will always exists.
|
||||
+ """
|
||||
+ dir_list = [
|
||||
+ 'local-fs.target.requires',
|
||||
+ 'local-fs.target.wants',
|
||||
+ 'local-fs-pre.target.requires',
|
||||
+ 'local-fs-pre.target.wants',
|
||||
+ 'remote-fs.target.requires',
|
||||
+ 'remote-fs.target.wants',
|
||||
+ 'remote-fs-pre.target.requires',
|
||||
+ 'remote-fs-pre.target.wants',
|
||||
+ ]
|
||||
+ for tdir in dir_list:
|
||||
+ _fix_symlinks_in_dir(dir_containing_mount_units, tdir)
|
||||
+
|
||||
+
|
||||
+def copy_units_into_system_location(upgrade_container_ctx, dir_with_our_mount_units):
|
||||
+ """
|
||||
+ Copy units and their .wants/.requires directories into the target userspace container.
|
||||
+
|
||||
+ :return: A list of files in the target userspace that were created by copying.
|
||||
+ :rtype: list[str]
|
||||
+ """
|
||||
+ dest_inside_container = '/usr/lib/systemd/system'
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Copying generated mount units for upgrade from {} to {}'.format(
|
||||
+ dir_with_our_mount_units,
|
||||
+ upgrade_container_ctx.full_path(dest_inside_container)
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ copied_files = []
|
||||
+ prefix_len_to_drop = len(upgrade_container_ctx.base_dir)
|
||||
+
|
||||
+ # We cannot rely on mounting library when copying into container
|
||||
+ # as we want to control what happens to symlinks and
|
||||
+ # shutil.copytree in Python3.6 fails if dst directory exists already
|
||||
+ # - which happens in some cases when copying these files.
|
||||
+ for root, dummy_dirs, files in os.walk(dir_with_our_mount_units):
|
||||
+ rel_path = os.path.relpath(root, dir_with_our_mount_units)
|
||||
+ if rel_path == '.':
|
||||
+ rel_path = ''
|
||||
+ dst_dir = os.path.join(upgrade_container_ctx.full_path(dest_inside_container), rel_path)
|
||||
+ os.makedirs(dst_dir, mode=0o755, exist_ok=True)
|
||||
+
|
||||
+ for file in files:
|
||||
+ src_file = os.path.join(root, file)
|
||||
+ dst_file = os.path.join(dst_dir, file)
|
||||
+ api.current_logger().debug(
|
||||
+ 'Copying mount unit file {} to {}'.format(src_file, dst_file)
|
||||
+ )
|
||||
+ if os.path.islink(dst_file):
|
||||
+ # If the target file already exists and it is a symlink, it will
|
||||
+ # fail and we want to overwrite this.
|
||||
+ # NOTE(pstodulk): You could think that it cannot happen, but
|
||||
+ # in future possibly it could happen, so let's rather be careful
|
||||
+ # and handle it. If the dst file exists, we want to overwrite it
|
||||
+ # for sure
|
||||
+ _delete_file(dst_file)
|
||||
+ shutil.copy2(src_file, dst_file, follow_symlinks=False)
|
||||
+ copied_files.append(dst_file[prefix_len_to_drop:])
|
||||
+
|
||||
+ return copied_files
|
||||
+
|
||||
+
|
||||
+def remove_units_for_targets_that_are_already_mounted_by_dracut(dir_with_our_mount_units):
|
||||
+ """
|
||||
+ Remove mount units for mount targets that are already mounted by dracut.
|
||||
+
|
||||
+ Namely, remove mount units:
|
||||
+ '-.mount' (mounts /)
|
||||
+ 'usr.mount' (mounts /usr)
|
||||
+ """
|
||||
+
|
||||
+ # NOTE: remount-fs.service creates dependency cycles that are nondeterministically broken
|
||||
+ # by systemd, causing unpredictable failures. The service is supposed to remount root
|
||||
+ # and /usr, reapplying mount options from /etc/fstab. However, the fstab file present in
|
||||
+ # the initramfs is not the fstab from the source system, and, therefore, it is pointless
|
||||
+ # to require the service. It would make sense after we switched root during normal boot
|
||||
+ # process.
|
||||
+ already_mounted_units = [
|
||||
+ '-.mount',
|
||||
+ 'usr.mount',
|
||||
+ 'local-fs.target.wants/systemd-remount-fs.service'
|
||||
+ ]
|
||||
+
|
||||
+ for unit in already_mounted_units:
|
||||
+ unit_location = os.path.join(dir_with_our_mount_units, unit)
|
||||
+
|
||||
+ if not os.path.exists(unit_location):
|
||||
+ api.current_logger().debug('The {} unit does not exists, no need to remove it.'.format(unit))
|
||||
+ continue
|
||||
+
|
||||
+ _delete_file(unit_location)
|
||||
+
|
||||
+
|
||||
+def request_units_inclusion_in_initramfs(files_to_include):
|
||||
+ api.current_logger().debug('Including the following files into initramfs: {}'.format(files_to_include))
|
||||
+
|
||||
+ additional_files = [
|
||||
+ '/usr/sbin/swapon' # If the system has swap, we have also generated a swap unit to activate it
|
||||
+ ]
|
||||
+
|
||||
+ tasks = UpgradeInitramfsTasks(include_files=files_to_include + additional_files)
|
||||
+ api.produce(tasks)
|
||||
+
|
||||
+
|
||||
+def setup_storage_initialization():
|
||||
+ userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
+
|
||||
+ with mounting.NspawnActions(base_dir=userspace_info.path) as upgrade_container_ctx:
|
||||
+ with tempfile.TemporaryDirectory(dir='/var/lib/leapp/', prefix='tmp_systemd_fstab_') as workspace_path:
|
||||
+ run_systemd_fstab_generator(workspace_path)
|
||||
+ remove_units_for_targets_that_are_already_mounted_by_dracut(workspace_path)
|
||||
+ prefix_all_mount_units_with_sysroot(workspace_path)
|
||||
+ fix_symlinks_in_targets(workspace_path)
|
||||
+ mount_unit_files = copy_units_into_system_location(upgrade_container_ctx, workspace_path)
|
||||
+ request_units_inclusion_in_initramfs(mount_unit_files)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
new file mode 100644
|
||||
index 00000000..b814f6ce
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -0,0 +1,269 @@
|
||||
+import os
|
||||
+import shutil
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.actor import mount_unit_generator
|
||||
+from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def test_run_systemd_fstab_generator_successful_generation(monkeypatch):
|
||||
+ """Test successful mount unit generation."""
|
||||
+
|
||||
+ output_dir = '/tmp/test_output'
|
||||
+ expected_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_dir,
|
||||
+ output_dir,
|
||||
+ output_dir
|
||||
+ ]
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ assert command == expected_cmd
|
||||
+
|
||||
+ return {
|
||||
+ "stdout": "",
|
||||
+ "stderr": "",
|
||||
+ "exit_code": 0,
|
||||
+ }
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+ mount_unit_generator.run_systemd_fstab_generator(output_dir)
|
||||
+
|
||||
+
|
||||
+def test_run_systemd_fstab_generator_failure(monkeypatch):
|
||||
+ """Test handling of systemd-fstab-generator failure."""
|
||||
+ output_dir = '/tmp/test_output'
|
||||
+ expected_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_dir,
|
||||
+ output_dir,
|
||||
+ output_dir
|
||||
+ ]
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ assert command == expected_cmd
|
||||
+ raise CalledProcessError(message='Generator failed', command=['test'], result={'exit_code': 1})
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError):
|
||||
+ mount_unit_generator.run_systemd_fstab_generator(output_dir)
|
||||
+
|
||||
+
|
||||
+def test_prefix_mount_unit_with_sysroot(monkeypatch):
|
||||
+ """Test prefixing a single mount unit with /sysroot."""
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+
|
||||
+ input_content = [
|
||||
+ "[Unit]\n",
|
||||
+ "Description=Test Mount\n",
|
||||
+ "[Mount]\n",
|
||||
+ "Where=/home\n",
|
||||
+ "What=/dev/sda1\n"
|
||||
+ ]
|
||||
+
|
||||
+ expected_output_lines = [
|
||||
+ "[Unit]",
|
||||
+ "Description=Test Mount",
|
||||
+ "[Mount]",
|
||||
+ "Where=/sysroot/home",
|
||||
+ "What=/dev/sda1"
|
||||
+ ]
|
||||
+
|
||||
+ def mock_read_unit_file_lines(unit_file_path):
|
||||
+ return input_content
|
||||
+
|
||||
+ def mock_write_unit_file_lines(unit_file_path, lines):
|
||||
+ assert unit_file_path == '/test/output.mount'
|
||||
+ assert lines == expected_output_lines
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_read_unit_file_lines', mock_read_unit_file_lines)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_write_unit_file_lines', mock_write_unit_file_lines)
|
||||
+
|
||||
+ mount_unit_generator._prefix_mount_unit_with_sysroot(
|
||||
+ '/test/input.mount',
|
||||
+ '/test/output.mount'
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def test_prefix_all_mount_units_with_sysroot(monkeypatch):
|
||||
+ """Test prefixing all mount units in a directory."""
|
||||
+
|
||||
+ expected_changes = {
|
||||
+ '/test/dir/home.mount': {
|
||||
+ 'new_unit_destination': '/test/dir/sysroot-home.mount',
|
||||
+ 'should_be_deleted': True,
|
||||
+ 'deleted': False,
|
||||
+ },
|
||||
+ '/test/dir/var.mount': {
|
||||
+ 'new_unit_destination': '/test/dir/sysroot-var.mount',
|
||||
+ 'should_be_deleted': True,
|
||||
+ 'deleted': False,
|
||||
+ },
|
||||
+ '/test/dir/not-a-mount.service': {
|
||||
+ 'new_unit_destination': None,
|
||||
+ 'should_be_deleted': False,
|
||||
+ 'deleted': False,
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ def mock_listdir(dir_path):
|
||||
+ return ['home.mount', 'var.mount', 'not-a-mount.service']
|
||||
+
|
||||
+ def mock_delete_file(file_path):
|
||||
+ assert file_path in expected_changes
|
||||
+ expected_changes[file_path]['deleted'] = True
|
||||
+
|
||||
+ def mock_prefix(unit_file_path, new_unit_destination):
|
||||
+ assert expected_changes[unit_file_path]['new_unit_destination'] == new_unit_destination
|
||||
+
|
||||
+ monkeypatch.setattr('os.listdir', mock_listdir)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_delete_file', mock_delete_file)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_prefix_mount_unit_with_sysroot', mock_prefix)
|
||||
+
|
||||
+ mount_unit_generator.prefix_all_mount_units_with_sysroot('/test/dir')
|
||||
+
|
||||
+ for original_mount_unit_location in expected_changes:
|
||||
+ should_be_deleted = expected_changes[original_mount_unit_location]['should_be_deleted']
|
||||
+ was_deleted = expected_changes[original_mount_unit_location]['deleted']
|
||||
+ assert should_be_deleted == was_deleted
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('dirname', (
|
||||
+ 'local-fs.target.requires',
|
||||
+ 'local-fs.target.wants',
|
||||
+ 'local-fs-pre.target.requires',
|
||||
+ 'local-fs-pre.target.wants',
|
||||
+ 'remote-fs.target.requires',
|
||||
+ 'remote-fs.target.wants',
|
||||
+ 'remote-fs-pre.target.requires',
|
||||
+ 'remote-fs-pre.target.wants',
|
||||
+))
|
||||
+def test_fix_symlinks_in_dir(monkeypatch, dirname):
|
||||
+ """Test fixing local-fs.target.requires symlinks."""
|
||||
+
|
||||
+ DIR_PATH = os.path.join('/test/dir/', dirname)
|
||||
+
|
||||
+ def mock_rmtree(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+
|
||||
+ def mock_mkdir(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+
|
||||
+ def mock_listdir(dir_path):
|
||||
+ return ['sysroot-home.mount', 'sysroot-var.mount', 'not-a-mount.service']
|
||||
+
|
||||
+ def mock_os_path_exist(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+ return dir_path == DIR_PATH
|
||||
+
|
||||
+ expected_calls = [
|
||||
+ ['ln', '-s', '../sysroot-home.mount', os.path.join(DIR_PATH, 'sysroot-home.mount')],
|
||||
+ ['ln', '-s', '../sysroot-var.mount', os.path.join(DIR_PATH, 'sysroot-var.mount')]
|
||||
+ ]
|
||||
+ call_count = 0
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ nonlocal call_count
|
||||
+ assert command in expected_calls
|
||||
+ call_count += 1
|
||||
+ return {
|
||||
+ "stdout": "",
|
||||
+ "stderr": "",
|
||||
+ "exit_code": 0,
|
||||
+ }
|
||||
+
|
||||
+ monkeypatch.setattr('shutil.rmtree', mock_rmtree)
|
||||
+ monkeypatch.setattr('os.mkdir', mock_mkdir)
|
||||
+ monkeypatch.setattr('os.listdir', mock_listdir)
|
||||
+ monkeypatch.setattr('os.path.exists', mock_os_path_exist)
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+
|
||||
+ mount_unit_generator._fix_symlinks_in_dir('/test/dir', dirname)
|
||||
+
|
||||
+
|
||||
+# Test the copy_units_into_system_location function
|
||||
+def test_copy_units_mixed_content(monkeypatch):
|
||||
+ """Test copying units with mixed files and directories."""
|
||||
+
|
||||
+ def mock_walk(dir_path):
|
||||
+ tuples_to_yield = [
|
||||
+ ('/source/dir', ['local-fs.target.requires'], ['unit1.mount', 'unit2.mount']),
|
||||
+ ('/source/dir/local-fs.target.requires', [], ['unit1.mount', 'unit2.mount']),
|
||||
+ ]
|
||||
+ for i in tuples_to_yield:
|
||||
+ yield i
|
||||
+
|
||||
+ def mock_isdir(path):
|
||||
+ return 'local-fs.target.requires' in path
|
||||
+
|
||||
+ def _make_couple(sub_path):
|
||||
+ return (
|
||||
+ os.path.join('/source/dir/', sub_path),
|
||||
+ os.path.join('/container/usr/lib/systemd/system/', sub_path)
|
||||
+ )
|
||||
+
|
||||
+ def mock_copy2(src, dst, follow_symlinks=True):
|
||||
+ valid_combinations = [
|
||||
+ _make_couple('unit1.mount'),
|
||||
+ _make_couple('unit2.mount'),
|
||||
+ _make_couple('local-fs.target.requires/unit1.mount'),
|
||||
+ _make_couple('local-fs.target.requires/unit2.mount'),
|
||||
+ ]
|
||||
+ assert not follow_symlinks
|
||||
+ assert (src, dst) in valid_combinations
|
||||
+
|
||||
+ def mock_islink(file_path):
|
||||
+ return file_path == '/container/usr/lib/systemd/system/local-fs.target.requires/unit2.mount'
|
||||
+
|
||||
+ class MockedDeleteFile:
|
||||
+ def __init__(self):
|
||||
+ self.removal_called = False
|
||||
+
|
||||
+ def __call__(self, file_path):
|
||||
+ assert file_path == '/container/usr/lib/systemd/system/local-fs.target.requires/unit2.mount'
|
||||
+ self.removal_called = True
|
||||
+
|
||||
+ def mock_makedirs(dst_dir, mode=0o777, exist_ok=False):
|
||||
+ assert exist_ok
|
||||
+ assert mode == 0o755
|
||||
+
|
||||
+ allowed_paths = [
|
||||
+ '/container/usr/lib/systemd/system',
|
||||
+ '/container/usr/lib/systemd/system/local-fs.target.requires'
|
||||
+ ]
|
||||
+ assert dst_dir.rstrip('/') in allowed_paths
|
||||
+
|
||||
+ monkeypatch.setattr(os, 'walk', mock_walk)
|
||||
+ monkeypatch.setattr(os, 'makedirs', mock_makedirs)
|
||||
+ monkeypatch.setattr(os.path, 'isdir', mock_isdir)
|
||||
+ monkeypatch.setattr(os.path, 'islink', mock_islink)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_delete_file', MockedDeleteFile())
|
||||
+ monkeypatch.setattr(shutil, 'copy2', mock_copy2)
|
||||
+
|
||||
+ class MockedContainerContext:
|
||||
+ def __init__(self):
|
||||
+ self.base_dir = '/container'
|
||||
+
|
||||
+ def full_path(self, path):
|
||||
+ return os.path.join('/container', path.lstrip('/'))
|
||||
+
|
||||
+ mock_container = MockedContainerContext()
|
||||
+
|
||||
+ files = mount_unit_generator.copy_units_into_system_location(
|
||||
+ mock_container, '/source/dir'
|
||||
+ )
|
||||
+
|
||||
+ expected_files = [
|
||||
+ '/usr/lib/systemd/system/unit1.mount',
|
||||
+ '/usr/lib/systemd/system/unit2.mount',
|
||||
+ '/usr/lib/systemd/system/local-fs.target.requires/unit1.mount',
|
||||
+ '/usr/lib/systemd/system/local-fs.target.requires/unit2.mount',
|
||||
+ ]
|
||||
+ assert sorted(files) == sorted(expected_files)
|
||||
+ assert mount_unit_generator._delete_file.removal_called
|
||||
--
|
||||
2.51.1
|
||||
|
||||
101
SOURCES/0005-Prevent-sssdupdate-actor-from-rising-errors.patch
Normal file
101
SOURCES/0005-Prevent-sssdupdate-actor-from-rising-errors.patch
Normal file
@ -0,0 +1,101 @@
|
||||
From e26359877b1d90d1f95a424216a00e711c72c923 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 9 Sep 2025 13:56:37 +0200
|
||||
Subject: [PATCH 05/55] Prevent sssdupdate actor from rising errors
|
||||
|
||||
Potential error rise (StopActorExecutionError) is replaced with
|
||||
warning logs in the SSSD update file processing function. This
|
||||
prevents the upgrade from failing when accessing non-critical files.
|
||||
Also fix minor formatting nit picks.
|
||||
|
||||
Jira: RHEL-108992
|
||||
---
|
||||
.../sssd/sssdchecks/libraries/sssdchecks.py | 4 ++--
|
||||
.../sssd/sssdfacts/libraries/sssdfacts.py | 5 ++++-
|
||||
.../sssd/sssdupdate/libraries/sssdupdate.py | 18 +++++++-----------
|
||||
3 files changed, 13 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
index 0a86fa7b..cb95026c 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
@@ -15,8 +15,8 @@ def check_config(model):
|
||||
'SSSD\'s sss_ssh_knownhostsproxy tool is replaced by the more '
|
||||
'reliable sss_ssh_knownhosts tool. SSH\'s configuration will be updated '
|
||||
'to reflect this by updating every mention of sss_ssh_knownhostsproxy by '
|
||||
- 'the corresponding mention of sss_ssh_knownhosts, even those commented out.\n'
|
||||
- 'SSSD\'s ssh service will be enabled if not already done.\n'
|
||||
+ 'the corresponding mention of sss_ssh_knownhosts, even those commented out. '
|
||||
+ 'SSSD\'s ssh service will be enabled if not already done.\n\n'
|
||||
'The following files will be updated:{}{}'.format(
|
||||
FMT_LIST_SEPARATOR,
|
||||
FMT_LIST_SEPARATOR.join(model.sssd_config_files + model.ssh_config_files)
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
index 0ae9d93f..7d343229 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
@@ -19,7 +19,10 @@ def _does_file_contain_expression(file_path, expression):
|
||||
)
|
||||
return False
|
||||
except OSError as e:
|
||||
- raise StopActorExecutionError('Could not open file ' + file_path, details={'details': str(e)})
|
||||
+ raise StopActorExecutionError(
|
||||
+ 'Could not open configuration file',
|
||||
+ details={'details': 'Coudn\'t open {} file with error: {}.'.format(file_path, str(e))}
|
||||
+ )
|
||||
|
||||
|
||||
def _look_for_files(expression: str, path_list: list[str]) -> list[str]:
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
index 6d745ead..5b96bcc6 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
-from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.stdlib import api
|
||||
|
||||
|
||||
def _process_knownhosts(line: str) -> str:
|
||||
@@ -29,30 +29,26 @@ def _process_enable_svc(line: str) -> str:
|
||||
|
||||
|
||||
def _update_file(filename, process_function):
|
||||
- newname = filename + '.new'
|
||||
- oldname = filename + '.old'
|
||||
+ newname = '{}.leappnew'.format(filename)
|
||||
+ oldname = '{}.leappsave'.format(filename)
|
||||
try:
|
||||
- with open(filename, 'r') as input_file, open(newname, 'x') as output_file:
|
||||
+ with open(filename, 'r') as input_file, open(newname, 'w') as output_file:
|
||||
istat = os.fstat(input_file.fileno())
|
||||
os.fchmod(output_file.fileno(), istat.st_mode)
|
||||
for line in input_file:
|
||||
try:
|
||||
output_file.write(process_function(line))
|
||||
except OSError as e:
|
||||
- raise StopActorExecutionError('Failed to write to {}'.format(newname),
|
||||
- details={'details': str(e)})
|
||||
+ api.current_logger().warning('Failed to write to {}'.format(newname), details={'details': str(e)})
|
||||
|
||||
- except FileExistsError as e:
|
||||
- raise StopActorExecutionError('Temporary file already exists: {}'.format(newname),
|
||||
- details={'details': str(e)})
|
||||
except OSError as e:
|
||||
try:
|
||||
os.unlink(newname)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
- raise StopActorExecutionError('Failed to access the required files', details={'details': str(e)})
|
||||
+ api.current_logger().error('Failed to access the required files', details={'details': str(e)})
|
||||
|
||||
- # Let's make sure the old configuration is preserverd if something goes wrong
|
||||
+ # Let's make sure the old configuration is preserved if something goes wrong
|
||||
os.replace(filename, oldname)
|
||||
os.replace(newname, filename)
|
||||
os.unlink(oldname)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
132
SOURCES/0006-Update-our-test-container-to-Fedora-42.patch
Normal file
132
SOURCES/0006-Update-our-test-container-to-Fedora-42.patch
Normal file
@ -0,0 +1,132 @@
|
||||
From 23d8f69509e692ceaa3dacc0de927349ec056189 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Tue, 19 Aug 2025 09:19:18 +0200
|
||||
Subject: [PATCH 06/55] Update our test container to Fedora 42
|
||||
|
||||
The distro.linux_distribution in createresumeservice test is replaced
|
||||
distro.id(). The distro.linux_distribution has been deprecated and on
|
||||
Fedora 42 containerized tests with python3.13 it doesn't work correctly
|
||||
and the createresumeservice tests don't get skipped.
|
||||
|
||||
Jira: RHELMISC-13271
|
||||
---
|
||||
Makefile | 19 +++++++++----------
|
||||
.../tests/test_createresumeservice.py | 2 +-
|
||||
.../{Containerfile.f34 => Containerfile.f42} | 4 ++--
|
||||
3 files changed, 12 insertions(+), 13 deletions(-)
|
||||
rename utils/container-tests/{Containerfile.f34 => Containerfile.f42} (84%)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 81b16376..e0fc7e00 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -165,7 +165,7 @@ help:
|
||||
@echo " MR=6 COPR_CONFIG='path/to/the/config/copr/file' make <target>"
|
||||
@echo " ACTOR=<actor> TEST_LIBS=y make test"
|
||||
@echo " BUILD_CONTAINER=rhel8 make build_container"
|
||||
- @echo " TEST_CONTAINER=f34 make test_container"
|
||||
+ @echo " TEST_CONTAINER=f42 make test_container"
|
||||
@echo " CONTAINER_TOOL=docker TEST_CONTAINER=rhel8 make test_container_no_lint"
|
||||
@echo ""
|
||||
|
||||
@@ -379,7 +379,6 @@ test_no_lint:
|
||||
done; \
|
||||
$(_PYTHON_VENV) -m pytest $(REPORT_ARG) $(TEST_PATHS) $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
|
||||
-
|
||||
test: lint test_no_lint
|
||||
|
||||
# container images act like a cache so that dependencies can only be downloaded once
|
||||
@@ -416,7 +415,7 @@ lint_container:
|
||||
@_TEST_CONT_TARGET="lint" $(MAKE) test_container
|
||||
|
||||
lint_container_all:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) lint_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -426,9 +425,9 @@ lint_container_all:
|
||||
# because e.g RHEL8 to RHEL9 IPU must work on python3.6 and python3.9.
|
||||
test_container:
|
||||
@case $(_TEST_CONTAINER) in \
|
||||
- f34) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.f34"; \
|
||||
- export _VENV="python3.9"; \
|
||||
+ f42) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.f42"; \
|
||||
+ export _VENV="python3.13"; \
|
||||
;; \
|
||||
rhel8) \
|
||||
export CONT_FILE="utils/container-tests/Containerfile.rhel8"; \
|
||||
@@ -439,7 +438,7 @@ test_container:
|
||||
export _VENV="python3.9"; \
|
||||
;; \
|
||||
*) \
|
||||
- echo "Error: Available containers are: f34, rhel8, rhel9"; exit 1; \
|
||||
+ echo "Error: Available containers are: f42, rhel8, rhel9"; exit 1; \
|
||||
;; \
|
||||
esac; \
|
||||
export TEST_IMAGE="leapp-repo-tests-$(_TEST_CONTAINER)"; \
|
||||
@@ -471,7 +470,7 @@ test_container:
|
||||
exit $$res
|
||||
|
||||
test_container_all:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -479,13 +478,13 @@ test_container_no_lint:
|
||||
@_TEST_CONT_TARGET="test_no_lint" $(MAKE) test_container
|
||||
|
||||
test_container_all_no_lint:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container_no_lint || exit 1; \
|
||||
done
|
||||
|
||||
# clean all testing and building containers and their images
|
||||
clean_containers:
|
||||
- @for i in "leapp-repo-tests-f34" "leapp-repo-tests-rhel8" \
|
||||
+ @for i in "leapp-repo-tests-f42" "leapp-repo-tests-rhel8" \
|
||||
"leapp-repo-tests-rhel9" "leapp-repo-build-el8"; do \
|
||||
$(_CONTAINER_TOOL) kill "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rm "$$i-cont" || :; \
|
||||
diff --git a/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py b/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
index 5302cdd2..c1cefc37 100644
|
||||
--- a/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
+++ b/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
@@ -6,7 +6,7 @@ import pytest
|
||||
|
||||
@pytest.mark.skipif(os.getuid() != 0, reason='User is not a root')
|
||||
@pytest.mark.skipif(
|
||||
- distro.linux_distribution()[0] == 'Fedora',
|
||||
+ distro.id() == 'fedora',
|
||||
reason='default.target.wants does not exists on Fedora distro',
|
||||
)
|
||||
def test_create_resume_service(current_actor_context):
|
||||
diff --git a/utils/container-tests/Containerfile.f34 b/utils/container-tests/Containerfile.f42
|
||||
similarity index 84%
|
||||
rename from utils/container-tests/Containerfile.f34
|
||||
rename to utils/container-tests/Containerfile.f42
|
||||
index a9346635..46f0f63a 100644
|
||||
--- a/utils/container-tests/Containerfile.f34
|
||||
+++ b/utils/container-tests/Containerfile.f42
|
||||
@@ -1,11 +1,11 @@
|
||||
-FROM fedora:34
|
||||
+FROM fedora:42
|
||||
|
||||
VOLUME /repo
|
||||
|
||||
RUN dnf update -y && \
|
||||
dnf install -y findutils make rsync python3-gobject-base NetworkManager-libnm
|
||||
|
||||
-ENV PYTHON_VENV python3.9
|
||||
+ENV PYTHON_VENV python3.13
|
||||
|
||||
COPY . /repocopy
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From db8d1f3fcc155b94b07d89d90eb82cd2a52d5cf9 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 20 Aug 2025 15:41:34 +0200
|
||||
Subject: [PATCH 07/55] networkmanagerconnectionscanner: Skip test on Python !=
|
||||
3.6
|
||||
|
||||
The test_nm_conn tests fails on at least Python >= 3.9 (not sure which
|
||||
version exactly).
|
||||
|
||||
Let's skip the test on Python != 3.6 as they never run on a different
|
||||
version - the actor is in the el8toel9 repo and is in FactsPhase.
|
||||
---
|
||||
.../unit_test_networkmanagerconnectionscanner.py | 12 +++++++++++-
|
||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py b/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
index 46af07c1..7558b307 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
@@ -1,4 +1,5 @@
|
||||
import errno
|
||||
+import sys
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
@@ -57,7 +58,16 @@ def test_no_conf(monkeypatch):
|
||||
assert not api.produce.called
|
||||
|
||||
|
||||
-@pytest.mark.skipif(not nmconnscanner.libnm_available, reason="NetworkManager g-ir not installed")
|
||||
+@pytest.mark.skipif(
|
||||
+ sys.version_info.major != 3 or sys.version_info.minor != 6,
|
||||
+ # On Python > 3.6 the GLib and NM libraries apparently behave differently and
|
||||
+ # the test fails. Let's skip it since the actor it's only ever run with
|
||||
+ # Python3.6 (el8toel9 repo and FactsPhase)
|
||||
+ reason="Only runs on Python 3.6",
|
||||
+)
|
||||
+@pytest.mark.skipif(
|
||||
+ not nmconnscanner.libnm_available, reason="NetworkManager g-ir not installed"
|
||||
+)
|
||||
def test_nm_conn(monkeypatch):
|
||||
"""
|
||||
Check a basic keyfile
|
||||
--
|
||||
2.51.1
|
||||
|
||||
132
SOURCES/0008-Remove-unused-rh-el7-Containerfiles.patch
Normal file
132
SOURCES/0008-Remove-unused-rh-el7-Containerfiles.patch
Normal file
@ -0,0 +1,132 @@
|
||||
From c4c36a2abd0c83b021a20a450e66b8b1fe7be2da Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 27 Aug 2025 20:02:46 +0200
|
||||
Subject: [PATCH 08/55] Remove unused (rh)el7 Containerfiles
|
||||
|
||||
---
|
||||
utils/container-builds/Containerfile.centos7 | 15 -----------
|
||||
utils/container-tests/Containerfile.rhel7 | 24 ------------------
|
||||
utils/container-tests/Containerfile.ubi7 | 25 -------------------
|
||||
utils/container-tests/Containerfile.ubi7-lint | 25 -------------------
|
||||
4 files changed, 89 deletions(-)
|
||||
delete mode 100644 utils/container-builds/Containerfile.centos7
|
||||
delete mode 100644 utils/container-tests/Containerfile.rhel7
|
||||
delete mode 100644 utils/container-tests/Containerfile.ubi7
|
||||
delete mode 100644 utils/container-tests/Containerfile.ubi7-lint
|
||||
|
||||
diff --git a/utils/container-builds/Containerfile.centos7 b/utils/container-builds/Containerfile.centos7
|
||||
deleted file mode 100644
|
||||
index af00eddb..00000000
|
||||
--- a/utils/container-builds/Containerfile.centos7
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
-FROM centos:7
|
||||
-
|
||||
-VOLUME /repo
|
||||
-
|
||||
-# mirror.centos.org is dead, comment out mirrorlist and set baseurl to vault.centos.org
|
||||
-RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install -y rpm-build python-devel make git
|
||||
-
|
||||
-WORKDIR /repo
|
||||
-ENV DIST_VERSION 7
|
||||
-ENTRYPOINT make _build_local
|
||||
diff --git a/utils/container-tests/Containerfile.rhel7 b/utils/container-tests/Containerfile.rhel7
|
||||
deleted file mode 100644
|
||||
index 0a0c384a..00000000
|
||||
--- a/utils/container-tests/Containerfile.rhel7
|
||||
+++ /dev/null
|
||||
@@ -1,24 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /repo
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install -y python-virtualenv python-setuptools make git rsync
|
||||
-
|
||||
-# see ./Containerfile.ubi7 for explanation
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-ENV PYTHON_VENV python2.7
|
||||
-
|
||||
-COPY . /repocopy
|
||||
-
|
||||
-WORKDIR /repocopy
|
||||
-
|
||||
-RUN rm -rf tut*
|
||||
-
|
||||
-RUN make clean && make install-deps
|
||||
-
|
||||
-WORKDIR /
|
||||
-
|
||||
diff --git a/utils/container-tests/Containerfile.ubi7 b/utils/container-tests/Containerfile.ubi7
|
||||
deleted file mode 100644
|
||||
index 44625a76..00000000
|
||||
--- a/utils/container-tests/Containerfile.ubi7
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /payload
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install python-virtualenv python-setuptools make git -y
|
||||
-
|
||||
-# NOTE(ivasilev,pstodulk) We need at least pip v10.0.1, however centos:7
|
||||
-# provides just v8.1.2 (via EPEL). So do this: install epel repos -> install
|
||||
-# python2-pip -> use pip to update to specific pip version we require. period
|
||||
-# NOTE(pstodulk) I see we take care about pip for py3 inside the Makefile,
|
||||
-# however I am afraid of additional possible troubles in future because of the
|
||||
-# archaic pip3 version (v9.0.1). As we want to run tests for Py2 and Py3 in ci
|
||||
-# always anyway, let's put py3 installation here as well..
|
||||
-# Dropped Python3 as it is now added in its own container on RHEL8
|
||||
-
|
||||
-# This is some trickery: We install python27-python-pip from the scl, use the scl to bootstrap the python
|
||||
-# module of pip version 20.3.0 and then make it update to 20.3.4 resulting the 'pip' command to be available.
|
||||
-# The --target approach doesn't add it, but at least we now have pip 20.3.4 installed ;-)
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-WORKDIR /payload
|
||||
-ENTRYPOINT make install-deps && make test_no_lint
|
||||
diff --git a/utils/container-tests/Containerfile.ubi7-lint b/utils/container-tests/Containerfile.ubi7-lint
|
||||
deleted file mode 100644
|
||||
index ed548985..00000000
|
||||
--- a/utils/container-tests/Containerfile.ubi7-lint
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /payload
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install python-virtualenv python-setuptools make git -y
|
||||
-
|
||||
-# NOTE(ivasilev,pstodulk) We need at least pip v10.0.1, however centos:7
|
||||
-# provides just v8.1.2 (via EPEL). So do this: install epel repos -> install
|
||||
-# python2-pip -> use pip to update to specific pip version we require. period
|
||||
-# NOTE(pstodulk) I see we take care about pip for py3 inside the Makefile,
|
||||
-# however I am afraid of additional possible troubles in future because of the
|
||||
-# archaic pip3 version (v9.0.1). As we want to run tests for Py2 and Py3 in ci
|
||||
-# always anyway, let's put py3 installation here as well..
|
||||
-# Dropped Python3 as it is now added in its own container on RHEL8
|
||||
-
|
||||
-# This is some trickery: We install python27-python-pip from the scl, use the scl to bootstrap the python
|
||||
-# module of pip version 20.3.0 and then make it update to 20.3.4 resulting the 'pip' command to be available.
|
||||
-# The --target approach doesn't add it, but at least we now have pip 20.3.4 installed ;-)
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-WORKDIR /payload
|
||||
-ENTRYPOINT make install-deps && make lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
239
SOURCES/0009-Rename-Containerfiles-to-consistent-names.patch
Normal file
239
SOURCES/0009-Rename-Containerfiles-to-consistent-names.patch
Normal file
@ -0,0 +1,239 @@
|
||||
From 29c7619f0368384dd2e266610098a1f8d7a13813 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 27 Aug 2025 20:04:28 +0200
|
||||
Subject: [PATCH 09/55] Rename Containerfiles to consistent names
|
||||
|
||||
The container files (both those used in CI and locally by the Makefile)
|
||||
and both build and test, use various base containers - Centos, UBIs.
|
||||
|
||||
This patch unifies the naming scheme to Containerfile.elX to avoid
|
||||
making the user remember which one is used by which command an at
|
||||
which version.
|
||||
|
||||
The containerfiles used by Github Actions are moved to separate
|
||||
folder to avoid name clashes.
|
||||
|
||||
Also, in the GitHub actions test workflow the
|
||||
--security-opt=seccomp=unconfined is removed. Not sure why it was set in
|
||||
the first place, but seems it's not needed anymore.
|
||||
---
|
||||
.github/workflows/unit-tests.yml | 24 ++++++++------
|
||||
Makefile | 31 +++++++++----------
|
||||
.../{Containerfile.ubi8 => Containerfile.el8} | 0
|
||||
.../{Containerfile.ubi9 => Containerfile.el9} | 0
|
||||
...{Containerfile.rhel8 => Containerfile.el8} | 0
|
||||
...{Containerfile.rhel9 => Containerfile.el9} | 0
|
||||
.../Containerfile.el8} | 0
|
||||
.../Containerfile.el8-lint} | 0
|
||||
.../Containerfile.el9} | 0
|
||||
.../Containerfile.el9-lint} | 0
|
||||
10 files changed, 30 insertions(+), 25 deletions(-)
|
||||
rename utils/container-builds/{Containerfile.ubi8 => Containerfile.el8} (100%)
|
||||
rename utils/container-builds/{Containerfile.ubi9 => Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.rhel8 => Containerfile.el8} (100%)
|
||||
rename utils/container-tests/{Containerfile.rhel9 => Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi8 => ci/Containerfile.el8} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi8-lint => ci/Containerfile.el8-lint} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi9 => ci/Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi9-lint => ci/Containerfile.el9-lint} (100%)
|
||||
|
||||
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
|
||||
index ed82e0e5..cfcec437 100644
|
||||
--- a/.github/workflows/unit-tests.yml
|
||||
+++ b/.github/workflows/unit-tests.yml
|
||||
@@ -19,36 +19,36 @@ jobs:
|
||||
- name: 'Unit tests (python:3.12; repos:el9toel10,common)'
|
||||
python: python3.12
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.12; repos:el9toel10,common)'
|
||||
python: python3.12
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
- name: 'Unit tests (python:3.9; repos:el9toel10,common)'
|
||||
python: python3.9
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.9; repos:el9toel10,common)'
|
||||
python: python3.9
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
# 8to9
|
||||
- name: 'Unit tests (python:3.9; repos:el8toel9,common)'
|
||||
python: python3.9
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.9; repos:el8toel9,common)'
|
||||
python: python3.9
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
- name: 'Unit tests (python:3.6; repos:el8toel9,common)'
|
||||
python: python3.6
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi8
|
||||
+ container: el8
|
||||
- name: 'Linters (python:3.6; repos:el8toel9,common)'
|
||||
python: python3.6
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi8-lint
|
||||
+ container: el8-lint
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -63,4 +63,10 @@ jobs:
|
||||
run: |
|
||||
git branch -f main origin/main
|
||||
- name: ${{matrix.scenarios.name}}
|
||||
- run: script -e -c /bin/bash -c 'TERM=xterm podman build --security-opt=seccomp=unconfined -t leapp-tests -f utils/container-tests/Containerfile.${{matrix.scenarios.container}} utils/container-tests && PYTHON_VENV=${{matrix.scenarios.python}} REPOSITORIES=${{matrix.scenarios.repos}} podman run --security-opt=seccomp=unconfined --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV --env=REPOSITORIES leapp-tests'
|
||||
+ run: |
|
||||
+ script -e -c /bin/bash -c \
|
||||
+ 'TERM=xterm \
|
||||
+ podman build -t leapp-tests -f utils/container-tests/ci/Containerfile.${{matrix.scenarios.container}} . && \
|
||||
+ PYTHON_VENV=${{matrix.scenarios.python}} \
|
||||
+ REPOSITORIES=${{matrix.scenarios.repos}} \
|
||||
+ podman run --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV --env=REPOSITORIES leapp-tests'
|
||||
diff --git a/Makefile b/Makefile
|
||||
index e0fc7e00..754c2c63 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -51,7 +51,7 @@ _COPR_CONFIG=$${COPR_CONFIG:-~/.config/copr_rh_oamg.conf}
|
||||
_CONTAINER_TOOL=$${CONTAINER_TOOL:-podman}
|
||||
|
||||
# container to run tests in
|
||||
-_TEST_CONTAINER=$${TEST_CONTAINER:-rhel8}
|
||||
+_TEST_CONTAINER=$${TEST_CONTAINER:-el8}
|
||||
|
||||
# In case just specific CHROOTs should be used for the COPR build, you can
|
||||
# set the multiple CHROOTs separated by comma in the COPR_CHROOT envar, e.g.
|
||||
@@ -129,7 +129,7 @@ help:
|
||||
@echo " test lint source code and run tests"
|
||||
@echo " test_no_lint run tests without linting the source code"
|
||||
@echo " test_container run lint and tests in container"
|
||||
- @echo " - default container is 'rhel8'"
|
||||
+ @echo " - default container is 'el8'"
|
||||
@echo " - can be changed by setting TEST_CONTAINER env"
|
||||
@echo " test_container_all run lint and tests in all available containers"
|
||||
@echo " test_container_no_lint run tests without linting in container, see test_container"
|
||||
@@ -164,9 +164,9 @@ help:
|
||||
@echo " PR=7 SUFFIX='my_additional_suffix' make <target>"
|
||||
@echo " MR=6 COPR_CONFIG='path/to/the/config/copr/file' make <target>"
|
||||
@echo " ACTOR=<actor> TEST_LIBS=y make test"
|
||||
- @echo " BUILD_CONTAINER=rhel8 make build_container"
|
||||
+ @echo " BUILD_CONTAINER=el8 make build_container"
|
||||
@echo " TEST_CONTAINER=f42 make test_container"
|
||||
- @echo " CONTAINER_TOOL=docker TEST_CONTAINER=rhel8 make test_container_no_lint"
|
||||
+ @echo " CONTAINER_TOOL=docker TEST_CONTAINER=el8 make test_container_no_lint"
|
||||
@echo ""
|
||||
|
||||
clean:
|
||||
@@ -252,10 +252,10 @@ build_container:
|
||||
echo "--- Build RPM ${PKGNAME}-${VERSION}-${RELEASE}.el$(DIST_VERSION).rpm in container ---";
|
||||
case "$(BUILD_CONTAINER)" in \
|
||||
el8) \
|
||||
- CONT_FILE="utils/container-builds/Containerfile.ubi8"; \
|
||||
+ CONT_FILE="utils/container-builds/Containerfile.el8"; \
|
||||
;; \
|
||||
el9) \
|
||||
- CONT_FILE="utils/container-builds/Containerfile.ubi9"; \
|
||||
+ CONT_FILE="utils/container-builds/Containerfile.el9"; \
|
||||
;; \
|
||||
"") \
|
||||
echo "BUILD_CONTAINER must be set"; \
|
||||
@@ -415,7 +415,7 @@ lint_container:
|
||||
@_TEST_CONT_TARGET="lint" $(MAKE) test_container
|
||||
|
||||
lint_container_all:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in f42 el{8,9}; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) lint_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -429,16 +429,16 @@ test_container:
|
||||
export CONT_FILE="utils/container-tests/Containerfile.f42"; \
|
||||
export _VENV="python3.13"; \
|
||||
;; \
|
||||
- rhel8) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.rhel8"; \
|
||||
+ el8) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.el8"; \
|
||||
export _VENV="python3.6"; \
|
||||
;; \
|
||||
- rhel9) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.rhel9"; \
|
||||
+ el9) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.el9"; \
|
||||
export _VENV="python3.9"; \
|
||||
;; \
|
||||
*) \
|
||||
- echo "Error: Available containers are: f42, rhel8, rhel9"; exit 1; \
|
||||
+ echo "Error: Available containers are: f42, el8, el9"; exit 1; \
|
||||
;; \
|
||||
esac; \
|
||||
export TEST_IMAGE="leapp-repo-tests-$(_TEST_CONTAINER)"; \
|
||||
@@ -470,7 +470,7 @@ test_container:
|
||||
exit $$res
|
||||
|
||||
test_container_all:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "el8" "el9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -478,14 +478,13 @@ test_container_no_lint:
|
||||
@_TEST_CONT_TARGET="test_no_lint" $(MAKE) test_container
|
||||
|
||||
test_container_all_no_lint:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in f42 el{8,9}; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container_no_lint || exit 1; \
|
||||
done
|
||||
|
||||
# clean all testing and building containers and their images
|
||||
clean_containers:
|
||||
- @for i in "leapp-repo-tests-f42" "leapp-repo-tests-rhel8" \
|
||||
- "leapp-repo-tests-rhel9" "leapp-repo-build-el8"; do \
|
||||
+ @for i in leapp-repo-tests-f42 leapp-repo-tests-el{8,9} leapp-repo-build-el{8,9}; do \
|
||||
$(_CONTAINER_TOOL) kill "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rm "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rmi "$$i" || :; \
|
||||
diff --git a/utils/container-builds/Containerfile.ubi8 b/utils/container-builds/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-builds/Containerfile.ubi8
|
||||
rename to utils/container-builds/Containerfile.el8
|
||||
diff --git a/utils/container-builds/Containerfile.ubi9 b/utils/container-builds/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-builds/Containerfile.ubi9
|
||||
rename to utils/container-builds/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.rhel8 b/utils/container-tests/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.rhel8
|
||||
rename to utils/container-tests/Containerfile.el8
|
||||
diff --git a/utils/container-tests/Containerfile.rhel9 b/utils/container-tests/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.rhel9
|
||||
rename to utils/container-tests/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.ubi8 b/utils/container-tests/ci/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi8
|
||||
rename to utils/container-tests/ci/Containerfile.el8
|
||||
diff --git a/utils/container-tests/Containerfile.ubi8-lint b/utils/container-tests/ci/Containerfile.el8-lint
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi8-lint
|
||||
rename to utils/container-tests/ci/Containerfile.el8-lint
|
||||
diff --git a/utils/container-tests/Containerfile.ubi9 b/utils/container-tests/ci/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi9
|
||||
rename to utils/container-tests/ci/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.ubi9-lint b/utils/container-tests/ci/Containerfile.el9-lint
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi9-lint
|
||||
rename to utils/container-tests/ci/Containerfile.el9-lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
80
SOURCES/0010-Replace-ubi-8-containers-with-centos-8.patch
Normal file
80
SOURCES/0010-Replace-ubi-8-containers-with-centos-8.patch
Normal file
@ -0,0 +1,80 @@
|
||||
From 17767238d038d36341181e1702b73681ae432439 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 20 Aug 2025 14:12:13 +0200
|
||||
Subject: [PATCH 10/55] Replace ubi:8 containers with centos:8
|
||||
|
||||
The networkmanagerconnectionscanner depends on NetworkManager-nmlib and
|
||||
python3-gobject. These are not available in the UBI 8 repos and the
|
||||
tests are skipped.
|
||||
|
||||
This patch changes the base container from UBI 8 to Centos 8 which has
|
||||
the packages available and the tests are not skipped.
|
||||
---
|
||||
commands/tests/test_upgrade_paths.py | 5 +++++
|
||||
utils/container-tests/Containerfile.el8 | 10 ++++++++--
|
||||
utils/container-tests/ci/Containerfile.el8 | 10 ++++++++--
|
||||
3 files changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/commands/tests/test_upgrade_paths.py b/commands/tests/test_upgrade_paths.py
|
||||
index 89b5eb71..9bdf5792 100644
|
||||
--- a/commands/tests/test_upgrade_paths.py
|
||||
+++ b/commands/tests/test_upgrade_paths.py
|
||||
@@ -42,6 +42,11 @@ def test_get_target_version(mock_open, monkeypatch):
|
||||
},
|
||||
)
|
||||
def test_get_target_release(mock_open, monkeypatch): # do not remove mock_open
|
||||
+ # Make it look like it's RHEL even on centos, because that's what the test
|
||||
+ # assumes.
|
||||
+ # Otherwise the test, when ran on Centos, fails because it works
|
||||
+ # with MAJOR.MINOR version format while Centos uses MAJOR format.
|
||||
+ monkeypatch.setattr(command_utils, 'get_distro_id', lambda: 'rhel')
|
||||
monkeypatch.setattr(command_utils, 'get_os_release_version_id', lambda x: '8.6')
|
||||
|
||||
# make sure env var LEAPP_DEVEL_TARGET_RELEASE takes precedence
|
||||
diff --git a/utils/container-tests/Containerfile.el8 b/utils/container-tests/Containerfile.el8
|
||||
index 6f21839b..b92e8742 100644
|
||||
--- a/utils/container-tests/Containerfile.el8
|
||||
+++ b/utils/container-tests/Containerfile.el8
|
||||
@@ -1,9 +1,15 @@
|
||||
-FROM registry.access.redhat.com/ubi8/ubi:latest
|
||||
+FROM centos:8
|
||||
+
|
||||
+RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
|
||||
VOLUME /repo
|
||||
|
||||
RUN dnf update -y && \
|
||||
- dnf install -y python3-virtualenv python3-setuptools python3-pip make git rsync
|
||||
+ dnf install -y git make rsync \
|
||||
+ python3-virtualenv python3-setuptools python3-pip \
|
||||
+ python3-gobject NetworkManager-libnm
|
||||
|
||||
ENV PYTHON_VENV python3.6
|
||||
|
||||
diff --git a/utils/container-tests/ci/Containerfile.el8 b/utils/container-tests/ci/Containerfile.el8
|
||||
index 4da60c18..4a19092e 100644
|
||||
--- a/utils/container-tests/ci/Containerfile.el8
|
||||
+++ b/utils/container-tests/ci/Containerfile.el8
|
||||
@@ -1,9 +1,15 @@
|
||||
-FROM registry.access.redhat.com/ubi8/ubi:latest
|
||||
+FROM centos:8
|
||||
+
|
||||
+RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
|
||||
VOLUME /payload
|
||||
|
||||
RUN dnf update -y && \
|
||||
- dnf install python3-virtualenv python3-setuptools python3-pip make git -y
|
||||
+ dnf install -y make git \
|
||||
+ python3-virtualenv python3-setuptools python3-pip \
|
||||
+ python3-gobject NetworkManager-libnm
|
||||
|
||||
WORKDIR /payload
|
||||
ENTRYPOINT make install-deps && make test_no_lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
From c4f3ace1ebb909dc53796e16959a2459a15d9d74 Mon Sep 17 00:00:00 2001
|
||||
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Date: Thu, 9 Oct 2025 13:30:16 +0000
|
||||
Subject: [PATCH 11/55] chore(deps): update actions/checkout action to v5
|
||||
|
||||
---
|
||||
.github/workflows/codespell.yml | 2 +-
|
||||
.github/workflows/differential-shellcheck.yml | 2 +-
|
||||
.github/workflows/unit-tests.yml | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml
|
||||
index 3e595e32..4b07e4b3 100644
|
||||
--- a/.github/workflows/codespell.yml
|
||||
+++ b/.github/workflows/codespell.yml
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- - uses: actions/checkout@v4
|
||||
+ - uses: actions/checkout@v5
|
||||
- uses: codespell-project/actions-codespell@v2
|
||||
with:
|
||||
ignore_words_list: ro,fo,couldn,repositor,zeor,bootup
|
||||
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml
|
||||
index e1bafb93..6c81713c 100644
|
||||
--- a/.github/workflows/differential-shellcheck.yml
|
||||
+++ b/.github/workflows/differential-shellcheck.yml
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Repository checkout
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
|
||||
index cfcec437..d1b8fb2a 100644
|
||||
--- a/.github/workflows/unit-tests.yml
|
||||
+++ b/.github/workflows/unit-tests.yml
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@v5
|
||||
with:
|
||||
# NOTE(ivasilev) fetch-depth 0 is critical here as leapp deps discovery depends on specific substring in
|
||||
# commit message and default 1 option will get us just merge commit which has an unrelevant message.
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From 601c26f795a7b2f6cb553c656112235d17137b8f Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 16 Sep 2025 15:58:29 +0200
|
||||
Subject: [PATCH 12/55] LiveMode: Add /etc/crypttab file to the target
|
||||
userspace container
|
||||
|
||||
When upgrading with LiveMode, the auto-unlock of encrypted devices
|
||||
fails because the /etc/crypttab configuration file is not present inside
|
||||
the squashfs, causing the boot process to fail.
|
||||
|
||||
This change copy /etc/crypttab file to the target userspace container
|
||||
during the upgrade process, allowing encrypted devices to be properly
|
||||
unlocked.
|
||||
|
||||
Jira: RHEL-90098
|
||||
---
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index 57a94e9d..aac171a7 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -3,6 +3,7 @@ from leapp.libraries.common.config.version import get_source_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CephInfo,
|
||||
+ CopyFile,
|
||||
DracutModule,
|
||||
LuksDumps,
|
||||
StorageInfo,
|
||||
@@ -156,7 +157,10 @@ def check_invalid_luks_devices():
|
||||
'tpm2-tools',
|
||||
'tpm2-abrmd'
|
||||
]
|
||||
- api.produce(TargetUserSpaceUpgradeTasks(install_rpms=required_crypt_rpms))
|
||||
+ api.produce(TargetUserSpaceUpgradeTasks(
|
||||
+ copy_files=[CopyFile(src="/etc/crypttab")],
|
||||
+ install_rpms=required_crypt_rpms)
|
||||
+ )
|
||||
api.produce(UpgradeInitramfsTasks(include_dracut_modules=[
|
||||
DracutModule(name='clevis'),
|
||||
DracutModule(name='clevis-pin-tpm2')
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
From ae048a890ddd2169f3f46d9fbd1545fd65670e16 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 6 Oct 2025 15:56:16 +0200
|
||||
Subject: [PATCH 13/55] livemode: Include /etc/crypttab in upgrade initramfs
|
||||
|
||||
The /etc/crypttab file is sometimes not picked up automatically by
|
||||
dracut, this change includes it unconditionally. This is required for
|
||||
auto-unlocking encrypted devices in upgrade environment.
|
||||
|
||||
The upgradeinitramfsgenerator is modified to process
|
||||
UpgradeInitramfsTasksinclude's include_files when upgrading in livemode.
|
||||
|
||||
Jira: RHEL-90098
|
||||
---
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 4 +++-
|
||||
.../libraries/upgradeinitramfsgenerator.py | 3 +++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index aac171a7..d52b9e73 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -161,7 +161,9 @@ def check_invalid_luks_devices():
|
||||
copy_files=[CopyFile(src="/etc/crypttab")],
|
||||
install_rpms=required_crypt_rpms)
|
||||
)
|
||||
- api.produce(UpgradeInitramfsTasks(include_dracut_modules=[
|
||||
+ api.produce(UpgradeInitramfsTasks(
|
||||
+ include_files=['/etc/crypttab'],
|
||||
+ include_dracut_modules=[
|
||||
DracutModule(name='clevis'),
|
||||
DracutModule(name='clevis-pin-tpm2')
|
||||
])
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
index 02c3fd9d..3ad92167 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
@@ -436,6 +436,9 @@ def _generate_livemode_initramfs(context, userspace_initramfs_dest, target_kerne
|
||||
'--lvmconf', '--mdadmconf',
|
||||
'--kver', target_kernel_ver, '-f', userspace_initramfs_dest]
|
||||
|
||||
+ # Add included files
|
||||
+ cmd.extend(itertools.chain(*(('--install', file) for file in initramfs_includes.files)))
|
||||
+
|
||||
# Add dracut modules
|
||||
cmd.extend(itertools.chain(*(('--add', module) for module in dracut_modules)))
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From 8248f6afd54bedcfe9d9d639fda3760669360dbe Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 13 Oct 2025 13:39:14 +0200
|
||||
Subject: [PATCH 14/55] overlaygen: Fix not enough arguments for format string
|
||||
|
||||
---
|
||||
repos/system_upgrade/common/libraries/overlaygen.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index 867e3559..a048af2b 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -710,7 +710,7 @@ def _create_mount_disk_image_old(disk_images_directory, path):
|
||||
try:
|
||||
utils.call_with_oserror_handled(cmd=['/sbin/mkfs.ext4', '-F', diskimage_path])
|
||||
except CalledProcessError as e:
|
||||
- api.current_logger().error('Failed to create ext4 filesystem in %s', exc_info=True)
|
||||
+ api.current_logger().error('Failed to create ext4 filesystem in %s', diskimage_path, exc_info=True)
|
||||
raise StopActorExecutionError(
|
||||
message=str(e)
|
||||
)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
444
SOURCES/0015-Generalize-TargetRepositories.patch
Normal file
444
SOURCES/0015-Generalize-TargetRepositories.patch
Normal file
@ -0,0 +1,444 @@
|
||||
From 546d18f64deabe8440ac6d4ee707d7a5b69415db Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 15 Sep 2025 11:09:59 +0200
|
||||
Subject: [PATCH 15/55] Generalize TargetRepositories
|
||||
|
||||
The RHELTargetRepository model is deprecated and replaced by the
|
||||
DistroTargetRepository. The target TargetRepositories model is updated
|
||||
accordingly.
|
||||
|
||||
TargetRepositories.rhel_repos are only filled on RHEL.
|
||||
---
|
||||
.../libraries/checktargetrepos.py | 4 ++-
|
||||
.../tests/test_checktargetrepos.py | 32 +++++++++++++------
|
||||
.../cloud/checkrhui/libraries/checkrhui.py | 5 ++-
|
||||
.../tests/component_test_checkrhui.py | 1 +
|
||||
.../libraries/setuptargetrepos.py | 29 +++++++++++------
|
||||
.../libraries/setuptargetrepos_repomap.py | 4 +--
|
||||
.../tests/test_setuptargetrepos.py | 22 ++++++++++---
|
||||
.../libraries/userspacegen.py | 2 ++
|
||||
.../tests/unit_test_targetuserspacecreator.py | 7 ++++
|
||||
.../common/models/targetrepositories.py | 32 +++++++++++++++++--
|
||||
10 files changed, 107 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
index c286ed4f..141cf8e4 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
@@ -2,12 +2,14 @@ from leapp import reporting
|
||||
from leapp.libraries.common import config, rhsm
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
-from leapp.models import CustomTargetRepositoryFile, RHUIInfo, TargetRepositories
|
||||
+from leapp.models import CustomTargetRepositoryFile, RHELTargetRepository, RHUIInfo, TargetRepositories
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
# TODO: we need to provide this path in a shared library
|
||||
CUSTOM_REPO_PATH = '/etc/leapp/files/leapp_upgrade_repositories.repo'
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def _any_custom_repo_defined():
|
||||
for tr in api.consume(TargetRepositories):
|
||||
if tr.custom_repos:
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
index c1ca8cd1..ea93ce7e 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
@@ -8,12 +8,11 @@ from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
CustomTargetRepositoryFile,
|
||||
- EnvVar,
|
||||
- Report,
|
||||
- RepositoryData,
|
||||
+ DistroTargetRepository,
|
||||
RHELTargetRepository,
|
||||
TargetRepositories
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
from leapp.utils.report import is_inhibitor
|
||||
|
||||
|
||||
@@ -32,11 +31,21 @@ class MockedConsume(object):
|
||||
return iter([msg for msg in self._msgs if isinstance(msg, model)])
|
||||
|
||||
|
||||
-_RHEL_REPOS = [
|
||||
- RHELTargetRepository(repoid='repo1'),
|
||||
- RHELTargetRepository(repoid='repo2'),
|
||||
- RHELTargetRepository(repoid='repo3'),
|
||||
- RHELTargetRepository(repoid='repo4'),
|
||||
+@suppress_deprecation(RHELTargetRepository)
|
||||
+def _test_rhel_repos():
|
||||
+ return [
|
||||
+ RHELTargetRepository(repoid='repo1'),
|
||||
+ RHELTargetRepository(repoid='repo2'),
|
||||
+ RHELTargetRepository(repoid='repo3'),
|
||||
+ RHELTargetRepository(repoid='repo4'),
|
||||
+ ]
|
||||
+
|
||||
+
|
||||
+_DISTRO_REPOS = [
|
||||
+ DistroTargetRepository(repoid='repo1'),
|
||||
+ DistroTargetRepository(repoid='repo2'),
|
||||
+ DistroTargetRepository(repoid='repo3'),
|
||||
+ DistroTargetRepository(repoid='repo4'),
|
||||
]
|
||||
|
||||
_CUSTOM_REPOS = [
|
||||
@@ -46,8 +55,10 @@ _CUSTOM_REPOS = [
|
||||
CustomTargetRepository(repoid='repo4', name='repo4name', baseurl=None, enabled=True),
|
||||
]
|
||||
|
||||
-_TARGET_REPOS_CUSTOM = TargetRepositories(rhel_repos=_RHEL_REPOS, custom_repos=_CUSTOM_REPOS)
|
||||
-_TARGET_REPOS_NO_CUSTOM = TargetRepositories(rhel_repos=_RHEL_REPOS)
|
||||
+_TARGET_REPOS_CUSTOM = TargetRepositories(
|
||||
+ rhel_repos=_test_rhel_repos(), distro_repos=_DISTRO_REPOS, custom_repos=_CUSTOM_REPOS
|
||||
+)
|
||||
+_TARGET_REPOS_NO_CUSTOM = TargetRepositories(rhel_repos=_test_rhel_repos(), distro_repos=_DISTRO_REPOS)
|
||||
_CUSTOM_TARGET_REPOFILE = CustomTargetRepositoryFile(file='/etc/leapp/files/leapp_upgrade_repositories.repo')
|
||||
|
||||
|
||||
@@ -55,6 +66,7 @@ def test_checktargetrepos_rhsm(monkeypatch):
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: False)
|
||||
monkeypatch.setattr(api, 'consume', MockedConsume())
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(checktargetrepos, 'get_target_major_version', lambda: '8')
|
||||
checktargetrepos.process()
|
||||
assert reporting.create_report.called == 0
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
index ea154173..5dcdd967 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
@@ -22,6 +22,7 @@ from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
DNFPluginTask,
|
||||
InstalledRPM,
|
||||
+ RHELTargetRepository,
|
||||
RHUIInfo,
|
||||
RpmTransactionTasks,
|
||||
TargetRepositories,
|
||||
@@ -30,6 +31,7 @@ from leapp.models import (
|
||||
TargetRHUISetupInfo,
|
||||
TargetUserSpacePreupgradeTasks
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
MatchingSetup = namedtuple('MatchingSetup', ['family', 'description'])
|
||||
|
||||
@@ -370,11 +372,12 @@ def emit_rhui_setup_tasks_based_on_config(rhui_config_dict):
|
||||
api.produce(rhui_info)
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def request_configured_repos_to_be_enabled(rhui_config):
|
||||
config_repos_to_enable = rhui_config[RhuiTargetRepositoriesToUse.name]
|
||||
custom_repos = [CustomTargetRepository(repoid=repoid) for repoid in config_repos_to_enable]
|
||||
if custom_repos:
|
||||
- target_repos = TargetRepositories(custom_repos=custom_repos, rhel_repos=[])
|
||||
+ target_repos = TargetRepositories(custom_repos=custom_repos, rhel_repos=[], distro_repos=[])
|
||||
api.produce(target_repos)
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
index 3ac9c1b8..02ca352e 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
@@ -468,6 +468,7 @@ def test_request_configured_repos_to_be_enabled(monkeypatch):
|
||||
|
||||
target_repos = api.produce.model_instances[0]
|
||||
assert isinstance(target_repos, TargetRepositories)
|
||||
+ assert not target_repos.distro_repos
|
||||
assert not target_repos.rhel_repos
|
||||
|
||||
custom_repoids = sorted(custom_repo_model.repoid for custom_repo_model in target_repos.custom_repos)
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
index a6073aa3..9e5b1334 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
@@ -1,9 +1,10 @@
|
||||
-
|
||||
from leapp.libraries.actor import setuptargetrepos_repomap
|
||||
+from leapp.libraries.common.config import get_distro_id
|
||||
from leapp.libraries.common.config.version import get_source_major_version, get_source_version, get_target_version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
+ DistroTargetRepository,
|
||||
InstalledRPM,
|
||||
RepositoriesBlacklisted,
|
||||
RepositoriesFacts,
|
||||
@@ -15,6 +16,7 @@ from leapp.models import (
|
||||
TargetRepositories,
|
||||
UsedRepositories
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810 = {
|
||||
'rhui-microsoft-azure-rhel8-sapapps': 'rhui-microsoft-azure-rhel8-base-sap-apps',
|
||||
@@ -80,6 +82,7 @@ def _get_mapped_repoids(repomap, src_repoids):
|
||||
return mapped_repoids
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository)
|
||||
def process():
|
||||
# Load relevant data from messages
|
||||
used_repoids_dict = _get_used_repo_dict()
|
||||
@@ -103,10 +106,11 @@ def process():
|
||||
# installed packages that have mapping to prevent missing repositories that are disabled during the upgrade, but
|
||||
# can be used to upgrade installed packages.
|
||||
repoids_to_map = enabled_repoids.union(repoids_from_installed_packages_with_mapping)
|
||||
+ is_rhel = get_distro_id() == 'rhel'
|
||||
|
||||
# RHEL8.10 use a different repoid for client repository, but the repomapping mechanism cannot distinguish these
|
||||
# as it does not use minor versions. Therefore, we have to hardcode these changes.
|
||||
- if get_source_version() == '8.10':
|
||||
+ if is_rhel and get_source_version() == '8.10':
|
||||
for rhel88_rhui_client_repoid, rhel810_rhui_client_repoid in RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810.items():
|
||||
if rhel810_rhui_client_repoid in repoids_to_map:
|
||||
# Replace RHEL8.10 rhui client repoids with RHEL8.8 repoids,
|
||||
@@ -119,9 +123,9 @@ def process():
|
||||
default_channels = setuptargetrepos_repomap.get_default_repository_channels(repomap, repoids_to_map)
|
||||
repomap.set_default_channels(default_channels)
|
||||
|
||||
- # Get target RHEL repoids based on the repomap
|
||||
+ # Get target distro repoids based on the repomap
|
||||
expected_repos = repomap.get_expected_target_pesid_repos(repoids_to_map)
|
||||
- target_rhel_repoids = set()
|
||||
+ target_distro_repoids = set()
|
||||
for target_pesid, target_pesidrepo in expected_repos.items():
|
||||
if not target_pesidrepo:
|
||||
# NOTE this could happen only for enabled repositories part of the set,
|
||||
@@ -139,7 +143,7 @@ def process():
|
||||
if target_pesidrepo.repoid in excluded_repoids:
|
||||
api.current_logger().debug('Skipping the {} repo (excluded).'.format(target_pesidrepo.repoid))
|
||||
continue
|
||||
- target_rhel_repoids.add(target_pesidrepo.repoid)
|
||||
+ target_distro_repoids.add(target_pesidrepo.repoid)
|
||||
|
||||
# FIXME: this could possibly result into a try to enable multiple repositories
|
||||
# from the same family (pesid). But unless we have a bug in previous actors,
|
||||
@@ -151,7 +155,7 @@ def process():
|
||||
if repo in excluded_repoids:
|
||||
api.current_logger().debug('Skipping the {} repo from setup task (excluded).'.format(repo))
|
||||
continue
|
||||
- target_rhel_repoids.add(repo)
|
||||
+ target_distro_repoids.add(repo)
|
||||
|
||||
# On 8.10, some RHUI setups have different names than the one computed by repomapping.
|
||||
# Although such situation could be avoided (having another client repo when a single
|
||||
@@ -159,12 +163,16 @@ def process():
|
||||
# solution.
|
||||
if get_target_version() == '8.10':
|
||||
for pre_810_repoid, post_810_repoid in RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810.items():
|
||||
- if pre_810_repoid in target_rhel_repoids:
|
||||
- target_rhel_repoids.remove(pre_810_repoid)
|
||||
- target_rhel_repoids.add(post_810_repoid)
|
||||
+ if pre_810_repoid in target_distro_repoids:
|
||||
+ target_distro_repoids.remove(pre_810_repoid)
|
||||
+ target_distro_repoids.add(post_810_repoid)
|
||||
|
||||
# create the final lists and sort them (for easier testing)
|
||||
- rhel_repos = [RHELTargetRepository(repoid=repoid) for repoid in sorted(target_rhel_repoids)]
|
||||
+ if is_rhel:
|
||||
+ rhel_repos = [RHELTargetRepository(repoid=repoid) for repoid in sorted(target_distro_repoids)]
|
||||
+ else:
|
||||
+ rhel_repos = []
|
||||
+ distro_repos = [DistroTargetRepository(repoid=repoid) for repoid in sorted(target_distro_repoids)]
|
||||
custom_repos = [repo for repo in custom_repos if repo.repoid not in excluded_repoids]
|
||||
custom_repos = sorted(custom_repos, key=lambda x: x.repoid)
|
||||
|
||||
@@ -179,5 +187,6 @@ def process():
|
||||
|
||||
api.produce(TargetRepositories(
|
||||
rhel_repos=rhel_repos,
|
||||
+ distro_repos=distro_repos,
|
||||
custom_repos=custom_repos,
|
||||
))
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
index 37be03f1..343ee2ea 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-from leapp.libraries.common.config import get_target_product_channel
|
||||
+from leapp.libraries.common.config import get_distro_id, get_target_product_channel
|
||||
from leapp.libraries.common.config.version import get_source_major_version, get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
|
||||
@@ -44,7 +44,7 @@ class RepoMapDataHandler(object):
|
||||
# ideal for work, but there is not any significant impact..
|
||||
self.repositories = repo_map.repositories
|
||||
self.mapping = repo_map.mapping
|
||||
- self.distro = distro or api.current_actor().configuration.os_release.release_id
|
||||
+ self.distro = distro or get_distro_id()
|
||||
# FIXME(pstodulk): what about default_channel -> fallback_channel
|
||||
# hardcoded always as ga? instead of list of channels..
|
||||
# it'd be possibly confusing naming now...
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
index 1f898e8f..e4a30f7f 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
@@ -198,11 +198,23 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
setuptargetrepos.process()
|
||||
assert api.produce.called
|
||||
|
||||
+ distro_repos = api.produce.model_instances[0].distro_repos
|
||||
rhel_repos = api.produce.model_instances[0].rhel_repos
|
||||
- assert len(rhel_repos) == 3
|
||||
|
||||
+ assert len(distro_repos) == 3
|
||||
+
|
||||
+ produced_distro_repoids = {repo.repoid for repo in distro_repos}
|
||||
produced_rhel_repoids = {repo.repoid for repo in rhel_repos}
|
||||
- expected_rhel_repoids = {'{0}-8-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
- '{0}-8-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
- '{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id)}
|
||||
- assert produced_rhel_repoids == expected_rhel_repoids
|
||||
+
|
||||
+ expected_repoids = {
|
||||
+ "{0}-8-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
+ "{0}-8-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
+ "{0}-8-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
+ }
|
||||
+
|
||||
+ assert produced_distro_repoids == expected_repoids
|
||||
+ if distro_id == 'rhel':
|
||||
+ assert len(rhel_repos) == 3
|
||||
+ assert produced_rhel_repoids == expected_repoids
|
||||
+ else:
|
||||
+ assert len(rhel_repos) == 0
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 55877d05..407cb0b7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -17,6 +17,7 @@ from leapp.models import (
|
||||
CustomTargetRepositoryFile,
|
||||
PkgManagerInfo,
|
||||
RepositoriesFacts,
|
||||
+ RHELTargetRepository,
|
||||
RHSMInfo,
|
||||
RHUIInfo,
|
||||
StorageInfo,
|
||||
@@ -967,6 +968,7 @@ def _get_rh_available_repoids(context, indata):
|
||||
return rh_repoids
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def gather_target_repositories(context, indata):
|
||||
"""
|
||||
Get available required target repositories and inhibit or raise error if basic checks do not pass.
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 7853a7ad..f05e6bc2 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -1072,6 +1072,7 @@ def test_consume_data(monkeypatch, raised, no_rhsm, testdata):
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Currently not implemented in the actor. It's TODO.")
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories(monkeypatch):
|
||||
monkeypatch.setattr(userspacegen.api, 'current_actor', CurrentActorMocked())
|
||||
# The available RHSM repos
|
||||
@@ -1104,6 +1105,7 @@ def test_gather_target_repositories_none_available(monkeypatch):
|
||||
assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
|
||||
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories_rhui(monkeypatch):
|
||||
|
||||
indata = testInData(
|
||||
@@ -1122,6 +1124,10 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
rhel_repos=[
|
||||
models.RHELTargetRepository(repoid='rhui-1'),
|
||||
models.RHELTargetRepository(repoid='rhui-2')
|
||||
+ ],
|
||||
+ distro_repos=[
|
||||
+ models.DistroTargetRepository(repoid='rhui-1'),
|
||||
+ models.DistroTargetRepository(repoid='rhui-2')
|
||||
]
|
||||
)
|
||||
])
|
||||
@@ -1130,6 +1136,7 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
assert target_repoids == set(['rhui-1', 'rhui-2'])
|
||||
|
||||
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
# If the repos that Leapp identifies as required for the upgrade (based on the repo mapping and PES data) are not
|
||||
# available, an exception shall be raised
|
||||
diff --git a/repos/system_upgrade/common/models/targetrepositories.py b/repos/system_upgrade/common/models/targetrepositories.py
|
||||
index 02c6c5e5..e1a0b646 100644
|
||||
--- a/repos/system_upgrade/common/models/targetrepositories.py
|
||||
+++ b/repos/system_upgrade/common/models/targetrepositories.py
|
||||
@@ -1,4 +1,5 @@
|
||||
from leapp.models import fields, Model
|
||||
+from leapp.reporting import deprecated
|
||||
from leapp.topics import TransactionTopic
|
||||
|
||||
|
||||
@@ -11,10 +12,18 @@ class UsedTargetRepository(TargetRepositoryBase):
|
||||
pass
|
||||
|
||||
|
||||
+@deprecated(
|
||||
+ since="2025-07-23",
|
||||
+ message="This model is deprecated, use DistroTargetRepository instead.",
|
||||
+)
|
||||
class RHELTargetRepository(TargetRepositoryBase):
|
||||
pass
|
||||
|
||||
|
||||
+class DistroTargetRepository(TargetRepositoryBase):
|
||||
+ pass
|
||||
+
|
||||
+
|
||||
class CustomTargetRepository(TargetRepositoryBase):
|
||||
name = fields.Nullable(fields.String())
|
||||
baseurl = fields.Nullable(fields.String())
|
||||
@@ -26,20 +35,39 @@ class TargetRepositories(Model):
|
||||
Repositories supposed to be used during the IPU process
|
||||
|
||||
The list of the actually used repositories could be just subset
|
||||
- of these repositoies. In case of `custom_repositories`, all such repositories
|
||||
+ of these repositories. In case of `custom_repositories`, all such repositories
|
||||
must be available otherwise the upgrade is inhibited. But in case of
|
||||
- `rhel_repos`, only BaseOS and Appstream repos are required now. If others
|
||||
+ `distro_repos`, only BaseOS and Appstream repos are required now. If others
|
||||
are missing, upgrade can still continue.
|
||||
+
|
||||
+ Note: `rhel_repos` are deprecated, use `distro_repos` instead.
|
||||
"""
|
||||
topic = TransactionTopic
|
||||
+
|
||||
+ # DEPRECATED: this has been superseded by distro_repos
|
||||
rhel_repos = fields.List(fields.Model(RHELTargetRepository))
|
||||
"""
|
||||
Expected target YUM RHEL repositories provided via RHSM
|
||||
|
||||
+ DEPRECATED - use distro_repos instead.
|
||||
+
|
||||
These repositories are stored inside /etc/yum.repos.d/redhat.repo and
|
||||
are expected to be used based on the provided repositories mapping.
|
||||
"""
|
||||
|
||||
+ distro_repos = fields.List(fields.Model(DistroTargetRepository))
|
||||
+ """
|
||||
+ Expected target DNF repositories provided by the distribution.
|
||||
+
|
||||
+ On RHEL these are the repositories provided via RHSM.
|
||||
+ These repositories are stored inside /etc/yum.repos.d/redhat.repo and
|
||||
+ are expected to be used based on the provided repositories mapping.
|
||||
+
|
||||
+ On other distributions, such as Centos Stream these are repositories
|
||||
+ in /etc/yum.repos.d/ that are provided by the distribution and are expected
|
||||
+ to be used based on the provided repositories mapping.
|
||||
+ """
|
||||
+
|
||||
custom_repos = fields.List(fields.Model(CustomTargetRepository), default=[])
|
||||
"""
|
||||
Custom YUM repositories required to be used for the IPU
|
||||
--
|
||||
2.51.1
|
||||
|
||||
65
SOURCES/0016-checktargetrepos-Skip-if-not-RHEL.patch
Normal file
65
SOURCES/0016-checktargetrepos-Skip-if-not-RHEL.patch
Normal file
@ -0,0 +1,65 @@
|
||||
From e61718d44e0175bcd28c8a5ee44dc46880d74482 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Tue, 5 Aug 2025 12:20:23 +0200
|
||||
Subject: [PATCH 16/55] checktargetrepos: Skip if not RHEL
|
||||
|
||||
Skip the target repos check on non-RHEL distros. On non-RHEL distros,
|
||||
there is no subscription-manager. The base repositories (BaseOS,
|
||||
AppStream, ...) should always be present.
|
||||
This is checked using the seatbelts in target userspace creator.
|
||||
---
|
||||
.../system_upgrade/common/actors/checktargetrepos/actor.py | 4 +++-
|
||||
.../actors/checktargetrepos/libraries/checktargetrepos.py | 7 ++++---
|
||||
.../actors/checktargetrepos/tests/test_checktargetrepos.py | 2 --
|
||||
3 files changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/actor.py b/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
index d61fb685..a5bdde10 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
@@ -6,7 +6,9 @@ from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
class Checktargetrepos(Actor):
|
||||
"""
|
||||
- Check whether target yum repositories are specified.
|
||||
+ Check whether target dnf repositories are specified on RHEL.
|
||||
+
|
||||
+ NOTE: this actor does nothing on distros other than RHEL.
|
||||
|
||||
RHSM | RHUI | ER | CTR | CTRF || result
|
||||
-----+------+----+-----+------++-------
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
index 141cf8e4..ea21e1de 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
@@ -40,9 +40,10 @@ def process():
|
||||
|
||||
rhui_info = next(api.consume(RHUIInfo), None)
|
||||
|
||||
- if not rhsm.skip_rhsm() or rhui_info:
|
||||
- # getting RH repositories through RHSM or RHUI; resolved by seatbelts
|
||||
- # implemented in other actors
|
||||
+ if config.get_distro_id() != 'rhel' or (not rhsm.skip_rhsm() or rhui_info):
|
||||
+ # RHEL: getting RH repositories through RHSM or RHUI;
|
||||
+ # resolved by seatbelts in other actors
|
||||
+ # other: distro repos provided by the distro directly, seatbelts elsewhere
|
||||
return
|
||||
|
||||
# rhsm skipped; take your seatbelts please
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
index ea93ce7e..e055b3a6 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
@@ -65,9 +65,7 @@ _CUSTOM_TARGET_REPOFILE = CustomTargetRepositoryFile(file='/etc/leapp/files/leap
|
||||
def test_checktargetrepos_rhsm(monkeypatch):
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: False)
|
||||
- monkeypatch.setattr(api, 'consume', MockedConsume())
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
- monkeypatch.setattr(checktargetrepos, 'get_target_major_version', lambda: '8')
|
||||
checktargetrepos.process()
|
||||
assert reporting.create_report.called == 0
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,820 @@
|
||||
From 32d9c40ffc7ea8d08e2b85881579ede1fdaedb32 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 7 Aug 2025 13:40:33 +0200
|
||||
Subject: [PATCH 17/55] userspacegen: Add repo gathering for non-RHEL distros
|
||||
|
||||
The _get_rh_available_repoids() function is replaced by the
|
||||
new get_distro_repoids() function from the distro library. This function
|
||||
works with all the "supported" distros.
|
||||
The idea is the same as for RHEL, scan well-known distro-provided
|
||||
repofiles for repositories.
|
||||
For RHEL, at least for now, the existing
|
||||
rhsm.get_rhsm_available_repoids() function is still used.
|
||||
|
||||
These changes together enable the use of repomapping on distros other
|
||||
than RHEL, as before this change the --enablerepo option had to be used
|
||||
to specify target repos and they were treated as custom repos.
|
||||
|
||||
Also, the unused _get_rhui_available_repoids() function is removed.
|
||||
|
||||
Jira: RHEL-107212
|
||||
|
||||
Move get_distro_repoids() to the distro library
|
||||
---
|
||||
.../libraries/userspacegen.py | 228 ++++++++++--------
|
||||
.../tests/unit_test_targetuserspacecreator.py | 56 ++++-
|
||||
.../system_upgrade/common/libraries/distro.py | 192 +++++++++++++++
|
||||
.../common/libraries/tests/test_distro.py | 154 ++++++++++++
|
||||
4 files changed, 524 insertions(+), 106 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 407cb0b7..26fec2d9 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -6,7 +6,7 @@ import shutil
|
||||
from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecution, StopActorExecutionError
|
||||
from leapp.libraries.actor import constants
|
||||
-from leapp.libraries.common import dnfplugin, mounting, overlaygen, repofileutils, rhsm, utils
|
||||
+from leapp.libraries.common import distro, dnfplugin, mounting, overlaygen, repofileutils, rhsm, utils
|
||||
from leapp.libraries.common.config import get_distro_id, get_env, get_product_type
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.common.gpg import get_path_to_gpg_certs, is_nogpgcheck_set
|
||||
@@ -58,6 +58,7 @@ from leapp.utils.deprecation import suppress_deprecation
|
||||
PROD_CERTS_FOLDER = 'prod-certs'
|
||||
PERSISTENT_PACKAGE_CACHE_DIR = '/var/lib/leapp/persistent_package_cache'
|
||||
DEDICATED_LEAPP_PART_URL = 'https://access.redhat.com/solutions/7011704'
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
|
||||
|
||||
def _check_deprecated_rhsm_skip():
|
||||
@@ -778,7 +779,7 @@ def _inhibit_on_duplicate_repos(repofiles):
|
||||
list_separator_fmt = '\n - '
|
||||
api.current_logger().warning(
|
||||
'The following repoids are defined multiple times:{0}{1}'
|
||||
- .format(list_separator_fmt, list_separator_fmt.join(duplicates))
|
||||
+ .format(list_separator_fmt, list_separator_fmt.join(sorted(duplicates)))
|
||||
)
|
||||
|
||||
reporting.create_report([
|
||||
@@ -786,7 +787,7 @@ def _inhibit_on_duplicate_repos(repofiles):
|
||||
reporting.Summary(
|
||||
'The following repositories are defined multiple times inside the'
|
||||
' "upgrade" container:{0}{1}'
|
||||
- .format(list_separator_fmt, list_separator_fmt.join(duplicates))
|
||||
+ .format(list_separator_fmt, list_separator_fmt.join(sorted(duplicates)))
|
||||
),
|
||||
reporting.Severity(reporting.Severity.MEDIUM),
|
||||
reporting.Groups([reporting.Groups.REPOSITORY]),
|
||||
@@ -815,21 +816,19 @@ def _get_all_available_repoids(context):
|
||||
return set(repoids)
|
||||
|
||||
|
||||
-def _get_rhsm_available_repoids(context):
|
||||
- target_major_version = get_target_major_version()
|
||||
+def _inhibit_if_no_base_repos(distro_repoids):
|
||||
# FIXME: check that required repo IDs (baseos, appstream)
|
||||
# + or check that all required RHEL repo IDs are available.
|
||||
- if rhsm.skip_rhsm():
|
||||
- return set()
|
||||
- # Get the RHSM repos available in the target RHEL container
|
||||
- # TODO: very similar thing should happens for all other repofiles in container
|
||||
- #
|
||||
- repoids = rhsm.get_available_repo_ids(context)
|
||||
+
|
||||
+ target_major_version = get_target_major_version()
|
||||
# NOTE(ivasilev) For the moment at least AppStream and BaseOS repos are required. While we are still
|
||||
# contemplating on what can be a generic solution to checking this, let's introduce a minimal check for
|
||||
# at-least-one-appstream and at-least-one-baseos among present repoids
|
||||
- if not repoids or all("baseos" not in ri for ri in repoids) or all("appstream" not in ri for ri in repoids):
|
||||
+ no_baseos = all("baseos" not in ri for ri in distro_repoids)
|
||||
+ no_appstream = all("appstream" not in ri for ri in distro_repoids)
|
||||
+ if no_baseos or no_appstream:
|
||||
reporting.create_report([
|
||||
+ # TODO: Make the report distro agnostic
|
||||
reporting.Title('Cannot find required basic RHEL target repositories.'),
|
||||
reporting.Summary(
|
||||
'This can happen when a repository ID was entered incorrectly either while using the --enablerepo'
|
||||
@@ -861,21 +860,6 @@ def _get_rhsm_available_repoids(context):
|
||||
title='Preparing for the upgrade')
|
||||
])
|
||||
raise StopActorExecution()
|
||||
- return set(repoids)
|
||||
-
|
||||
-
|
||||
-def _get_rhui_available_repoids(context, cloud_repo):
|
||||
- repofiles = repofileutils.get_parsed_repofiles(context)
|
||||
-
|
||||
- # TODO: same refactoring as Issue #486?
|
||||
- _inhibit_on_duplicate_repos(repofiles)
|
||||
- repoids = []
|
||||
- for rfile in repofiles:
|
||||
- if rfile.file == cloud_repo and rfile.data:
|
||||
- repoids = [repo.repoid for repo in rfile.data]
|
||||
- repoids.sort()
|
||||
- break
|
||||
- return set(repoids)
|
||||
|
||||
|
||||
def get_copy_location_from_copy_in_task(context_basepath, copy_task):
|
||||
@@ -886,86 +870,106 @@ def get_copy_location_from_copy_in_task(context_basepath, copy_task):
|
||||
return copy_task.dst
|
||||
|
||||
|
||||
-def _get_rh_available_repoids(context, indata):
|
||||
+def _get_rhui_available_repoids(context, rhui_info):
|
||||
"""
|
||||
- RH repositories are provided either by RHSM or are stored in the expected repo file provided by
|
||||
- RHUI special packages (every cloud provider has itw own rpm).
|
||||
+ Get repoids provided by the RHUI target clients
|
||||
+
|
||||
+ :rtype: set[str]
|
||||
"""
|
||||
+ # If we are upgrading a RHUI system, check what repositories are provided by the (already installed) target clients
|
||||
+ setup_info = rhui_info.target_client_setup_info
|
||||
+ target_content_access_files = set()
|
||||
+ if setup_info.bootstrap_target_client:
|
||||
+ target_content_access_files = _query_rpm_for_pkg_files(context, rhui_info.target_client_pkg_names)
|
||||
|
||||
- rh_repoids = _get_rhsm_available_repoids(context)
|
||||
+ def is_repofile(path):
|
||||
+ return os.path.dirname(path) == '/etc/yum.repos.d' and os.path.basename(path).endswith('.repo')
|
||||
|
||||
- # If we are upgrading a RHUI system, check what repositories are provided by the (already installed) target clients
|
||||
- if indata and indata.rhui_info:
|
||||
- setup_info = indata.rhui_info.target_client_setup_info
|
||||
- target_content_access_files = set()
|
||||
- if setup_info.bootstrap_target_client:
|
||||
- target_content_access_files = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
+ def extract_repoid_from_line(line):
|
||||
+ return line.split(':', 1)[1].strip()
|
||||
|
||||
- def is_repofile(path):
|
||||
- return os.path.dirname(path) == '/etc/yum.repos.d' and os.path.basename(path).endswith('.repo')
|
||||
+ target_ver = api.current_actor().configuration.version.target
|
||||
+ setup_tasks = rhui_info.target_client_setup_info.preinstall_tasks.files_to_copy_into_overlay
|
||||
|
||||
- def extract_repoid_from_line(line):
|
||||
- return line.split(':', 1)[1].strip()
|
||||
+ yum_repos_d = context.full_path('/etc/yum.repos.d')
|
||||
+ all_repofiles = {os.path.join(yum_repos_d, path) for path in os.listdir(yum_repos_d) if path.endswith('.repo')}
|
||||
+ api.current_logger().debug('(RHUI Setup) All available repofiles: {0}'.format(' '.join(all_repofiles)))
|
||||
|
||||
- target_ver = api.current_actor().configuration.version.target
|
||||
- setup_tasks = indata.rhui_info.target_client_setup_info.preinstall_tasks.files_to_copy_into_overlay
|
||||
+ target_access_repofiles = {
|
||||
+ context.full_path(path) for path in target_content_access_files if is_repofile(path)
|
||||
+ }
|
||||
|
||||
- yum_repos_d = context.full_path('/etc/yum.repos.d')
|
||||
- all_repofiles = {os.path.join(yum_repos_d, path) for path in os.listdir(yum_repos_d) if path.endswith('.repo')}
|
||||
- api.current_logger().debug('(RHUI Setup) All available repofiles: {0}'.format(' '.join(all_repofiles)))
|
||||
+ # Exclude repofiles used to setup the target rhui access as on some platforms the repos provided by
|
||||
+ # the client are not sufficient to install the client into target userspace (GCP)
|
||||
+ rhui_setup_repofile_tasks = [task for task in setup_tasks if task.src.endswith('repo')]
|
||||
+ rhui_setup_repofiles = (
|
||||
+ get_copy_location_from_copy_in_task(context.base_dir, copy) for copy in rhui_setup_repofile_tasks
|
||||
+ )
|
||||
+ rhui_setup_repofiles = {context.full_path(repofile) for repofile in rhui_setup_repofiles}
|
||||
|
||||
- target_access_repofiles = {
|
||||
- context.full_path(path) for path in target_content_access_files if is_repofile(path)
|
||||
- }
|
||||
+ foreign_repofiles = all_repofiles - target_access_repofiles - rhui_setup_repofiles
|
||||
|
||||
- # Exclude repofiles used to setup the target rhui access as on some platforms the repos provided by
|
||||
- # the client are not sufficient to install the client into target userspace (GCP)
|
||||
- rhui_setup_repofile_tasks = [task for task in setup_tasks if task.src.endswith('repo')]
|
||||
- rhui_setup_repofiles = (
|
||||
- get_copy_location_from_copy_in_task(context.base_dir, copy) for copy in rhui_setup_repofile_tasks
|
||||
- )
|
||||
- rhui_setup_repofiles = {context.full_path(repofile) for repofile in rhui_setup_repofiles}
|
||||
+ api.current_logger().debug(
|
||||
+ 'The following repofiles are considered as unknown to'
|
||||
+ ' the target RHUI content setup and will be ignored: {0}'.format(' '.join(foreign_repofiles))
|
||||
+ )
|
||||
|
||||
- foreign_repofiles = all_repofiles - target_access_repofiles - rhui_setup_repofiles
|
||||
+ # Rename non-client repofiles so they will not be recognized when running dnf repolist
|
||||
+ for foreign_repofile in foreign_repofiles:
|
||||
+ os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile))
|
||||
|
||||
- api.current_logger().debug(
|
||||
- 'The following repofiles are considered as unknown to'
|
||||
- ' the target RHUI content setup and will be ignored: {0}'.format(' '.join(foreign_repofiles))
|
||||
+ rhui_repoids = set()
|
||||
+ try:
|
||||
+ dnf_cmd = [
|
||||
+ 'dnf', 'repolist',
|
||||
+ '--releasever', target_ver, '-v',
|
||||
+ '--enablerepo', '*',
|
||||
+ '--disablerepo', '*-source-*',
|
||||
+ '--disablerepo', '*-debug-*',
|
||||
+ ]
|
||||
+ repolist_result = context.call(dnf_cmd)['stdout']
|
||||
+ repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')]
|
||||
+ rhui_repoids.update({extract_repoid_from_line(line) for line in repoid_lines})
|
||||
+
|
||||
+ except CalledProcessError as err:
|
||||
+ details = {'err': err.stderr, 'details': str(err)}
|
||||
+ raise StopActorExecutionError(
|
||||
+ message='Failed to retrieve repoids provided by target RHUI clients.',
|
||||
+ details=details
|
||||
)
|
||||
|
||||
- # Rename non-client repofiles so they will not be recognized when running dnf repolist
|
||||
+ finally:
|
||||
+ # Revert the renaming of non-client repofiles
|
||||
for foreign_repofile in foreign_repofiles:
|
||||
- os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile))
|
||||
+ os.rename('{0}.back'.format(foreign_repofile), foreign_repofile)
|
||||
|
||||
- try:
|
||||
- dnf_cmd = [
|
||||
- 'dnf', 'repolist',
|
||||
- '--releasever', target_ver, '-v',
|
||||
- '--enablerepo', '*',
|
||||
- '--disablerepo', '*-source-*',
|
||||
- '--disablerepo', '*-debug-*',
|
||||
- ]
|
||||
- repolist_result = context.call(dnf_cmd)['stdout']
|
||||
- repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')]
|
||||
- rhui_repoids = {extract_repoid_from_line(line) for line in repoid_lines}
|
||||
- rh_repoids.update(rhui_repoids)
|
||||
-
|
||||
- except CalledProcessError as err:
|
||||
- details = {'err': err.stderr, 'details': str(err)}
|
||||
- raise StopActorExecutionError(
|
||||
- message='Failed to retrieve repoids provided by target RHUI clients.',
|
||||
- details=details
|
||||
- )
|
||||
+ return rhui_repoids
|
||||
|
||||
- finally:
|
||||
- # Revert the renaming of non-client repofiles
|
||||
- for foreign_repofile in foreign_repofiles:
|
||||
- os.rename('{0}.back'.format(foreign_repofile), foreign_repofile)
|
||||
|
||||
- api.current_logger().debug(
|
||||
- 'The following repofiles are considered as provided by RedHat: {0}'.format(' '.join(rh_repoids))
|
||||
- )
|
||||
- return rh_repoids
|
||||
+def _get_distro_available_repoids(context, indata):
|
||||
+ """
|
||||
+ Get repoids provided by the distribution
|
||||
+
|
||||
+ On RHEL: RH repositories are provided either by RHSM or are stored in the
|
||||
+ expected repo file provided by RHUI special packages (every cloud
|
||||
+ provider has itw own rpm).
|
||||
+ On other: Repositories are provided in specific repofiles (e.g. centos.repo
|
||||
+ and centos-addons.repo on CS)
|
||||
+
|
||||
+ :return: A set of repoids provided by distribution
|
||||
+ :rtype: set[str]
|
||||
+ """
|
||||
+ distro_repoids = distro.get_target_distro_repoids(context)
|
||||
+ distro_id = get_distro_id()
|
||||
+ rhel_and_rhsm = distro_id == 'rhel' and not rhsm.skip_rhsm()
|
||||
+ if distro_id != 'rhel' or rhel_and_rhsm:
|
||||
+ _inhibit_if_no_base_repos(distro_repoids)
|
||||
+
|
||||
+ if indata and indata.rhui_info:
|
||||
+ rhui_repoids = _get_rhui_available_repoids(context, indata.rhui_info)
|
||||
+ distro_repoids.extend(rhui_repoids)
|
||||
+
|
||||
+ return set(distro_repoids)
|
||||
|
||||
|
||||
@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
@@ -986,17 +990,31 @@ def gather_target_repositories(context, indata):
|
||||
:param context: An instance of a mounting.IsolatedActions class
|
||||
:type context: mounting.IsolatedActions class
|
||||
:return: List of target system repoids
|
||||
- :rtype: List(string)
|
||||
+ :rtype: set[str]
|
||||
"""
|
||||
- rh_available_repoids = _get_rh_available_repoids(context, indata)
|
||||
- all_available_repoids = _get_all_available_repoids(context)
|
||||
|
||||
- target_repoids = []
|
||||
- missing_custom_repoids = []
|
||||
+ distro_repoids = _get_distro_available_repoids(context, indata)
|
||||
+ if distro_repoids:
|
||||
+ api.current_logger().info(
|
||||
+ "The following repoids are considered as provided by the '{}' distribution:{}{}".format(
|
||||
+ get_distro_id(),
|
||||
+ FMT_LIST_SEPARATOR,
|
||||
+ FMT_LIST_SEPARATOR.join(sorted(distro_repoids)),
|
||||
+ )
|
||||
+ )
|
||||
+ else:
|
||||
+ api.current_logger().warning(
|
||||
+ "No repoids provided by the {} distribution have been discovered".format(get_distro_id())
|
||||
+ )
|
||||
+
|
||||
+ all_repoids = _get_all_available_repoids(context)
|
||||
+
|
||||
+ target_repoids = set()
|
||||
+ missing_custom_repoids = set()
|
||||
for target_repo in api.consume(TargetRepositories):
|
||||
- for rhel_repo in target_repo.rhel_repos:
|
||||
- if rhel_repo.repoid in rh_available_repoids:
|
||||
- target_repoids.append(rhel_repo.repoid)
|
||||
+ for distro_repo in target_repo.distro_repos:
|
||||
+ if distro_repo.repoid in distro_repoids:
|
||||
+ target_repoids.add(distro_repo.repoid)
|
||||
else:
|
||||
# TODO: We shall report that the RHEL repos that we deem necessary for
|
||||
# the upgrade are not available; but currently it would just print bunch of
|
||||
@@ -1005,12 +1023,16 @@ def gather_target_repositories(context, indata):
|
||||
# of the upgrade. Let's skip it for now until it's clear how we will deal
|
||||
# with it.
|
||||
pass
|
||||
+
|
||||
for custom_repo in target_repo.custom_repos:
|
||||
- if custom_repo.repoid in all_available_repoids:
|
||||
- target_repoids.append(custom_repo.repoid)
|
||||
+ if custom_repo.repoid in all_repoids:
|
||||
+ target_repoids.add(custom_repo.repoid)
|
||||
else:
|
||||
- missing_custom_repoids.append(custom_repo.repoid)
|
||||
- api.current_logger().debug("Gathered target repositories: {}".format(', '.join(target_repoids)))
|
||||
+ missing_custom_repoids.add(custom_repo.repoid)
|
||||
+ api.current_logger().debug(
|
||||
+ "Gathered target repositories: {}".format(", ".join(sorted(target_repoids)))
|
||||
+ )
|
||||
+
|
||||
if not target_repoids:
|
||||
target_major_version = get_target_major_version()
|
||||
reporting.create_report([
|
||||
@@ -1056,7 +1078,7 @@ def gather_target_repositories(context, indata):
|
||||
' while using the --enablerepo option of leapp, or in a third party actor that produces a'
|
||||
' CustomTargetRepositoryMessage.\n'
|
||||
'The following repositories IDs could not be found in the target configuration:\n'
|
||||
- '- {}\n'.format('\n- '.join(missing_custom_repoids))
|
||||
+ '- {}\n'.format('\n- '.join(sorted(missing_custom_repoids)))
|
||||
),
|
||||
reporting.Groups([reporting.Groups.REPOSITORY]),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
@@ -1073,7 +1095,7 @@ def gather_target_repositories(context, indata):
|
||||
))
|
||||
])
|
||||
raise StopActorExecution()
|
||||
- return set(target_repoids)
|
||||
+ return target_repoids
|
||||
|
||||
|
||||
def _install_custom_repofiles(context, custom_repofiles):
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index f05e6bc2..2ae194d7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -11,9 +11,9 @@ import pytest
|
||||
from leapp import models, reporting
|
||||
from leapp.exceptions import StopActorExecution, StopActorExecutionError
|
||||
from leapp.libraries.actor import userspacegen
|
||||
-from leapp.libraries.common import overlaygen, repofileutils, rhsm
|
||||
+from leapp.libraries.common import distro, overlaygen, repofileutils, rhsm
|
||||
from leapp.libraries.common.config import architecture
|
||||
-from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked, logger_mocked, produce_mocked
|
||||
from leapp.libraries.stdlib import api, CalledProcessError
|
||||
from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
@@ -1115,7 +1115,9 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
monkeypatch.setattr(userspacegen.api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(userspacegen, '_get_all_available_repoids', lambda x: [])
|
||||
monkeypatch.setattr(
|
||||
- userspacegen, '_get_rh_available_repoids', lambda x, y: ['rhui-1', 'rhui-2', 'rhui-3']
|
||||
+ userspacegen,
|
||||
+ "_get_distro_available_repoids",
|
||||
+ lambda dummy_context, dummy_indata: {"rhui-1", "rhui-2", "rhui-3"},
|
||||
)
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
monkeypatch.setattr(
|
||||
@@ -1195,6 +1197,54 @@ def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
|
||||
|
||||
+def test__get_distro_available_repoids_norhsm_norhui(monkeypatch):
|
||||
+ """
|
||||
+ Empty set should be returned when on rhel and skip_rhsm == True.
|
||||
+ """
|
||||
+ monkeypatch.setattr(
|
||||
+ userspacegen.api, "current_actor", CurrentActorMocked(release_id="rhel")
|
||||
+ )
|
||||
+ monkeypatch.setattr(userspacegen.api.current_actor(), 'produce', produce_mocked())
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_repoids', lambda ctx: [])
|
||||
+
|
||||
+ indata = testInData(_PACKAGES_MSGS, None, None, _XFS_MSG, _STORAGEINFO_MSG, None)
|
||||
+ # NOTE: context is not used without rhsm, for simplicity setting to None
|
||||
+ repoids = userspacegen._get_distro_available_repoids(None, indata)
|
||||
+ assert repoids == set()
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ "distro_id,skip_rhsm", [("rhel", False), ("centos", True), ("almalinux", True)]
|
||||
+)
|
||||
+def test__get_distro_available_repoids_nobaserepos_inhibit(
|
||||
+ monkeypatch, distro_id, skip_rhsm
|
||||
+):
|
||||
+ """
|
||||
+ Test that get_distro_available repoids reports and raises if there are no base repos.
|
||||
+ """
|
||||
+ monkeypatch.setattr(
|
||||
+ userspacegen.api, "current_actor", CurrentActorMocked(release_id=distro_id)
|
||||
+ )
|
||||
+ monkeypatch.setattr(userspacegen.api.current_actor(), 'produce', produce_mocked())
|
||||
+ monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_repoids', lambda ctx: [])
|
||||
+
|
||||
+ indata = testInData(_PACKAGES_MSGS, None, None, _XFS_MSG, _STORAGEINFO_MSG, None)
|
||||
+ with pytest.raises(StopActorExecution):
|
||||
+ # NOTE: context is not used without rhsm, for simplicity setting to None
|
||||
+ userspacegen._get_distro_available_repoids(None, indata)
|
||||
+
|
||||
+ # TODO adjust the asserts when the report is made distro agnostic
|
||||
+ assert reporting.create_report.called == 1
|
||||
+ report = reporting.create_report.reports[0]
|
||||
+ assert "Cannot find required basic RHEL target repositories" in report["title"]
|
||||
+ assert reporting.Groups.INHIBITOR in report["groups"]
|
||||
+
|
||||
+
|
||||
def mocked_consume_data():
|
||||
packages = {'dnf', 'dnf-command(config-manager)', 'pkgA', 'pkgB'}
|
||||
rhsm_info = _RHSMINFO_MSG
|
||||
diff --git a/repos/system_upgrade/common/libraries/distro.py b/repos/system_upgrade/common/libraries/distro.py
|
||||
index 2ed5eacd..d6a2381a 100644
|
||||
--- a/repos/system_upgrade/common/libraries/distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/distro.py
|
||||
@@ -2,6 +2,10 @@ import json
|
||||
import os
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.common import repofileutils, rhsm
|
||||
+from leapp.libraries.common.config import get_distro_id
|
||||
+from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_X86_64
|
||||
+from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
|
||||
|
||||
@@ -16,3 +20,191 @@ def get_distribution_data(distribution):
|
||||
raise StopActorExecutionError(
|
||||
'Cannot find distribution signature configuration.',
|
||||
details={'Problem': 'Distribution {} was not found in {}.'.format(distribution, distributions_path)})
|
||||
+
|
||||
+
|
||||
+# distro -> major_version -> repofile -> tuple of architectures where it's present
|
||||
+_DISTRO_REPOFILES_MAP = {
|
||||
+ 'rhel': {
|
||||
+ '8': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ '9': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ '10': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ },
|
||||
+ 'centos': {
|
||||
+ '8': {
|
||||
+ # TODO is this true on all archs?
|
||||
+ 'CentOS-Linux-AppStream.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-BaseOS.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-ContinuousRelease.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Debuginfo.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Devel.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Extras.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-FastTrack.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-HighAvailability.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Media.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Plus.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-PowerTools.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Sources.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '9': {
|
||||
+ '/etc/yum.repos.d/centos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/centos-addons.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '10': {
|
||||
+ '/etc/yum.repos.d/centos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/centos-addons.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ },
|
||||
+ 'almalinux': {
|
||||
+ '8': {
|
||||
+ # TODO is this true on all archs?
|
||||
+ '/etc/yum.repos.d/almalinux-ha.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-powertools.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-resilientstorage.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '9': {
|
||||
+ '/etc/yum.repos.d/almalinux-appstream.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-baseos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-crb.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-extras.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-highavailability.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-resilientstorage.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ # RT and NFV are only on x86_64 on almalinux 9
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': (ARCH_X86_64,),
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': (ARCH_X86_64,),
|
||||
+ },
|
||||
+ '10': {
|
||||
+ # no resilientstorage on 10
|
||||
+ '/etc/yum.repos.d/almalinux-appstream.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-baseos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-crb.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-extras.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-highavailability.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ # RT and NFV are only on x86_64 on almalinux 10
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': (ARCH_X86_64,),
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': (ARCH_X86_64,),
|
||||
+ },
|
||||
+ },
|
||||
+}
|
||||
+
|
||||
+
|
||||
+def _get_distro_repofiles(distro, major_version, arch):
|
||||
+ """
|
||||
+ Get distribution provided repofiles.
|
||||
+
|
||||
+ Note that this does not perform any validation, the caller must check
|
||||
+ whether the files exist.
|
||||
+
|
||||
+ :param distro: The distribution to get repofiles for.
|
||||
+ :type distro: str
|
||||
+ :param major_version: The major version to get repofiles for.
|
||||
+ :type major_version: str
|
||||
+ :param arch: The architecture to get repofiles for.
|
||||
+ :type arch: str
|
||||
+ :return: A list of paths to repofiles provided by distribution
|
||||
+ :rtype: list[str] or None if no repofiles are mapped for the arguments
|
||||
+ """
|
||||
+
|
||||
+ distro_repofiles = _DISTRO_REPOFILES_MAP.get(distro)
|
||||
+ if not distro_repofiles:
|
||||
+ return None
|
||||
+
|
||||
+ version_repofiles = distro_repofiles.get(major_version, {})
|
||||
+ if not version_repofiles:
|
||||
+ return None
|
||||
+
|
||||
+ return [repofile for repofile, archs in version_repofiles.items() if arch in archs]
|
||||
+
|
||||
+
|
||||
+def get_target_distro_repoids(context):
|
||||
+ """
|
||||
+ Get repoids defined in distro provided repofiles
|
||||
+
|
||||
+ See the generic :func:`_get_distro_repoids` for more details.
|
||||
+
|
||||
+ :param context: An instance of mounting.IsolatedActions class
|
||||
+ :type context: mounting.IsolatedActions
|
||||
+ :return: Repoids of distribution provided repositories
|
||||
+ :type: list[str]
|
||||
+ """
|
||||
+
|
||||
+ return get_distro_repoids(
|
||||
+ context,
|
||||
+ get_distro_id(),
|
||||
+ get_target_major_version(),
|
||||
+ api.current_actor().configuration.architecture
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def get_distro_repoids(context, distro, major_version, arch):
|
||||
+ """
|
||||
+ Get repoids defined in distro provided repofiles
|
||||
+
|
||||
+ On RHEL with RHSM this delegates to rhsm.get_available_repo_ids.
|
||||
+
|
||||
+ Repofiles installed by RHUI client packages are not covered by this
|
||||
+ function.
|
||||
+
|
||||
+ :param context: An instance of mounting.IsolatedActions class
|
||||
+ :type context: mounting.IsolatedActions
|
||||
+ :param distro: The distro whose repoids to return
|
||||
+ :type distro: str
|
||||
+ :param major_version: The major version to get distro repoids for.
|
||||
+ :type major_version: str
|
||||
+ :param arch: The architecture to get distro repoids for.
|
||||
+ :type arch: str
|
||||
+ :return: Repoids of distribution provided repositories
|
||||
+ :type: list[str]
|
||||
+ """
|
||||
+
|
||||
+ if distro == 'rhel':
|
||||
+ if rhsm.skip_rhsm():
|
||||
+ return []
|
||||
+ # Kept this todo here from the original code from
|
||||
+ # userspacegen._get_rh_available_repoids:
|
||||
+ # Get the RHSM repos available in the target RHEL container
|
||||
+ # TODO: very similar thing should happens for all other repofiles in container
|
||||
+ return rhsm.get_available_repo_ids(context)
|
||||
+
|
||||
+ repofiles = repofileutils.get_parsed_repofiles(context)
|
||||
+ distro_repofiles = _get_distro_repofiles(distro, major_version, arch)
|
||||
+ if not distro_repofiles:
|
||||
+ # TODO: a different way of signaling an error would be preferred (e.g. returning None),
|
||||
+ # but since rhsm.get_available_repo_ids also raises StopActorExecutionError,
|
||||
+ # let's make it easier for the caller for now and use it too
|
||||
+ raise StopActorExecutionError(
|
||||
+ "No known distro provided repofiles mapped",
|
||||
+ details={
|
||||
+ "details": "distro: {}, major version: {}, architecture: {}".format(
|
||||
+ distro, major_version, arch
|
||||
+ )
|
||||
+ },
|
||||
+ )
|
||||
+
|
||||
+ distro_repoids = []
|
||||
+ for rfile in repofiles:
|
||||
+ if rfile.file in distro_repofiles:
|
||||
+
|
||||
+ if not os.path.exists(context.full_path(rfile.file)):
|
||||
+ api.current_logger().debug(
|
||||
+ "Expected distribution provided repofile does not exists: {}".format(
|
||||
+ rfile
|
||||
+ )
|
||||
+ )
|
||||
+ continue
|
||||
+
|
||||
+ if rfile.data:
|
||||
+ distro_repoids.extend([repo.repoid for repo in rfile.data])
|
||||
+
|
||||
+ return sorted(distro_repoids)
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
new file mode 100644
|
||||
index 00000000..3a8f174f
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -0,0 +1,154 @@
|
||||
+import os
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.actors import StopActorExecutionError
|
||||
+from leapp.libraries.common import distro, repofileutils, rhsm
|
||||
+from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_ARM64, ARCH_PPC64LE, ARCH_S390X, ARCH_X86_64
|
||||
+from leapp.libraries.common.distro import _get_distro_repofiles, get_distro_repoids
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import RepositoryData, RepositoryFile
|
||||
+
|
||||
+_RHEL_REPOFILES = ['/etc/yum.repos.d/redhat.repo']
|
||||
+_CENTOS_REPOFILES = [
|
||||
+ "/etc/yum.repos.d/centos.repo", "/etc/yum.repos.d/centos-addons.repo"
|
||||
+]
|
||||
+
|
||||
+
|
||||
+def test_get_distro_repofiles(monkeypatch):
|
||||
+ """
|
||||
+ Test the functionality, not the data.
|
||||
+ """
|
||||
+ test_map = {
|
||||
+ 'distro1': {
|
||||
+ '8': {
|
||||
+ 'repofile1': ARCH_ACCEPTED,
|
||||
+ 'repofile2': [ARCH_X86_64],
|
||||
+ },
|
||||
+ '9': {
|
||||
+ 'repofile3': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ },
|
||||
+ 'distro2': {
|
||||
+ '8': {},
|
||||
+ '9': {
|
||||
+ 'repofile2': [ARCH_X86_64],
|
||||
+ 'repofile3': [ARCH_ARM64, ARCH_S390X, ARCH_PPC64LE],
|
||||
+ },
|
||||
+ },
|
||||
+ }
|
||||
+ monkeypatch.setattr(distro, '_DISTRO_REPOFILES_MAP', test_map)
|
||||
+
|
||||
+ # mix of all and specific arch
|
||||
+ repofiles = _get_distro_repofiles('distro1', '8', ARCH_X86_64)
|
||||
+ assert repofiles == ['repofile1', 'repofile2']
|
||||
+
|
||||
+ # match all but not x86_64
|
||||
+ repofiles = _get_distro_repofiles('distro1', '8', ARCH_ARM64)
|
||||
+ assert repofiles == ['repofile1']
|
||||
+
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_X86_64)
|
||||
+ assert repofiles == ['repofile2']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_ARM64)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_S390X)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_PPC64LE)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+
|
||||
+ # version not mapped
|
||||
+ repofiles = _get_distro_repofiles('distro2', '8', ARCH_X86_64)
|
||||
+ assert repofiles is None
|
||||
+
|
||||
+ # distro not mapped
|
||||
+ repofiles = _get_distro_repofiles('distro42', '8', ARCH_X86_64)
|
||||
+ assert repofiles is None
|
||||
+
|
||||
+
|
||||
+def _make_repo(repoid):
|
||||
+ return RepositoryData(repoid=repoid, name='name {}'.format(repoid))
|
||||
+
|
||||
+
|
||||
+def _make_repofile(rfile, data=None):
|
||||
+ if data is None:
|
||||
+ data = [_make_repo("{}-{}".format(rfile.split("/")[-1], i)) for i in range(3)]
|
||||
+ return RepositoryFile(file=rfile, data=data)
|
||||
+
|
||||
+
|
||||
+def _make_repofiles(rfiles):
|
||||
+ return [_make_repofile(rfile) for rfile in rfiles]
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('other_rfiles', [
|
||||
+ [],
|
||||
+ [_make_repofile("foo")],
|
||||
+ _make_repofiles(["foo", "bar"]),
|
||||
+])
|
||||
+@pytest.mark.parametrize(
|
||||
+ "distro_id,skip_rhsm,distro_rfiles",
|
||||
+ [
|
||||
+ ("rhel", True, []),
|
||||
+ ("rhel", True, _make_repofiles(_RHEL_REPOFILES)),
|
||||
+ ("rhel", False, _make_repofiles(_RHEL_REPOFILES)),
|
||||
+ ("centos", True, []),
|
||||
+ ("centos", True, _make_repofiles(_CENTOS_REPOFILES)),
|
||||
+ ]
|
||||
+)
|
||||
+def test_get_distro_repoids(
|
||||
+ monkeypatch, distro_id, skip_rhsm, distro_rfiles, other_rfiles
|
||||
+):
|
||||
+ """
|
||||
+ Tests that the correct repoids are returned
|
||||
+
|
||||
+ This is a little ugly because on RHEL the get_distro_repoids function still
|
||||
+ delegates to rhsm.get_available_repo_ids and also has different behavior
|
||||
+ with skip_rhsm
|
||||
+ """
|
||||
+ current_actor = CurrentActorMocked(release_id=distro_id if distro_id else 'rhel')
|
||||
+ monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
+
|
||||
+ repofiles = other_rfiles
|
||||
+ if distro_rfiles:
|
||||
+ repofiles.extend(distro_rfiles)
|
||||
+ monkeypatch.setattr(repofileutils, 'get_parsed_repofiles', lambda x: repofiles)
|
||||
+
|
||||
+ distro_repoids = []
|
||||
+ for rfile in distro_rfiles:
|
||||
+ distro_repoids.extend([repo.repoid for repo in rfile.data] if rfile else [])
|
||||
+ distro_repoids.sort()
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'get_available_repo_ids', lambda _: distro_repoids)
|
||||
+ monkeypatch.setattr(os.path, 'exists', lambda f: f in _CENTOS_REPOFILES)
|
||||
+
|
||||
+ class MockedContext:
|
||||
+ def full_path(self, path):
|
||||
+ return path
|
||||
+
|
||||
+ repoids = get_distro_repoids(MockedContext(), distro_id, '9', 'x86_64')
|
||||
+
|
||||
+ if distro_id == 'rhel' and skip_rhsm:
|
||||
+ assert repoids == []
|
||||
+ else:
|
||||
+ assert sorted(repoids) == distro_repoids
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('other_rfiles', [
|
||||
+ [],
|
||||
+ [_make_repofile("foo")],
|
||||
+ _make_repofiles(["foo", "bar"]),
|
||||
+])
|
||||
+def test_get_distro_repoids_no_distro_repofiles(monkeypatch, other_rfiles):
|
||||
+ """
|
||||
+ Test that exception is thrown when there are no known distro provided repofiles.
|
||||
+ """
|
||||
+
|
||||
+ def mocked_get_distro_repofiles(*args):
|
||||
+ return []
|
||||
+
|
||||
+ monkeypatch.setattr(distro, '_get_distro_repofiles', mocked_get_distro_repofiles)
|
||||
+ monkeypatch.setattr(repofileutils, "get_parsed_repofiles", lambda x: other_rfiles)
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError):
|
||||
+ get_distro_repoids(None, 'somedistro', '8', 'x86_64')
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
From ae9a953dc111c0b14a8b86b3f0aee26cea1f08b4 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 1 Sep 2025 23:43:53 +0200
|
||||
Subject: [PATCH 18/55] lib/distro: Add tests for existing
|
||||
get_distribution_data() function
|
||||
|
||||
---
|
||||
.../common/libraries/tests/test_distro.py | 47 ++++++++++++++++++-
|
||||
1 file changed, 46 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
index 3a8f174f..8e866455 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+import json
|
||||
import os
|
||||
|
||||
import pytest
|
||||
@@ -5,7 +6,7 @@ import pytest
|
||||
from leapp.actors import StopActorExecutionError
|
||||
from leapp.libraries.common import distro, repofileutils, rhsm
|
||||
from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_ARM64, ARCH_PPC64LE, ARCH_S390X, ARCH_X86_64
|
||||
-from leapp.libraries.common.distro import _get_distro_repofiles, get_distro_repoids
|
||||
+from leapp.libraries.common.distro import _get_distro_repofiles, get_distribution_data, get_distro_repoids
|
||||
from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import RepositoryData, RepositoryFile
|
||||
@@ -15,6 +16,50 @@ _CENTOS_REPOFILES = [
|
||||
"/etc/yum.repos.d/centos.repo", "/etc/yum.repos.d/centos-addons.repo"
|
||||
]
|
||||
|
||||
+_CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('distro', ['rhel', 'centos'])
|
||||
+def test_get_distribution_data(monkeypatch, distro):
|
||||
+ common_path = os.path.join(_CUR_DIR, "../../files/", 'distro')
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "get_common_folder_path",
|
||||
+ lambda folder: common_path
|
||||
+ )
|
||||
+ data_path = os.path.join(common_path, distro, "gpg-signatures.json")
|
||||
+
|
||||
+ def exists_mocked(path):
|
||||
+ assert path == data_path
|
||||
+ return True
|
||||
+
|
||||
+ monkeypatch.setattr(os.path, 'exists', exists_mocked)
|
||||
+ ret = get_distribution_data(distro)
|
||||
+
|
||||
+ with open(data_path) as fp:
|
||||
+ assert ret == json.load(fp)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('distro', ['rhel', 'centos'])
|
||||
+def test_get_distribution_data_not_exists(monkeypatch, distro):
|
||||
+ common_path = os.path.join(_CUR_DIR, "../../files/", 'distro')
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "get_common_folder_path",
|
||||
+ lambda folder: common_path
|
||||
+ )
|
||||
+ data_path = os.path.join(common_path, distro, "gpg-signatures.json")
|
||||
+
|
||||
+ def exists_mocked(path):
|
||||
+ assert path == data_path
|
||||
+ return False
|
||||
+
|
||||
+ monkeypatch.setattr(os.path, 'exists', exists_mocked)
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError) as err:
|
||||
+ get_distribution_data(distro)
|
||||
+ assert 'Cannot find distribution signature configuration.' in err
|
||||
+
|
||||
|
||||
def test_get_distro_repofiles(monkeypatch):
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
152
SOURCES/0019-Disable-RHSM-tests.patch
Normal file
152
SOURCES/0019-Disable-RHSM-tests.patch
Normal file
@ -0,0 +1,152 @@
|
||||
From e749dbc430099ac0d0cb06fb9dff4ec458d359b3 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Diblik <ddiblik@redhat.com>
|
||||
Date: Fri, 10 Oct 2025 16:51:34 +0200
|
||||
Subject: [PATCH 19/55] Disable RHSM tests
|
||||
|
||||
Signed-off-by: Daniel Diblik <ddiblik@redhat.com>
|
||||
---
|
||||
.packit.yaml | 30 +++++++++++++++---------------
|
||||
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 607dff93..3d1cd7ff 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -155,7 +155,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -209,7 +209,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -232,7 +232,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -258,7 +258,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -284,7 +284,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -306,7 +306,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -332,7 +332,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -358,7 +358,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -434,7 +434,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:9to10 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -463,7 +463,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -489,7 +489,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -514,7 +514,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:9to10 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -543,7 +543,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -572,7 +572,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
--
|
||||
2.51.1
|
||||
|
||||
462
SOURCES/0020-Update-packit-config.patch
Normal file
462
SOURCES/0020-Update-packit-config.patch
Normal file
@ -0,0 +1,462 @@
|
||||
From 6a38e8a3373bdc41a04538a090531ba0ccf8fa96 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 14 Oct 2025 15:11:02 +0200
|
||||
Subject: [PATCH 20/55] Update packit config
|
||||
|
||||
Introduce refactor of labels and introduce 8.10 -> 9.6 AWS tests.
|
||||
---
|
||||
.packit.yaml | 285 ++++++++++++++++++++++++++-------------------------
|
||||
1 file changed, 143 insertions(+), 142 deletions(-)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 3d1cd7ff..720d07a7 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -104,6 +104,8 @@ jobs:
|
||||
# is the last RHEL 8 release and all new future tests will start from this
|
||||
# one release.
|
||||
|
||||
+# This job is never triggered - we define abstract anchor that are reused in jobs that 'inherit'
|
||||
+# and have actionable triggers
|
||||
- &sanity-abstract-8to9
|
||||
job: tests
|
||||
trigger: ignore
|
||||
@@ -116,6 +118,47 @@ jobs:
|
||||
epel-8-x86_64:
|
||||
distros: [RHEL-8.10.0-Nightly]
|
||||
identifier: sanity-abstract-8to9
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9'
|
||||
+ environments:
|
||||
+ - &tmt-env-settings-810to94
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to94
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.4"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to96
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to96
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.6"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to97
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to97
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.7"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to98
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to98
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.8"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
- &sanity-abstract-8to9-aws
|
||||
<<: *sanity-abstract-8to9
|
||||
@@ -147,7 +190,10 @@ jobs:
|
||||
# ######################### Individual tests ########################### #
|
||||
# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.4
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.4 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
- &sanity-810to94
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -157,15 +203,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to94
|
||||
+ env: &env-810to94
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.4"
|
||||
LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
@@ -184,18 +223,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to94
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.4"
|
||||
- LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
+ <<: *env-810to94
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to94
|
||||
@@ -212,19 +242,19 @@ jobs:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
+ context: *tmt-context-810to94
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.4"
|
||||
- LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
+ <<: *env-810to94
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.6 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.6
|
||||
- &sanity-810to96
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -234,15 +264,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to96
|
||||
+ env: &env-810to96
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.6"
|
||||
|
||||
@@ -260,17 +283,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to96
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.6"
|
||||
+ <<: *env-810to96
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to96
|
||||
@@ -285,20 +300,37 @@ jobs:
|
||||
test:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to96
|
||||
+ env:
|
||||
+ <<: *env-810to96
|
||||
+
|
||||
+- &sanity-810to96-aws
|
||||
+ <<: *sanity-abstract-8to9-aws
|
||||
+ trigger: pull_request
|
||||
+ targets:
|
||||
+ epel-8-x86_64:
|
||||
+ distros: [RHEL-8.10-rhui]
|
||||
+ identifier: sanity-8.10to9.6-aws
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:rhui-aws-tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
+ context: *tmt-context-810to96
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.6"
|
||||
+ <<: *env-810to96
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.7 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.7
|
||||
- &sanity-810to97
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -308,15 +340,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to97
|
||||
+ env: &env-810to97
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.7"
|
||||
|
||||
@@ -334,17 +359,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to97
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.7"
|
||||
+ <<: *env-810to97
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to97
|
||||
@@ -360,17 +377,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to97
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.7"
|
||||
+ <<: *env-810to97
|
||||
|
||||
# ###################################################################### #
|
||||
# ############################## 9 TO 10 ################################ #
|
||||
@@ -392,6 +401,38 @@ jobs:
|
||||
epel-9-x86_64:
|
||||
distros: [RHEL-9.6.0-Nightly]
|
||||
identifier: sanity-abstract-9to10
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:9to10'
|
||||
+ environments:
|
||||
+ - &tmt-env-settings-96to100
|
||||
+ tmt:
|
||||
+ context: &tmt-context-96to100
|
||||
+ distro: "rhel-9.6"
|
||||
+ distro_target: "rhel-10.0"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-97to101
|
||||
+ tmt:
|
||||
+ context: &tmt-context-97to101
|
||||
+ distro: "rhel-9.7"
|
||||
+ distro_target: "rhel-10.1"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-98to102
|
||||
+ tmt:
|
||||
+ context: &tmt-context-98to102
|
||||
+ distro: "rhel-9.8"
|
||||
+ distro_target: "rhel-10.2"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
- &sanity-abstract-9to10-aws
|
||||
<<: *sanity-abstract-9to10
|
||||
@@ -423,7 +464,10 @@ jobs:
|
||||
# ######################### Individual tests ########################### #
|
||||
# ###################################################################### #
|
||||
|
||||
-# Tests: 9.6 -> 10.0
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.6 > 10.0 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
- &sanity-96to100
|
||||
<<: *sanity-abstract-9to10
|
||||
trigger: pull_request
|
||||
@@ -436,15 +480,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-96to100
|
||||
+ env: &env-96to100
|
||||
SOURCE_RELEASE: "9.6"
|
||||
TARGET_RELEASE: "10.0"
|
||||
|
||||
@@ -465,17 +502,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-96to100
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.6"
|
||||
- TARGET_RELEASE: "10.0"
|
||||
+ <<: *env-96to100
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-96to100
|
||||
@@ -491,19 +520,14 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-96to100
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.6"
|
||||
- TARGET_RELEASE: "10.0"
|
||||
+ <<: *env-96to100
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.7 > 10.1 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 9.7 -> 10.1
|
||||
- &sanity-97to101
|
||||
<<: *sanity-abstract-9to10
|
||||
trigger: pull_request
|
||||
@@ -516,15 +540,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-97to101
|
||||
+ env: &env-97to101
|
||||
SOURCE_RELEASE: "9.7"
|
||||
TARGET_RELEASE: "10.1"
|
||||
|
||||
@@ -545,17 +562,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-97to101
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.7"
|
||||
- TARGET_RELEASE: "10.1"
|
||||
+ <<: *env-97to101
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-97to101
|
||||
@@ -574,14 +583,6 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-97to101
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.7"
|
||||
- TARGET_RELEASE: "10.1"
|
||||
+ <<: *env-97to101
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,880 @@
|
||||
From 06afa61c2508f18937244787440c709c5ee0a285 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 14 Oct 2025 15:56:11 +0200
|
||||
Subject: [PATCH 21/55] Update upgrade paths: 8.10 -> 9.8 -> 10.2 with
|
||||
certificates
|
||||
|
||||
Jira: RHEL-108025
|
||||
---
|
||||
.packit.yaml | 119 ++++++++++++++++++
|
||||
.../common/files/prod-certs/10.2/279.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/362.pem | 36 ++++++
|
||||
.../common/files/prod-certs/10.2/363.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/419.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/433.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/479.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/486.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/72.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/279.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/362.pem | 36 ++++++
|
||||
.../common/files/prod-certs/9.8/363.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/419.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/433.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/479.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/486.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/72.pem | 35 ++++++
|
||||
.../common/files/upgrade_paths.json | 10 +-
|
||||
18 files changed, 687 insertions(+), 4 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 720d07a7..0c3f682a 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -381,6 +381,60 @@ jobs:
|
||||
env:
|
||||
<<: *env-810to97
|
||||
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.8 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+- &sanity-810to98
|
||||
+ <<: *sanity-abstract-8to9
|
||||
+ trigger: pull_request
|
||||
+ identifier: sanity-8.10to9.8
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env: &env-810to98
|
||||
+ SOURCE_RELEASE: "8.10"
|
||||
+ TARGET_RELEASE: "9.8"
|
||||
+
|
||||
+# On-demand minimal beaker tests
|
||||
+- &beaker-minimal-810to98
|
||||
+ <<: *beaker-minimal-8to9-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - beaker-minimal
|
||||
+ - beaker-minimal-8.10to9.8
|
||||
+ - 8.10to9.8
|
||||
+ identifier: sanity-8.10to9.8-beaker-minimal-ondemand
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env:
|
||||
+ <<: *env-810to98
|
||||
+
|
||||
+# On-demand kernel-rt tests
|
||||
+- &kernel-rt-810to98
|
||||
+ <<: *kernel-rt-abstract-8to9-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - kernel-rt
|
||||
+ - kernel-rt-8.10to9.8
|
||||
+ - 8.10to9.8
|
||||
+ identifier: sanity-8.10to9.8-kernel-rt-ondemand
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env:
|
||||
+ <<: *env-810to98
|
||||
+
|
||||
# ###################################################################### #
|
||||
# ############################## 9 TO 10 ################################ #
|
||||
# ###################################################################### #
|
||||
@@ -586,3 +640,68 @@ jobs:
|
||||
- *tmt-env-settings-97to101
|
||||
env:
|
||||
<<: *env-97to101
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.8 > 10.2 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+- &sanity-98to102
|
||||
+ <<: *sanity-abstract-9to10
|
||||
+ trigger: pull_request
|
||||
+ identifier: sanity-9.8to10.2
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8.0-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env: &env-98to102
|
||||
+ SOURCE_RELEASE: "9.8"
|
||||
+ TARGET_RELEASE: "10.2"
|
||||
+
|
||||
+# On-demand minimal beaker tests
|
||||
+- &beaker-minimal-98to102
|
||||
+ <<: *beaker-minimal-9to10-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - beaker-minimal
|
||||
+ - beaker-minimal-9.8to10.2
|
||||
+ - 9.8to10.2
|
||||
+ identifier: sanity-9.8to10.2-beaker-minimal-ondemand
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env:
|
||||
+ <<: *env-98to102
|
||||
+
|
||||
+# On-demand kernel-rt tests
|
||||
+- &kernel-rt-98to102
|
||||
+ <<: *kernel-rt-abstract-9to10-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - kernel-rt
|
||||
+ - kernel-rt-9.8to10.2
|
||||
+ - 9.8to10.2
|
||||
+ identifier: sanity-9.8to10.2-kernel-rt-ondemand
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env:
|
||||
+ <<: *env-98to102
|
||||
+
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/279.pem b/repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
new file mode 100644
|
||||
index 00000000..76336f82
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKDCCBBCgAwIBAgIJALDxRLt/tVBkMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsyOWJlMDI0
|
||||
+My03NGU1LTRiNDctYjEwNy1iZjhkNjRjYmNjNDhdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsTCBrjAJBgNVHRMEAjAAMEMGDCsGAQQBkggJAYIXAQQzDDFSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuMBYGDCsG
|
||||
+AQQBkggJAYIXAgQGDAQxMC4yMBkGDCsGAQQBkggJAYIXAwQJDAdwcGM2NGxlMCkG
|
||||
+DCsGAQQBkggJAYIXBAQZDBdyaGVsLTEwLHJoZWwtMTAtcHBjNjRsZTANBgkqhkiG
|
||||
+9w0BAQsFAAOCAgEAGouNVN3DdCE2cqv3lKMNC3jit5mHi7QQt7fqN/KX4fQfArb6
|
||||
+IQ9M0GaGJM8W9rj+9s+Q9LOFjys24Pcdb9qbQWpfwvn9FY60uQw3TIXAerJaVb98
|
||||
+doxrFHjVptm0/VX2xnOa/dY97dmMT4Amwe5+y4RYlMEsYqY8dpJkVuKNdGtCg+Uf
|
||||
+f9hb6XjDqRevADgskHNprXrjF65Ib3a92qJRfttnVUfqqeDkTPntIPbau9hZwLeR
|
||||
+oMl8pn4kMIYLz1IolSAC8yBFe9sLxllGu8qIFqH4Efzx8BOtHkPUH/VqtgvUej+j
|
||||
+boJ0EEpwYjvYbz00mZmJHFNkUheW6cDUPWmMoTzYibPzRTrBcAIfvybpeuPjFGfl
|
||||
+gYZa/DpEG68hlEnSxB4TNpVCx9qfiqXvNcukmeX3Jr7DS1uC2ePBFDQKewx6WdAa
|
||||
+bAmuANmBUB+NX1WMuNTfxxIzxfIoShaChiFRVjsRTkLo1ZPuMkvXOXYfyfW1PKQN
|
||||
+PXHEdY9wprn8ZY2qhMwmE1sDdndNpSxB3boI9FQBUVDzbSG6KwbPfSdmrte+Wdrh
|
||||
+QCIGU+0x7ulF68yOkMkz1spPNgrTXt0efaCSWqUK0nqv1s1Gh2Q6iJaE0yETpSG7
|
||||
+hFeHpENftckpmuKcJM0v/uBBeIX7X8plrL7Fkm4ND/e61tEiDwvnhxGhtBE=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/362.pem b/repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
new file mode 100644
|
||||
index 00000000..ebeb065c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
@@ -0,0 +1,36 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGNzCCBB+gAwIBAgIJALDxRLt/tVBTMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFthMmU1N2Ix
|
||||
+MS03ZDBiLTRiNGYtOGE5ZC03MmRkNGM2NDA2NzJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBwDCBvTAJBgNVHRMEAjAAMEgGDCsGAQQBkggJAYJqAQQ4DDZSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuIEJldGEw
|
||||
+GwYMKwYBBAGSCAkBgmoCBAsMCTEwLjIgQmV0YTAZBgwrBgEEAZIICQGCagMECQwH
|
||||
+cHBjNjRsZTAuBgwrBgEEAZIICQGCagQEHgwccmhlbC0xMCxyaGVsLTEwLWJldGEt
|
||||
+cHBjNjRsZTANBgkqhkiG9w0BAQsFAAOCAgEAgQC6qqfeW79hSj2S+OfBT5ccNNZa
|
||||
+8blVYtVJU5iTfhX29VQTdGus/ROWGqfgDe8MMOCJyt0eNeqGO70KRJsT3pGeeKcM
|
||||
+UbDfdqzopgD7+/6IL1c1fw/8HijOorW+CMAzeOBdnjMwRjhZxcDlFSqxNCWtngnp
|
||||
+XlDMIlUR3m0rlBwzNfUMk7KYPUESmyEiBWMSKmqRDeiUg3BSP6Ci0x3Ufnf0xTBv
|
||||
+VPVKO/h3ta3+pAYzeFy/ageJ/sR9tLRZQZXzvxYvIY+8/EehafPJCHDHH3uCTpdZ
|
||||
+JAeXDLf2QcOBZnl8uONdev+KaE1JFRCRmqwhliUsARv/t24CY+UBoEzzaj/py2bR
|
||||
+RQqfE5WI1JSdj6HoQ6YHbtR6SF+UedfvMQoSF4zPiXAPNebiIiLkc1rtb/ycUi1f
|
||||
+bUjkRfgRqlDwUcgfHrKhSDp5/XhjgxVXiESNcDe2ltKvVr09qAaPBarLolWeIXkN
|
||||
+n2csdFxyiDZIhk6tFL8lUtpmXWpeEn/iBPwaiBIYoBnIbaqN4OZngwfi2QtTdl+s
|
||||
+9iCuYgbGQiEZnV3g7HLsYXrAagPuJxXs0FMYJZ8x6biREgUQATwTzZMQ8vWRMmYY
|
||||
+kteQBaOCDzNpb8OUgbPxgncl9kgr4NIBn+5oGeMitb+I1XvWqoCFsA7Uii6oygdk
|
||||
+iE+YZEA6e/4057M=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/363.pem b/repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
new file mode 100644
|
||||
index 00000000..865fbda6
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKTCCBBGgAwIBAgIJALDxRLt/tVBSMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0NjJhNDRj
|
||||
+ZC1jNWUzLTQzZGItYTExNy0zZjA5ZGU1ZDRmMzNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsjCBrzAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYJrAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NCBCZXRhMBsGDCsGAQQBkggJAYJr
|
||||
+AgQLDAkxMC4yIEJldGEwGQYMKwYBBAGSCAkBgmsDBAkMB2FhcmNoNjQwLgYMKwYB
|
||||
+BAGSCAkBgmsEBB4MHHJoZWwtMTAscmhlbC0xMC1iZXRhLWFhcmNoNjQwDQYJKoZI
|
||||
+hvcNAQELBQADggIBAC/KEEZ85rdWnL/CK9q3uT/d4reNZc1WD5oWYcpj+J31u4sw
|
||||
+pjAvmq/eA6DmzqGjhfEGhwu5MDbVg77OAPCcfm7qqGSDcnjqnO3ZogDjyzat1WS5
|
||||
+J2uuRcPbF6DIk/LkgIc/FgvSFG8Vc93hM+P56wTzTbnPYSRyJq3BBm8ZjSiFO5jq
|
||||
+V9WOganzxsVKzifTK8RoSdWLyB0JpvL/LZKa4G97ahUctYVilhJBHCgd+uT6/IVn
|
||||
+ppETnw4xo6SXg0+O+fC1P+90+GZrWWzeHeHnEgmZ8B+RTDQbx/KHQHU4UhqU5qnT
|
||||
+6VngqL1453IxmlxVxwKlkwzV4SYrQnmEZPvugMhlenbx0T9pJvwg/xvWYJJTGjUy
|
||||
+1l9p0LtyUHmFJxtbq50++oooUdDtQ6RDD5jtxnvWMF5PFLYGxf6gXFFCJVSgwonP
|
||||
+BtqoBH2PWp8/nwumAOquzks41m+bqzaMALhp0GUGTKKTITrM4gsLVHqKh2WTCOPs
|
||||
+s6mdXOyVma/o5Jri8Ec12/HGyIRlQQleb6vcC68PK3X088LZi/zENi2Bq31W5Hip
|
||||
+R03YxVzmjZA3kJsA8Vim4zaG7e6puLGuXmQLawN7oScBFlvVLvZD2ycZsYLOesCz
|
||||
+VSxJkmqDMb6To9RRbSmN0csPFKWNkdD8D5iBei4IaGWXyOB3GGJJ2ME/Qv65
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/419.pem b/repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
new file mode 100644
|
||||
index 00000000..42986ccc
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGjCCBAKgAwIBAgIJALDxRLt/tVBjMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0MjIwNzhj
|
||||
+OS1mY2MzLTQwMWQtOGM2Yi0yZGUwNWRmZGEyN2NdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBozCBoDAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYMjAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NDAWBgwrBgEEAZIICQGDIwIEBgwE
|
||||
+MTAuMjAZBgwrBgEEAZIICQGDIwMECQwHYWFyY2g2NDApBgwrBgEEAZIICQGDIwQE
|
||||
+GQwXcmhlbC0xMCxyaGVsLTEwLWFhcmNoNjQwDQYJKoZIhvcNAQELBQADggIBAAvn
|
||||
+gY6rJIku70uFkod9Xc45wNgPNMkim2p+dCOQXl5GG7rSLqBp/e6MhBOu+VfvXddF
|
||||
+zEndO84pb7Evc3PjjtnBietvvcmcoJjMTrGF2oKcJWJP+x/SKMzN2qPPoQu4QoZj
|
||||
+OTuaemuHLCkA9cnvRj2qxW9ZpINmr6H72jCHPoYGWD8Omupnctyt3/uu/MG7KT4y
|
||||
+8B5hXLmFeuF1vgOkKnoqjZRgZ86xsJ4dig/vLWkAKdsWPlRlV0SICwgVALqFmTge
|
||||
+Hgrz0A6F2BM7f0vYNFUTRv0qQwHR7EA/jEHCQByNc73cvDtHZFyODTqvEBoLFVOw
|
||||
+2fad9K5EID1GKj9U1NGYAlAvEpbrgs2Xd2ugFyN5mtbSLon+VeXm5q9fB/Ca0j7z
|
||||
+vvfdoKsd89R822m2Y+HB0eei63zGE6Ykr4aaTQNjQyTu5K8pUNG/y5UGWIpSM1IR
|
||||
+YqOsdJvCyavBlQ98K7OfL9yqOiZFXB9VkmXPPiT1ljNgpYzK63ZWidjXkpG2I7g1
|
||||
+YoCIT0JE5xX6x2U5Ia79OFug/g9SwQn6izVYrLCgqqNqeld0WokeFBPnyZkXSYt1
|
||||
+pzY4HAjXjaDGbF1O4SmoCTtagB2vNmi1wUPazizA5SESifVcYfPeaWRk10PJT9MR
|
||||
+p3EFR/BSg/hvmehuGSEfRNFV8g9Deo3EN1LHEhTY
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/433.pem b/repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
new file mode 100644
|
||||
index 00000000..932dbf7a
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGLDCCBBSgAwIBAgIJALDxRLt/tVBUMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsxNzhhMzJi
|
||||
+NC0xZWNjLTRmZDEtOTA2NS0wMGZkMjQzZDEzYzBdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBtTCBsjAJBgNVHRMEAjAAMEEGDCsGAQQBkggJAYMxAQQxDC9SZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIElCTSB6IFN5c3RlbXMgQmV0YTAbBgwrBgEE
|
||||
+AZIICQGDMQIECwwJMTAuMiBCZXRhMBcGDCsGAQQBkggJAYMxAwQHDAVzMzkweDAs
|
||||
+BgwrBgEEAZIICQGDMQQEHAwacmhlbC0xMCxyaGVsLTEwLWJldGEtczM5MHgwDQYJ
|
||||
+KoZIhvcNAQELBQADggIBAAUwQwSc0A1Q5SiC7N5xSS1ZegZQT1hER7SRDs5p6drK
|
||||
+Riayu5bER7kpQnJc/ww1/iTmHHH/H180pSP+EZEPqCLumqYmf1vW60SAR4BMklyh
|
||||
+QuYqVkJCxA7uloA59cLZcPnEu+xHLfnhSQdTIXhi1uLK960mEIiexCT8xMkQ5E5A
|
||||
+ZUajyEhdLp4ca8K+nUWzSzYQBpGYpkiQtniLZ/i4kzaYTfHpFGJNQQCrPlB2lMCa
|
||||
+vZKseaPlFzExXfq5MJ5IX1lc2RNqeaf22p49Bia6CgVLMagsFnAr909zZ9NAaZWV
|
||||
+kYqjLVMJ5EY25OJS21So0fI//lOsRVBxlfqOS7v9hYBnuLhPuiIiHEaNcQyNBI/7
|
||||
+DgT5xCmL8IDzvsBJLZ/AqolO1fo5lSVOZ5PCbwIZj7bBZJwf8gTSUu2cuhbN2Gxi
|
||||
+s7R2QFVco+AAPcuoWOISG4cKwX4wDUR+rHqQMCKJM6mQGlnB2OXBwZX1fYo7k82d
|
||||
+b7BygRhEML6INaweUe2Do7v8phz6TXM2lFJCQYnja2lO6GxSlaXgRNb4Rnc6ty79
|
||||
+O5S6K2g3uEc4Uc8F7echBFAudl9KQqu9il9cb3f0fI+kYX2j9ib4isdF8qIusZVp
|
||||
+F191fHyl1Y6pp4eWKA48uO8Op8uO320UIX8HQnNGi74eEOvCqvZtfKZE5+Za/YT+
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/479.pem b/repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
new file mode 100644
|
||||
index 00000000..2c4b8db2
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGDCCBACgAwIBAgIJALDxRLt/tVBmMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs5OTUxYjVm
|
||||
+NC0yZTE4LTQ1OGEtYTc4ZC05NGNkZDhkN2I1ZWVdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBoTCBnjAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYNfAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NDAWBgwrBgEEAZIICQGDXwIEBgwE
|
||||
+MTAuMjAYBgwrBgEEAZIICQGDXwMECAwGeDg2XzY0MCgGDCsGAQQBkggJAYNfBAQY
|
||||
+DBZyaGVsLTEwLHJoZWwtMTAteDg2XzY0MA0GCSqGSIb3DQEBCwUAA4ICAQDUoyHm
|
||||
+MM07NncLVGO9xO6qa3cxy8NyJO95LScKCAzlx3dHrgW+v1CcxZEzMsV6Rtpch0kH
|
||||
+De61DOCn50JgQ6s7e6Cxk6nMovcxYMi5q4JxYoIlCFTbeRRGdTQv8SmndmSd7rh2
|
||||
+6mDUWoDxbw1fpeNxiWAOq8IQXrcmrEnVIpOQP4Fc+yNw/Sdsqz23o9VBlP0yBJ4W
|
||||
+a6zGCwRzcisLsNOc+8mRtuirG11Zqm07V0xt2YVXlV13Wu/Dy0qKW49tPJD8WceO
|
||||
+hCC/alSRh1s4YV50gVlA0IRyyezAwU/0Al+lMKfMeqqedg81QGMBiy6qzDjXllcK
|
||||
+XfKYsWC2egkofpvxb5jVU0EXdl0kE+RGQfK3fVq09YwNim41n9qgJTlA1vIBrq8o
|
||||
+1NMwyrbQdfndyGZLSpzWxLHpYUCe2lJomgJTNvrA6+xTnlpfEPOn2zDUxJ7CSfoQ
|
||||
+ZkPhdO4UsrvJOPLt5oY5R5Q6tXLVR7xL24WeUw5FXtzFMibOaE3kT9ib0o8zluMS
|
||||
+ly290tfnl8Wq7fgjFT8mt0NIH/rXC4COBw87EjLbhxUCbEHnbJiOj+JT2QRxKjWg
|
||||
+9icCBbU5TEY0V8rC+vx54JCcx8NGaJDDKDmv6tgEOA0u9YEpGw44fk6RxqeNaysW
|
||||
+glkF2dUoSBDKWSqiroYrjEgaFWvdSaalOSJQuA==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/486.pem b/repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
new file mode 100644
|
||||
index 00000000..181b7a98
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJzCCBA+gAwIBAgIJALDxRLt/tVBVMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs2OWQ5ZGY5
|
||||
+Yy1mMGFmLTRjY2UtYTRhMi0zZDA4MDM1YjJmYjFdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsDCBrTAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYNmAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NCBCZXRhMBsGDCsGAQQBkggJAYNm
|
||||
+AgQLDAkxMC4yIEJldGEwGAYMKwYBBAGSCAkBg2YDBAgMBng4Nl82NDAtBgwrBgEE
|
||||
+AZIICQGDZgQEHQwbcmhlbC0xMCxyaGVsLTEwLWJldGEteDg2XzY0MA0GCSqGSIb3
|
||||
+DQEBCwUAA4ICAQA00Q5BALEU5y1CJwF7ru1xNujrtjZvwOdXeNl+esZIqlZQqITP
|
||||
+Rr6Xww0/mcMcvqEHu/PlJ2xyWC8VYrhZ+/LC6EtTbPEKSDEAHE914MU934pC02tP
|
||||
+QE+a7BKsHPGhh4SyvMrZ0vWoxnwcug5g8V5uXNOQYSgnOAHdNQxMeMh8LCHO76np
|
||||
+fjWL7en5dUMWHOB9W1kyZO87f2WBGhFrTyNnFTcg99G/MNMkMD5rLc+Qg8GhY1Zt
|
||||
+8+AN4c5HprFI1cUz8/4osj2ZBW1xxH+mcps2oy3L8UNFceiAdewVpTmwlBN0HEUk
|
||||
+3+NB64+QXLf13EowJnAunJrVms+bQbB1Y2zOL1ymiCLF6iQu4mIdEP2yqzk7lowa
|
||||
+RmuxEOI/S279n+YtilUuWKoeaLcGqPd0rPS5B01M049+KXW0Vv/6OOakA0rltB76
|
||||
++RBeE4UTnPCOIBfyVCHdoCTDFaI5GavVZGTr1bLQR9FdIRzQs+nx3VUYf6o2ZHOW
|
||||
+R1I794GHADaLwNfD5b5oo1XwIkuDxcvrF5kFlhnI3X9cVFDhk6uvMTzKEHPsdoYY
|
||||
+Oe2PdTNfyaiAZs5RzE7If+DAK1zCHrO3GHN4tRyQEwG5p/1F91iw2/Kj67zosH38
|
||||
+Wvm4FSL0ENRPIIUt+p0zT4FBPXOr4YwQGBn0PuaIob5mymAdbUI6Q3CHqA==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/72.pem b/repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
new file mode 100644
|
||||
index 00000000..3d15c146
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGTCCBAGgAwIBAgIJALDxRLt/tVBlMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtmM2M4ZTQ0
|
||||
+OC1lYmY4LTQxN2MtOTI5My01ZmE5NjU2YTI4YjJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBojCBnzAJBgNVHRMEAjAAMDsGCysGAQQBkggJAUgBBCwMKlJlZCBIYXQg
|
||||
+RW50ZXJwcmlzZSBMaW51eCBmb3IgSUJNIHogU3lzdGVtczAVBgsrBgEEAZIICQFI
|
||||
+AgQGDAQxMC4yMBYGCysGAQQBkggJAUgDBAcMBXMzOTB4MCYGCysGAQQBkggJAUgE
|
||||
+BBcMFXJoZWwtMTAscmhlbC0xMC1zMzkweDANBgkqhkiG9w0BAQsFAAOCAgEAMT/B
|
||||
+VjMEkJIvwAShBe9XhWj1lNvd58VQNaet8eMebCOy2CN32v50zquH9QgQH4Sf/aBm
|
||||
+X8HfQWl23zAQApCjMr2Sawmjmy05Oj7UGghkbANDvwHV2VKg1nOIoy4oaRvQj86m
|
||||
+Hn7g0t4Iz1/kTCioZkRgj1PULeDKa7u/GKiYgpc1HVjxUUwJsC2JQwjZ1CwRsNPc
|
||||
+AV6sDLveJn0doggYrxbC/+9oGYSxxUrkvaPzMmuvHa5F50NHuwgcNTL47uVkglIV
|
||||
++GBQaBaOq9c/8yWbqLVVDbXu1JD6zgzGj6BYiziJEpU7cqYfCOF9qPIYTD9AnZLx
|
||||
+43LHz33E6dRRCD9yTuMQEHE3uUoFi/G+yQvf/paSddE5FBX2d35jPSKk5um/x30g
|
||||
+EiFhQKSuHqWIz/cfucwFBQJRHIPj/yN93RqE9u+uJQrSk8KorEg3fVTumBT6bTYh
|
||||
+QprOvJBrV6UZg7oHnUC9byiyHzHRHktHv2HOPGbywbIZd0TM5R0KWaEQEVg0OAJG
|
||||
+KgwEeuiEufQZGq29EZTEtyDpDIP9wNiC4pBHe9B1UpE6EdzfoZWlJb6wbUMRtTqw
|
||||
+RS1ijNAFzvYy2Yuz0/aRi163qek95YwoXeeZn2QbDN+YgFjJZq6pHjNxYTyDthos
|
||||
+uWfveDk3xJRFp+Ja5WbgEK9FxzdFz34OZKFlre4=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/279.pem b/repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
new file mode 100644
|
||||
index 00000000..8757b9b0
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJTCCBA2gAwIBAgIJALDxRLt/tVAaMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtkZDJiN2Jk
|
||||
+OS01NmJkLTQ3YzctOWQxOS1jNWYyNmE5YWQwZTJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrjCBqzAJBgNVHRMEAjAAMEMGDCsGAQQBkggJAYIXAQQzDDFSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuMBUGDCsG
|
||||
+AQQBkggJAYIXAgQFDAM5LjgwGQYMKwYBBAGSCAkBghcDBAkMB3BwYzY0bGUwJwYM
|
||||
+KwYBBAGSCAkBghcEBBcMFXJoZWwtOSxyaGVsLTktcHBjNjRsZTANBgkqhkiG9w0B
|
||||
+AQsFAAOCAgEAEzlRfJCOY32tUEuMY4Z/cBUoJjM3/IoKY+7tA1xjzNWzL0hPWXcP
|
||||
+Ifb2iYXG7rINxRkGk56PiFYReGjxlkhkUWRiciAZc6oHfbpw3IyeWnCgSHJXQqTc
|
||||
+kUEWcUG0CJOlE9OBegvqK+PSydRx2JYhaAFza3zMvIYrdtmOvqhP3/GvuN+nnI4G
|
||||
+F7GgJkOyalbaSTOWlH2+wxuXeAnlEtUTytRFBEsBywuyi6NIpBL6Oj+QoBFQdCOE
|
||||
+Ot2Q3v0N4Q5+aiu5UsYPHs97NV8DPkuA0I2qDZr9j/PgxwftbMt14QHG+G9LW3Cz
|
||||
+DSRIXeKfXGo0GbR7E4ZZBLpp/3LMmH5w/K13skoGtnfWC5x/yoHFRPGmSb1Rrzx2
|
||||
+kre8EMrXrFFZn4hXu/huQwLTxpg8Hn5pPzDphEksTKQxLeUF0lRj5b3NtqJbQ4he
|
||||
+NDBAA9cgpifdfaFO8Ax/zppiUeoEizAyst4FFGMDC5u4EFPNQJLjh6vc/2rvP1bk
|
||||
+KwH2FRxd/jyCcu6bEF4Fv/O/dpddkYtmSPQs3DLX9g9N30uOdOp9TM3W9lt/HFQE
|
||||
+VpqG7mXTu+f4hx5LFqJXR1pSLzCjVPl03sVi05rjD0Tjkt//pRybpzf/66wMQ1wE
|
||||
+LWoT869L+7EiL5aSPE3dX7D6IsNzqHvIPKuFAO8T2ZXdiwidAlpXlyA=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/362.pem b/repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
new file mode 100644
|
||||
index 00000000..cb1b7c00
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
@@ -0,0 +1,36 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGNDCCBBygAwIBAgIJALDxRLt/tVAGMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFswMGIwYzc0
|
||||
+MS0xMDQyLTRiZGUtOTYyYy1kZjRjOGVlMmNiNjBdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBvTCBujAJBgNVHRMEAjAAMEgGDCsGAQQBkggJAYJqAQQ4DDZSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuIEJldGEw
|
||||
+GgYMKwYBBAGSCAkBgmoCBAoMCDkuOCBCZXRhMBkGDCsGAQQBkggJAYJqAwQJDAdw
|
||||
+cGM2NGxlMCwGDCsGAQQBkggJAYJqBAQcDBpyaGVsLTkscmhlbC05LWJldGEtcHBj
|
||||
+NjRsZTANBgkqhkiG9w0BAQsFAAOCAgEAvtSvgFTBFe30H/WQcgvDjJe2ucROmr6B
|
||||
+AW3OF3hvamcwciLMjzMgVyf4dwRDCsKL0q9cRmFXlMR0H36iNQnYkZU1p/sWfCIB
|
||||
+HtPDPlSr3miELB6FTvod/L4zn+CqbjgN2D3wJJKVfldbQzOTV3kEFed96yB8exTV
|
||||
+ObdCIzyadhtULog9mtUCe+8IxG8oDzpjAaaYfwkyq6tY3VzbvRS76292yFVQe6rG
|
||||
+wc9kxhwCfprnvzH7+dTlbMJlvk7PQB7xH1CvSmrIf7C5tfLf/BrsygFtqnq8KLTx
|
||||
+v644hMGkOvMBdEw5Ry3jMPAlmL+Eyc5751XkN3b5yujXA+T71t1/F0i99DM8XTO8
|
||||
+WovLAH4KjX+gvHugdsEQs0ujRpxPDgkv9/RFWs0kkBgzhUlFqOGBsi3HyGoqq770
|
||||
+/e4Fvnj/XxHzs4G3FgiyGnsKLOaKm7eFTwhePsscIckGr/6oq7U0VQF1xOc77I7n
|
||||
+uPFdSXso5TUUO2UVhqmeq71hhj000wpw4vKQ71rEfgTtMiC7Et93hpk4y4iwuk9w
|
||||
+mDGTksyr50QNgS9ZNWGLu2JejT3s9RcjROEJ6VOWJxorDWxEY/LXl683FtRXPEM2
|
||||
+UjHyhx8twhxbIlcD3a8S0R4BfcWCLvhtpdnmOtFGACYMaYd9TAdOG/AZoc/jBOpy
|
||||
+s2OKIQwKXPY=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/363.pem b/repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
new file mode 100644
|
||||
index 00000000..fa09ec7c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJjCCBA6gAwIBAgIJALDxRLt/tVAFMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0MTFmZDc4
|
||||
+NC00ZTc4LTQ5YWQtOTNiOC0zNjc2OWY0ZDFlZTVdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrzCBrDAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYJrAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NCBCZXRhMBoGDCsGAQQBkggJAYJr
|
||||
+AgQKDAg5LjggQmV0YTAZBgwrBgEEAZIICQGCawMECQwHYWFyY2g2NDAsBgwrBgEE
|
||||
+AZIICQGCawQEHAwacmhlbC05LHJoZWwtOS1iZXRhLWFhcmNoNjQwDQYJKoZIhvcN
|
||||
+AQELBQADggIBAFzGv13LCdYf3XkOt3TjwVwY2ldFVMxf2Sx/uNjLFG4I1mhYwZZ9
|
||||
+0Pyz7J771yMxyhyKb8rc8XMAYxi8lOKfOpp1PpPRVC+NtKo2pdrbZhWy2qKomfyL
|
||||
+S6jN/hEgg7P6LHGEnvT1Bm9e+BoED3gmOVAmupL4xKv2eRxgXuwuPHrvE6oo63SB
|
||||
+xtrYIo/pmYgVFgl/d7X5vXqerF4pwLR2DwtK6O84DSyVRf35ghNET09GYm6G+URQ
|
||||
+eGWi1/h0YCpS9LCXOOOv/J4MM8zr+NLbDyJWxmaG83/zvAQhX65bzJ0bBtb0avJ0
|
||||
+cgos6LBCDxt+kmipnAMqz5Cb+HVifgdBz1ep3EcoxHwmwBDpHewq0zNtPgMyjzhi
|
||||
+uwB0inlcCk7JKdjdO36H7RdUYvrM7WEDUKAXtMgOXxr3o6h9v9jZKTfbk5Af91/D
|
||||
+epoMULy0sErnEuzHAq9sdh3HTmDTHsMNcUpxwC+93VGaCGGrbyM2yQtdLg7dhHQK
|
||||
+7d9Z9BJEzKReIy+R354M1jQsLGLQ3B8uY476dmP0G0Q01m86rsJ/gjxa8vrJpafO
|
||||
+t1Up9YexwbVtEtKG7koCz4fwxPv2cauGncuUTdyHJDoS5FpPLMlaWXAfwD0Udbiv
|
||||
+gZke/PD+39I+UPrxtM+XIXGoJPeZdM5Kv0+3/suvKHGqtkFa8YiK2EHA
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/419.pem b/repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
new file mode 100644
|
||||
index 00000000..9ad33fd1
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFzCCA/+gAwIBAgIJALDxRLt/tVAZMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtiOWY4OWYx
|
||||
+OC0xNjAzLTRlZDUtYTFmOS0xN2YyMmEwNDdlODNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBoDCBnTAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYMjAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NDAVBgwrBgEEAZIICQGDIwIEBQwD
|
||||
+OS44MBkGDCsGAQQBkggJAYMjAwQJDAdhYXJjaDY0MCcGDCsGAQQBkggJAYMjBAQX
|
||||
+DBVyaGVsLTkscmhlbC05LWFhcmNoNjQwDQYJKoZIhvcNAQELBQADggIBAFu1LxAU
|
||||
+wPUs7/e6mFAzT/JIzq1fQ6kMHxbrf9nS+g9pO0G0z7Imwj85Rk7qOpJpEjKaLVDy
|
||||
+OJ9fXV20TNidKDvjZuL+F209NLam64MEpy7q40LgOaDYsr9tvGfJJFAQRKRszbrC
|
||||
+/CGj7l/q09ym1FB3LXgpn4vHR8jD7LloGFEWq19UpRLe+L+1Frh16apy03WNYTnk
|
||||
+JLALo274I3+kgO69sEemXZF+WD/O+4ySugY/ImbrIlrY1SAeAWTd/kudLMLVLYnN
|
||||
+JlmB7OPUGE2ZAR0aOTvTeoDBZPz1EGItbJg2hlx4vrhrnGG9kKu+/cDOOAJ7+bgx
|
||||
+fgc64NOoLTSc+9QIgKKhDt5jShXHfFjpwWbJ08/U29bTZmntcRO0h6F0WBS3ptgW
|
||||
+hocfN2nDN7pPvivnrUUo+kRY7jKE57im3+mznHHw97em6YCREuvc/NwLIxi4LSiU
|
||||
+cJgOQ3ltljrFSMKlv4p6evMxlX/QOwgeE+hf/QYjCODoHe/66h5bnKkLGnFdPHxk
|
||||
+6btQfVePn8UpMUO64OgIcPuGyAEXu1m9N/PFL3S5JUVmfjF9COhmZQEW1x5HBF/u
|
||||
+mAfwI79++xKH1nmVsgDUjm5HMVZ3qj0y3miAKtC3Ses9Ym6JawpvPSld3xFGF5Mc
|
||||
+BiYQsv12swSrLy3IzdvJViXRFUFE3dWuVdG1
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/433.pem b/repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
new file mode 100644
|
||||
index 00000000..eaf93d90
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKTCCBBGgAwIBAgIJALDxRLt/tVAHMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsyYjk5MzMx
|
||||
+OC0xZjFiLTRlY2UtODJiMS0wODEzYmFjOGFkNGJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsjCBrzAJBgNVHRMEAjAAMEEGDCsGAQQBkggJAYMxAQQxDC9SZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIElCTSB6IFN5c3RlbXMgQmV0YTAaBgwrBgEE
|
||||
+AZIICQGDMQIECgwIOS44IEJldGEwFwYMKwYBBAGSCAkBgzEDBAcMBXMzOTB4MCoG
|
||||
+DCsGAQQBkggJAYMxBAQaDBhyaGVsLTkscmhlbC05LWJldGEtczM5MHgwDQYJKoZI
|
||||
+hvcNAQELBQADggIBACjKAgygB5V2mVD3S5snrHjFTpP2x1ODX1GdSgwrXFZ/ehom
|
||||
+hf1SI9zIsmm+s96ns/Gc5BDrqS2TSil083OqG5YZ98ap+NkQPI/XqIhMRSw2z+QK
|
||||
+p1i7e/Si6VZyiitnutCrbX/b1RzWCSOAfIU2m41iptvT7HATw0y/6CQpQNrhZ3wR
|
||||
+TubEIEypmxO5stJt4CO/bqkU3vX+U3FdQdSJWJn3qpvErJ4qNFdwl8zX9WGoaueh
|
||||
+gNbYrz2EWARVbvedp+ylB1VNdpYXQ+LUI/KwHI4Sxizgg16+IxcFoKJVCYNOH7Wh
|
||||
+IoMZc7eW91oAzm57yS36RF/Z50S1x8JHHg2hgev+2czDG9dgRTsLvvAXqsnrUHuD
|
||||
+lRPMDjgaSooUWJmKwIXQ7yJDAPHoxZAXWtMEc1kNLZGEPVDQbT73j4eDOxzZDZrr
|
||||
+agWGoWJ3kuY9AVvv/RTi6z5VWs7ySJER7RxQcGhH8TctysW7gIMjHfgnTGN2bW5U
|
||||
+mV5Ds+/i9AiA9/V+rWWsv8riz+MfEa23/J/EvOdBBCd5MuzsqkXn2gde8WP3cjes
|
||||
+sgqUKQzOy7Rqr5LHT1IQl5SkyYr1QV1InghJ8dh7BjRLvWUaw0uqPRvxX1c6K1l/
|
||||
+NFsCie9RwuhdE8OBwHuBjB28k3Zs9SPaVzYRe70qwi0epbCrhwcGOkTNfCcz
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/479.pem b/repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
new file mode 100644
|
||||
index 00000000..a0ff7061
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFTCCA/2gAwIBAgIJALDxRLt/tVAcMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs4ZmM5YTM4
|
||||
+Ni0wYzkzLTQ0MjctYTlhOC1kMTdkMzAwZGJmZDZdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBnjCBmzAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYNfAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NDAVBgwrBgEEAZIICQGDXwIEBQwD
|
||||
+OS44MBgGDCsGAQQBkggJAYNfAwQIDAZ4ODZfNjQwJgYMKwYBBAGSCAkBg18EBBYM
|
||||
+FHJoZWwtOSxyaGVsLTkteDg2XzY0MA0GCSqGSIb3DQEBCwUAA4ICAQC6vt8EEay9
|
||||
+CjdRGHmseXosuo03ub+bUt61uYVpf15IoVUV+7XT6ZHff8cPZbKBjoRbuWNILvR2
|
||||
+rCdl11bm3prCxfLNJh5u8hqNXv+iIB4k4qhCSrhPFQEf3HNJma2J67U/8Mt7oM4B
|
||||
+RqpZ1CCw9VTHQSB+iraKzE+BFr9kNlQfZu75Clsgv5dZaT1WK5hKiuQy8kc2CBKy
|
||||
+CuiL6i0PK2tzNtNH4ON/tMU3AM+edIiUFV6C376kewwO/omArY6FYmJVcPLKWh3h
|
||||
+TSUt81CmaHmyW+XKJ2pM3f2hfHdq1Lf7lInjgw5Rolyhm/Xqrrj8j19SrUSru/tw
|
||||
+WcmLMhhEyU2/jwfipbbzB9AC3tIXZjKv8539e4omsBmHwHQno1NAjq0+alGxr9pK
|
||||
+AZywsuMhiGyznbYdIANGZyMUN3sULIsG649UcEsmzM5q9g1TVyuJH9m+OJSK2PGk
|
||||
+UnorgDlGs1AiJhsqZuW8zxzy3nfQmniO/o/6wZbqlKiyLjQY7Fxa4Rb0hXbBJkZ7
|
||||
+TkHkjlAObUEkcjg0jUHb8sFRQ7hXx+Tk4tGk549crSZCCg951SITV5By9bAxm7fu
|
||||
+DHGXgY7tOwHII51sfBfryuvIKs+JmzF9Evzssf3kLBSXylyS6pr/8dKN6sF7Pw4M
|
||||
+Fe/gvJ3J/pARSVP41wR6tI0zYvqkO/ULQg==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/486.pem b/repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
new file mode 100644
|
||||
index 00000000..84461ed8
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJDCCBAygAwIBAgIJALDxRLt/tVAIMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtkZjUwNWIw
|
||||
+ZS02Y2E4LTRkODQtOTY0Mi0wNGRlYTg5NjY0MzNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrTCBqjAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYNmAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NCBCZXRhMBoGDCsGAQQBkggJAYNm
|
||||
+AgQKDAg5LjggQmV0YTAYBgwrBgEEAZIICQGDZgMECAwGeDg2XzY0MCsGDCsGAQQB
|
||||
+kggJAYNmBAQbDBlyaGVsLTkscmhlbC05LWJldGEteDg2XzY0MA0GCSqGSIb3DQEB
|
||||
+CwUAA4ICAQCNeDKnDjuvHBE0Fa0cMAFM96OWn3b3wTtAx7i9BCaCe4NsRTjEMJTw
|
||||
+jO4KwkfzCQWpOJuFHnOKmVZBXVZZ8aOLCfYTyQZ6nZ1UsiekL7l9sdIFCHrbgKkL
|
||||
+zBFe+8cVtUMwb9f7fORPp960ImtYpvt8ERihHf2LvIBUI+BGRz/D/3NW1ehVggGI
|
||||
+0VCe270sgLSl3y8lR5BrNXtKbigeI4mNMasndf/TDMFeCk5OH4FJ+DyiY0zma2IT
|
||||
+x0PwQmEeI4my1KTmQSUDgIOmHtKbq1tCR2wMIh/ju/HOrvVeOnzEsBgQTiTh92qJ
|
||||
+U7/++7Ayqw/6PfPCd+gOMqIPS1+Aef7w54I+zWyYeHQcXXCxcffPwO7sZV3zQJyh
|
||||
+clfLJv13Oe6G5mB7ZCH+tB4LdaVBURz9G0MkLwXGfTWfnU5N61Kne8hjOriSBWP4
|
||||
+2FZEP+2BQ/1Z7aIssbQKegdRvvMd/KqJjIeiFtrz9AVSodEUZgJlxiZ9KDSysG18
|
||||
+hmZcPuk2mc9nwWQ9gHZWzatGs+uONS92QqFvXxlY7TWMDIdlscubcjV/bbDHm69P
|
||||
++pqGilb3zJz8msBwFpdO+h4l8eUMMMsLzdUdH499q/enZrH3VSdmNtWtoVm9R7rp
|
||||
+khFJ4DdORE9/P5lfqAObt8KNO72BQ2/KcK0FZ1lLxKWG/4dZ5oAdGw==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/72.pem b/repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
new file mode 100644
|
||||
index 00000000..724e0a62
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFjCCA/6gAwIBAgIJALDxRLt/tVAbMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtlYjMyYzY1
|
||||
+Ny00OGY0LTRiZjUtYmY3Yy1mYjMwNWU1YjgyMDFdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBnzCBnDAJBgNVHRMEAjAAMDsGCysGAQQBkggJAUgBBCwMKlJlZCBIYXQg
|
||||
+RW50ZXJwcmlzZSBMaW51eCBmb3IgSUJNIHogU3lzdGVtczAUBgsrBgEEAZIICQFI
|
||||
+AgQFDAM5LjgwFgYLKwYBBAGSCAkBSAMEBwwFczM5MHgwJAYLKwYBBAGSCAkBSAQE
|
||||
+FQwTcmhlbC05LHJoZWwtOS1zMzkweDANBgkqhkiG9w0BAQsFAAOCAgEADCKqieee
|
||||
+Hvj06J4U23K/Wr5zn+d6AtA2vfhpicAYh5jzYqLAJHmB9T5Ql6pFqJ9lMLI2EGSg
|
||||
+jhLD+lzDP9A2vk+rFWK0BEGnqlPrQtM5atTBeihRVRci1ymspPBrLwu+Zu3jromg
|
||||
+I14r86EZwSXpPZLaNUsOjOi4Euc50Q3wsUJGvXCpoU4SgnnAIER3lq9HSNFDZkmp
|
||||
+AjW+VHAhPIOTujm9PhCFIn5bB0jsygHHYyqV7KvQSmxoPTaLMxFpva+Xy0QNKlwg
|
||||
+NXKw/JYAHX1yaskeZviqwZzhKpnvycyEgWF9f7cBD6O8Adxx9qkqXqer7YsQ/wgR
|
||||
+cHjGCAKbV2OTIgyQEDie1gdPLdSUPzrbzJ9C1I85tSJH3ujdACiGG/aHPtspLb3Z
|
||||
+M6265fbXDbXOqjFuP/njDUqal3WgUgw34w4Xi2JLCcqLvHLQhTmZSKiD0SJbRDL1
|
||||
+smcle/yKhTc4+7zJqQV8faR9LVEAkaLzjG3ZRiTUDq4RASr9tN/A0AfXqggG9nGL
|
||||
+06m6QcXRxHM0OVgLHLksKsj3rG3VX0v3aQm353GW1sxxX0hqFnoOnGWA410GUG9S
|
||||
+rg897hshyti1pn045uhhFjbpxYRKu/JY9VNNyRW0KqL1hyz4TY7OQxJxGDAPX7uJ
|
||||
+7NGSWW9EsYMZNMxEee6br9lWVwGWnc8DWhA=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/upgrade_paths.json b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
index 22e0fd7d..61bb73c0 100644
|
||||
--- a/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
+++ b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
@@ -2,9 +2,10 @@
|
||||
"rhel": {
|
||||
"default": {
|
||||
"7.9": ["8.10"],
|
||||
- "8.10": ["9.4", "9.6", "9.7"],
|
||||
+ "8.10": ["9.4", "9.6", "9.7", "9.8"],
|
||||
"9.6": ["10.0"],
|
||||
"9.7": ["10.1"],
|
||||
+ "9.8": ["10.2"],
|
||||
"7": ["8.10"],
|
||||
"8": ["9.4", "9.6"],
|
||||
"9": ["10.0"]
|
||||
@@ -15,6 +16,7 @@
|
||||
"8.10": ["9.6", "9.4"],
|
||||
"8": ["9.6", "9.4"],
|
||||
"9.6": ["10.0"],
|
||||
+ "9.8": ["10.2"],
|
||||
"9": ["10.0"]
|
||||
}
|
||||
},
|
||||
@@ -25,13 +27,13 @@
|
||||
},
|
||||
"_virtual_versions": {
|
||||
"8": "8.10",
|
||||
- "9": "9.7",
|
||||
- "10": "10.1"
|
||||
+ "9": "9.8",
|
||||
+ "10": "10.2"
|
||||
}
|
||||
},
|
||||
"almalinux": {
|
||||
"default": {
|
||||
- "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7"],
|
||||
+ "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7","9.8"],
|
||||
"9.7": ["10.0", "10.1"]
|
||||
}
|
||||
}
|
||||
--
|
||||
2.51.1
|
||||
|
||||
48
SOURCES/0022-Add-kpatch-actor-to-el9toel10.patch
Normal file
48
SOURCES/0022-Add-kpatch-actor-to-el9toel10.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From b41d5b386f3369cf714cff9f3277863f6f601bc1 Mon Sep 17 00:00:00 2001
|
||||
From: denli <denli@redhat.com>
|
||||
Date: Mon, 6 Oct 2025 12:25:07 -0400
|
||||
Subject: [PATCH 22/55] Add kpatch actor to el9toel10
|
||||
|
||||
---
|
||||
.../actors/kernel/checkkpatch/actor.py | 29 +++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..e7f6179c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
@@ -0,0 +1,29 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import CopyFile, DistributionSignedRPM, TargetUserSpacePreupgradeTasks
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+PLUGIN_PKGNAME = "kpatch-dnf"
|
||||
+CONFIG_PATH = "/etc/dnf/plugins/kpatch.conf"
|
||||
+
|
||||
+
|
||||
+class CheckKpatch(Actor):
|
||||
+ """
|
||||
+ Carry over kpatch-dnf and it's config into the container
|
||||
+
|
||||
+ Check is kpatch-dnf plugin is installed and if it is, install it and copy
|
||||
+ over the config file so that the plugin can make a decision on whether any
|
||||
+ kpatch-patch packages need to be installed during in-place upgrade.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_kpatch'
|
||||
+ consumes = (DistributionSignedRPM,)
|
||||
+ produces = (TargetUserSpacePreupgradeTasks,)
|
||||
+ tags = (IPUWorkflowTag, ChecksPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ if has_package(DistributionSignedRPM, PLUGIN_PKGNAME):
|
||||
+ api.produce(TargetUserSpacePreupgradeTasks(
|
||||
+ install_rpms=[PLUGIN_PKGNAME],
|
||||
+ copy_files=[CopyFile(src=CONFIG_PATH)]))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
54
SOURCES/0023-move-kpatch-actor-to-common-repo.patch
Normal file
54
SOURCES/0023-move-kpatch-actor-to-common-repo.patch
Normal file
@ -0,0 +1,54 @@
|
||||
From 0cf9d8adb12b40f4cdcd423e6c55c11e0fbacff5 Mon Sep 17 00:00:00 2001
|
||||
From: denli <denli@redhat.com>
|
||||
Date: Tue, 7 Oct 2025 08:09:58 -0400
|
||||
Subject: [PATCH 23/55] move kpatch actor to common repo
|
||||
|
||||
---
|
||||
.../actors/kernel/checkkpatch/actor.py | 0
|
||||
.../actors/kernel/checkkpatch/actor.py | 29 -------------------
|
||||
2 files changed, 29 deletions(-)
|
||||
rename repos/system_upgrade/{el8toel9 => common}/actors/kernel/checkkpatch/actor.py (100%)
|
||||
delete mode 100644 repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/common/actors/kernel/checkkpatch/actor.py
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/el8toel9/actors/kernel/checkkpatch/actor.py
|
||||
rename to repos/system_upgrade/common/actors/kernel/checkkpatch/actor.py
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
deleted file mode 100644
|
||||
index e7f6179c..00000000
|
||||
--- a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
+++ /dev/null
|
||||
@@ -1,29 +0,0 @@
|
||||
-from leapp.actors import Actor
|
||||
-from leapp.libraries.common.rpms import has_package
|
||||
-from leapp.libraries.stdlib import api
|
||||
-from leapp.models import CopyFile, DistributionSignedRPM, TargetUserSpacePreupgradeTasks
|
||||
-from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
-
|
||||
-PLUGIN_PKGNAME = "kpatch-dnf"
|
||||
-CONFIG_PATH = "/etc/dnf/plugins/kpatch.conf"
|
||||
-
|
||||
-
|
||||
-class CheckKpatch(Actor):
|
||||
- """
|
||||
- Carry over kpatch-dnf and it's config into the container
|
||||
-
|
||||
- Check is kpatch-dnf plugin is installed and if it is, install it and copy
|
||||
- over the config file so that the plugin can make a decision on whether any
|
||||
- kpatch-patch packages need to be installed during in-place upgrade.
|
||||
- """
|
||||
-
|
||||
- name = 'check_kpatch'
|
||||
- consumes = (DistributionSignedRPM,)
|
||||
- produces = (TargetUserSpacePreupgradeTasks,)
|
||||
- tags = (IPUWorkflowTag, ChecksPhaseTag)
|
||||
-
|
||||
- def process(self):
|
||||
- if has_package(DistributionSignedRPM, PLUGIN_PKGNAME):
|
||||
- api.produce(TargetUserSpacePreupgradeTasks(
|
||||
- install_rpms=[PLUGIN_PKGNAME],
|
||||
- copy_files=[CopyFile(src=CONFIG_PATH)]))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
From 3128ca5df81b4c7591af189c9e2ae02f96c88fb4 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 09:00:20 +0200
|
||||
Subject: [PATCH 24/55] Makefile: Do not copy unnecessary files to test
|
||||
containers
|
||||
|
||||
In addition to tut/, docs/, packaging/, .git/ and all the __pycache__
|
||||
directories (and .pyc files) are excluded. This makes for a significant
|
||||
speedup in container setup (output with -v added to rsync) as a lot less
|
||||
needs to be copied:
|
||||
|
||||
Without this patch:
|
||||
sent 2,405,488 bytes received 19,754 bytes 194,019.36 bytes/sec
|
||||
total size is 165,333,162 speedup is 68.17
|
||||
|
||||
With this patch:
|
||||
sent 551,179 bytes received 4,067 bytes 100,953.82 bytes/sec
|
||||
total size is 23,280,513 speedup is 41.93
|
||||
|
||||
Some other small files and directories are still unnecessarily copied,
|
||||
but those don't really affect the copied size that much.
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 754c2c63..1bfbc3ac 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,7 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude "tut*" /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
python3.6) \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
From 7d9ae2c0adcef2eac7cb09fd9acf74f9a6011d64 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 09:08:02 +0200
|
||||
Subject: [PATCH 25/55] Makefile: Properly copy commands dir to test containers
|
||||
|
||||
During a containerized tests run, the commands/ directory is not used
|
||||
when running the commands tests. Instead, the commands are imported from
|
||||
tut/lib/python3.X/site-packages/leapp/cli/commands/ where python3.X is
|
||||
the python used in the tut/ virtualenv.
|
||||
|
||||
When there are changes breaking the commands tests, the test are still
|
||||
passing because the files are not being updated in the directory
|
||||
mentioned above. This can be currently fixed by rebuilding the container
|
||||
which takes a lot of time.
|
||||
|
||||
This patch adds copying of the commands/ dir to the
|
||||
tut/lib/python3.X/site-packages/leapp/cli/commands/.
|
||||
|
||||
This helped while working on #1438 because I caught the failing tests
|
||||
only after opening a the PR. The CI containerized tests are always
|
||||
created from scratch so it works there.
|
||||
---
|
||||
Makefile | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1bfbc3ac..9774a475 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,8 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' --exclude 'commands/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude '**/__pycache__/' /repo/commands/ /repocopy/tut/lib/$$_VENV/site-packages/leapp/cli/commands/ && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
python3.6) \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
From 1ba6d4301602c8a253ba92263fd829e385463182 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 15:19:03 +0200
|
||||
Subject: [PATCH 26/55] livemode: update obsoleted log msg about config
|
||||
|
||||
The original livemode configuration was located in
|
||||
/etc/leapp/files/leapp-livemode.ini
|
||||
|
||||
However, this file has been replaced by new configuration for actors,
|
||||
represented by variable filename under /etc/leapp/actor_conf.d/
|
||||
|
||||
I decided to keep the info log, but dropped the information about the
|
||||
file path.
|
||||
---
|
||||
.../livemode_config_scanner/libraries/scan_livemode_config.py | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py b/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
index 26fd9d09..7d72204c 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
@@ -5,7 +5,6 @@ from leapp.libraries.common.rpms import has_package
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import InstalledRPM, LiveModeConfig
|
||||
|
||||
-LIVEMODE_CONFIG_LOCATION = '/etc/leapp/files/devel-livemode.ini'
|
||||
DEFAULT_SQUASHFS_PATH = '/var/lib/leapp/live-upgrade.img'
|
||||
|
||||
|
||||
@@ -39,8 +38,7 @@ def scan_config_and_emit_message():
|
||||
if not should_scan_config():
|
||||
return
|
||||
|
||||
- api.current_logger().info('Loading livemode config from %s', LIVEMODE_CONFIG_LOCATION)
|
||||
-
|
||||
+ api.current_logger().info('Loading the livemode configuration.')
|
||||
config = api.current_actor().config[livemode_config_lib.LIVEMODE_CONFIG_SECTION]
|
||||
|
||||
# Mapping from model field names to configuration fields - because we might have
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,147 @@
|
||||
From 37409349656c12efd4033e0cb5a3c25d10e6630d Mon Sep 17 00:00:00 2001
|
||||
From: Mark Huth <mhuth@redhat.com>
|
||||
Date: Mon, 15 Sep 2025 16:29:02 +1000
|
||||
Subject: [PATCH 27/55] chore(RHINENG-19596): Rebrand Insights to Lightspeed
|
||||
|
||||
---
|
||||
commands/preupgrade/__init__.py | 2 +-
|
||||
commands/upgrade/__init__.py | 2 +-
|
||||
docs/source/configuring-ipu/envars.md | 2 +-
|
||||
.../common/actors/checkinsightsautoregister/actor.py | 2 +-
|
||||
.../libraries/checkinsightsautoregister.py | 5 +++--
|
||||
.../common/actors/insightsautoregister/actor.py | 2 +-
|
||||
.../insightsautoregister/libraries/insightsautoregister.py | 6 +++---
|
||||
.../insightsautoregister/tests/test_insightsautoregister.py | 2 +-
|
||||
8 files changed, 12 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/commands/preupgrade/__init__.py b/commands/preupgrade/__init__.py
|
||||
index 6443bd8a..f24e779a 100644
|
||||
--- a/commands/preupgrade/__init__.py
|
||||
+++ b/commands/preupgrade/__init__.py
|
||||
@@ -26,7 +26,7 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
help='Use only custom repositories and skip actions with Red Hat Subscription Manager.'
|
||||
' This only has effect on Red Hat Enterprise Linux systems.'
|
||||
)
|
||||
-@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Insights')
|
||||
+@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Lightspeed')
|
||||
@command_opt('no-rhsm-facts', is_flag=True, help='Do not store migration information using Red Hat '
|
||||
'Subscription Manager. Automatically implied by --no-rhsm.')
|
||||
@command_opt('enablerepo', action='append', metavar='<repoid>',
|
||||
diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py
|
||||
index 36be0719..c5900c0d 100644
|
||||
--- a/commands/upgrade/__init__.py
|
||||
+++ b/commands/upgrade/__init__.py
|
||||
@@ -32,7 +32,7 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
help='Use only custom repositories and skip actions with Red Hat Subscription Manager.'
|
||||
' This only has effect on Red Hat Enterprise Linux systems.'
|
||||
)
|
||||
-@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Insights')
|
||||
+@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Lightspeed')
|
||||
@command_opt('no-rhsm-facts', is_flag=True, help='Do not store migration information using Red Hat '
|
||||
'Subscription Manager. Automatically implied by --no-rhsm.')
|
||||
@command_opt('enablerepo', action='append', metavar='<repoid>',
|
||||
diff --git a/docs/source/configuring-ipu/envars.md b/docs/source/configuring-ipu/envars.md
|
||||
index a042ba4a..09634df2 100644
|
||||
--- a/docs/source/configuring-ipu/envars.md
|
||||
+++ b/docs/source/configuring-ipu/envars.md
|
||||
@@ -21,7 +21,7 @@ Overrides the automatically detected storage device with GRUB core (e.g. /dev/sd
|
||||
Set to 1 to disable RPM GPG checks (same as yum/dnf –nogpgckeck option). It‘s equivalent to the --nogpgcheck leapp option.
|
||||
|
||||
#### LEAPP_NO_INSIGHTS_REGISTER
|
||||
-If set to `1`, Leapp does not register the system into Red Hat Insights automatically. It‘s equivalent to the --no-insights-register leapp option.
|
||||
+If set to `1`, Leapp does not register the system into Red Hat Lightspeed automatically. It‘s equivalent to the --no-insights-register leapp option.
|
||||
|
||||
#### LEAPP_NO_NETWORK_RENAMING
|
||||
If set to `1`, the actor responsible to handle NICs names ends without doing anything. The actor usually creates UDEV rules to preserve original NICs in case they are changed. However, in some cases it‘s not wanted and it leads in malfunction network configuration (e.g. in case the bonding is configured on the system). It‘s expected that NICs have to be handled manually if needed.
|
||||
diff --git a/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py b/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
index 70b3b670..52108566 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
@@ -7,7 +7,7 @@ from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
class CheckInsightsAutoregister(Actor):
|
||||
"""
|
||||
- Checks if system can be automatically registered into Red Hat Insights
|
||||
+ Checks if system can be automatically registered into Red Hat Lightspeed
|
||||
|
||||
The registration is skipped if NO_INSIGHTS_REGISTER=1 environment variable
|
||||
is set, the --no-insights-register command line argument present. if the
|
||||
diff --git a/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py b/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
index 762f3c08..8e26485b 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
@@ -24,9 +24,9 @@ def _ensure_package(package):
|
||||
def _report_registration_info(installing_client):
|
||||
pkg_msg = " The '{}' package required for the registration will be installed during the upgrade."
|
||||
|
||||
- title = "Automatic registration into Red Hat Insights"
|
||||
+ title = "Automatic registration into Red Hat Lightspeed"
|
||||
summary = (
|
||||
- "After the upgrade, this system will be automatically registered into Red Hat Insights."
|
||||
+ "After the upgrade, this system will be automatically registered into Red Hat Lightspeed."
|
||||
"{}"
|
||||
" To skip the automatic registration, use the '--no-insights-register' command line option or"
|
||||
" set the LEAPP_NO_INSIGHTS_REGISTER environment variable."
|
||||
@@ -38,6 +38,7 @@ def _report_registration_info(installing_client):
|
||||
reporting.Summary(summary),
|
||||
reporting.Severity(reporting.Severity.INFO),
|
||||
reporting.Groups([reporting.Groups.SERVICES]),
|
||||
+ reporting.Key('693963253195f418526f045b6d630a1f4c7a193d'),
|
||||
]
|
||||
)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/actor.py b/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
index a81b434c..56615390 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
@@ -7,7 +7,7 @@ from leapp.tags import FirstBootPhaseTag, IPUWorkflowTag
|
||||
|
||||
class InsightsAutoregister(Actor):
|
||||
"""
|
||||
- Automatically registers system into Red Hat Insights
|
||||
+ Automatically registers system into Red Hat Lightspeed
|
||||
|
||||
The registration is skipped if NO_INSIGHTS_REGISTER=1 environment variable
|
||||
is set, the --no-insights-register command line argument present or the
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py b/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
index 2134a8bb..bd113a1f 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
@@ -6,18 +6,18 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
def _insights_register():
|
||||
try:
|
||||
run(['insights-client', '--register'])
|
||||
- api.current_logger().info('Automatically registered into Red Hat Insights')
|
||||
+ api.current_logger().info('Automatically registered into Red Hat Lightspeed')
|
||||
except (CalledProcessError) as err:
|
||||
# TODO(mmatuska) produce post-upgrade report?
|
||||
api.current_logger().error(
|
||||
- 'Automatic registration into Red Hat Insights failed: {}'.format(err)
|
||||
+ 'Automatic registration into Red Hat Lightspeed failed: {}'.format(err)
|
||||
)
|
||||
|
||||
|
||||
def process():
|
||||
if rhsm.skip_rhsm() or get_env('LEAPP_NO_INSIGHTS_REGISTER', '0') == '1':
|
||||
api.current_logger().debug(
|
||||
- 'Skipping registration into Insights due to --no-insights-register'
|
||||
+ 'Skipping registration into Red Hat Lightspeed due to --no-insights-register'
|
||||
' or LEAPP_NO_INSIGHTS_REGISTER=1 set'
|
||||
)
|
||||
return
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py b/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
index 0a039455..d5e6ba20 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
@@ -41,7 +41,7 @@ def test_insights_register_success_logged(monkeypatch):
|
||||
|
||||
def run_mocked(cmd, **kwargs):
|
||||
return {
|
||||
- 'stdout': 'Successfully registered into Insights',
|
||||
+ 'stdout': 'Successfully registered into Red Hat Lightspeed',
|
||||
'stderr': '',
|
||||
'exit_code': 0
|
||||
}
|
||||
--
|
||||
2.51.1
|
||||
|
||||
131
SOURCES/0028-ceph-luks-Fix-ceph-cephvolumescan-for-cephadm.patch
Normal file
131
SOURCES/0028-ceph-luks-Fix-ceph-cephvolumescan-for-cephadm.patch
Normal file
@ -0,0 +1,131 @@
|
||||
From ddefdee20a97d9b5e08502e4348d92212a702cc7 Mon Sep 17 00:00:00 2001
|
||||
From: Lukas Bezdicka <lbezdick@redhat.com>
|
||||
Date: Fri, 16 Feb 2024 14:58:02 +0100
|
||||
Subject: [PATCH 28/55] [ceph][luks] Fix ceph cephvolumescan for cephadm
|
||||
|
||||
For cephadm the containers are named ceph-<hash>-osd... while
|
||||
ceph-ansible still uses the ceph-osd-...
|
||||
|
||||
Other issue is that OSDs can have multiple volumes in them so filtering
|
||||
just for the first one is wrong and we need to check each volume for
|
||||
the encryption.
|
||||
|
||||
Resolves: rhbz#2264543
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-25838
|
||||
---
|
||||
.../libraries/cephvolumescan.py | 5 +-
|
||||
.../tests/test_cephvolumescan.py | 50 +++++++++++++++++--
|
||||
2 files changed, 50 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py b/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
index b2364104..a9bff005 100644
|
||||
--- a/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
+++ b/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
@@ -8,7 +8,7 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import InstalledRPM
|
||||
|
||||
CEPH_CONF = "/etc/ceph/ceph.conf"
|
||||
-CONTAINER = "ceph-osd"
|
||||
+CONTAINER = "ceph-.*osd"
|
||||
|
||||
|
||||
def select_osd_container(engine):
|
||||
@@ -63,7 +63,8 @@ def encrypted_osds_list():
|
||||
output = get_ceph_lvm_list()
|
||||
if output is not None:
|
||||
try:
|
||||
- result = [output[key][0]['lv_uuid'] for key in output if output[key][0]['tags']['ceph.encrypted']]
|
||||
+ for key in output:
|
||||
+ result.extend([element['lv_uuid'] for element in output[key] if element['tags']['ceph.encrypted']])
|
||||
except KeyError:
|
||||
# TODO: possibly raise a report item with a medium risk factor
|
||||
# TODO: possibly create list of problematic osds, extend the cephinfo
|
||||
diff --git a/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py b/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
index f3811c45..168b8fc2 100644
|
||||
--- a/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
+++ b/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
@@ -8,6 +8,8 @@ from leapp.reporting import Report
|
||||
CONT_PS_COMMAND_OUTPUT = {
|
||||
"stdout":
|
||||
"""CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
+ b5a3d8ef25b9 undercloud-0.ctlplane.redhat.local:8787/rh-osbs/rhceph:5 "-n osd.8 -f --set..." \
|
||||
+ 2 hours ago Up 2 hours ago ceph-bea1a933-0846-4aaa-8223-62cb8cb2873c-osd-8
|
||||
50d96fe72019 registry.redhat.io/rhceph/rhceph-4-rhel8:latest "/opt/ceph-contain..." \
|
||||
2 weeks ago Up 2 weeks ceph-osd-0
|
||||
f93c17b49c40 registry.redhat.io/rhceph/rhceph-4-rhel8:latest "/opt/ceph-contain..." \
|
||||
@@ -41,6 +43,32 @@ CEPH_VOLUME_OUTPUT = {
|
||||
"type":"block",
|
||||
"vg_name":"ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc"
|
||||
}
|
||||
+ ],
|
||||
+ "8":[
|
||||
+ {
|
||||
+ "devices": [
|
||||
+ "/dev/nvme0n1"
|
||||
+ ],
|
||||
+ "lv_name": "osd-db-b04857a0-a2a2-40c3-a490-cbe1f892a76c",
|
||||
+ "lv_uuid": "zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3",
|
||||
+ "tags":{
|
||||
+ "ceph.encrypted":"1"
|
||||
+ },
|
||||
+ "type": "db",
|
||||
+ "vg_name": "ceph-b78309b3-bd80-4399-87a3-ac647b216b63"
|
||||
+ },
|
||||
+ {
|
||||
+ "devices": [
|
||||
+ "/dev/sdb"
|
||||
+ ],
|
||||
+ "lv_name": "osd-block-477c303f-5eaf-4be8-b5cc-f6073eb345bf",
|
||||
+ "lv_uuid": "Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3",
|
||||
+ "tags":{
|
||||
+ "ceph.encrypted":"1"
|
||||
+ },
|
||||
+ "type": "block",
|
||||
+ "vg_name": "ceph-e3e0345b-8be1-40a7-955a-378ba967f954"
|
||||
+ }
|
||||
]
|
||||
}"""
|
||||
}
|
||||
@@ -51,7 +79,19 @@ CEPH_LVM_LIST = {
|
||||
'lv_uuid': 'Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn',
|
||||
'tags': {'ceph.encrypted': '1'},
|
||||
'type': 'block',
|
||||
- 'vg_name': 'ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc'}]
|
||||
+ 'vg_name': 'ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc'}],
|
||||
+ '8': [{'devices': ['/dev/nvme0n1'],
|
||||
+ 'lv_name': 'osd-db-b04857a0-a2a2-40c3-a490-cbe1f892a76c',
|
||||
+ 'lv_uuid': 'zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3',
|
||||
+ 'tags': {'ceph.encrypted': '1'},
|
||||
+ 'type': 'db',
|
||||
+ 'vg_name': 'ceph-b78309b3-bd80-4399-87a3-ac647b216b63'},
|
||||
+ {'devices': ['/dev/sdb'],
|
||||
+ 'lv_name': 'osd-block-477c303f-5eaf-4be8-b5cc-f6073eb345bf',
|
||||
+ 'lv_uuid': 'Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3',
|
||||
+ 'tags': {'ceph.encrypted': '1'},
|
||||
+ 'type': 'block',
|
||||
+ 'vg_name': 'ceph-e3e0345b-8be1-40a7-955a-378ba967f954'}]
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +100,7 @@ def test_select_osd_container(m_run):
|
||||
|
||||
m_run.return_value = CONT_PS_COMMAND_OUTPUT
|
||||
|
||||
- assert cephvolumescan.select_osd_container('docker') == "ceph-osd-0"
|
||||
+ assert cephvolumescan.select_osd_container('docker') == "ceph-bea1a933-0846-4aaa-8223-62cb8cb2873c-osd-8"
|
||||
|
||||
|
||||
@patch('leapp.libraries.actor.cephvolumescan.has_package')
|
||||
@@ -82,4 +122,8 @@ def test_encrypted_osds_list(m_get_ceph_lvm_list, m_isfile):
|
||||
m_get_ceph_lvm_list.return_value = CEPH_LVM_LIST
|
||||
m_isfile.return_value = True
|
||||
|
||||
- assert cephvolumescan.encrypted_osds_list() == ['Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn']
|
||||
+ assert cephvolumescan.encrypted_osds_list() == [
|
||||
+ 'Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn',
|
||||
+ 'zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3',
|
||||
+ 'Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3'
|
||||
+ ]
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
From bf1b5f5f537ff163470b29d8bb7ba452901368eb Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 22 Oct 2025 17:52:52 +0200
|
||||
Subject: [PATCH 29/55] Makefile: Do copy commands/ dir in containerized tests
|
||||
|
||||
In 7d9ae2c0 the commands dir copying was changed to copy the dir to
|
||||
tut/lib/$$_VENV/site-packages/leapp/cli/commands/ instead of the normal
|
||||
location in the container.
|
||||
|
||||
This fixed the problem that modifications on the host were not reflected
|
||||
in the testing containers. However a new problem was introduced -
|
||||
modifications to tests in the commands directory are not getting
|
||||
reflected in the testing containers.
|
||||
|
||||
This patch fixes that by copying the entire commands directory both to
|
||||
the normal location and the virtual env (path above).
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 9774a475..64115006 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,7 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' --exclude 'commands/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
$(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude '**/__pycache__/' /repo/commands/ /repocopy/tut/lib/$$_VENV/site-packages/leapp/cli/commands/ && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
From 87f584d8f9b957b9ae0138d6963077d87ccb2067 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 20 Oct 2025 11:40:04 +0200
|
||||
Subject: [PATCH 30/55] skip pre-generation of systemd fstab mount units during
|
||||
LiveMode upgrade
|
||||
|
||||
The new storage initialization solution interfered with LiveMode. Since
|
||||
LiveMode is a different upgrade approach, we now skip pre-generation of
|
||||
systemd fstab mount units (mount_unit_generator actor) when
|
||||
upgrading this way.
|
||||
---
|
||||
.../actors/initramfs/mount_units_generator/actor.py | 5 ++++-
|
||||
.../libraries/mount_unit_generator.py | 8 ++++++--
|
||||
2 files changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
index 5fe25515..dd667513 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -1,16 +1,19 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
|
||||
|
||||
class MountUnitGenerator(Actor):
|
||||
"""
|
||||
Sets up storage initialization using systemd's mount units in the upgrade container.
|
||||
+
|
||||
+ Note that this storage initialization is skipped when the LiveMode is enabled.
|
||||
"""
|
||||
|
||||
name = 'mount_unit_generator'
|
||||
consumes = (
|
||||
+ LiveModeConfig,
|
||||
TargetUserSpaceInfo,
|
||||
)
|
||||
produces = (
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
index e1060559..943bddd4 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -5,7 +5,7 @@ import tempfile
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
|
||||
|
||||
def run_systemd_fstab_generator(output_directory):
|
||||
@@ -295,8 +295,12 @@ def request_units_inclusion_in_initramfs(files_to_include):
|
||||
|
||||
|
||||
def setup_storage_initialization():
|
||||
- userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
+ livemode_config = next(api.consume(LiveModeConfig), None)
|
||||
+ if livemode_config and livemode_config.is_enabled:
|
||||
+ api.current_logger().debug('Pre-generation of systemd fstab mount units skipped: The LiveMode is enabled.')
|
||||
+ return
|
||||
|
||||
+ userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
with mounting.NspawnActions(base_dir=userspace_info.path) as upgrade_container_ctx:
|
||||
with tempfile.TemporaryDirectory(dir='/var/lib/leapp/', prefix='tmp_systemd_fstab_') as workspace_path:
|
||||
run_systemd_fstab_generator(workspace_path)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
From 827e28de7b707f9fc458e1f5fdad9fffd7474abe Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Tue, 12 Aug 2025 16:59:01 +0200
|
||||
Subject: [PATCH 31/55] pylint: enable consider-using-set-comprehension
|
||||
|
||||
Fixed occurrences of list comprehensions wrapped in set() by using
|
||||
set comprehensions directly, removing disables for
|
||||
consider-using-set-comprehension added for Python 2 compatibility.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../checkconsumedassets/tests/test_asset_version_checking.py | 2 +-
|
||||
.../common/actors/selinux/selinuxapplycustom/actor.py | 4 +---
|
||||
3 files changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 5d75df40..e54d9a54 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -45,7 +45,6 @@ disable=
|
||||
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
# new for python3 version of pylint
|
||||
useless-object-inheritance,
|
||||
- consider-using-set-comprehension, # pylint3 force to use comprehension in place we don't want (py2 doesnt have these options, for inline skip)
|
||||
unnecessary-pass,
|
||||
invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
||||
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
diff --git a/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py b/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
index 9c324b44..f37dcea4 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
@@ -44,4 +44,4 @@ def test_make_report_entries_with_unique_urls():
|
||||
docs_url_to_title_map = {'/path/to/asset1': ['asset1_title1', 'asset1_title2'],
|
||||
'/path/to/asset2': ['asset2_title']}
|
||||
report_urls = check_consumed_assets_lib.make_report_entries_with_unique_urls(docs_url_to_title_map)
|
||||
- assert set([ru.value['url'] for ru in report_urls]) == {'/path/to/asset1', '/path/to/asset2'}
|
||||
+ assert {ru.value['url'] for ru in report_urls} == {'/path/to/asset1', '/path/to/asset2'}
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
index 4856f36a..db8fe8ac 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
@@ -40,9 +40,7 @@ class SELinuxApplyCustom(Actor):
|
||||
return
|
||||
|
||||
# get list of policy modules after the upgrade
|
||||
- installed_modules = set(
|
||||
- [module[0] for module in selinuxapplycustom.list_selinux_modules()]
|
||||
- )
|
||||
+ installed_modules = {module[0] for module in selinuxapplycustom.list_selinux_modules()}
|
||||
|
||||
# import custom SElinux modules
|
||||
for semodules in self.consume(SELinuxModules):
|
||||
--
|
||||
2.51.1
|
||||
|
||||
165
SOURCES/0032-pylint-enable-consider-using-with.patch
Normal file
165
SOURCES/0032-pylint-enable-consider-using-with.patch
Normal file
@ -0,0 +1,165 @@
|
||||
From 006517ea2d69d3f0d9e3de2eb67bfb4d32f20551 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 10:46:10 +0200
|
||||
Subject: [PATCH 32/55] pylint: enable consider-using-with
|
||||
|
||||
Emitted when a resource-allocating assignment or call could be replaced
|
||||
by a 'with' block. Enabling this warning enforces using 'with' to ensure
|
||||
resources are properly released even if an exception occurs.
|
||||
|
||||
* ifcfgscanner: use StringIO in tests instead of mock_open for iteration support with 'with open'
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../ifcfgscanner/libraries/ifcfgscanner.py | 27 +++++++++----------
|
||||
.../tests/unit_test_ifcfgscanner.py | 8 +++---
|
||||
.../luksscanner/tests/test_luksdump_parser.py | 8 +++---
|
||||
.../scansaphana/tests/test_scansaphana.py | 6 ++---
|
||||
.../system_upgrade/common/libraries/guards.py | 2 +-
|
||||
6 files changed, 25 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index e54d9a54..fd770061 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -51,7 +51,6 @@ disable=
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
- consider-using-with, # on bunch spaces we cannot change that...
|
||||
duplicate-string-formatting-argument, # TMP: will be fixed in close future
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
use-dict-literal,
|
||||
diff --git a/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py b/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
index 683327b3..f0c8b847 100644
|
||||
--- a/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
@@ -18,23 +18,22 @@ def process_ifcfg(filename, secrets=False):
|
||||
return None
|
||||
|
||||
properties = []
|
||||
- for line in open(filename).readlines():
|
||||
- try:
|
||||
- (name, value) = line.split("#")[0].strip().split("=")
|
||||
+ with open(filename) as f:
|
||||
+ for line in f:
|
||||
+ try:
|
||||
+ (name, value) = line.split("#")[0].strip().split("=")
|
||||
+ except ValueError:
|
||||
+ # We're not interested in lines that are not
|
||||
+ # simple assignments. Play it safe.
|
||||
+ continue
|
||||
+
|
||||
if secrets:
|
||||
value = None
|
||||
- except ValueError:
|
||||
- # We're not interested in lines that are not
|
||||
- # simple assignments. Play it safe.
|
||||
- continue
|
||||
-
|
||||
- # Deal with simple quoting. We don't expand anything, nor do
|
||||
- # multiline strings or anything of that sort.
|
||||
- if value is not None and len(value) > 1 and value[0] == value[-1]:
|
||||
- if value.startswith('"') or value.startswith("'"):
|
||||
+ elif len(value) > 1 and value[0] in ('"', "'") and value[0] == value[-1]:
|
||||
+ # Deal with simple quoting. We don't expand anything, nor do
|
||||
+ # multiline strings or anything of that sort.
|
||||
value = value[1:-1]
|
||||
-
|
||||
- properties.append(IfCfgProperty(name=name, value=value))
|
||||
+ properties.append(IfCfgProperty(name=name, value=value))
|
||||
return properties
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py b/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
index d3b4846f..d996de84 100644
|
||||
--- a/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
@@ -1,5 +1,6 @@
|
||||
import errno
|
||||
import textwrap
|
||||
+from io import StringIO
|
||||
from os.path import basename
|
||||
|
||||
import mock
|
||||
@@ -63,8 +64,7 @@ def test_ifcfg1(monkeypatch):
|
||||
KEY_TYPE=key
|
||||
""")
|
||||
|
||||
- mock_config = mock.mock_open(read_data=ifcfg_file)
|
||||
- with mock.patch(_builtins_open, mock_config):
|
||||
+ with mock.patch(_builtins_open, return_value=StringIO(ifcfg_file)):
|
||||
monkeypatch.setattr(ifcfgscanner, "listdir", _listdir_ifcfg)
|
||||
monkeypatch.setattr(ifcfgscanner.path, "exists", _exists_ifcfg)
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
@@ -110,8 +110,8 @@ def test_ifcfg_key(monkeypatch):
|
||||
Report ifcfg secrets from keys- file.
|
||||
"""
|
||||
|
||||
- mock_config = mock.mock_open(read_data="KEY_PASSPHRASE1=Hell0")
|
||||
- with mock.patch(_builtins_open, mock_config):
|
||||
+ file_data = "KEY_PASSPHRASE1=Hell0"
|
||||
+ with mock.patch(_builtins_open, side_effect=lambda *a, **k: StringIO(file_data)):
|
||||
monkeypatch.setattr(ifcfgscanner, "listdir", _listdir_ifcfg)
|
||||
monkeypatch.setattr(ifcfgscanner.path, "exists", _exists_keys)
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py b/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
index 4b190149..f0482eef 100644
|
||||
--- a/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
+++ b/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
@@ -7,8 +7,8 @@ CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def test_luksdump_parser_luks1(current_actor_context):
|
||||
- f = open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks1.txt'))
|
||||
- parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
+ with open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks1.txt')) as f:
|
||||
+ parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
|
||||
assert parsed_dict["Version"] == "1"
|
||||
assert parsed_dict["Cipher name"] == "aes"
|
||||
@@ -39,8 +39,8 @@ def test_luksdump_parser_luks1(current_actor_context):
|
||||
|
||||
|
||||
def test_luksdump_parser_luks2_tokens(current_actor_context):
|
||||
- f = open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks2_tokens.txt'))
|
||||
- parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
+ with open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks2_tokens.txt')) as f:
|
||||
+ parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
|
||||
assert parsed_dict["Version"] == "2"
|
||||
assert parsed_dict["Epoch"] == "9"
|
||||
diff --git a/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py b/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
index 0b55c9fb..38a1cae7 100644
|
||||
--- a/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
+++ b/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
@@ -77,9 +77,9 @@ class SubprocessCall(object):
|
||||
assert args[0][0:3] == ['sudo', '-u', self.admusername]
|
||||
cmd = args[0][3:]
|
||||
kwargs.pop('checked', None)
|
||||
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
- p.wait()
|
||||
- return {'exit_code': p.returncode, 'stdout': p.stdout.read()}
|
||||
+ with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
|
||||
+ stdout, stderr = p.communicate()
|
||||
+ return {'exit_code': p.returncode, 'stdout': stdout.decode('utf-8'), 'stderr': stderr.decode('utf-8')}
|
||||
|
||||
|
||||
def test_scansaphana_get_instance_status(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/libraries/guards.py b/repos/system_upgrade/common/libraries/guards.py
|
||||
index c8001817..ea2bf4dd 100644
|
||||
--- a/repos/system_upgrade/common/libraries/guards.py
|
||||
+++ b/repos/system_upgrade/common/libraries/guards.py
|
||||
@@ -34,7 +34,7 @@ def guarded_execution(*guards):
|
||||
def connection_guard(url='https://example.com'):
|
||||
def closure():
|
||||
try:
|
||||
- urlopen(url)
|
||||
+ urlopen(url) # pylint: disable=consider-using-with
|
||||
return None
|
||||
except URLError as e:
|
||||
cause = '''Failed to open url '{url}' with error: {error}'''.format(url=url, error=e)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
From 21bf23c218966040d4c3104d04ce0bcc39d0fb3d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 11:36:36 +0200
|
||||
Subject: [PATCH 33/55] pylint: duplicate-string-formatting-argument
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
repos/system_upgrade/common/libraries/fetch.py | 4 ++--
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index fd770061..aaa5d99e 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -51,7 +51,6 @@ disable=
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
- duplicate-string-formatting-argument, # TMP: will be fixed in close future
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
use-dict-literal,
|
||||
redundant-u-string-prefix, # still have py2 to support
|
||||
diff --git a/repos/system_upgrade/common/libraries/fetch.py b/repos/system_upgrade/common/libraries/fetch.py
|
||||
index 82bf4ff3..baf2c4eb 100644
|
||||
--- a/repos/system_upgrade/common/libraries/fetch.py
|
||||
+++ b/repos/system_upgrade/common/libraries/fetch.py
|
||||
@@ -56,8 +56,8 @@ def _request_data(service_path, cert, proxies, timeout=REQUEST_TIMEOUT):
|
||||
timeout = (timeout[0], timeout[1] + 10)
|
||||
if attempt > MAX_ATTEMPTS:
|
||||
logger.warning(
|
||||
- 'Attempt {} of {} to get {} failed: {}.'
|
||||
- .format(MAX_ATTEMPTS, MAX_ATTEMPTS, service_path, etype_msg)
|
||||
+ 'Attempt {max} of {max} to get {service} failed: {error}.'
|
||||
+ .format(max=MAX_ATTEMPTS, service=service_path, error=etype_msg)
|
||||
)
|
||||
raise
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
25
SOURCES/0034-pylint-enable-use-dict-literal.patch
Normal file
25
SOURCES/0034-pylint-enable-use-dict-literal.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 9cd95f0fb90a60b650ddc5bd05df6807f0e80a60 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:13:24 +0200
|
||||
Subject: [PATCH 34/55] pylint: enable use-dict-literal
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index aaa5d99e..bc051513 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,7 +52,6 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- use-dict-literal,
|
||||
redundant-u-string-prefix, # still have py2 to support
|
||||
logging-format-interpolation,
|
||||
logging-not-lazy,
|
||||
--
|
||||
2.51.1
|
||||
|
||||
43
SOURCES/0035-pylint-enable-redundant-u-string-prefix.patch
Normal file
43
SOURCES/0035-pylint-enable-redundant-u-string-prefix.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From d99c059cb0eae4d720a2d48fb39acf6e93bc0b0e Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:19:58 +0200
|
||||
Subject: [PATCH 35/55] pylint: enable redundant-u-string-prefix
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../common/actors/rootscanner/tests/test_rootscanner.py | 6 +++---
|
||||
2 files changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index bc051513..7d938715 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,7 +52,6 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- redundant-u-string-prefix, # still have py2 to support
|
||||
logging-format-interpolation,
|
||||
logging-not-lazy,
|
||||
use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
diff --git a/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py b/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
index 659a3017..07ce5da8 100644
|
||||
--- a/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
@@ -9,9 +9,9 @@ from leapp.libraries.actor.rootscanner import scan_dir
|
||||
|
||||
|
||||
@pytest.mark.parametrize("filename,symlink,count_invalid",
|
||||
- [(u'a_utf_file'.encode('utf-8'), u"utf8_symlink".encode('utf-8'), 0),
|
||||
- (u'простофайл'.encode('koi8-r'), u"этонеутф8".encode('koi8-r'), 2),
|
||||
- (u'a_utf_file'.encode('utf-8'), u"этонеутф8".encode('koi8-r'), 1)])
|
||||
+ [('a_utf_file'.encode('utf-8'), "utf8_symlink".encode('utf-8'), 0),
|
||||
+ ('простофайл'.encode('koi8-r'), "этонеутф8".encode('koi8-r'), 2),
|
||||
+ ('a_utf_file'.encode('utf-8'), "этонеутф8".encode('koi8-r'), 1)])
|
||||
def test_invalid_symlinks(filename, symlink, count_invalid):
|
||||
# Let's create a directory with both valid utf-8 and non-utf symlinks
|
||||
# NOTE(ivasilev) As this has to run for python2 as well can't use the nice tempfile.TemporaryDirectory way
|
||||
--
|
||||
2.51.1
|
||||
|
||||
110
SOURCES/0036-pylint-enable-logging-not-lazy.patch
Normal file
110
SOURCES/0036-pylint-enable-logging-not-lazy.patch
Normal file
@ -0,0 +1,110 @@
|
||||
From 078ba51a5851e388abe1357a552b981cba1acca9 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:43:04 +0200
|
||||
Subject: [PATCH 36/55] pylint: enable logging-not-lazy
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../rpmtransactionconfigtaskscollector.py | 5 +++--
|
||||
.../storagescanner/libraries/storagescanner.py | 8 ++++++--
|
||||
.../common/libraries/persistentnetnames.py | 2 +-
|
||||
.../libraries/multipathconfread.py | 14 +++++++++-----
|
||||
5 files changed, 19 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 7d938715..f7f4b25d 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -53,7 +53,6 @@ disable=
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
logging-format-interpolation,
|
||||
- logging-not-lazy,
|
||||
use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
|
||||
[FORMAT]
|
||||
diff --git a/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py b/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
index 43ac1fc4..84895f83 100644
|
||||
--- a/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
+++ b/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
@@ -29,8 +29,9 @@ def load_tasks(base_dir, logger):
|
||||
filtered = set(to_install) - set(to_install_filtered)
|
||||
if filtered:
|
||||
api.current_logger().debug(
|
||||
- 'The following packages from "to_install" file will be ignored as they are already installed:'
|
||||
- '\n- ' + '\n- '.join(filtered))
|
||||
+ 'The following packages from "to_install" file will be ignored as they are already installed:\n- %s',
|
||||
+ '\n- '.join(filtered)
|
||||
+ )
|
||||
|
||||
return RpmTransactionTasks(
|
||||
to_install=to_install_filtered,
|
||||
diff --git a/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py b/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
index cae38731..e2d869da 100644
|
||||
--- a/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
@@ -35,7 +35,7 @@ def _is_file_readable(path):
|
||||
def _get_cmd_output(cmd, delim, expected_len):
|
||||
""" Verify if command exists and return output """
|
||||
if not any(os.access(os.path.join(path, cmd[0]), os.X_OK) for path in os.environ['PATH'].split(os.pathsep)):
|
||||
- api.current_logger().warning("'%s': command not found" % cmd[0])
|
||||
+ api.current_logger().warning("'%s': command not found", cmd[0])
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -45,7 +45,11 @@ def _get_cmd_output(cmd, delim, expected_len):
|
||||
output = subprocess.check_output(cmd, env={'LVM_SUPPRESS_FD_WARNINGS': '1', 'PATH': os.environ['PATH']})
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
- api.current_logger().debug("Command '%s' return non-zero exit status: %s" % (" ".join(cmd), e.returncode))
|
||||
+ api.current_logger().debug(
|
||||
+ "Command '%s' returned non-zero exit status: %s",
|
||||
+ " ".join(cmd),
|
||||
+ e.returncode
|
||||
+ )
|
||||
return
|
||||
|
||||
if bytes is not str:
|
||||
diff --git a/repos/system_upgrade/common/libraries/persistentnetnames.py b/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
index 8769712c..7fdf7eaa 100644
|
||||
--- a/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
+++ b/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
@@ -50,7 +50,7 @@ def interfaces():
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
# FIXME(msekleta): We should probably handle errors more granularly
|
||||
# Maybe we should inhibit upgrade process at this point
|
||||
- api.current_logger().warning('Failed to gather information about network interface: ' + str(e))
|
||||
+ api.current_logger().warning('Failed to gather information about network interface: %s', e)
|
||||
continue
|
||||
|
||||
yield Interface(**attrs)
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py b/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
index e5b3f06c..5b1cef50 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
@@ -68,12 +68,16 @@ def _parse_config_dir(config_dir):
|
||||
res.append(conf)
|
||||
except OSError as e:
|
||||
if e.errno == errno.ENOENT:
|
||||
- api.current_logger().debug('Multipath conf directory ' +
|
||||
- '"{}" doesn\'t exist'.format(config_dir))
|
||||
+ api.current_logger().debug(
|
||||
+ 'Multipath conf directory "%s" doesn\'t exist',
|
||||
+ config_dir
|
||||
+ )
|
||||
else:
|
||||
- api.current_logger().warning('Failed to read multipath config ' +
|
||||
- 'directory ' +
|
||||
- '"{}": {}'.format(config_dir, e))
|
||||
+ api.current_logger().warning(
|
||||
+ 'Failed to read multipath config directory "%s": %s',
|
||||
+ config_dir,
|
||||
+ e
|
||||
+ )
|
||||
return res
|
||||
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
87
SOURCES/0037-pylint-enable-use-yield-from.patch
Normal file
87
SOURCES/0037-pylint-enable-use-yield-from.patch
Normal file
@ -0,0 +1,87 @@
|
||||
From 1104e25977b728a7059fc1ef4613ef55d1e0a9d7 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:51:34 +0200
|
||||
Subject: [PATCH 37/55] pylint: enable use-yield-from
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 3 +--
|
||||
.../mount_units_generator/tests/test_mount_unit_generation.py | 3 +--
|
||||
.../actors/storagescanner/tests/unit_test_storagescanner.py | 3 +--
|
||||
.../tests/unit_test_targetuserspacecreator.py | 3 +--
|
||||
repos/system_upgrade/common/libraries/config/version.py | 3 +--
|
||||
5 files changed, 5 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index f7f4b25d..15a69461 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,8 +52,7 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- logging-format-interpolation,
|
||||
- use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
+ logging-format-interpolation
|
||||
|
||||
[FORMAT]
|
||||
# Maximum number of characters on a single line.
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index b814f6ce..9d75a31d 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -196,8 +196,7 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
('/source/dir', ['local-fs.target.requires'], ['unit1.mount', 'unit2.mount']),
|
||||
('/source/dir/local-fs.target.requires', [], ['unit1.mount', 'unit2.mount']),
|
||||
]
|
||||
- for i in tuples_to_yield:
|
||||
- yield i
|
||||
+ yield from tuples_to_yield
|
||||
|
||||
def mock_isdir(path):
|
||||
return 'local-fs.target.requires' in path
|
||||
diff --git a/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py b/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
index 456e40ec..3c7fcbd6 100644
|
||||
--- a/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
@@ -268,8 +268,7 @@ def test_get_lsblk_info(monkeypatch):
|
||||
'crypt', '', '/dev/nvme0n1p1'],
|
||||
['/dev/nvme0n1p1', '259:1', '0', str(39 * bytes_per_gb), '0', 'part', '', '/dev/nvme0n1'],
|
||||
]
|
||||
- for output_line_parts in output_lines_split_on_whitespace:
|
||||
- yield output_line_parts
|
||||
+ yield from output_lines_split_on_whitespace
|
||||
elif len(cmd) == 5 and cmd[:4] == ['lsblk', '-nr', '--output', 'NAME,KNAME,SIZE']:
|
||||
# We cannot have the output in a list, since the command is called per device. Therefore, we have to map
|
||||
# each device path to its output.
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 2ae194d7..e78c3ac7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -95,8 +95,7 @@ def traverse_structure(structure, root=Path('/')):
|
||||
filepath = root / filename
|
||||
|
||||
if isinstance(links_to, dict):
|
||||
- for pair in traverse_structure(links_to, filepath):
|
||||
- yield pair
|
||||
+ yield from traverse_structure(links_to, root=filepath)
|
||||
else:
|
||||
yield (filepath, links_to)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/version.py b/repos/system_upgrade/common/libraries/config/version.py
|
||||
index 00ce3ec8..5efa932d 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/version.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/version.py
|
||||
@@ -106,8 +106,7 @@ class _SupportedVersionsDict(dict):
|
||||
|
||||
def __iter__(self):
|
||||
self._feed_supported_versions()
|
||||
- for d in self.data:
|
||||
- yield d
|
||||
+ yield from self.data
|
||||
|
||||
def __repr__(self):
|
||||
self._feed_supported_versions()
|
||||
--
|
||||
2.51.1
|
||||
|
||||
1323
SOURCES/0038-pylint-enable-useless-object-inheritance.patch
Normal file
1323
SOURCES/0038-pylint-enable-useless-object-inheritance.patch
Normal file
File diff suppressed because it is too large
Load Diff
127
SOURCES/0039-pylint-enable-invalid-envvar-default.patch
Normal file
127
SOURCES/0039-pylint-enable-invalid-envvar-default.patch
Normal file
@ -0,0 +1,127 @@
|
||||
From e530472760f0df186531bf3d17323ee082c7fba8 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 13:12:24 +0200
|
||||
Subject: [PATCH 39/55] pylint: enable invalid-envvar-default
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../removeresumeservice/tests/test_removeresumeservice.py | 2 +-
|
||||
.../tests/test_scheduleselinuxrelabeling.py | 4 ++--
|
||||
.../tests/component_test_selinuxapplycustom.py | 2 +-
|
||||
.../tests/component_test_selinuxcontentscanner.py | 2 +-
|
||||
.../selinuxprepare/tests/component_test_selinuxprepare.py | 2 +-
|
||||
.../setpermissiveselinux/tests/test_setpermissiveselinux.py | 4 ++--
|
||||
7 files changed, 8 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index d98ab151..7a373e3d 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -45,7 +45,6 @@ disable=
|
||||
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
||||
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
diff --git a/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py b/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
index ea803856..d59ef346 100644
|
||||
--- a/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
+++ b/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
@@ -11,7 +11,7 @@ import pytest
|
||||
'under the root user.',
|
||||
)
|
||||
# TODO make the test not destructive
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_remove_resume_service(current_actor_context):
|
||||
service_name = 'leapp_resume.service'
|
||||
diff --git a/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py b/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
index 595b9985..8603bd97 100644
|
||||
--- a/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
+++ b/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
@@ -9,7 +9,7 @@ from leapp.snactor.fixture import current_actor_context
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system',
|
||||
)
|
||||
def test_schedule_no_relabel(current_actor_context):
|
||||
@@ -19,7 +19,7 @@ def test_schedule_no_relabel(current_actor_context):
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system',
|
||||
)
|
||||
def test_schedule_relabel(current_actor_context):
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
index 8a4665c1..aab18e58 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
@@ -72,7 +72,7 @@ def destructive_selinux_env():
|
||||
"Failed to remove SELinux customizations after testing")
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxApplyCustom(current_actor_context, destructive_selinux_teardown):
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
index faa2e1b0..802e038a 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
@@ -76,7 +76,7 @@ def find_semanage_rule(rules, rule):
|
||||
return next((r for r in rules if all(word in r for word in rule)), None)
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "false") in ["False", "false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxContentScanner(current_actor_context, destructive_selinux_env):
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
index bad1baa2..d124675a 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
@@ -76,7 +76,7 @@ def destructive_selinux_env():
|
||||
_run_cmd(semodule_command)
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv('DESTRUCTIVE_TESTING', False) in [False, '0'],
|
||||
+@pytest.mark.skipif(os.getenv('DESTRUCTIVE_TESTING', '0').lower() in ['false', '0'],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxPrepare(current_actor_context, semodule_lfull_initial, semanage_export_initial,
|
||||
destructive_selinux_env):
|
||||
diff --git a/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py b/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
index efa4e550..9acdf39a 100644
|
||||
--- a/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
+++ b/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
@@ -6,7 +6,7 @@ from leapp.models import SelinuxPermissiveDecision
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["0", "false"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def check_permissive_in_conf():
|
||||
""" Check if we have set permissive in SElinux conf file """
|
||||
@@ -19,7 +19,7 @@ def check_permissive_in_conf():
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "false").lower() in ["0", "false"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_set_selinux_permissive(current_actor_context):
|
||||
current_actor_context.feed(SelinuxPermissiveDecision(set_permissive=True))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
613
SOURCES/0040-pylint-enable-bad-option-value.patch
Normal file
613
SOURCES/0040-pylint-enable-bad-option-value.patch
Normal file
@ -0,0 +1,613 @@
|
||||
From 81b24a657037ceffc3959abb4231a19352ca9a82 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 14:42:15 +0200
|
||||
Subject: [PATCH 40/55] pylint: enable bad-option-value
|
||||
|
||||
This pylint warning triggers when you try to disable a pylint check that is unknown or obsolete. Enabling this rule caused such warnings to appear, so the corresponding disables needed to be removed:
|
||||
* no-absolute-import -> Only relevant for Python 2. Python 3 uses absolute imports by default.
|
||||
* no-init -> Obsolete: __init__ method checks have changed, this option no longer exists.
|
||||
* bad-continuation -> Superseded by modern pylint formatting checks.
|
||||
* no-self-use -> Checks whether a method could be a function.
|
||||
* relative-import -> Python 3 discourages relative imports differently.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 8 +----
|
||||
commands/upgrade/breadcrumbs.py | 9 +++--
|
||||
.../checkmemory/libraries/checkmemory.py | 4 +--
|
||||
.../tests/test_enablerhsmtargetrepos.py | 3 +-
|
||||
.../tests/test_mount_unit_generation.py | 3 +-
|
||||
.../libraries/upgradeinitramfsgenerator.py | 2 +-
|
||||
.../unit_test_upgradeinitramfsgenerator.py | 2 +-
|
||||
.../tests/test_kernelcmdlineconfig.py | 4 +--
|
||||
.../opensshpermitrootlogincheck/actor.py | 6 ++--
|
||||
.../actors/persistentnetnamesdisable/actor.py | 6 ++--
|
||||
.../libraries/scankernel.py | 2 +-
|
||||
.../tests/unit_test_targetuserspacecreator.py | 3 +-
|
||||
.../tests/test_trustedgpgkeys.py | 2 +-
|
||||
.../common/files/rhel_upgrade.py | 9 +++--
|
||||
.../common/libraries/dnfplugin.py | 3 +-
|
||||
repos/system_upgrade/common/libraries/grub.py | 4 +--
|
||||
.../common/libraries/mounting.py | 3 +-
|
||||
.../common/libraries/overlaygen.py | 35 ++++++++++++-------
|
||||
.../common/libraries/tests/test_distro.py | 3 +-
|
||||
.../common/libraries/tests/test_grub.py | 2 +-
|
||||
.../common/libraries/tests/test_rhsm.py | 6 ++--
|
||||
.../common/libraries/testutils.py | 2 +-
|
||||
.../checkvdo/tests/unit_test_checkvdo.py | 6 ++--
|
||||
.../actors/nisscanner/libraries/nisscan.py | 6 ++--
|
||||
.../libraries/opensslconfigcheck.py | 3 +-
|
||||
25 files changed, 81 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 7a373e3d..0cba1129 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -9,23 +9,19 @@ disable=
|
||||
raising-bad-type,
|
||||
redundant-keyword-arg, # it's one or the other, this one is not so bad at all
|
||||
# "W" Warnings for stylistic problems or minor programming issues
|
||||
- no-absolute-import,
|
||||
arguments-differ,
|
||||
cell-var-from-loop,
|
||||
fixme,
|
||||
lost-exception,
|
||||
- no-init,
|
||||
pointless-string-statement,
|
||||
protected-access,
|
||||
redefined-outer-name,
|
||||
- relative-import,
|
||||
undefined-loop-variable,
|
||||
unsubscriptable-object,
|
||||
unused-argument,
|
||||
unused-import,
|
||||
unspecified-encoding,
|
||||
# "C" Coding convention violations
|
||||
- bad-continuation,
|
||||
missing-docstring,
|
||||
wrong-import-order,
|
||||
use-maxsplit-arg,
|
||||
@@ -33,7 +29,6 @@ disable=
|
||||
consider-using-enumerate,
|
||||
# "R" Refactor recommendations
|
||||
duplicate-code,
|
||||
- no-self-use,
|
||||
too-few-public-methods,
|
||||
too-many-branches,
|
||||
too-many-locals,
|
||||
@@ -42,10 +37,9 @@ disable=
|
||||
use-list-literal,
|
||||
use-dict-literal,
|
||||
too-many-lines, # we do not want to take care about that one
|
||||
- too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
+ too-many-positional-arguments,
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
diff --git a/commands/upgrade/breadcrumbs.py b/commands/upgrade/breadcrumbs.py
|
||||
index 1a90c143..95a551c3 100644
|
||||
--- a/commands/upgrade/breadcrumbs.py
|
||||
+++ b/commands/upgrade/breadcrumbs.py
|
||||
@@ -80,7 +80,8 @@ class _BreadCrumbs:
|
||||
# even though it shouldn't though, just ignore it
|
||||
pass
|
||||
|
||||
- def _commit_rhsm_facts(self):
|
||||
+ @staticmethod
|
||||
+ def _commit_rhsm_facts():
|
||||
if runs_in_container():
|
||||
return
|
||||
cmd = ['/usr/sbin/subscription-manager', 'facts', '--update']
|
||||
@@ -122,7 +123,8 @@ class _BreadCrumbs:
|
||||
except OSError:
|
||||
sys.stderr.write('WARNING: Could not write to /etc/migration-results\n')
|
||||
|
||||
- def _get_packages(self):
|
||||
+ @staticmethod
|
||||
+ def _get_packages():
|
||||
cmd = ['/bin/bash', '-c', 'rpm -qa --queryformat="%{nevra} %{SIGPGP:pgpsig}\n" | grep -Ee "leapp|snactor"']
|
||||
res = _call(cmd, lambda x, y: None, lambda x, y: None)
|
||||
if res.get('exit_code', None) == 0:
|
||||
@@ -131,7 +133,8 @@ class _BreadCrumbs:
|
||||
for t in [line.strip().split(' ', 1) for line in res['stdout'].split('\n') if line.strip()]]
|
||||
return []
|
||||
|
||||
- def _verify_leapp_pkgs(self):
|
||||
+ @staticmethod
|
||||
+ def _verify_leapp_pkgs():
|
||||
if not os.environ.get('LEAPP_IPU_IN_PROGRESS'):
|
||||
return []
|
||||
upg_path = os.environ.get('LEAPP_IPU_IN_PROGRESS').split('to')
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
index 808c9662..040b404b 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
@@ -34,8 +34,8 @@ def process():
|
||||
if minimum_req_error:
|
||||
title = 'Minimum memory requirements for RHEL {} are not met'.format(version.get_target_major_version())
|
||||
summary = 'Memory detected: {} MiB, required: {} MiB'.format(
|
||||
- int(minimum_req_error['detected'] / 1024), # noqa: W1619; pylint: disable=old-division
|
||||
- int(minimum_req_error['minimal_req'] / 1024), # noqa: W1619; pylint: disable=old-division
|
||||
+ int(minimum_req_error['detected'] / 1024),
|
||||
+ int(minimum_req_error['minimal_req'] / 1024),
|
||||
)
|
||||
reporting.create_report([
|
||||
reporting.Title(title),
|
||||
diff --git a/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py b/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
index f7b3f34a..dba38fff 100644
|
||||
--- a/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
@@ -17,7 +17,8 @@ def not_isolated_actions(raise_err=False):
|
||||
def __init__(self, base_dir=None):
|
||||
pass
|
||||
|
||||
- def call(self, cmd, **kwargs):
|
||||
+ @staticmethod
|
||||
+ def call(cmd, **kwargs):
|
||||
commands_called.append((cmd, kwargs))
|
||||
if raise_err:
|
||||
raise_call_error()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index 9d75a31d..8849ada9 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -249,7 +249,8 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
def __init__(self):
|
||||
self.base_dir = '/container'
|
||||
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return os.path.join('/container', path.lstrip('/'))
|
||||
|
||||
mock_container = MockedContainerContext()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
index 3ad92167..f7e4a8af 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
@@ -271,7 +271,7 @@ def _get_fspace(path, convert_to_mibs=False, coefficient=1):
|
||||
coefficient = min(coefficient, 1)
|
||||
fspace_bytes = int(stat.f_frsize * stat.f_bavail * coefficient)
|
||||
if convert_to_mibs:
|
||||
- return int(fspace_bytes / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(fspace_bytes / 1024 / 1024)
|
||||
return fspace_bytes
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
index 185cd4f0..b96bf79f 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
@@ -257,7 +257,7 @@ class MockedGetFspace:
|
||||
def __call__(self, dummy_path, convert_to_mibs=False):
|
||||
if not convert_to_mibs:
|
||||
return self.space
|
||||
- return int(self.space / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(self.space / 1024 / 1024)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('input_msgs,dracut_modules,kernel_modules', [
|
||||
diff --git a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
index b7e51833..5b35bcd3 100644
|
||||
--- a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
@@ -15,7 +15,7 @@ from leapp.models import InstalledTargetKernelInfo, KernelCmdlineArg, TargetKern
|
||||
|
||||
TARGET_KERNEL_NEVRA = 'kernel-core-1.2.3-4.x86_64.el8.x64_64'
|
||||
|
||||
-# pylint: disable=E501
|
||||
+# pylint: disable=line-too-long
|
||||
SAMPLE_KERNEL_ARGS = ('ro rootflags=subvol=root'
|
||||
' resume=/dev/mapper/luks-2c0df999-81ec-4a35-a1f9-b93afee8c6ad'
|
||||
' rd.luks.uuid=luks-90a6412f-c588-46ca-9118-5aca35943d25'
|
||||
@@ -31,7 +31,7 @@ title="Fedora Linux (6.5.13-100.fc37.x86_64) 37 (Thirty Seven)"
|
||||
id="a3018267cdd8451db7c77bb3e5b1403d-6.5.13-100.fc37.x86_64"
|
||||
""" # noqa: E501
|
||||
SAMPLE_GRUBBY_INFO_OUTPUT = TEMPLATE_GRUBBY_INFO_OUTPUT.format(SAMPLE_KERNEL_ARGS, SAMPLE_KERNEL_ROOT)
|
||||
-# pylint: enable=E501
|
||||
+# pylint: enable=line-too-long
|
||||
|
||||
|
||||
class MockedRun:
|
||||
diff --git a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
index 9c1a421c..98d329ab 100644
|
||||
--- a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
@@ -55,7 +55,8 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
else:
|
||||
api.current_logger().warning('Unknown source major version: {}'.format(get_source_major_version()))
|
||||
|
||||
- def process7to8(self, config):
|
||||
+ @staticmethod
|
||||
+ def process7to8(config):
|
||||
# when the config was not modified, we can pass this check and let the
|
||||
# rpm handle the configuration file update
|
||||
if not config.modified:
|
||||
@@ -112,7 +113,8 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
] + COMMON_RESOURCES)
|
||||
|
||||
- def process8to9(self, config):
|
||||
+ @staticmethod
|
||||
+ def process8to9(config):
|
||||
# RHEL8 default sshd configuration file is not modified: It will get replaced by rpm and
|
||||
# root will no longer be able to connect through ssh. This will probably result in many
|
||||
# false positives so it will have to be waived a lot
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
index 1add3588..b0182982 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
@@ -18,7 +18,8 @@ class PersistentNetNamesDisable(Actor):
|
||||
produces = (KernelCmdlineArg, Report)
|
||||
tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
|
||||
- def ethX_count(self, interfaces):
|
||||
+ @staticmethod
|
||||
+ def ethX_count(interfaces):
|
||||
ethX = re.compile('eth[0-9]+')
|
||||
count = 0
|
||||
|
||||
@@ -27,7 +28,8 @@ class PersistentNetNamesDisable(Actor):
|
||||
count = count + 1
|
||||
return count
|
||||
|
||||
- def single_eth0(self, interfaces):
|
||||
+ @staticmethod
|
||||
+ def single_eth0(interfaces):
|
||||
return len(interfaces) == 1 and interfaces[0].name == 'eth0'
|
||||
|
||||
def disable_persistent_naming(self):
|
||||
diff --git a/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py b/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
index c1cc69ee..35683cca 100644
|
||||
--- a/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
+++ b/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
@@ -70,7 +70,7 @@ def get_boot_files_provided_by_kernel_pkg(kernel_nevra):
|
||||
|
||||
@suppress_deprecation(InstalledTargetKernelVersion)
|
||||
def process():
|
||||
- # pylint: disable=no-else-return - false positive
|
||||
+ # pylint: disable=no-else-return # false positive
|
||||
# TODO: should we take care about stuff of kernel-rt and kernel in the same
|
||||
# time when both are present? or just one? currently, handle only one
|
||||
# of these during the upgrade. kernel-rt has higher prio when original sys
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 1e5b87b0..bb17d89a 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -50,7 +50,8 @@ class MockedMountingBase:
|
||||
def __call__(self, **dummy_kwarg):
|
||||
yield self
|
||||
|
||||
- def call(self, *args, **kwargs):
|
||||
+ @staticmethod
|
||||
+ def call(*args, **kwargs):
|
||||
return {'stdout': ''}
|
||||
|
||||
def nspawn(self):
|
||||
diff --git a/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py b/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
index 7497c2a9..b8229d00 100644
|
||||
--- a/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
+++ b/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
@@ -40,7 +40,7 @@ class MockedGetGpgFromFile:
|
||||
self._data[fname] = fps
|
||||
|
||||
def get_files(self):
|
||||
- return self._data.keys() # noqa: W1655; pylint: disable=dict-keys-not-iterating
|
||||
+ return self._data.keys()
|
||||
|
||||
def __call__(self, fname):
|
||||
return self._data.get(fname, [])
|
||||
diff --git a/repos/system_upgrade/common/files/rhel_upgrade.py b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
index 4f76a61d..a5d7045b 100644
|
||||
--- a/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
+++ b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
@@ -49,7 +49,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
metavar="[%s]" % "|".join(CMDS))
|
||||
parser.add_argument('filename')
|
||||
|
||||
- def _process_entities(self, entities, op, entity_name):
|
||||
+ @staticmethod
|
||||
+ def _process_entities(entities, op, entity_name):
|
||||
"""
|
||||
Adds list of packages for given operation to the transaction
|
||||
"""
|
||||
@@ -73,7 +74,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
with open(self.opts.filename, 'w+') as fo:
|
||||
json.dump(self.plugin_data, fo, sort_keys=True, indent=2)
|
||||
|
||||
- def _read_aws_region(self, repo):
|
||||
+ @staticmethod
|
||||
+ def _read_aws_region(repo):
|
||||
region = None
|
||||
if repo.baseurl:
|
||||
# baseurl is tuple (changed by Amazon-id plugin)
|
||||
@@ -86,7 +88,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
sys.exit(1)
|
||||
return region
|
||||
|
||||
- def _fix_rhui_url(self, repo, region):
|
||||
+ @staticmethod
|
||||
+ def _fix_rhui_url(repo, region):
|
||||
if repo.baseurl:
|
||||
repo.baseurl = tuple(
|
||||
url.replace('REGION', region, 1) for url in repo.baseurl
|
||||
diff --git a/repos/system_upgrade/common/libraries/dnfplugin.py b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
index 4f0c3a99..1af52dc5 100644
|
||||
--- a/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
+++ b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
@@ -461,9 +461,10 @@ def perform_transaction_install(target_userspace_info, storage_info, used_repos,
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _prepare_perform(used_repos, target_userspace_info, xfs_info, storage_info, target_iso=None):
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
+ # noqa: W0135
|
||||
reserve_space = overlaygen.get_recommended_leapp_free_space(target_userspace_info.path)
|
||||
with _prepare_transaction(used_repos=used_repos,
|
||||
target_userspace_info=target_userspace_info
|
||||
diff --git a/repos/system_upgrade/common/libraries/grub.py b/repos/system_upgrade/common/libraries/grub.py
|
||||
index 71432371..77679d01 100644
|
||||
--- a/repos/system_upgrade/common/libraries/grub.py
|
||||
+++ b/repos/system_upgrade/common/libraries/grub.py
|
||||
@@ -34,7 +34,6 @@ class EFIBootLoaderEntry:
|
||||
"""
|
||||
Representation of an UEFI boot loader entry.
|
||||
"""
|
||||
- # pylint: disable=eq-without-hash
|
||||
|
||||
def __init__(self, boot_number, label, active, efi_bin_source):
|
||||
self.boot_number = boot_number
|
||||
@@ -163,7 +162,8 @@ class EFIBootInfo:
|
||||
# it's not expected that no entry exists
|
||||
raise StopActorExecution('UEFI: Unable to detect any UEFI bootloader entry.')
|
||||
|
||||
- def _parse_key_value(self, bootmgr_output, key):
|
||||
+ @staticmethod
|
||||
+ def _parse_key_value(bootmgr_output, key):
|
||||
# e.g.: <key>: <value>
|
||||
for line in bootmgr_output.splitlines():
|
||||
if line.startswith(key + ':'):
|
||||
diff --git a/repos/system_upgrade/common/libraries/mounting.py b/repos/system_upgrade/common/libraries/mounting.py
|
||||
index 4e99e31e..ae3885cf 100644
|
||||
--- a/repos/system_upgrade/common/libraries/mounting.py
|
||||
+++ b/repos/system_upgrade/common/libraries/mounting.py
|
||||
@@ -66,7 +66,8 @@ class IsolationType:
|
||||
""" Release the isolation context """
|
||||
pass
|
||||
|
||||
- def make_command(self, cmd):
|
||||
+ @staticmethod
|
||||
+ def make_command(cmd):
|
||||
""" Transform the given command to the isolated environment """
|
||||
return cmd
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index a048af2b..83dc33b8 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -185,7 +185,7 @@ def _get_fspace(path, convert_to_mibs=False, coefficient=1):
|
||||
coefficient = min(coefficient, 1)
|
||||
fspace_bytes = int(stat.f_frsize * stat.f_bavail * coefficient)
|
||||
if convert_to_mibs:
|
||||
- return int(fspace_bytes / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(fspace_bytes / 1024 / 1024)
|
||||
return fspace_bytes
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ def _prepare_required_mounts(scratch_dir, mounts_dir, storage_info, scratch_rese
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _build_overlay_mount(root_mount, mounts):
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
if not root_mount:
|
||||
@@ -480,8 +480,8 @@ def _create_mount_disk_image(disk_images_directory, path, disk_size):
|
||||
# NOTE(pstodulk): In case the formatting params are modified,
|
||||
# the minimal required size could be different
|
||||
api.current_logger().warning(
|
||||
- 'The apparent size for the disk image representing {path}'
|
||||
- ' is too small ({disk_size} MiBs) for a formatting. Setting 130 MiBs instead.'
|
||||
+ 'The apparent size for the disk image representing {path} '
|
||||
+ 'is too small ({disk_size} MiBs) for a formatting. Setting 130 MiBs instead.'
|
||||
.format(path=path, disk_size=disk_size)
|
||||
)
|
||||
disk_size = 130
|
||||
@@ -489,12 +489,11 @@ def _create_mount_disk_image(disk_images_directory, path, disk_size):
|
||||
cmd = [
|
||||
'/bin/dd',
|
||||
'if=/dev/zero', 'of={}'.format(diskimage_path),
|
||||
- 'bs=1M', 'count=0', 'seek={}'.format(disk_size)
|
||||
+ 'bs=1M', 'count=0', 'seek={}'.format(disk_size),
|
||||
]
|
||||
hint = (
|
||||
'Please ensure that there is enough diskspace on the partition hosting'
|
||||
- 'the {} directory.'
|
||||
- .format(disk_images_directory)
|
||||
+ 'the {} directory.'.format(disk_images_directory)
|
||||
)
|
||||
|
||||
api.current_logger().debug('Attempting to create disk image at %s', diskimage_path)
|
||||
@@ -540,7 +539,9 @@ def _create_mounts_dir(scratch_dir, mounts_dir):
|
||||
utils.makedirs(mounts_dir)
|
||||
api.current_logger().debug('Done creating mount directories.')
|
||||
except OSError:
|
||||
- api.current_logger().error('Failed to create mounting directories %s', mounts_dir, exc_info=True)
|
||||
+ api.current_logger().error(
|
||||
+ 'Failed to create mounting directories %s', mounts_dir, exc_info=True
|
||||
+ )
|
||||
|
||||
# This is an attempt for giving the user a chance to resolve it on their own
|
||||
raise StopActorExecutionError(
|
||||
@@ -556,17 +557,25 @@ def _mount_dnf_cache(overlay_target):
|
||||
"""
|
||||
Convenience context manager to ensure bind mounted /var/cache/dnf and removal of the mount.
|
||||
"""
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
with mounting.BindMount(
|
||||
- source='/var/cache/dnf',
|
||||
- target=os.path.join(overlay_target, 'var', 'cache', 'dnf')) as cache_mount:
|
||||
+ source='/var/cache/dnf',
|
||||
+ target=os.path.join(overlay_target, 'var', 'cache', 'dnf'),
|
||||
+ ) as cache_mount:
|
||||
yield cache_mount
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
-def create_source_overlay(mounts_dir, scratch_dir, xfs_info, storage_info, mount_target=None, scratch_reserve=0):
|
||||
+def create_source_overlay(
|
||||
+ mounts_dir,
|
||||
+ scratch_dir,
|
||||
+ xfs_info,
|
||||
+ storage_info,
|
||||
+ mount_target=None,
|
||||
+ scratch_reserve=0,
|
||||
+):
|
||||
"""
|
||||
Context manager that prepares the source system overlay and yields the mount.
|
||||
|
||||
@@ -610,7 +619,7 @@ def create_source_overlay(mounts_dir, scratch_dir, xfs_info, storage_info, mount
|
||||
:type scratch_reserve: Optional[int]
|
||||
:rtype: mounting.BindMount or mounting.NullMount
|
||||
"""
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
api.current_logger().debug('Creating source overlay in {scratch_dir} with mounts in {mounts_dir}'.format(
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
index 8e866455..13e782e6 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -168,7 +168,8 @@ def test_get_distro_repoids(
|
||||
monkeypatch.setattr(os.path, 'exists', lambda f: f in _CENTOS_REPOFILES)
|
||||
|
||||
class MockedContext:
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return path
|
||||
|
||||
repoids = get_distro_repoids(MockedContext(), distro_id, '9', 'x86_64')
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_grub.py b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
index d6f428bb..08dc6895 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
@@ -23,7 +23,7 @@ INVALID_DD = b'Nothing to see here!'
|
||||
|
||||
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
-# pylint: disable=E501
|
||||
+# pylint: disable=line-too-long
|
||||
# flake8: noqa: E501
|
||||
EFIBOOTMGR_OUTPUT = r"""
|
||||
BootCurrent: 0006
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_rhsm.py b/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
index 84a1bd5e..b118da29 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
@@ -73,7 +73,8 @@ class IsolatedActionsMocked:
|
||||
# A map from called commands to their mocked output
|
||||
self.mocked_command_call_outputs = dict()
|
||||
|
||||
- def is_isolated(self):
|
||||
+ @staticmethod
|
||||
+ def is_isolated():
|
||||
return True
|
||||
|
||||
def call(self, cmd, *args, **dummy_kwargs):
|
||||
@@ -93,7 +94,8 @@ class IsolatedActionsMocked:
|
||||
'exit_code': exit_code
|
||||
}
|
||||
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return path
|
||||
|
||||
def remove(self, path):
|
||||
diff --git a/repos/system_upgrade/common/libraries/testutils.py b/repos/system_upgrade/common/libraries/testutils.py
|
||||
index 328a7ede..e84cc03a 100644
|
||||
--- a/repos/system_upgrade/common/libraries/testutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/testutils.py
|
||||
@@ -120,7 +120,7 @@ class CurrentActorMocked: # pylint:disable=R0904
|
||||
return os.path.join(self._common_tools_folder, name)
|
||||
|
||||
def consume(self, model):
|
||||
- return iter(filter( # pylint:disable=W0110,W1639
|
||||
+ return iter(filter(
|
||||
lambda msg: isinstance(msg, model), self._msgs
|
||||
))
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py b/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
index 865e036f..d7cfb4fb 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
@@ -15,13 +15,15 @@ from leapp.utils.report import is_inhibitor
|
||||
|
||||
# Mock actor base for CheckVdo tests.
|
||||
class MockedActorCheckVdo(CurrentActorMocked):
|
||||
- def get_vdo_answer(self):
|
||||
+ @staticmethod
|
||||
+ def get_vdo_answer():
|
||||
return False
|
||||
|
||||
|
||||
# Mock actor for all_vdo_converted dialog response.
|
||||
class MockedActorAllVdoConvertedTrue(MockedActorCheckVdo):
|
||||
- def get_vdo_answer(self):
|
||||
+ @staticmethod
|
||||
+ def get_vdo_answer():
|
||||
return True
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py b/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
index 9910f748..ae51c69d 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
@@ -14,7 +14,8 @@ class NISScanLibrary:
|
||||
Helper library for NISScan actor.
|
||||
"""
|
||||
|
||||
- def client_has_non_default_configuration(self):
|
||||
+ @staticmethod
|
||||
+ def client_has_non_default_configuration():
|
||||
"""
|
||||
Check for any significant ypbind configuration lines in .conf file.
|
||||
"""
|
||||
@@ -31,7 +32,8 @@ class NISScanLibrary:
|
||||
return True
|
||||
return False
|
||||
|
||||
- def server_has_non_default_configuration(self):
|
||||
+ @staticmethod
|
||||
+ def server_has_non_default_configuration():
|
||||
"""
|
||||
Check for any additional (not default) files in ypserv DIR.
|
||||
"""
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
index f36a62e1..07c1b22f 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
@@ -115,7 +115,8 @@ def _openssl_reachable_key(config, key, value=None):
|
||||
return False
|
||||
|
||||
|
||||
-# pylint: disable=too-many-return-statements -- could not simplify more
|
||||
+# pylint: disable=too-many-return-statements
|
||||
+# could not simplify more
|
||||
def _openssl_reachable_path(config, path, value=None):
|
||||
"""
|
||||
Check if the given path is reachable in OpenSSL configuration
|
||||
--
|
||||
2.51.1
|
||||
|
||||
182
SOURCES/0041-pylint-enable-super-with-arguments.patch
Normal file
182
SOURCES/0041-pylint-enable-super-with-arguments.patch
Normal file
@ -0,0 +1,182 @@
|
||||
From 2abc41bb019a0ebef73e48f2a50990d8e5038e51 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 15:16:36 +0200
|
||||
Subject: [PATCH 41/55] pylint: enable super-with-arguments
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../unit_test_applytransactionworkarounds.py | 2 +-
|
||||
.../common/files/rhel_upgrade.py | 4 +--
|
||||
.../common/libraries/mounting.py | 28 +++++++++++--------
|
||||
.../common/libraries/repofileutils.py | 2 +-
|
||||
5 files changed, 20 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 0cba1129..4cfc49e0 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -40,7 +40,6 @@ disable=
|
||||
too-many-positional-arguments,
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
diff --git a/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py b/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
index 369514fc..96b8094f 100644
|
||||
--- a/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
+++ b/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
@@ -7,7 +7,7 @@ from leapp.models import DNFWorkaround
|
||||
|
||||
class ShowMessageCurrentActorMocked(CurrentActorMocked):
|
||||
def __init__(self, *args, **kwargs):
|
||||
- super(ShowMessageCurrentActorMocked, self).__init__(*args, **kwargs)
|
||||
+ super().__init__(*args, **kwargs)
|
||||
self._show_messages = []
|
||||
|
||||
@property
|
||||
diff --git a/repos/system_upgrade/common/files/rhel_upgrade.py b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
index a5d7045b..63910fe0 100644
|
||||
--- a/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
+++ b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
@@ -40,7 +40,7 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
summary = 'Plugin for upgrading to the next RHEL major release'
|
||||
|
||||
def __init__(self, cli):
|
||||
- super(RhelUpgradeCommand, self).__init__(cli)
|
||||
+ super().__init__(cli)
|
||||
self.plugin_data = {}
|
||||
|
||||
@staticmethod
|
||||
@@ -225,6 +225,6 @@ class RhelUpgradePlugin(dnf.Plugin):
|
||||
name = 'rhel-upgrade'
|
||||
|
||||
def __init__(self, base, cli):
|
||||
- super(RhelUpgradePlugin, self).__init__(base, cli)
|
||||
+ super().__init__(base, cli)
|
||||
if cli:
|
||||
cli.register_command(RhelUpgradeCommand)
|
||||
diff --git a/repos/system_upgrade/common/libraries/mounting.py b/repos/system_upgrade/common/libraries/mounting.py
|
||||
index ae3885cf..279d31dc 100644
|
||||
--- a/repos/system_upgrade/common/libraries/mounting.py
|
||||
+++ b/repos/system_upgrade/common/libraries/mounting.py
|
||||
@@ -46,7 +46,7 @@ class MountError(Exception):
|
||||
""" Exception that is thrown when a mount related operation failed """
|
||||
|
||||
def __init__(self, message, details):
|
||||
- super(MountError, self).__init__(message)
|
||||
+ super().__init__(message)
|
||||
self.details = details
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class IsolationType:
|
||||
""" systemd-nspawn implementation """
|
||||
|
||||
def __init__(self, target, binds=(), env_vars=None):
|
||||
- super(IsolationType.NSPAWN, self).__init__(target=target)
|
||||
+ super().__init__(target=target)
|
||||
self.binds = list(binds) + ALWAYS_BIND
|
||||
self.env_vars = env_vars or get_all_envs()
|
||||
|
||||
@@ -98,7 +98,7 @@ class IsolationType:
|
||||
""" chroot implementation """
|
||||
|
||||
def __init__(self, target):
|
||||
- super(IsolationType.CHROOT, self).__init__(target)
|
||||
+ super().__init__(target)
|
||||
self.context = None
|
||||
|
||||
def create(self):
|
||||
@@ -262,14 +262,14 @@ class ChrootActions(IsolatedActions):
|
||||
""" Isolation with chroot """
|
||||
|
||||
def __init__(self, base_dir):
|
||||
- super(ChrootActions, self).__init__(base_dir=base_dir, implementation=IsolationType.CHROOT)
|
||||
+ super().__init__(base_dir=base_dir, implementation=IsolationType.CHROOT)
|
||||
|
||||
|
||||
class NspawnActions(IsolatedActions):
|
||||
""" Isolation with systemd-nspawn """
|
||||
|
||||
def __init__(self, base_dir, binds=(), env_vars=None):
|
||||
- super(NspawnActions, self).__init__(
|
||||
+ super().__init__(
|
||||
base_dir=base_dir, implementation=IsolationType.NSPAWN, binds=binds, env_vars=env_vars)
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ class NotIsolatedActions(IsolatedActions):
|
||||
_isolated = False
|
||||
|
||||
def __init__(self, base_dir):
|
||||
- super(NotIsolatedActions, self).__init__(base_dir=base_dir, implementation=IsolationType.NONE)
|
||||
+ super().__init__(base_dir=base_dir, implementation=IsolationType.NONE)
|
||||
|
||||
|
||||
class MountConfig:
|
||||
@@ -375,7 +375,7 @@ class NullMount(MountingBase):
|
||||
""" This is basically a NoOp for compatibility with other mount operations, in case a mount is optional """
|
||||
|
||||
def __init__(self, target, config=MountConfig.AttachOnly):
|
||||
- super(NullMount, self).__init__(source=target, target=target, mode=MountingMode.NONE, config=config)
|
||||
+ super().__init__(source=target, target=target, mode=MountingMode.NONE, config=config)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
@@ -388,21 +388,21 @@ class LoopMount(MountingBase):
|
||||
""" Performs loop mounts """
|
||||
|
||||
def __init__(self, source, target, config=MountConfig.Mount):
|
||||
- super(LoopMount, self).__init__(source=source, target=target, mode=MountingMode.LOOP, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.LOOP, config=config)
|
||||
|
||||
|
||||
class BindMount(MountingBase):
|
||||
""" Performs bind mounts """
|
||||
|
||||
def __init__(self, source, target, config=MountConfig.Mount):
|
||||
- super(BindMount, self).__init__(source=source, target=target, mode=MountingMode.BIND, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.BIND, config=config)
|
||||
|
||||
|
||||
class TypedMount(MountingBase):
|
||||
""" Performs a typed mounts """
|
||||
|
||||
def __init__(self, fstype, source, target, config=MountConfig.Mount):
|
||||
- super(TypedMount, self).__init__(source=source, target=target, mode=MountingMode.FSTYPE, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.FSTYPE, config=config)
|
||||
self.fstype = fstype
|
||||
|
||||
def _mount_options(self):
|
||||
@@ -416,8 +416,12 @@ class OverlayMount(MountingBase):
|
||||
""" Performs an overlayfs mount """
|
||||
|
||||
def __init__(self, name, source, workdir, config=MountConfig.Mount):
|
||||
- super(OverlayMount, self).__init__(source=source, target=os.path.join(workdir, name),
|
||||
- mode=MountingMode.OVERLAY, config=config)
|
||||
+ super().__init__(
|
||||
+ source=source,
|
||||
+ target=os.path.join(workdir, name),
|
||||
+ mode=MountingMode.OVERLAY,
|
||||
+ config=config
|
||||
+ )
|
||||
self._upper_dir = os.path.join(workdir, 'upper')
|
||||
self._work_dir = os.path.join(workdir, 'work')
|
||||
self.additional_directories = (self._upper_dir, self._work_dir)
|
||||
diff --git a/repos/system_upgrade/common/libraries/repofileutils.py b/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
index cab3c42b..376473a4 100644
|
||||
--- a/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
@@ -16,7 +16,7 @@ class InvalidRepoDefinition(Exception):
|
||||
def __init__(self, msg, repofile, repoid):
|
||||
message = 'Invalid repository definition: {repoid} in: {repofile}: {msg}'.format(
|
||||
repoid=repoid, repofile=repofile, msg=msg)
|
||||
- super(InvalidRepoDefinition, self).__init__(message)
|
||||
+ super().__init__(message)
|
||||
self.repofile = repofile
|
||||
self.repoid = repoid
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
203
SOURCES/0042-pylint-enable-use-a-generator.patch
Normal file
203
SOURCES/0042-pylint-enable-use-a-generator.patch
Normal file
@ -0,0 +1,203 @@
|
||||
From 215f307eeb1362e420ac08f528f9f11d6c1c974d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 8 Sep 2025 08:10:13 +0200
|
||||
Subject: [PATCH 42/55] pylint: enable use-a-generator
|
||||
|
||||
Comprehensions inside functions like any(), all(), max(), min(), or sum()
|
||||
are unnecessary. Enabling this warning enforces using generator expressions
|
||||
instead of full list/set comprehensions in these cases.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 2 +-
|
||||
.../actors/checksaphana/tests/test_checksaphana.py | 7 +++++--
|
||||
.../tests/test_ddddload.py | 2 +-
|
||||
.../tests/test_persistentnetnamesconfig.py | 2 +-
|
||||
.../libraries/scandynamiclinkerconfiguration.py | 2 +-
|
||||
.../tests/test_checksystemdbrokensymlinks.py | 4 ++--
|
||||
.../tests/test_transitionsystemdservicesstates.py | 6 ++----
|
||||
.../tests/unit_test_targetuserspacecreator.py | 4 ++--
|
||||
.../actors/rocecheck/tests/unit_test_rocecheck.py | 10 ++++++++--
|
||||
10 files changed, 23 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 4cfc49e0..a82f8818 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -41,7 +41,6 @@ disable=
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
- use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
logging-format-interpolation
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index d52b9e73..84e8e61f 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -27,7 +27,7 @@ def _formatted_list_output(input_list, sep=FMT_LIST_SEPARATOR):
|
||||
|
||||
|
||||
def _at_least_one_tpm_token(luks_dump):
|
||||
- return any([token.token_type == "clevis-tpm2" for token in luks_dump.tokens])
|
||||
+ return any(token.token_type == "clevis-tpm2" for token in luks_dump.tokens)
|
||||
|
||||
|
||||
def _get_ceph_volumes():
|
||||
diff --git a/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py b/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
index 29e9c930..8ec8d17f 100644
|
||||
--- a/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
+++ b/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
@@ -284,7 +284,7 @@ def test_checksaphana_perform_check(monkeypatch):
|
||||
# Expected 3 reports due to v1names + v2lownames + running
|
||||
assert len(reports) == 3
|
||||
# Verifies that all expected title patterns are within the reports and not just coincidentally 3
|
||||
- assert all([any([pattern(report) for report in reports]) for pattern in EXPECTED_TITLE_PATTERNS.values()])
|
||||
+ assert all(any(pattern(report) for report in reports) for pattern in EXPECTED_TITLE_PATTERNS.values())
|
||||
|
||||
list_clear(reports)
|
||||
monkeypatch.setattr(checksaphana.api, 'consume', _consume_mock_sap_hana_info(
|
||||
@@ -294,4 +294,7 @@ def test_checksaphana_perform_check(monkeypatch):
|
||||
# Expected 2 reports due to v1names + v2lownames
|
||||
assert len(reports) == 2
|
||||
# Verifies that all expected title patterns are within the reports and not just coincidentally 2
|
||||
- assert all([any([EXPECTED_TITLE_PATTERNS[pattern](report) for report in reports]) for pattern in ['v1', 'low']])
|
||||
+ assert all(
|
||||
+ any(EXPECTED_TITLE_PATTERNS[pattern](report) for report in reports)
|
||||
+ for pattern in ['v1', 'low']
|
||||
+ )
|
||||
diff --git a/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py b/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
index c3386745..1f3473b6 100644
|
||||
--- a/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
+++ b/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
@@ -60,7 +60,7 @@ def test_filtered_load(monkeypatch):
|
||||
|
||||
assert produced
|
||||
assert len(produced[0].entries) == 3
|
||||
- assert not any([e.device_type == 'unsupported' for e in produced[0].entries])
|
||||
+ assert not any(e.device_type == 'unsupported' for e in produced[0].entries)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('data', (
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
index 5ad52c43..ee199ae4 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
@@ -177,7 +177,7 @@ def test_bz_1899455_crash_iface(monkeypatch, adjust_cwd):
|
||||
|
||||
for prod_models in [RenamedInterfaces, InitrdIncludes, TargetInitramfsTasks]:
|
||||
any(isinstance(i, prod_models) for i in persistentnetnamesconfig.api.produce.model_instances)
|
||||
- assert any(['Some network devices' in x for x in persistentnetnamesconfig.api.current_logger.warnmsg])
|
||||
+ assert any('Some network devices' in x for x in persistentnetnamesconfig.api.current_logger.warnmsg)
|
||||
|
||||
|
||||
def test_no_network_renaming(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py b/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
index 8d3b473e..73b0c84e 100644
|
||||
--- a/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
+++ b/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
@@ -113,5 +113,5 @@ def scan_dynamic_linker_configuration():
|
||||
included_configs=included_config_files,
|
||||
used_variables=used_variables)
|
||||
|
||||
- if other_lines or any([config.modified for config in included_config_files]) or used_variables:
|
||||
+ if other_lines or any(config.modified for config in included_config_files) or used_variables:
|
||||
api.produce(configuration)
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py b/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
index bcc33f13..a4c0a657 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
@@ -20,7 +20,7 @@ def test_report_broken_symlinks(monkeypatch):
|
||||
checksystemdbrokensymlinks._report_broken_symlinks(symlinks)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields['summary'] for s in symlinks])
|
||||
+ assert all(s in created_reports.report_fields['summary'] for s in symlinks)
|
||||
|
||||
|
||||
def test_report_enabled_services_broken_symlinks(monkeypatch):
|
||||
@@ -35,7 +35,7 @@ def test_report_enabled_services_broken_symlinks(monkeypatch):
|
||||
checksystemdbrokensymlinks._report_enabled_services_broken_symlinks(symlinks)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields['summary'] for s in symlinks])
|
||||
+ assert all(s in created_reports.report_fields['summary'] for s in symlinks)
|
||||
|
||||
|
||||
class ReportBrokenSymlinks:
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py b/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
index 6964a65b..488b37d4 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
@@ -205,9 +205,7 @@ def test_report_kept_enabled(monkeypatch, tasks, expect_extended_summary):
|
||||
assert created_reports.called
|
||||
if expect_extended_summary:
|
||||
assert extended_summary_str in created_reports.report_fields["summary"]
|
||||
- assert all(
|
||||
- [s in created_reports.report_fields["summary"] for s in tasks.to_enable]
|
||||
- )
|
||||
+ all(s in created_reports.report_fields['summary'] for s in tasks.to_enable)
|
||||
else:
|
||||
assert extended_summary_str not in created_reports.report_fields["summary"]
|
||||
|
||||
@@ -238,7 +236,7 @@ def test_report_newly_enabled(monkeypatch):
|
||||
transitionsystemdservicesstates._report_newly_enabled(newly_enabled)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields["summary"] for s in newly_enabled])
|
||||
+ assert all(s in created_reports.report_fields["summary"] for s in newly_enabled)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index bb17d89a..0bb64f6f 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -1068,7 +1068,7 @@ def test_consume_data(monkeypatch, raised, no_rhsm, testdata):
|
||||
assert raised[1] in err.value.message
|
||||
else:
|
||||
assert userspacegen.api.current_logger.warnmsg
|
||||
- assert any([raised[1] in x for x in userspacegen.api.current_logger.warnmsg])
|
||||
+ assert any(raised[1] in x for x in userspacegen.api.current_logger.warnmsg)
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Currently not implemented in the actor. It's TODO.")
|
||||
@@ -1390,7 +1390,7 @@ def test__get_files_owned_by_rpms_recursive(monkeypatch):
|
||||
assert sorted(owned[0:4]) == sorted(out)
|
||||
|
||||
def has_dbgmsg(substr):
|
||||
- return any([substr in log for log in logger.dbgmsg])
|
||||
+ return any(substr in log for log in logger.dbgmsg)
|
||||
|
||||
# test a few
|
||||
assert has_dbgmsg(
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py b/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
index a36cc8ed..b5511d17 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
@@ -91,7 +91,10 @@ def test_roce_old_rhel(monkeypatch, msgs, version):
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
rocecheck.process()
|
||||
assert reporting.create_report.called
|
||||
- assert any(['version of RHEL' in report['title'] for report in reporting.create_report.reports])
|
||||
+ assert any(
|
||||
+ 'version of RHEL' in report['title']
|
||||
+ for report in reporting.create_report.reports
|
||||
+ )
|
||||
|
||||
|
||||
# NOTE: what about the situation when net.naming-scheme is configured multiple times???
|
||||
@@ -113,4 +116,7 @@ def test_roce_wrong_configuration(monkeypatch, msgs, version):
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
rocecheck.process()
|
||||
assert reporting.create_report.called
|
||||
- assert any(['RoCE configuration' in report['title'] for report in reporting.create_report.reports])
|
||||
+ assert any(
|
||||
+ 'RoCE configuration' in report['title']
|
||||
+ for report in reporting.create_report.reports
|
||||
+ )
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,484 @@
|
||||
From adac307afff48ebbf4255edbd620ed29cbc9429e Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 13:12:19 +0200
|
||||
Subject: [PATCH 43/55] Set CurrentActorMocked src/dst version to 8->9 values
|
||||
|
||||
Currently, the default upgrade path is 7.8->8.1 which has been dropped
|
||||
from the repo. Several tests make assumptions about these defaults and in
|
||||
some cases this means that code path for other general upgrade paths
|
||||
(8->9, 9->10) are left untested e.g. modify_userspace_for_livemode.
|
||||
|
||||
This patch changes the default path to 8.10->9.6.
|
||||
|
||||
Updated tests:
|
||||
- checkrhui: assume 8->9 upgrade path
|
||||
- setuptargetrepos: Update tests to assume 8->9 upg path.
|
||||
- repairsystemdsymlinks: use 8->9 upgrade path instead of 7->8:
|
||||
We need to mock some "installation changed" service as there is
|
||||
*currently* none.
|
||||
- checkmemory: assume 8->9 upgrade path
|
||||
- peseventsscanner: assume 8->9 upgrade path
|
||||
- lib/config: assume correct upgrade path
|
||||
- persistentnetnamesconfig: use 8->9 upgrade path instead of 7->8
|
||||
|
||||
Jira: RHELMISC-16538
|
||||
---
|
||||
.../checkmemory/tests/test_checkmemory.py | 2 +-
|
||||
.../tests/component_test_checkrhui.py | 20 +++---
|
||||
.../libraries/persistentnetnamesconfig.py | 24 +++----
|
||||
.../tests/test_persistentnetnamesconfig.py | 16 ++++-
|
||||
.../tests/test_pes_event_scanner.py | 14 ++--
|
||||
.../tests/test_setuptargetrepos.py | 68 +++++++++----------
|
||||
.../libraries/repairsystemdsymlinks.py | 1 -
|
||||
.../tests/test_repairsystemdsymlinks.py | 29 +++++---
|
||||
.../libraries/config/tests/test_version.py | 2 +-
|
||||
.../common/libraries/testutils.py | 2 +-
|
||||
10 files changed, 98 insertions(+), 80 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py b/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
index a0bac0a9..79158dc6 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
@@ -21,7 +21,7 @@ def test_check_memory_high(monkeypatch):
|
||||
|
||||
|
||||
def test_report(monkeypatch):
|
||||
- title_msg = 'Minimum memory requirements for RHEL 8 are not met'
|
||||
+ title_msg = 'Minimum memory requirements for RHEL 9 are not met'
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(api, 'consume', lambda x: iter([MemoryInfo(mem_total=129)]))
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
index 02ca352e..2e6f279e 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
@@ -279,10 +279,14 @@ class ExpectedAction(Enum):
|
||||
)
|
||||
def test_process(monkeypatch, extra_installed_pkgs, skip_rhsm, expected_action):
|
||||
known_setups = {
|
||||
- RHUIFamily('rhui-variant'): [
|
||||
- mk_rhui_setup(clients={'src_pkg'}, os_version='7'),
|
||||
- mk_rhui_setup(clients={'target_pkg'}, os_version='8', leapp_pkg='leapp_pkg',
|
||||
- mandatory_files=[('file1', '/etc'), ('file2', '/var')]),
|
||||
+ RHUIFamily("rhui-variant"): [
|
||||
+ mk_rhui_setup(clients={"src_pkg"}, os_version="8"),
|
||||
+ mk_rhui_setup(
|
||||
+ clients={"target_pkg"},
|
||||
+ os_version="9",
|
||||
+ leapp_pkg="leapp_pkg",
|
||||
+ mandatory_files=[("file1", "/etc"), ("file2", "/var")],
|
||||
+ ),
|
||||
]
|
||||
}
|
||||
|
||||
@@ -291,7 +295,7 @@ def test_process(monkeypatch, extra_installed_pkgs, skip_rhsm, expected_action):
|
||||
installed_rpms = InstalledRPM(items=installed_pkgs)
|
||||
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- actor = CurrentActorMocked(src_ver='7.9', msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
+ actor = CurrentActorMocked(msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
monkeypatch.setattr(api, 'current_actor', actor)
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
@@ -318,12 +322,12 @@ def test_unknown_target_rhui_setup(monkeypatch, is_target_setup_known):
|
||||
rhui_family = RHUIFamily('rhui-variant')
|
||||
known_setups = {
|
||||
rhui_family: [
|
||||
- mk_rhui_setup(clients={'src_pkg'}, os_version='7'),
|
||||
+ mk_rhui_setup(clients={'src_pkg'}, os_version='8'),
|
||||
]
|
||||
}
|
||||
|
||||
if is_target_setup_known:
|
||||
- target_setup = mk_rhui_setup(clients={'target_pkg'}, os_version='8', leapp_pkg='leapp_pkg')
|
||||
+ target_setup = mk_rhui_setup(clients={'target_pkg'}, os_version='9', leapp_pkg='leapp_pkg')
|
||||
known_setups[rhui_family].append(target_setup)
|
||||
|
||||
installed_pkgs = {'zip', 'kernel-core', 'python', 'src_pkg', 'leapp_pkg'}
|
||||
@@ -331,7 +335,7 @@ def test_unknown_target_rhui_setup(monkeypatch, is_target_setup_known):
|
||||
installed_rpms = InstalledRPM(items=installed_pkgs)
|
||||
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- actor = CurrentActorMocked(src_ver='7.9', msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
+ actor = CurrentActorMocked(msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
monkeypatch.setattr(api, 'current_actor', actor)
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
index c90d13f2..189cd4d0 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
@@ -55,21 +55,21 @@ def process():
|
||||
)
|
||||
return
|
||||
|
||||
- rhel7_ifaces = next(api.consume(PersistentNetNamesFacts)).interfaces
|
||||
- rhel8_ifaces = next(api.consume(PersistentNetNamesFactsInitramfs)).interfaces
|
||||
+ source_ifaces = next(api.consume(PersistentNetNamesFacts)).interfaces
|
||||
+ target_ifaces = next(api.consume(PersistentNetNamesFactsInitramfs)).interfaces
|
||||
|
||||
- rhel7_ifaces_map = {iface.mac: iface for iface in rhel7_ifaces}
|
||||
- rhel8_ifaces_map = {iface.mac: iface for iface in rhel8_ifaces}
|
||||
+ source_ifaces_map = {iface.mac: iface for iface in source_ifaces}
|
||||
+ target_ifaces_map = {iface.mac: iface for iface in target_ifaces}
|
||||
|
||||
initrd_files = []
|
||||
missing_ifaces = []
|
||||
renamed_interfaces = []
|
||||
|
||||
- if rhel7_ifaces != rhel8_ifaces:
|
||||
- for iface in rhel7_ifaces:
|
||||
- rhel7_name = rhel7_ifaces_map[iface.mac].name
|
||||
+ if source_ifaces != target_ifaces:
|
||||
+ for iface in source_ifaces:
|
||||
+ source_name = source_ifaces_map[iface.mac].name
|
||||
try:
|
||||
- rhel8_name = rhel8_ifaces_map[iface.mac].name
|
||||
+ target_name = target_ifaces_map[iface.mac].name
|
||||
except KeyError:
|
||||
missing_ifaces.append(iface)
|
||||
api.current_logger().warning(
|
||||
@@ -80,13 +80,13 @@ def process():
|
||||
)
|
||||
continue
|
||||
|
||||
- if rhel7_name != rhel8_name and get_env('LEAPP_NO_NETWORK_RENAMING', '0') != '1':
|
||||
- api.current_logger().warning('Detected interface rename {} -> {}.'.format(rhel7_name, rhel8_name))
|
||||
+ if source_name != target_name and get_env('LEAPP_NO_NETWORK_RENAMING', '0') != '1':
|
||||
+ api.current_logger().warning('Detected interface rename {} -> {}.'.format(source_name, target_name))
|
||||
|
||||
if re.search('eth[0-9]+', iface.name) is not None:
|
||||
api.current_logger().warning('Interface named using eth prefix, refusing to generate link file')
|
||||
- renamed_interfaces.append(RenamedInterface(**{'rhel7_name': rhel7_name,
|
||||
- 'rhel8_name': rhel8_name}))
|
||||
+ renamed_interfaces.append(RenamedInterface(**{'rhel7_name': source_name,
|
||||
+ 'rhel8_name': target_name}))
|
||||
continue
|
||||
|
||||
initrd_files.append(generate_link_file(iface))
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
index ee199ae4..c584c7ea 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
@@ -12,7 +12,6 @@ from leapp.models import (
|
||||
PCIAddress,
|
||||
PersistentNetNamesFacts,
|
||||
PersistentNetNamesFactsInitramfs,
|
||||
- RenamedInterface,
|
||||
RenamedInterfaces,
|
||||
TargetInitramfsTasks
|
||||
)
|
||||
@@ -170,7 +169,12 @@ def test_bz_1899455_crash_iface(monkeypatch, adjust_cwd):
|
||||
PersistentNetNamesFactsInitramfs.create(json_msgs["PersistentNetNamesFactsInitramfs"]),
|
||||
]
|
||||
monkeypatch.setattr(persistentnetnamesconfig, 'generate_link_file', generate_link_file_mocked)
|
||||
- monkeypatch.setattr(persistentnetnamesconfig.api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(
|
||||
+ persistentnetnamesconfig.api,
|
||||
+ "current_actor",
|
||||
+ # without this the actor exits early
|
||||
+ CurrentActorMocked(msgs=msgs, envars={"LEAPP_DISABLE_NET_NAMING_SCHEMES": "1"}),
|
||||
+ )
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_logger', logger_mocked())
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'produce', produce_mocked())
|
||||
persistentnetnamesconfig.process()
|
||||
@@ -194,7 +198,13 @@ def test_no_network_renaming(monkeypatch):
|
||||
msgs = [PersistentNetNamesFacts(interfaces=interfaces)]
|
||||
interfaces[0].name = 'changedinterfacename0'
|
||||
msgs.append(PersistentNetNamesFactsInitramfs(interfaces=interfaces))
|
||||
- mocked_actor = CurrentActorMocked(msgs=msgs, envars={'LEAPP_NO_NETWORK_RENAMING': '1'})
|
||||
+ mocked_actor = CurrentActorMocked(
|
||||
+ msgs=msgs,
|
||||
+ envars={
|
||||
+ "LEAPP_DISABLE_NET_NAMING_SCHEMES": "1",
|
||||
+ "LEAPP_NO_NETWORK_RENAMING": "1",
|
||||
+ },
|
||||
+ )
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_actor', mocked_actor)
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_logger', logger_mocked())
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'produce', produce_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
index 09a1e82d..f67f3840 100644
|
||||
--- a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
@@ -325,18 +325,18 @@ def test_blacklisted_repoid_is_not_produced(monkeypatch):
|
||||
Test that upgrade with a package that would be from a blacklisted repository on the target system does not remove
|
||||
the package as it was already installed, however, the blacklisted repoid should not be produced.
|
||||
"""
|
||||
- installed_pkgs = {Package('pkg-a', 'blacklisted-rhel7', None), Package('pkg-b', 'repoid-rhel7', None)}
|
||||
+ installed_pkgs = {Package('pkg-a', 'blacklisted-rhel8', None), Package('pkg-b', 'repoid-rhel8', None)}
|
||||
events = [
|
||||
- Event(1, Action.MOVED, {Package('pkg-b', 'repoid-rhel7', None)}, {Package('pkg-b', 'repoid-rhel8', None)},
|
||||
- (8, 0), (8, 1), []),
|
||||
- Event(2, Action.MOVED, {Package('pkg-a', 'repoid-rhel7', None)}, {Package('pkg-a', 'blacklisted-rhel8', None)},
|
||||
- (8, 0), (8, 1), []),
|
||||
+ Event(1, Action.MOVED, {Package('pkg-b', 'repoid-rhel8', None)}, {Package('pkg-b', 'repoid-rhel9', None)},
|
||||
+ (9, 0), (9, 1), []),
|
||||
+ Event(2, Action.MOVED, {Package('pkg-a', 'repoid-rhel8', None)}, {Package('pkg-a', 'blacklisted-rhel9', None)},
|
||||
+ (9, 0), (9, 1), []),
|
||||
]
|
||||
|
||||
monkeypatch.setattr(pes_events_scanner, 'get_installed_pkgs', lambda: installed_pkgs)
|
||||
monkeypatch.setattr(pes_events_scanner, 'get_pes_events', lambda folder, filename: events)
|
||||
monkeypatch.setattr(pes_events_scanner, 'apply_transaction_configuration', lambda pkgs, transaction_cfg: pkgs)
|
||||
- monkeypatch.setattr(pes_events_scanner, 'get_blacklisted_repoids', lambda: {'blacklisted-rhel8'})
|
||||
+ monkeypatch.setattr(pes_events_scanner, 'get_blacklisted_repoids', lambda: {'blacklisted-rhel9'})
|
||||
monkeypatch.setattr(pes_events_scanner, 'replace_pesids_with_repoids_in_packages',
|
||||
lambda pkgs, src_pkgs_repoids: pkgs)
|
||||
|
||||
@@ -357,7 +357,7 @@ def test_blacklisted_repoid_is_not_produced(monkeypatch):
|
||||
|
||||
repo_setup_tasks = [msg for msg in api.produce.model_instances if isinstance(msg, RepositoriesSetupTasks)]
|
||||
assert len(repo_setup_tasks) == 1
|
||||
- assert repo_setup_tasks[0].to_enable == ['repoid-rhel8']
|
||||
+ assert repo_setup_tasks[0].to_enable == ['repoid-rhel9']
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
index e4a30f7f..ce7f01c0 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
@@ -1,6 +1,5 @@
|
||||
import pytest
|
||||
|
||||
-from leapp.libraries import stdlib
|
||||
from leapp.libraries.actor import setuptargetrepos
|
||||
from leapp.libraries.common.testutils import CurrentActorMocked, produce_mocked
|
||||
from leapp.libraries.stdlib import api
|
||||
@@ -15,8 +14,7 @@ from leapp.models import (
|
||||
RepositoriesSetupTasks,
|
||||
RepositoryData,
|
||||
RepositoryFile,
|
||||
- RPM,
|
||||
- TargetRepositories
|
||||
+ RPM
|
||||
)
|
||||
|
||||
RH_PACKAGER = 'Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>'
|
||||
@@ -108,27 +106,27 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
the RepositoriesMapping information for a specific distro.
|
||||
"""
|
||||
repos_data = [
|
||||
- RepositoryData(repoid='{}-7-server-rpms'.format(distro_id), name='{} 7 Server'.format(distro_id)),
|
||||
- RepositoryData(repoid='{}-7-blacklisted-rpms'.format(distro_id), name='{} 7 Blacklisted'.format(distro_id))]
|
||||
+ RepositoryData(repoid='{}-8-server-rpms'.format(distro_id), name='{} 8 Server'.format(distro_id)),
|
||||
+ RepositoryData(repoid='{}-8-blacklisted-rpms'.format(distro_id), name='{} 8 Blacklisted'.format(distro_id))]
|
||||
|
||||
repos_files = [RepositoryFile(file='/etc/yum.repos.d/redhat.repo', data=repos_data)]
|
||||
facts = RepositoriesFacts(repositories=repos_files)
|
||||
installed_rpms = InstalledRPM(
|
||||
- items=[mock_package('foreman', '{}-7-for-x86_64-satellite-extras-rpms'.format(distro_id)),
|
||||
- mock_package('foreman-proxy', 'nosuch-{}-7-for-x86_64-satellite-extras-rpms'.format(distro_id))])
|
||||
+ items=[mock_package('foreman', '{}-8-for-x86_64-satellite-extras-rpms'.format(distro_id)),
|
||||
+ mock_package('foreman-proxy', 'nosuch-{}-8-for-x86_64-satellite-extras-rpms'.format(distro_id))])
|
||||
|
||||
repomap = RepositoriesMapping(
|
||||
- mapping=[RepoMapEntry(source='{0}7-base'.format(distro_id),
|
||||
- target=['{0}8-baseos'.format(distro_id),
|
||||
- '{0}8-appstream'.format(distro_id),
|
||||
- '{0}8-blacklist'.format(distro_id)]),
|
||||
- RepoMapEntry(source='{0}7-satellite-extras'.format(distro_id),
|
||||
- target=['{0}8-satellite-extras'.format(distro_id)])],
|
||||
+ mapping=[RepoMapEntry(source='{0}8-base'.format(distro_id),
|
||||
+ target=['{0}9-baseos'.format(distro_id),
|
||||
+ '{0}9-appstream'.format(distro_id),
|
||||
+ '{0}9-blacklist'.format(distro_id)]),
|
||||
+ RepoMapEntry(source='{0}8-satellite-extras'.format(distro_id),
|
||||
+ target=['{0}9-satellite-extras'.format(distro_id)])],
|
||||
repositories=[
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}7-base'.format(distro_id),
|
||||
- repoid='{0}-7-server-rpms'.format(distro_id),
|
||||
- major_version='7',
|
||||
+ pesid='{0}8-base'.format(distro_id),
|
||||
+ repoid='{0}-8-server-rpms'.format(distro_id),
|
||||
+ major_version='8',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -136,9 +134,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-baseos'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-baseos'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -146,9 +144,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-appstream'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-appstream'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -156,9 +154,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-blacklist'.format(distro_id),
|
||||
- repoid='{0}-8-blacklisted-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-blacklist'.format(distro_id),
|
||||
+ repoid='{0}-9-blacklisted-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -166,9 +164,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}7-satellite-extras'.format(distro_id),
|
||||
- repoid='{0}-7-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
- major_version='7',
|
||||
+ pesid='{0}8-satellite-extras'.format(distro_id),
|
||||
+ repoid='{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
+ major_version='8',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -176,9 +174,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-satellite-extras'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-satellite-extras'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -188,7 +186,7 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
]
|
||||
)
|
||||
|
||||
- repos_blacklisted = RepositoriesBlacklisted(repoids=['{}-8-blacklisted-rpms'.format(distro_id)])
|
||||
+ repos_blacklisted = RepositoriesBlacklisted(repoids=['{}-9-blacklisted-rpms'.format(distro_id)])
|
||||
|
||||
msgs = [facts, repomap, repos_blacklisted, installed_rpms]
|
||||
|
||||
@@ -207,9 +205,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
produced_rhel_repoids = {repo.repoid for repo in rhel_repos}
|
||||
|
||||
expected_repoids = {
|
||||
- "{0}-8-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
- "{0}-8-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
- "{0}-8-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
}
|
||||
|
||||
assert produced_distro_repoids == expected_repoids
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
index 3fcf4aa6..a8e801b9 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
@@ -7,7 +7,6 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import SystemdBrokenSymlinksSource, SystemdBrokenSymlinksTarget, SystemdServicesInfoSource
|
||||
|
||||
_INSTALLATION_CHANGED = {
|
||||
- '8': ['rngd.service', 'sysstat.service'],
|
||||
'9': [],
|
||||
'10': [],
|
||||
}
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
index 5771fc6c..d52abdfa 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
@@ -1,13 +1,8 @@
|
||||
from leapp.libraries.actor import repairsystemdsymlinks
|
||||
from leapp.libraries.common import systemd
|
||||
-from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked
|
||||
-from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import (
|
||||
- SystemdBrokenSymlinksSource,
|
||||
- SystemdBrokenSymlinksTarget,
|
||||
- SystemdServiceFile,
|
||||
- SystemdServicesInfoSource
|
||||
-)
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import SystemdServiceFile, SystemdServicesInfoSource
|
||||
|
||||
|
||||
class MockedSystemdCmd:
|
||||
@@ -20,8 +15,16 @@ class MockedSystemdCmd:
|
||||
|
||||
|
||||
def test_bad_symslinks(monkeypatch):
|
||||
+ # there is no _INSTALLATION_CHANGED service on RHEL 8 and RHEL 9, but it's
|
||||
+ # possible such service will be discovered and added in the future as it
|
||||
+ # was on RHEL 7, so let's add such case
|
||||
+ monkeypatch.setitem(
|
||||
+ repairsystemdsymlinks._INSTALLATION_CHANGED,
|
||||
+ "9", ["some.service"],
|
||||
+ )
|
||||
+
|
||||
service_files = [
|
||||
- SystemdServiceFile(name='rngd.service', state='enabled'),
|
||||
+ SystemdServiceFile(name='some.service', state='enabled'),
|
||||
SystemdServiceFile(name='sysstat.service', state='disabled'),
|
||||
SystemdServiceFile(name='hello.service', state='enabled'),
|
||||
SystemdServiceFile(name='world.service', state='disabled'),
|
||||
@@ -36,11 +39,15 @@ def test_bad_symslinks(monkeypatch):
|
||||
monkeypatch.setattr(systemd, 'reenable_unit', reenable_mocked)
|
||||
|
||||
service_info = SystemdServicesInfoSource(service_files=service_files)
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[service_info]))
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "current_actor",
|
||||
+ CurrentActorMocked(src_ver="8.10", dst_ver="9.6", msgs=[service_info]),
|
||||
+ )
|
||||
|
||||
repairsystemdsymlinks._handle_bad_symlinks(service_info.service_files)
|
||||
|
||||
- assert reenable_mocked.units == ['rngd.service']
|
||||
+ assert reenable_mocked.units == ['some.service']
|
||||
|
||||
|
||||
def test_handle_newly_broken_symlink(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/tests/test_version.py b/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
index d51f8098..f36dbc5f 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
@@ -94,7 +94,7 @@ def test_matches_source_version(monkeypatch, result, version_list):
|
||||
(False, ['8.2', '8.0']),
|
||||
])
|
||||
def test_matches_target_version(monkeypatch, result, version_list):
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(src_ver='7.6'))
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(src_ver='7.6', dst_ver='8.1'))
|
||||
assert version.matches_target_version(*version_list) == result
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/testutils.py b/repos/system_upgrade/common/libraries/testutils.py
|
||||
index e84cc03a..107ad8a7 100644
|
||||
--- a/repos/system_upgrade/common/libraries/testutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/testutils.py
|
||||
@@ -80,7 +80,7 @@ def _make_default_config(actor_config_schema):
|
||||
class CurrentActorMocked: # pylint:disable=R0904
|
||||
def __init__(self, arch=architecture.ARCH_X86_64, envars=None, # pylint:disable=R0913
|
||||
kernel='3.10.0-957.43.1.el7.x86_64',
|
||||
- release_id='rhel', src_ver='7.8', dst_ver='8.1', msgs=None, flavour='default', config=None,
|
||||
+ release_id='rhel', src_ver='8.10', dst_ver='9.6', msgs=None, flavour='default', config=None,
|
||||
virtual_source_version=None, virtual_target_version=None,
|
||||
supported_upgrade_paths=None):
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,303 @@
|
||||
From ad9b2ae552b6c36d78a445dbbcfcc179afd1d839 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:23:55 +0200
|
||||
Subject: [PATCH 44/55] scancpu: Remove non-JSON ("txt") lscpu output support
|
||||
|
||||
This was only used on RHEL 7.
|
||||
|
||||
- Remove txt test files
|
||||
- Remove empty_field test - IIRC it's not possible to have and empty
|
||||
field in JSON lscpu output, there would be null
|
||||
---
|
||||
.../actors/scancpu/libraries/scancpu.py | 11 ++---
|
||||
.../scancpu/tests/files/{json => }/invalid | 0
|
||||
.../tests/files/{json => }/lscpu_aarch64 | 0
|
||||
.../tests/files/{json => }/lscpu_ppc64le | 0
|
||||
.../tests/files/{json => }/lscpu_s390x | 0
|
||||
.../tests/files/{json => }/lscpu_x86_64 | 0
|
||||
.../scancpu/tests/files/txt/lscpu_aarch64 | 25 -----------
|
||||
.../scancpu/tests/files/txt/lscpu_empty_field | 4 --
|
||||
.../scancpu/tests/files/txt/lscpu_ppc64le | 15 -------
|
||||
.../scancpu/tests/files/txt/lscpu_s390x | 26 ------------
|
||||
.../scancpu/tests/files/txt/lscpu_x86_64 | 36 ----------------
|
||||
.../actors/scancpu/tests/test_scancpu.py | 42 ++-----------------
|
||||
12 files changed, 7 insertions(+), 152 deletions(-)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/invalid (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_aarch64 (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_ppc64le (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_s390x (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_x86_64 (100%)
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
index db3f92d4..ecc23349 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
@@ -2,17 +2,15 @@ import json
|
||||
import re
|
||||
|
||||
from leapp.libraries.common.config import architecture
|
||||
-from leapp.libraries.common.config.version import get_source_major_version
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import CPUInfo, DetectedDeviceOrDriver, DeviceDriverDeprecationData
|
||||
|
||||
-LSCPU_NAME_VALUE = re.compile(r'^(?P<name>[^:]+):[^\S\n]+(?P<value>.+)\n?', flags=re.MULTILINE)
|
||||
PPC64LE_MODEL = re.compile(r'\d+\.\d+ \(pvr (?P<family>[0-9a-fA-F]+) 0*[0-9a-fA-F]+\)')
|
||||
|
||||
|
||||
-def _get_lscpu_output(output_json=False):
|
||||
+def _get_lscpu_output():
|
||||
try:
|
||||
- result = run(['lscpu'] + (['-J'] if output_json else []))
|
||||
+ result = run(['lscpu', '-J'])
|
||||
return result.get('stdout', '')
|
||||
except (OSError, CalledProcessError):
|
||||
api.current_logger().debug('Executing `lscpu` failed', exc_info=True)
|
||||
@@ -20,10 +18,7 @@ def _get_lscpu_output(output_json=False):
|
||||
|
||||
|
||||
def _parse_lscpu_output():
|
||||
- if get_source_major_version() == '7':
|
||||
- return dict(LSCPU_NAME_VALUE.findall(_get_lscpu_output()))
|
||||
-
|
||||
- lscpu = _get_lscpu_output(output_json=True)
|
||||
+ lscpu = _get_lscpu_output()
|
||||
try:
|
||||
parsed_json = json.loads(lscpu)
|
||||
# The json contains one entry "lscpu" which is a list of dictionaries
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid b/repos/system_upgrade/common/actors/scancpu/tests/files/invalid
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/invalid
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64 b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_x86_64
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_x86_64
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
deleted file mode 100644
|
||||
index 3b9619ef..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-Architecture: aarch64
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 160
|
||||
-On-line CPU(s) list: 0-159
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 80
|
||||
-Socket(s): 2
|
||||
-NUMA node(s): 4
|
||||
-Vendor ID: ARM
|
||||
-BIOS Vendor ID: Ampere(R)
|
||||
-Model: 1
|
||||
-Model name: Neoverse-N1
|
||||
-BIOS Model name: Ampere(R) Altra(R) Processor
|
||||
-Stepping: r3p1
|
||||
-CPU max MHz: 3000.0000
|
||||
-CPU min MHz: 1000.0000
|
||||
-BogoMIPS: 50.00
|
||||
-L1d cache: 64K
|
||||
-L1i cache: 64K
|
||||
-L2 cache: 1024K
|
||||
-NUMA node0 CPU(s): 0-79
|
||||
-NUMA node1 CPU(s): 80-159
|
||||
-NUMA node2 CPU(s):
|
||||
-NUMA node3 CPU(s):
|
||||
-Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
deleted file mode 100644
|
||||
index f830b7fe..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
+++ /dev/null
|
||||
@@ -1,4 +0,0 @@
|
||||
-Empyt 1:
|
||||
-Empyt 2:
|
||||
-Empyt 3:
|
||||
-Flags: flag
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
deleted file mode 100644
|
||||
index 07d2ed65..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
-Architecture: ppc64le
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 8
|
||||
-On-line CPU(s) list: 0-7
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 1
|
||||
-Socket(s): 8
|
||||
-NUMA node(s): 1
|
||||
-Model: 2.1 (pvr 004b 0201)
|
||||
-Model name: POWER8E (raw), altivec supported
|
||||
-Hypervisor vendor: KVM
|
||||
-Virtualization type: para
|
||||
-L1d cache: 64K
|
||||
-L1i cache: 32K
|
||||
-NUMA node0 CPU(s): 0-7
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
deleted file mode 100644
|
||||
index 2c0de9f9..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
+++ /dev/null
|
||||
@@ -1,26 +0,0 @@
|
||||
-Architecture: s390x
|
||||
-CPU op-mode(s): 32-bit, 64-bit
|
||||
-Byte Order: Big Endian
|
||||
-CPU(s): 4
|
||||
-On-line CPU(s) list: 0-3
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 1
|
||||
-Socket(s) per book: 1
|
||||
-Book(s) per drawer: 1
|
||||
-Drawer(s): 4
|
||||
-NUMA node(s): 1
|
||||
-Vendor ID: IBM/S390
|
||||
-Machine type: 3931
|
||||
-CPU dynamic MHz: 5200
|
||||
-CPU static MHz: 5200
|
||||
-BogoMIPS: 3331.00
|
||||
-Hypervisor: KVM/Linux
|
||||
-Hypervisor vendor: KVM
|
||||
-Virtualization type: full
|
||||
-Dispatching mode: horizontal
|
||||
-L1d cache: 128K
|
||||
-L1i cache: 128K
|
||||
-L2 cache: 32768K
|
||||
-L3 cache: 262144K
|
||||
-NUMA node0 CPU(s): 0-3
|
||||
-Flags: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt vxp2 nnpa sie
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64 b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
deleted file mode 100644
|
||||
index a1dc1035..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
+++ /dev/null
|
||||
@@ -1,36 +0,0 @@
|
||||
-Architecture: x86_64
|
||||
-CPU op-mode(s): 32-bit, 64-bit
|
||||
-Address sizes: 46 bits physical, 48 bits virtual
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 48
|
||||
-On-line CPU(s) list: 0-47
|
||||
-Vendor ID: GenuineIntel
|
||||
-Model name: Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz
|
||||
-CPU family: 6
|
||||
-Model: 63
|
||||
-Thread(s) per core: 2
|
||||
-Core(s) per socket: 12
|
||||
-Socket(s): 2
|
||||
-Stepping: 2
|
||||
-CPU(s) scaling MHz: 44%
|
||||
-CPU max MHz: 3100.0000
|
||||
-CPU min MHz: 1200.0000
|
||||
-BogoMIPS: 4599.83
|
||||
-Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d
|
||||
-Virtualization: VT-x
|
||||
-L1d cache: 768 KiB (24 instances)
|
||||
-L1i cache: 768 KiB (24 instances)
|
||||
-L2 cache: 6 MiB (24 instances)
|
||||
-L3 cache: 60 MiB (2 instances)
|
||||
-NUMA node(s): 2
|
||||
-NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46
|
||||
-NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47
|
||||
-Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
|
||||
-Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
|
||||
-Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
|
||||
-Vulnerability Meltdown: Mitigation; PTI
|
||||
-Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
|
||||
-Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
|
||||
-Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
|
||||
-Vulnerability Srbds: Not affected
|
||||
-Vulnerability Tsx async abort: Not affected
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
index be0802ba..3605ebe7 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
@@ -61,29 +61,20 @@ class mocked_get_cpuinfo:
|
||||
def __init__(self, filename):
|
||||
self.filename = filename
|
||||
|
||||
- def __call__(self, output_json=False):
|
||||
+ def __call__(self):
|
||||
"""
|
||||
Return lines of the self.filename test file located in the files directory.
|
||||
|
||||
Those files contain /proc/cpuinfo content from several machines.
|
||||
"""
|
||||
-
|
||||
- filename = self.filename
|
||||
- if output_json:
|
||||
- filename = os.path.join('json', filename)
|
||||
- else:
|
||||
- filename = os.path.join('txt', filename)
|
||||
- filename = os.path.join(CUR_DIR, 'files', filename)
|
||||
+ filename = os.path.join(CUR_DIR, 'files', self.filename)
|
||||
|
||||
with open(filename, 'r') as fp:
|
||||
return '\n'.join(fp.read().splitlines())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("arch", ARCH_SUPPORTED)
|
||||
-@pytest.mark.parametrize("version", ['7', '8'])
|
||||
-def test_scancpu(monkeypatch, arch, version):
|
||||
-
|
||||
- monkeypatch.setattr('leapp.libraries.actor.scancpu.get_source_major_version', lambda: version)
|
||||
+def test_scancpu(monkeypatch, arch):
|
||||
|
||||
mocked_cpuinfo = mocked_get_cpuinfo('lscpu_' + arch)
|
||||
monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
@@ -106,34 +97,9 @@ def test_scancpu(monkeypatch, arch, version):
|
||||
assert expected == produced
|
||||
|
||||
|
||||
-def test_lscpu_with_empty_field(monkeypatch):
|
||||
-
|
||||
- def mocked_cpuinfo(*args, **kwargs):
|
||||
- return mocked_get_cpuinfo('lscpu_empty_field')(output_json=False)
|
||||
-
|
||||
- monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
- monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- current_actor = CurrentActorMocked()
|
||||
- monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
-
|
||||
- scancpu.process()
|
||||
-
|
||||
- expected = CPUInfo(machine_type=None, flags=['flag'])
|
||||
- produced = api.produce.model_instances[0]
|
||||
-
|
||||
- assert api.produce.called == 1
|
||||
-
|
||||
- assert expected.machine_type == produced.machine_type
|
||||
- assert sorted(expected.flags) == sorted(produced.flags)
|
||||
-
|
||||
-
|
||||
def test_parse_invalid_json(monkeypatch):
|
||||
|
||||
- monkeypatch.setattr('leapp.libraries.actor.scancpu.get_source_major_version', lambda: '8')
|
||||
-
|
||||
- def mocked_cpuinfo(*args, **kwargs):
|
||||
- return mocked_get_cpuinfo('invalid')(output_json=True)
|
||||
-
|
||||
+ mocked_cpuinfo = mocked_get_cpuinfo('invalid')
|
||||
monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
From 44c6b10a1813bfa019fb8ee2ec08a619e325ba08 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:34:37 +0200
|
||||
Subject: [PATCH 45/55] modify_userspace_for_livemode: Remove RHEL7
|
||||
crypto-policies workaround
|
||||
|
||||
---
|
||||
.../libraries/prepareliveimage.py | 13 -------------
|
||||
.../tests/test_livemode_userspace_modifications.py | 2 --
|
||||
2 files changed, 15 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
index 686c4cd6..116c463d 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
@@ -381,19 +381,6 @@ def setup_sshd(context, authorized_keys):
|
||||
error
|
||||
)
|
||||
|
||||
- # @Todo(mhecko): This is hazardous. I guess we are setting this so that we can use weaker SSH keys from RHEL7,
|
||||
- # # but this way we change crypto settings system-wise (could be a problem for FIPS). Instead, we
|
||||
- # # should check whether the keys will be OK on RHEL8, and inform the user otherwise.
|
||||
- if get_target_major_version() == '8': # set to LEGACY for 7>8 only
|
||||
- try:
|
||||
- with context.open('/etc/crypto-policies/config', 'w+') as f:
|
||||
- f.write('LEGACY\n')
|
||||
- except OSError as error:
|
||||
- api.current_logger().warning('Cannot set crypto policy to LEGACY')
|
||||
- details = {'details': 'Failed to set crypto-policies to LEGACY due to the error: {0}'.format(error)}
|
||||
- raise StopActorExecutionError('Failed to set up livemode SSHD', details=details)
|
||||
-
|
||||
-
|
||||
# stolen from upgradeinitramfsgenerator.py
|
||||
def _get_target_kernel_version(context):
|
||||
"""
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
index e890f45a..b046d8c7 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
@@ -296,8 +296,6 @@ def test_setup_sshd(monkeypatch):
|
||||
Action(type_=ActionType.SYMLINK,
|
||||
args=('/usr/lib/systemd/system/sshd.service',
|
||||
'/USERSPACE/etc/systemd/system/multi-user.target.wants/sshd.service')),
|
||||
- Action(type_=ActionType.OPEN, args=('/USERSPACE/etc/crypto-policies/config',)),
|
||||
- Action(type_=ActionType.WRITE, args=('LEGACY\n',)),
|
||||
]
|
||||
|
||||
error = assert_execution_trace_subsumes_other(actual_trace, expected_trace)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
From 4bede4b415f3e561399bf5c4ebed659c1aa4948d Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:37:41 +0200
|
||||
Subject: [PATCH 46/55] modify_userspace_for_livemode: Remove unused code in
|
||||
modify_userspace_for_livemode
|
||||
|
||||
---
|
||||
.../libraries/prepareliveimage.py | 30 +------------------
|
||||
1 file changed, 1 insertion(+), 29 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
index 116c463d..2587bf89 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
@@ -6,7 +6,7 @@ import os.path
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
-from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.libraries.stdlib import api
|
||||
from leapp.models import LiveImagePreparationInfo
|
||||
|
||||
LEAPP_UPGRADE_SERVICE_FILE = 'upgrade.service'
|
||||
@@ -381,34 +381,6 @@ def setup_sshd(context, authorized_keys):
|
||||
error
|
||||
)
|
||||
|
||||
-# stolen from upgradeinitramfsgenerator.py
|
||||
-def _get_target_kernel_version(context):
|
||||
- """
|
||||
- Get the version of the most recent kernel version within the container.
|
||||
- """
|
||||
- try:
|
||||
- results = context.call(['rpm', '-qa', 'kernel-core'], split=True)['stdout']
|
||||
-
|
||||
- except CalledProcessError as error:
|
||||
- problem = 'Could not query the target userspace kernel version through rpm. Full error: {0}'.format(error)
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot get the version of the installed kernel.',
|
||||
- details={'Problem': problem})
|
||||
-
|
||||
- if len(results) > 1:
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot detect the version of the target userspace kernel.',
|
||||
- details={'Problem': 'Detected unexpectedly multiple kernels inside target userspace container.'})
|
||||
- if not results:
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot detect the version of the target userspace kernel.',
|
||||
- details={'Problem': 'An rpm query for the available kernels did not produce any results.'})
|
||||
-
|
||||
- kernel_version = '-'.join(results[0].rsplit("-", 2)[-2:])
|
||||
- api.current_logger().debug('Detected kernel version inside container: {}.'.format(kernel_version))
|
||||
-
|
||||
- return kernel_version
|
||||
-
|
||||
|
||||
def fakerootfs():
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,170 @@
|
||||
From 000c5f6558e788842fbf95d2fdb0014d18285c15 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 15:10:58 +0200
|
||||
Subject: [PATCH 47/55] repositoriesblacklist: Remove the rhel7-optional
|
||||
unsupported PESID
|
||||
|
||||
Update tests to assume 8->9 upgrade path.
|
||||
---
|
||||
.../libraries/repositoriesblacklist.py | 4 +-
|
||||
.../tests/test_repositoriesblacklist.py | 48 ++++++++++---------
|
||||
2 files changed, 27 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py b/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
index e22fbee0..5059f619 100644
|
||||
--- a/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
+++ b/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
@@ -6,7 +6,6 @@ from leapp.models import CustomTargetRepository, RepositoriesBlacklisted, Reposi
|
||||
|
||||
# {OS_MAJOR_VERSION: PESID}
|
||||
UNSUPPORTED_PESIDS = {
|
||||
- "7": "rhel7-optional",
|
||||
"8": "rhel8-CRB",
|
||||
"9": "rhel9-CRB",
|
||||
"10": "rhel10-CRB"
|
||||
@@ -28,9 +27,8 @@ def _report_using_unsupported_repos(repos):
|
||||
|
||||
|
||||
def _report_excluded_repos(repos):
|
||||
- optional_repository_name = 'optional' if get_source_major_version() == '7' else 'CRB'
|
||||
api.current_logger().info(
|
||||
- "The {0} repository is not enabled. Excluding {1} from the upgrade".format(optional_repository_name, repos)
|
||||
+ "The CRB repository is not enabled. Excluding {} from the upgrade".format(repos)
|
||||
)
|
||||
|
||||
report = [
|
||||
diff --git a/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py b/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
index c4f9a36e..945007c6 100644
|
||||
--- a/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
+++ b/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
@@ -20,8 +20,8 @@ from leapp.models import (
|
||||
def repofacts_opts_disabled():
|
||||
repos_data = [
|
||||
RepositoryData(
|
||||
- repoid="rhel-7-server-optional-rpms",
|
||||
- name="RHEL 7 Server",
|
||||
+ repoid="codeready-builder-for-rhel-8-x86_64-rpms",
|
||||
+ name="RHEL 8 CRB",
|
||||
enabled=False,
|
||||
)
|
||||
]
|
||||
@@ -32,11 +32,11 @@ def repofacts_opts_disabled():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def rhel7_optional_pesidrepo():
|
||||
+def rhel8_crb_pesidrepo():
|
||||
return PESIDRepositoryEntry(
|
||||
- pesid='rhel7-optional',
|
||||
- major_version='7',
|
||||
- repoid='rhel-7-server-optional-rpms',
|
||||
+ pesid='rhel8-CRB',
|
||||
+ major_version='8',
|
||||
+ repoid='codeready-builder-for-rhel-8-x86_64-rpms',
|
||||
rhui='',
|
||||
arch='x86_64',
|
||||
channel='ga',
|
||||
@@ -46,11 +46,11 @@ def rhel7_optional_pesidrepo():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def rhel8_crb_pesidrepo():
|
||||
+def rhel9_crb_pesidrepo():
|
||||
return PESIDRepositoryEntry(
|
||||
- pesid='rhel8-CRB',
|
||||
- major_version='8',
|
||||
- repoid='codeready-builder-for-rhel-8-x86_64-rpms',
|
||||
+ pesid='rhel9-CRB',
|
||||
+ major_version='9',
|
||||
+ repoid='codeready-builder-for-rhel-9-x86_64-rpms',
|
||||
rhui='',
|
||||
arch='x86_64',
|
||||
channel='ga',
|
||||
@@ -60,10 +60,10 @@ def rhel8_crb_pesidrepo():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def repomap_opts_only(rhel7_optional_pesidrepo, rhel8_crb_pesidrepo):
|
||||
+def repomap_opts_only(rhel8_crb_pesidrepo, rhel9_crb_pesidrepo):
|
||||
return RepositoriesMapping(
|
||||
- mapping=[RepoMapEntry(source='rhel7-optional', target=['rhel8-CRB'])],
|
||||
- repositories=[rhel7_optional_pesidrepo, rhel8_crb_pesidrepo]
|
||||
+ mapping=[RepoMapEntry(source='rhel8-CRB', target=['rhel9-CRB'])],
|
||||
+ repositories=[rhel8_crb_pesidrepo, rhel9_crb_pesidrepo]
|
||||
)
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ def test_all_target_optionals_blacklisted_when_no_optional_on_source(monkeypatch
|
||||
|
||||
repos_data = [
|
||||
RepositoryData(
|
||||
- repoid="rhel-7-server-rpms",
|
||||
- name="RHEL 7 Server",
|
||||
+ repoid="rhel-8-server-rpms",
|
||||
+ name="RHEL 8 Server",
|
||||
enabled=True,
|
||||
)
|
||||
]
|
||||
@@ -92,7 +92,7 @@ def test_all_target_optionals_blacklisted_when_no_optional_on_source(monkeypatch
|
||||
repositoriesblacklist.process()
|
||||
|
||||
assert api.produce.called
|
||||
- assert 'codeready-builder-for-rhel-8-x86_64-rpms' in api.produce.model_instances[0].repoids
|
||||
+ assert 'codeready-builder-for-rhel-9-x86_64-rpms' in api.produce.model_instances[0].repoids
|
||||
|
||||
|
||||
def test_with_no_mapping_for_optional_repos(monkeypatch, repomap_opts_only, repofacts_opts_disabled):
|
||||
@@ -115,7 +115,11 @@ def test_blacklist_produced_when_optional_repo_disabled(monkeypatch, repofacts_o
|
||||
Tests whether a correct blacklist is generated when there is disabled optional repo on the system.
|
||||
"""
|
||||
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[repofacts_opts_disabled, repomap_opts_only]))
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "current_actor",
|
||||
+ CurrentActorMocked(msgs=[repofacts_opts_disabled, repomap_opts_only]),
|
||||
+ )
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
monkeypatch.setattr(reporting, "create_report", produce_mocked())
|
||||
|
||||
@@ -123,7 +127,7 @@ def test_blacklist_produced_when_optional_repo_disabled(monkeypatch, repofacts_o
|
||||
|
||||
assert api.produce.model_instances, 'A blacklist should get generated.'
|
||||
|
||||
- expected_blacklisted_repoid = 'codeready-builder-for-rhel-8-x86_64-rpms'
|
||||
+ expected_blacklisted_repoid = 'codeready-builder-for-rhel-9-x86_64-rpms'
|
||||
err_msg = 'Blacklist does not contain expected repoid.'
|
||||
assert expected_blacklisted_repoid in api.produce.model_instances[0].repoids, err_msg
|
||||
|
||||
@@ -166,8 +170,8 @@ def test_repositoriesblacklist_not_empty(monkeypatch, repofacts_opts_disabled, r
|
||||
|
||||
def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repomap_opts_only):
|
||||
"""
|
||||
- Tests whether nothing is produced if there are some disabled optional repos, but an empty blacklist is determined
|
||||
- from the repo mapping data.
|
||||
+ Tests whether nothing is produced if there are some disabled optional
|
||||
+ repos, but an empty blacklist is determined from the repo mapping data.
|
||||
"""
|
||||
|
||||
msgs_to_feed = [repofacts_opts_disabled, repomap_opts_only]
|
||||
@@ -177,7 +181,7 @@ def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repom
|
||||
repositoriesblacklist,
|
||||
"_get_repoids_to_exclude",
|
||||
lambda dummy_mapping: set()
|
||||
- ) # pylint:disable=W0108
|
||||
+ )
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
|
||||
repositoriesblacklist.process()
|
||||
@@ -187,7 +191,7 @@ def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repom
|
||||
@pytest.mark.parametrize(
|
||||
("enabled_repo", "exp_report_title", "message_produced"),
|
||||
[
|
||||
- ("codeready-builder-for-rhel-8-x86_64-rpms", "Using repository not supported by Red Hat", False),
|
||||
+ ("codeready-builder-for-rhel-9-x86_64-rpms", "Using repository not supported by Red Hat", False),
|
||||
("some_other_enabled_repo", "Excluded target system repositories", True),
|
||||
(None, "Excluded target system repositories", True),
|
||||
],
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,209 @@
|
||||
From 0a203330cee4fba6a28c65f1c6e0e450cc45771e Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Thu, 30 Oct 2025 11:52:39 +0100
|
||||
Subject: [PATCH 48/55] mount_unit_gen: bind mount /sysroot/boot to /boot
|
||||
|
||||
Our changes towards using systemd-fstab-generator in the upgrade
|
||||
initramfs caused that we are mounting almost all partitions, including
|
||||
/boot (the actual mount target is /sysroot/boot) early in the boot
|
||||
process. When upgrading with FIPS, the dracut fips module tries to mount
|
||||
the device where the boot partition resides to check the integrity of
|
||||
the kernel, however, it fails as the boot block device is already
|
||||
mounted by us. This patch therefore introduces a static unit that
|
||||
bind-mounts What=/sysroot/boot to Where=/boot, making the contents of
|
||||
/boot available to the fips module. The bind-mounting service is
|
||||
introduced only if the source system has /boot on a separate partition.
|
||||
This is determined by checking whether anything shuld be mounted at
|
||||
/boot according to fstab.
|
||||
|
||||
Jira-ref: RHEL-123886
|
||||
---
|
||||
.../initramfs/mount_units_generator/actor.py | 3 +-
|
||||
.../files/bundled_units/boot.mount | 11 ++++
|
||||
.../libraries/mount_unit_generator.py | 38 ++++++++++-
|
||||
.../tests/test_mount_unit_generation.py | 63 ++++++++++++++++++-
|
||||
4 files changed, 111 insertions(+), 4 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
index dd667513..23c618b6 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -1,6 +1,6 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
-from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ class MountUnitGenerator(Actor):
|
||||
consumes = (
|
||||
LiveModeConfig,
|
||||
TargetUserSpaceInfo,
|
||||
+ StorageInfo,
|
||||
)
|
||||
produces = (
|
||||
UpgradeInitramfsTasks,
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
new file mode 100644
|
||||
index 00000000..869c5e4c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
@@ -0,0 +1,11 @@
|
||||
+[Unit]
|
||||
+DefaultDependencies=no
|
||||
+Before=local-fs.target
|
||||
+After=sysroot-boot.target
|
||||
+Requires=sysroot-boot.target
|
||||
+
|
||||
+[Mount]
|
||||
+What=/sysroot/boot
|
||||
+Where=/boot
|
||||
+Type=none
|
||||
+Options=bind
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
index 943bddd4..e3070986 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -5,7 +5,9 @@ import tempfile
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+BIND_MOUNT_SYSROOT_BOOT_UNIT = 'boot.mount'
|
||||
|
||||
|
||||
def run_systemd_fstab_generator(output_directory):
|
||||
@@ -294,6 +296,39 @@ def request_units_inclusion_in_initramfs(files_to_include):
|
||||
api.produce(tasks)
|
||||
|
||||
|
||||
+def does_system_have_separate_boot_partition():
|
||||
+ storage_info = next(api.consume(StorageInfo), None)
|
||||
+ if not storage_info:
|
||||
+ err_msg = 'Actor did not receive required information about system storage (StorageInfo)'
|
||||
+ raise StopActorExecutionError(err_msg)
|
||||
+
|
||||
+ for fstab_entry in storage_info.fstab:
|
||||
+ if fstab_entry.fs_file == '/boot':
|
||||
+ return True
|
||||
+
|
||||
+ return False
|
||||
+
|
||||
+
|
||||
+def inject_bundled_units(workspace):
|
||||
+ """
|
||||
+ Copy static units that are bundled within this actor into the workspace.
|
||||
+ """
|
||||
+ bundled_units_dir = api.get_actor_folder_path('bundled_units')
|
||||
+ for unit in os.listdir(bundled_units_dir):
|
||||
+ if unit == BIND_MOUNT_SYSROOT_BOOT_UNIT:
|
||||
+ has_separate_boot = does_system_have_separate_boot_partition()
|
||||
+ if not has_separate_boot:
|
||||
+ # We perform bind-mounting because of dracut's fips module.
|
||||
+ # When /boot is not a separate partition, we don't need to bind mount it --
|
||||
+ # the fips module itself will create a symlink.
|
||||
+ continue
|
||||
+
|
||||
+ unit_path = os.path.join(bundled_units_dir, unit)
|
||||
+ unit_dst = os.path.join(workspace, unit)
|
||||
+ api.current_logger().debug('Copying static unit bundled within leapp {} to {}'.format(unit, unit_dst))
|
||||
+ shutil.copyfile(unit_path, unit_dst)
|
||||
+
|
||||
+
|
||||
def setup_storage_initialization():
|
||||
livemode_config = next(api.consume(LiveModeConfig), None)
|
||||
if livemode_config and livemode_config.is_enabled:
|
||||
@@ -306,6 +341,7 @@ def setup_storage_initialization():
|
||||
run_systemd_fstab_generator(workspace_path)
|
||||
remove_units_for_targets_that_are_already_mounted_by_dracut(workspace_path)
|
||||
prefix_all_mount_units_with_sysroot(workspace_path)
|
||||
+ inject_bundled_units(workspace_path)
|
||||
fix_symlinks_in_targets(workspace_path)
|
||||
mount_unit_files = copy_units_into_system_location(upgrade_container_ctx, workspace_path)
|
||||
request_units_inclusion_in_initramfs(mount_unit_files)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index 8849ada9..eb90a75d 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -5,9 +5,9 @@ import pytest
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.actor import mount_unit_generator
|
||||
-from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked
|
||||
from leapp.libraries.stdlib import api, CalledProcessError
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import FstabEntry, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
|
||||
|
||||
def test_run_systemd_fstab_generator_successful_generation(monkeypatch):
|
||||
@@ -267,3 +267,62 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
]
|
||||
assert sorted(files) == sorted(expected_files)
|
||||
assert mount_unit_generator._delete_file.removal_called
|
||||
+
|
||||
+
|
||||
+class CurrentActorMockedWithActorFolder(CurrentActorMocked):
|
||||
+ def __init__(self, actor_folder_path, *args, **kwargs):
|
||||
+ self.actor_folder_path = actor_folder_path
|
||||
+ super().__init__(*args, **kwargs)
|
||||
+
|
||||
+ def get_actor_folder_path(self, subfolder):
|
||||
+ return os.path.join(self.actor_folder_path, subfolder)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('has_separate_boot', (True, False))
|
||||
+def test_injection_of_sysroot_boot_bindmount_unit(monkeypatch, has_separate_boot):
|
||||
+ fstab_entries = [
|
||||
+ FstabEntry(fs_spec='UUID=123', fs_file='/root', fs_vfstype='xfs',
|
||||
+ fs_mntops='defaults', fs_freq='0', fs_passno='0')
|
||||
+ ]
|
||||
+
|
||||
+ if has_separate_boot:
|
||||
+ boot_fstab_entry = FstabEntry(fs_spec='UUID=123', fs_file='/root', fs_vfstype='xfs',
|
||||
+ fs_mntops='defaults', fs_freq='0', fs_passno='0')
|
||||
+ fstab_entries.append(boot_fstab_entry)
|
||||
+
|
||||
+ storage_info = StorageInfo(fstab=fstab_entries)
|
||||
+
|
||||
+ actor_mock = CurrentActorMockedWithActorFolder(actor_folder_path='/actor', msgs=[storage_info])
|
||||
+ monkeypatch.setattr(api, 'current_actor', actor_mock)
|
||||
+
|
||||
+ workspace_path = '/workspace'
|
||||
+ was_copyfile_for_sysroot_boot_called = False
|
||||
+
|
||||
+ def copyfile_mocked(source, dest, *args, **kwargs):
|
||||
+ if not os.path.basename(source) == mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT:
|
||||
+ return
|
||||
+
|
||||
+ assert has_separate_boot
|
||||
+ assert dest == os.path.join(workspace_path, mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT)
|
||||
+
|
||||
+ nonlocal was_copyfile_for_sysroot_boot_called
|
||||
+ was_copyfile_for_sysroot_boot_called = True
|
||||
+
|
||||
+ monkeypatch.setattr(shutil, 'copyfile', copyfile_mocked)
|
||||
+
|
||||
+ def listdir_mocked(path):
|
||||
+ assert path == actor_mock.get_actor_folder_path('bundled_units')
|
||||
+ return [
|
||||
+ mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT,
|
||||
+ 'other.mount'
|
||||
+ ]
|
||||
+
|
||||
+ monkeypatch.setattr(os, 'listdir', listdir_mocked)
|
||||
+ monkeypatch.setattr(mount_unit_generator,
|
||||
+ 'does_system_have_separate_boot_partition',
|
||||
+ lambda: has_separate_boot)
|
||||
+
|
||||
+ mount_unit_generator.inject_bundled_units(workspace_path)
|
||||
+
|
||||
+ if has_separate_boot:
|
||||
+ assert was_copyfile_for_sysroot_boot_called
|
||||
--
|
||||
2.51.1
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user