Compare commits
No commits in common. "c8" and "c8s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,2 +1,5 @@
|
||||
SOURCES/deps-pkgs-13.tar.gz
|
||||
SOURCES/leapp-repository-0.24.0.tar.gz
|
||||
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
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
3590b33b4a79ebe62f5cfa0eeca7efb41d526498 SOURCES/deps-pkgs-13.tar.gz
|
||||
2271b92541564ebd07a038a8b45e5a33d5f8b9c9 SOURCES/leapp-repository-0.24.0.tar.gz
|
||||
251
0001-rhui-do-not-bootstrap-target-client-on-aws.patch
Normal file
251
0001-rhui-do-not-bootstrap-target-client-on-aws.patch
Normal file
@ -0,0 +1,251 @@
|
||||
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
|
||||
|
||||
830
0002-Packit-Drop-tests-for-obsoleted-upgrade-paths-restru.patch
Normal file
830
0002-Packit-Drop-tests-for-obsoleted-upgrade-paths-restru.patch
Normal file
@ -0,0 +1,830 @@
|
||||
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
|
||||
|
||||
25
0003-silence-use-yield-from-from-pylint-3.1.patch
Normal file
25
0003-silence-use-yield-from-from-pylint-3.1.patch
Normal file
@ -0,0 +1,25 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
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
|
||||
|
||||
624
0005-Fix-incorrect-parsing-of-lscpu-output.patch
Normal file
624
0005-Fix-incorrect-parsing-of-lscpu-output.patch
Normal file
@ -0,0 +1,624 @@
|
||||
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
|
||||
|
||||
254
0006-Add-unit-tests-for-actor-udevamdinfo.patch
Normal file
254
0006-Add-unit-tests-for-actor-udevamdinfo.patch
Normal file
@ -0,0 +1,254 @@
|
||||
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
|
||||
|
||||
166
0007-Add-unit-tests-for-scansourcefiles-actor-1190.patch
Normal file
166
0007-Add-unit-tests-for-scansourcefiles-actor-1190.patch
Normal file
@ -0,0 +1,166 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
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
|
||||
|
||||
176
0011-check_grub_legacy-inhibit-when-GRUB-legacy-is-presen.patch
Normal file
176
0011-check_grub_legacy-inhibit-when-GRUB-legacy-is-presen.patch
Normal file
@ -0,0 +1,176 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
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
|
||||
|
||||
39
0013-Enhance-grub2-install-failure-message.patch
Normal file
39
0013-Enhance-grub2-install-failure-message.patch
Normal file
@ -0,0 +1,39 @@
|
||||
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
|
||||
|
||||
388
0014-boot-check-first-partition-offset-on-GRUB-devices.patch
Normal file
388
0014-boot-check-first-partition-offset-on-GRUB-devices.patch
Normal file
@ -0,0 +1,388 @@
|
||||
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
|
||||
|
||||
138
0015-boot-Skip-checks-of-first-partition-offset-for-for-g.patch
Normal file
138
0015-boot-Skip-checks-of-first-partition-offset-for-for-g.patch
Normal file
@ -0,0 +1,138 @@
|
||||
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
|
||||
|
||||
152
0016-repomapping-Add-RHEL7-ELS-repos.patch
Normal file
152
0016-repomapping-Add-RHEL7-ELS-repos.patch
Normal file
@ -0,0 +1,152 @@
|
||||
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
|
||||
|
||||
25
0017-bump-required-repomap-version.patch
Normal file
25
0017-bump-required-repomap-version.patch
Normal file
@ -0,0 +1,25 @@
|
||||
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
|
||||
|
||||
24
0018-fixup-bump-required-repomap-version.patch
Normal file
24
0018-fixup-bump-required-repomap-version.patch
Normal file
@ -0,0 +1,24 @@
|
||||
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
|
||||
|
||||
33
0019-Fix-incorrect-command-formulation.patch
Normal file
33
0019-Fix-incorrect-command-formulation.patch
Normal file
@ -0,0 +1,33 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
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
|
||||
|
||||
47
0021-Update-packit-config-after-tier-redefinition.patch
Normal file
47
0021-Update-packit-config-after-tier-redefinition.patch
Normal file
@ -0,0 +1,47 @@
|
||||
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
|
||||
|
||||
34
0022-Update-reboot-msg-Note-the-console-access.patch
Normal file
34
0022-Update-reboot-msg-Note-the-console-access.patch
Normal file
@ -0,0 +1,34 @@
|
||||
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
|
||||
|
||||
435
0023-Fix-kernel-cmdline-args-we-add-not-being-propogated-.patch
Normal file
435
0023-Fix-kernel-cmdline-args-we-add-not-being-propogated-.patch
Normal file
@ -0,0 +1,435 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
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
|
||||
|
||||
3332
0025-Data-Update-DDDD.json-fixed-incorrect-data-add-craft.patch
Normal file
3332
0025-Data-Update-DDDD.json-fixed-incorrect-data-add-craft.patch
Normal file
File diff suppressed because it is too large
Load Diff
143062
0026-Data-Update-PES-data-to-cover-up-to-date-changes.patch
Normal file
143062
0026-Data-Update-PES-data-to-cover-up-to-date-changes.patch
Normal file
File diff suppressed because it is too large
Load Diff
110
0027-Move-common-Satellite-Upgrade-code-to-common.patch
Normal file
110
0027-Move-common-Satellite-Upgrade-code-to-common.patch
Normal file
@ -0,0 +1,110 @@
|
||||
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
|
||||
|
||||
252
0028-Add-el8toel9-upgrade-facts-for-Satellite.patch
Normal file
252
0028-Add-el8toel9-upgrade-facts-for-Satellite.patch
Normal file
@ -0,0 +1,252 @@
|
||||
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
|
||||
|
||||
112
0029-Refresh-collation-version-if-pulp-ansible-is-present.patch
Normal file
112
0029-Refresh-collation-version-if-pulp-ansible-is-present.patch
Normal file
@ -0,0 +1,112 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,90 @@
|
||||
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
|
||||
|
||||
144
0031-mount-usr-Implement-try-sleep-loop-add-time-for-stor.patch
Normal file
144
0031-mount-usr-Implement-try-sleep-loop-add-time-for-stor.patch
Normal file
@ -0,0 +1,144 @@
|
||||
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
|
||||
|
||||
374
0032-Add-additional-KB-resources.patch
Normal file
374
0032-Add-additional-KB-resources.patch
Normal file
@ -0,0 +1,374 @@
|
||||
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
|
||||
|
||||
43
0033-storage-initialisation-apply-sleep-always.patch
Normal file
43
0033-storage-initialisation-apply-sleep-always.patch
Normal file
@ -0,0 +1,43 @@
|
||||
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
|
||||
|
||||
30
0034-Add-renovate-to-track-github-actions-deps.patch
Normal file
30
0034-Add-renovate-to-track-github-actions-deps.patch
Normal file
@ -0,0 +1,30 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
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
|
||||
|
||||
76
0036-chore-deps-update-actions-checkout-action-to-v4.patch
Normal file
76
0036-chore-deps-update-actions-checkout-action-to-v4.patch
Normal file
@ -0,0 +1,76 @@
|
||||
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
|
||||
|
||||
25
0037-chore-deps-update-dependency-ubuntu-to-v22.patch
Normal file
25
0037-chore-deps-update-dependency-ubuntu-to-v22.patch
Normal file
@ -0,0 +1,25 @@
|
||||
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
|
||||
|
||||
119
0038-Fix-E0606-errors-reported-by-pylint.patch
Normal file
119
0038-Fix-E0606-errors-reported-by-pylint.patch
Normal file
@ -0,0 +1,119 @@
|
||||
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
|
||||
|
||||
78
0039-Fix-W0135-reported-by-pylint.patch
Normal file
78
0039-Fix-W0135-reported-by-pylint.patch
Normal file
@ -0,0 +1,78 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
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
|
||||
|
||||
56
0041-properly-indent-the-list-of-supported-OSes.patch
Normal file
56
0041-properly-indent-the-list-of-supported-OSes.patch
Normal file
@ -0,0 +1,56 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
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
|
||||
|
||||
25
0043-Fix-typo-in-.packit.yaml.patch
Normal file
25
0043-Fix-typo-in-.packit.yaml.patch
Normal file
@ -0,0 +1,25 @@
|
||||
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
|
||||
|
||||
55
0044-drop-unused-packager-field-from-distro-metadata.patch
Normal file
55
0044-drop-unused-packager-field-from-distro-metadata.patch
Normal file
@ -0,0 +1,55 @@
|
||||
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
|
||||
|
||||
39
0045-Add-environment-information-to-leappdb.patch
Normal file
39
0045-Add-environment-information-to-leappdb.patch
Normal file
@ -0,0 +1,39 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
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
|
||||
|
||||
69
0047-fix-some-typos-spotted-by-codespell.patch
Normal file
69
0047-fix-some-typos-spotted-by-codespell.patch
Normal file
@ -0,0 +1,69 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
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
|
||||
|
||||
373
0049-Add-product-certs-and-target-for-9.5.patch
Normal file
373
0049-Add-product-certs-and-target-for-9.5.patch
Normal file
@ -0,0 +1,373 @@
|
||||
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
|
||||
|
||||
@ -1,112 +0,0 @@
|
||||
From 34aeae1e023e61345a1bb020b42231a79a0be4a8 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 26 Feb 2026 17:52:23 +0100
|
||||
Subject: [PATCH 01/44] Remove legacy overlay solution leftovers
|
||||
|
||||
The solution was removed in 93429, however there are some leftovers.
|
||||
---
|
||||
.../libraries/userspacegen.py | 19 -------------------
|
||||
.../common/libraries/dnfplugin.py | 15 ++++-----------
|
||||
.../common/libraries/overlaygen.py | 6 ------
|
||||
3 files changed, 4 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 66843645..7dbadae2 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -178,26 +178,7 @@ def _import_gpg_keys(context, install_root_dir, target_major_version):
|
||||
)
|
||||
|
||||
|
||||
-def _handle_transaction_err_msg_size_old(err):
|
||||
- # NOTE(pstodulk): This is going to be removed in future!
|
||||
-
|
||||
- article_section = 'Generic case'
|
||||
- xfs_info = next(api.consume(XFSPresence), XFSPresence())
|
||||
- if xfs_info.present and xfs_info.without_ftype:
|
||||
- article_section = 'XFS ftype=0 case'
|
||||
-
|
||||
- message = ('There is not enough space on the file system hosting /var/lib/leapp directory '
|
||||
- 'to extract the packages.')
|
||||
- details = {'hint': "Please follow the instructions in the '{}' section of the article at: "
|
||||
- "link: https://access.redhat.com/solutions/5057391".format(article_section)}
|
||||
-
|
||||
- raise StopActorExecutionError(message=message, details=details)
|
||||
-
|
||||
-
|
||||
def _handle_transaction_err_msg_size(err):
|
||||
- if get_env('LEAPP_OVL_LEGACY', '0') == '1':
|
||||
- _handle_transaction_err_msg_size_old(err)
|
||||
- return # not needed actually as the above function raises error, but for visibility
|
||||
NO_SPACE_STR = 'more space needed on the'
|
||||
|
||||
# Disk Requirements:
|
||||
diff --git a/repos/system_upgrade/common/libraries/dnfplugin.py b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
index d50dbbce..b91bcbe7 100644
|
||||
--- a/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
+++ b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
@@ -7,7 +7,6 @@ import shutil
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import dnfconfig, guards, mounting, overlaygen, rhsm, utils
|
||||
-from leapp.libraries.common.config import get_env
|
||||
from leapp.libraries.common.config.version import get_target_major_version, get_target_version
|
||||
from leapp.libraries.common.gpg import is_nogpgcheck_set
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, config
|
||||
@@ -166,16 +165,10 @@ def _handle_transaction_err_msg_old(stage, xfs_info, err):
|
||||
raise StopActorExecutionError(message=message, details=details)
|
||||
|
||||
|
||||
-def _handle_transaction_err_msg(stage, xfs_info, err, is_container=False):
|
||||
- # ignore the fallback when the error is related to the container issue
|
||||
- # e.g. installation of packages inside the container; so it's unrelated
|
||||
- # to the upgrade transactions.
|
||||
- if get_env('LEAPP_OVL_LEGACY', '0') == '1' and not is_container:
|
||||
- _handle_transaction_err_msg_old(stage, xfs_info, err)
|
||||
- return # not needed actually as the above function raises error, but for visibility
|
||||
+def _handle_transaction_err_msg(err, is_container=False):
|
||||
NO_SPACE_STR = 'more space needed on the'
|
||||
- message = 'DNF execution failed with non zero exit code.'
|
||||
if NO_SPACE_STR not in err.stderr:
|
||||
+ message = 'DNF execution failed with non zero exit code.'
|
||||
# if there was a problem reaching repos and proxy is configured in DNF/YUM configs, the
|
||||
# proxy is likely the problem.
|
||||
# NOTE(mmatuska): We can't consistently detect there was a problem reaching some repos,
|
||||
@@ -308,7 +301,7 @@ def _transaction(context, stage, target_repoids, tasks, plugin_info, xfs_info,
|
||||
)
|
||||
except CalledProcessError as e:
|
||||
api.current_logger().error('Cannot calculate, check, test, or perform the upgrade transaction.')
|
||||
- _handle_transaction_err_msg(stage, xfs_info, e, is_container=False)
|
||||
+ _handle_transaction_err_msg(e, is_container=False)
|
||||
finally:
|
||||
if stage == 'check':
|
||||
backup_debug_data(context=context)
|
||||
@@ -384,7 +377,7 @@ def install_initramdisk_requirements(packages, target_userspace_info, used_repos
|
||||
api.current_logger().error(
|
||||
'Cannot install packages in the target container required to build the upgrade initramfs.'
|
||||
)
|
||||
- _handle_transaction_err_msg('', None, e, is_container=True)
|
||||
+ _handle_transaction_err_msg(e, is_container=True)
|
||||
|
||||
|
||||
def perform_transaction_install(target_userspace_info, storage_info, used_repos, tasks, plugin_info, xfs_info):
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index f0d0ba1d..3091ab5b 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -594,12 +594,6 @@ def create_source_overlay(
|
||||
in the OVERLAY_DO_NOT_MOUNT set. Such prepared OVL images are then composed
|
||||
together to reflect the real host filesystem. In the end everything is cleaned.
|
||||
|
||||
- The new solution can be now problematic for system with too many partitions
|
||||
- and loop devices. For such systems we keep for now the possibility of the
|
||||
- fallback to an old solution, which has however number of issues that are
|
||||
- fixed by the new design. To fallback to the old solution, set envar:
|
||||
- LEAPP_OVL_LEGACY=1
|
||||
-
|
||||
Disk images created for OVL are formatted with XFS by default. In case of
|
||||
problems, it's possible to switch to Ext4 FS using:
|
||||
LEAPP_OVL_IMG_FS_EXT4=1
|
||||
--
|
||||
2.53.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,106 +0,0 @@
|
||||
From b96c610bb27ab5f7ef1ad65a1a763ed2d31b6816 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Tue, 17 Feb 2026 10:23:18 +0100
|
||||
Subject: [PATCH 03/44] Enable logrotate.timer during 8to9 IPU
|
||||
|
||||
On el8 logrotate uses cron, on el9 a systemd timer is used. This is not
|
||||
automatically migrated during an IPU, this patch adds a actor that
|
||||
does so.
|
||||
|
||||
Jira: RHEL-17361
|
||||
---
|
||||
.../actors/enablelogrotatetimer/actor.py | 22 +++++++++++++
|
||||
.../libraries/enablelogrotatetimer.py | 13 ++++++++
|
||||
.../tests/test_enablelogrotatetimer.py | 31 +++++++++++++++++++
|
||||
3 files changed, 66 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/actor.py
|
||||
create mode 100644 repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/libraries/enablelogrotatetimer.py
|
||||
create mode 100644 repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/tests/test_enablelogrotatetimer.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/actor.py b/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..bc3c7ec3
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/actor.py
|
||||
@@ -0,0 +1,22 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import enablelogrotatetimer
|
||||
+from leapp.models import SystemdServicesInfoTarget, SystemdServicesTasks
|
||||
+from leapp.tags import FinalizationPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class EnableLogrotateTimer(Actor):
|
||||
+ """
|
||||
+ Enable logrotate.timer on the target system after upgrade
|
||||
+
|
||||
+ The logrotate.timer systemd timer unit replaces the traditional cron-based
|
||||
+ logrotate execution used in RHEL 8. This actor ensures the timer is enabled
|
||||
+ after the in-place upgrade is complete.
|
||||
+ """
|
||||
+
|
||||
+ name = 'enable_logrotate_timer'
|
||||
+ consumes = (SystemdServicesInfoTarget,)
|
||||
+ produces = (SystemdServicesTasks,)
|
||||
+ tags = (FinalizationPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ enablelogrotatetimer.process()
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/libraries/enablelogrotatetimer.py b/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/libraries/enablelogrotatetimer.py
|
||||
new file mode 100644
|
||||
index 00000000..c9783ae9
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/libraries/enablelogrotatetimer.py
|
||||
@@ -0,0 +1,13 @@
|
||||
+from leapp.libraries.common.systemd import enable_unit
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+
|
||||
+LOGROTATE_TIMER = 'logrotate.timer'
|
||||
+
|
||||
+
|
||||
+def process():
|
||||
+ try:
|
||||
+ enable_unit(LOGROTATE_TIMER)
|
||||
+ except CalledProcessError as e:
|
||||
+ api.current_logger().error(
|
||||
+ "Failed to enable {}: {}".format(LOGROTATE_TIMER, e)
|
||||
+ )
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/tests/test_enablelogrotatetimer.py b/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/tests/test_enablelogrotatetimer.py
|
||||
new file mode 100644
|
||||
index 00000000..f366bd6a
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/enablelogrotatetimer/tests/test_enablelogrotatetimer.py
|
||||
@@ -0,0 +1,31 @@
|
||||
+from leapp.libraries.actor import enablelogrotatetimer
|
||||
+from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+
|
||||
+
|
||||
+def test_success(monkeypatch):
|
||||
+
|
||||
+ def mock_enable_unit(unit):
|
||||
+ assert unit == 'logrotate.timer'
|
||||
+
|
||||
+ monkeypatch.setattr(enablelogrotatetimer, "enable_unit", mock_enable_unit)
|
||||
+ enablelogrotatetimer.process()
|
||||
+
|
||||
+
|
||||
+def test_failed_to_enable(monkeypatch):
|
||||
+
|
||||
+ def mock_enable_unit(unit):
|
||||
+ assert unit == 'logrotate.timer'
|
||||
+ raise CalledProcessError(
|
||||
+ "Failed to enable logrotate.titmer",
|
||||
+ ["systemctl", "enable", "logrotate.timer"],
|
||||
+ {
|
||||
+ "exit_code": 1,
|
||||
+ "stderr": "err",
|
||||
+ },
|
||||
+ )
|
||||
+
|
||||
+ monkeypatch.setattr(enablelogrotatetimer, "enable_unit", mock_enable_unit)
|
||||
+ monkeypatch.setattr(api, "current_logger", logger_mocked())
|
||||
+ enablelogrotatetimer.process()
|
||||
+ assert "Failed to enable logrotate.timer" in api.current_logger.errmsg[0]
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
From 0e0db2860587d57193a52135ae88df8917d70538 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 11 Feb 2026 16:51:41 +0100
|
||||
Subject: [PATCH 04/44] feat(net-naming-scheme): enable by default on CS 9to10
|
||||
|
||||
This was done for RHEL 9to10 in
|
||||
91f37a3913c1608b24c9aa583ac3b13a08aace71.
|
||||
|
||||
Jira: RHEL-148291
|
||||
---
|
||||
.../libraries/emit_net_naming.py | 10 ++++------
|
||||
.../tests/test_emit_net_naming_scheme.py | 9 ++-------
|
||||
2 files changed, 6 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/emit_net_naming_scheme/libraries/emit_net_naming.py b/repos/system_upgrade/common/actors/emit_net_naming_scheme/libraries/emit_net_naming.py
|
||||
index 7b112ff0..ef2c0b79 100644
|
||||
--- a/repos/system_upgrade/common/actors/emit_net_naming_scheme/libraries/emit_net_naming.py
|
||||
+++ b/repos/system_upgrade/common/actors/emit_net_naming_scheme/libraries/emit_net_naming.py
|
||||
@@ -1,5 +1,5 @@
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
-from leapp.libraries.common.config import get_env, get_target_distro_id, version
|
||||
+from leapp.libraries.common.config import get_env, version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
KernelCmdline,
|
||||
@@ -49,11 +49,9 @@ def is_net_scheme_compatible_with_current_cmdline():
|
||||
def emit_msgs_to_use_net_naming_schemes():
|
||||
is_feature_enabled = get_env('LEAPP_DISABLE_NET_NAMING_SCHEMES', '0') != '1'
|
||||
|
||||
- is_net_naming_available = version.get_target_major_version() == "9" or (
|
||||
- version.matches_target_version(">= 10.2")
|
||||
- # TODO the net-naming-sysattrs pkg is not yet available on CS10, remove
|
||||
- # this when it becomes
|
||||
- and not get_target_distro_id() == "centos"
|
||||
+ is_net_naming_available = (
|
||||
+ version.get_target_major_version() == "9"
|
||||
+ or version.matches_target_version(">= 10.2")
|
||||
)
|
||||
|
||||
if not (is_feature_enabled and is_net_naming_available):
|
||||
diff --git a/repos/system_upgrade/common/actors/emit_net_naming_scheme/tests/test_emit_net_naming_scheme.py b/repos/system_upgrade/common/actors/emit_net_naming_scheme/tests/test_emit_net_naming_scheme.py
|
||||
index 9c1f91bb..d8eef404 100644
|
||||
--- a/repos/system_upgrade/common/actors/emit_net_naming_scheme/tests/test_emit_net_naming_scheme.py
|
||||
+++ b/repos/system_upgrade/common/actors/emit_net_naming_scheme/tests/test_emit_net_naming_scheme.py
|
||||
@@ -95,13 +95,8 @@ def test_emit_msgs_to_use_net_naming_schemes(
|
||||
pkg_name = emit_net_naming_lib.NET_NAMING_SYSATTRS_RPM_NAME[target_major]
|
||||
produced_messages = api.produce.model_instances
|
||||
|
||||
- if (
|
||||
- is_net_scheme_enabled
|
||||
- # the package is available since 10.2
|
||||
- and target_ver != "10.0"
|
||||
- # TODO not yet available in CS 10, remove this when it is
|
||||
- and not (target_distro == "centos" and target_major == "10")
|
||||
- ):
|
||||
+ # the package is available since 10.2
|
||||
+ if is_net_scheme_enabled and target_ver != "10.0":
|
||||
userspace_tasks = ensure_one_msg_of_type_produced(produced_messages, TargetUserSpaceUpgradeTasks)
|
||||
assert userspace_tasks.install_rpms == [pkg_name]
|
||||
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From 26e4ca841b23907eda2de78288183285e6b54b1f Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 3 Mar 2026 13:56:26 +0100
|
||||
Subject: [PATCH 05/44] Leapp_resume.service: Silence AVC SELinux warnings
|
||||
|
||||
Wrap the ExecStart command in `/bin/sh -c` to avoid SELinux AVC denials.
|
||||
|
||||
The leapp_resume.service unit is inherently "malformed" from SELinux's
|
||||
perspective: it directly executes /root/tmp_leapp_py3/leapp3, which is
|
||||
labeled admin_home_t. When the system boots in Permissive mode (as it
|
||||
does during the upgrade), SELinux logs AVC denials for this access
|
||||
rather than blocking it. These AVCs are expected but noisy and
|
||||
confusing.
|
||||
|
||||
By invoking the command through /bin/sh -c, the execution context is
|
||||
evaluated against /bin/sh (which carries a proper shell_exec_t label),
|
||||
avoiding the admin_home_t AVC altogether.
|
||||
|
||||
It is also confirmed with SELinux team that this issue could be
|
||||
solved with also following solution (in case of any future issues):
|
||||
```
|
||||
ExecStartPre=chcon -t bin_t /root/tmp_leapp_py3/leapp3
|
||||
ExecStart=/root/tmp_leapp_py3/leapp3 upgrade --resume
|
||||
````
|
||||
|
||||
Jira: RHEL-149141
|
||||
---
|
||||
.../actors/createresumeservice/files/leapp_resume.service | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/createresumeservice/files/leapp_resume.service b/repos/system_upgrade/common/actors/createresumeservice/files/leapp_resume.service
|
||||
index 39ac6112..859237a1 100644
|
||||
--- a/repos/system_upgrade/common/actors/createresumeservice/files/leapp_resume.service
|
||||
+++ b/repos/system_upgrade/common/actors/createresumeservice/files/leapp_resume.service
|
||||
@@ -9,7 +9,7 @@ Wants=network-online.target
|
||||
[Service]
|
||||
Type=oneshot
|
||||
# FIXME: this is temporary workaround for Python3
|
||||
-ExecStart=/root/tmp_leapp_py3/leapp3 upgrade --resume
|
||||
+ExecStart=/bin/sh -c "/root/tmp_leapp_py3/leapp3 upgrade --resume"
|
||||
StandardOutput=journal+console
|
||||
# FIXME: this shouldn't be needed, but Satellite upgrade runs installer, and that's slow
|
||||
TimeoutStartSec=infinity
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,138 +0,0 @@
|
||||
From 9827568a1e8caeb3e96c0c40a3d7a741997391c6 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Tue, 17 Feb 2026 16:56:43 +0100
|
||||
Subject: [PATCH 06/44] Add API to get a distro "report" name
|
||||
|
||||
Add a global variable DISTRO_REPORT_NAMES which can be directly be used
|
||||
in format_map() or unpacked into format() calls.
|
||||
There are also source and target fields which can be used in e.g.
|
||||
fstrings.
|
||||
|
||||
Jira: RHEL-130948
|
||||
---
|
||||
.../system_upgrade/common/libraries/distro.py | 72 ++++++++++++++++++-
|
||||
.../common/libraries/tests/test_distro.py | 19 +++++
|
||||
2 files changed, 90 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/distro.py b/repos/system_upgrade/common/libraries/distro.py
|
||||
index 34c48a57..1a5e3923 100644
|
||||
--- a/repos/system_upgrade/common/libraries/distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/distro.py
|
||||
@@ -1,9 +1,10 @@
|
||||
import json
|
||||
import os
|
||||
+from collections.abc import Mapping
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import efi, repofileutils, rhsm
|
||||
-from leapp.libraries.common.config import get_target_distro_id
|
||||
+from leapp.libraries.common.config import get_source_distro_id, get_target_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
|
||||
@@ -234,6 +235,75 @@ def distro_id_to_pretty_name(distro_id):
|
||||
}[distro_id]
|
||||
|
||||
|
||||
+def _distro_id_to_report_name(distro_id):
|
||||
+ """
|
||||
+ Get the display name for the given distro id.
|
||||
+
|
||||
+ The display name should be used for user facing text, such as in reports.
|
||||
+ For a real/full name see the :func:`distro_id_to_pretty_name` function.
|
||||
+ """
|
||||
+ return {
|
||||
+ "rhel": "RHEL",
|
||||
+ "centos": "CentOS Stream",
|
||||
+ "almalinux": "AlmaLinux"
|
||||
+ }[distro_id]
|
||||
+
|
||||
+
|
||||
+class _DistroReportNames(Mapping):
|
||||
+ """
|
||||
+ A mapping of distro names to be used in reports.
|
||||
+
|
||||
+ In addition to the properties :attr:`source` and :attr:`target`, this class
|
||||
+ can be used in :func:`format_map()` or unpacked to :func:`format` where it
|
||||
+ exposes them as 'source_distro' and 'target_distro'.
|
||||
+ """
|
||||
+
|
||||
+ @property
|
||||
+ def source(self) -> str:
|
||||
+ """
|
||||
+ The source distro report name.
|
||||
+
|
||||
+ :type: str
|
||||
+ """
|
||||
+ return _distro_id_to_report_name(get_source_distro_id())
|
||||
+
|
||||
+ @property
|
||||
+ def target(self) -> str:
|
||||
+ """
|
||||
+ The target distro report name.
|
||||
+
|
||||
+ :type: str
|
||||
+ """
|
||||
+ return _distro_id_to_report_name(get_target_distro_id())
|
||||
+
|
||||
+ def __getitem__(self, key):
|
||||
+ if key == 'source_distro':
|
||||
+ return self.source
|
||||
+
|
||||
+ if key == 'target_distro':
|
||||
+ return self.target
|
||||
+
|
||||
+ raise KeyError(f"Key '{key}' not found in {self.__class__.__name__}")
|
||||
+
|
||||
+ def __len__(self):
|
||||
+ return 2
|
||||
+
|
||||
+ def __iter__(self):
|
||||
+ yield from ['source_distro', 'target_distro']
|
||||
+
|
||||
+
|
||||
+DISTRO_REPORT_NAMES = _DistroReportNames()
|
||||
+"""
|
||||
+A mapping of distro "display" names for use in reports.
|
||||
+
|
||||
+Can be used as argument for format_map() or unpacked in format() calls.
|
||||
+The format string placeholders 'source_distro' and 'target_distro' are then
|
||||
+replaced by the respective distro names or abbreviations of them.
|
||||
+
|
||||
+See :class:`_DistroReportNames`.
|
||||
+"""
|
||||
+
|
||||
+
|
||||
def get_distro_efidir_canon_path(distro_id):
|
||||
"""
|
||||
Get canonical path to the distro EFI directory in the EFI mountpoint.
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
index ec7d8f77..d266a9c6 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -235,3 +235,22 @@ def test_get_distro_repoids_invalid_repo(monkeypatch):
|
||||
)
|
||||
def test__get_distro_efidir_canon_path(distro, expect):
|
||||
assert expect == distrolib.get_distro_efidir_canon_path(distro)
|
||||
+
|
||||
+
|
||||
+def test_distro_report_names(monkeypatch):
|
||||
+ current_actor = CurrentActorMocked(src_distro="centos", dst_distro="rhel")
|
||||
+ monkeypatch.setattr(api, "current_actor", current_actor)
|
||||
+
|
||||
+ assert distrolib.DISTRO_REPORT_NAMES.source == "CentOS Stream"
|
||||
+ assert distrolib.DISTRO_REPORT_NAMES.target == "RHEL"
|
||||
+
|
||||
+ expect = "CentOS Stream is upstream for RHEL"
|
||||
+ template = "{source_distro} is upstream for {target_distro}"
|
||||
+ assert expect == template.format_map(distrolib.DISTRO_REPORT_NAMES)
|
||||
+ assert expect == template.format(**distrolib.DISTRO_REPORT_NAMES)
|
||||
+
|
||||
+ template = "{source_distro} is {what} for {target_distro}"
|
||||
+ assert expect == template.format(what='upstream', **distrolib.DISTRO_REPORT_NAMES)
|
||||
+
|
||||
+ template = "{source_distro} is {what} for RHEL"
|
||||
+ assert expect == template.format(what='upstream', **distrolib.DISTRO_REPORT_NAMES)
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,190 +0,0 @@
|
||||
From d6e4afe5c51ac8809649ca395e2ffafc5ab76922 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Wed, 4 Mar 2026 22:45:18 +0100
|
||||
Subject: [PATCH 07/44] livemode: copy upgrade kernel's hmac into /boot
|
||||
|
||||
Copying kernel's HMAC is necessary in order to boot with FIPS mode
|
||||
enabled. Standard (old) upgrade process copies the kernel HMAC file
|
||||
already, livemode did not in order to keep the initial implementation
|
||||
simple. This change adds copying of kernel HMAC also for livemode.
|
||||
|
||||
Jira-ref: RHEL-129571
|
||||
---
|
||||
.../libraries/upgradeinitramfsgenerator.py | 50 +++++++----
|
||||
.../unit_test_upgradeinitramfsgenerator.py | 84 ++++++++++++++++++-
|
||||
2 files changed, 118 insertions(+), 16 deletions(-)
|
||||
|
||||
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 03447b7c..1a0dccd8 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
@@ -480,6 +480,16 @@ def prepare_boot_files_for_livemode(context):
|
||||
|
||||
copy_target_kernel_from_userspace_into_boot(context, target_kernel_ver, kernel_artifact_name)
|
||||
|
||||
+ uspace_kernel_hmac_path = context.full_path('/lib/modules/{}/.vmlinuz.hmac'.format(target_kernel_ver))
|
||||
+ upgrade_kernel_hmac_dest = '/boot/.{}.hmac'.format(kernel_artifact_name)
|
||||
+ create_upgrade_hmac_from_target_hmac(uspace_kernel_hmac_path, upgrade_kernel_hmac_dest, kernel_artifact_name)
|
||||
+ api.current_logger().info(
|
||||
+ 'Written hmac ({0}) for the upgrade kernel (based on {1})'.format(
|
||||
+ upgrade_kernel_hmac_dest,
|
||||
+ uspace_kernel_hmac_path
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
USERSPACE_ARTIFACTS_PATH = '/artifacts'
|
||||
context.makedirs(USERSPACE_ARTIFACTS_PATH, exists_ok=True)
|
||||
userspace_initramfs_dest = os.path.join(USERSPACE_ARTIFACTS_PATH, initramfs_artifact_name)
|
||||
@@ -493,25 +503,35 @@ def prepare_boot_files_for_livemode(context):
|
||||
|
||||
return BootContent(kernel_path=host_kernel_dest,
|
||||
initram_path=host_initramfs_dest,
|
||||
- kernel_hmac_path='')
|
||||
+ kernel_hmac_path=upgrade_kernel_hmac_dest)
|
||||
+
|
||||
+
|
||||
+def _read_file(path):
|
||||
+ with open(path) as in_file:
|
||||
+ return in_file.read()
|
||||
+
|
||||
+
|
||||
+def _write_file(path, data):
|
||||
+ with open(path, 'w') as out_file:
|
||||
+ out_file.write(data)
|
||||
|
||||
|
||||
-def create_upgrade_hmac_from_target_hmac(original_hmac_path, upgrade_hmac_path, upgrade_kernel):
|
||||
+def create_upgrade_hmac_from_target_hmac(original_hmac_path: str, upgrade_hmac_path: str, upgrade_kernel: str):
|
||||
# Rename the kernel name stored in the HMAC file as the upgrade kernel is named differently and the HMAC file
|
||||
# refers to the real target kernel
|
||||
- with open(original_hmac_path) as original_hmac_file:
|
||||
- hmac_file_lines = [line for line in original_hmac_file.read().split('\n') if line]
|
||||
- if len(hmac_file_lines) > 1:
|
||||
- details = ('Expected the target kernel HMAC file to containing only one HMAC line, '
|
||||
- 'found {0}'.format(len(hmac_file_lines)))
|
||||
- raise StopActorExecutionError('Failed to prepare HMAC file for upgrade kernel.',
|
||||
- details={'details': details})
|
||||
-
|
||||
- # Keep only non-empty strings after splitting on space
|
||||
- hmac, dummy_target_kernel_name = [fragment for fragment in hmac_file_lines[0].split(' ') if fragment]
|
||||
-
|
||||
- with open(upgrade_hmac_path, 'w') as upgrade_kernel_hmac_file:
|
||||
- upgrade_kernel_hmac_file.write('{hmac} {kernel}\n'.format(hmac=hmac, kernel=upgrade_kernel))
|
||||
+ original_hmac_file_content = _read_file(original_hmac_path)
|
||||
+ hmac_file_lines = [line for line in original_hmac_file_content.split('\n') if line]
|
||||
+ if len(hmac_file_lines) > 1:
|
||||
+ details = ('Expected the target kernel HMAC file to containing only one HMAC line, '
|
||||
+ 'found {0}'.format(len(hmac_file_lines)))
|
||||
+ raise StopActorExecutionError('Failed to prepare HMAC file for upgrade kernel.',
|
||||
+ details={'details': details})
|
||||
+
|
||||
+ # Keep only non-empty strings after splitting on space
|
||||
+ hmac, dummy_target_kernel_name = [fragment for fragment in hmac_file_lines[0].split(' ') if fragment]
|
||||
+
|
||||
+ upgrade_hmac_content = '{hmac} {kernel}\n'.format(hmac=hmac, kernel=upgrade_kernel)
|
||||
+ _write_file(upgrade_hmac_path, upgrade_hmac_content)
|
||||
|
||||
|
||||
def copy_boot_files(context):
|
||||
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 b96bf79f..165a4df0 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
|
||||
@@ -116,7 +116,7 @@ class MockedContext:
|
||||
self.called_copy_to.append((src, dst))
|
||||
self.content.add(dst)
|
||||
|
||||
- def makedirs(self, path):
|
||||
+ def makedirs(self, path, exists_ok=True):
|
||||
self.called_makedirs.append(path)
|
||||
|
||||
def remove_tree(self, path):
|
||||
@@ -402,3 +402,85 @@ def test_copy_modules_duplicate_skip(monkeypatch, kind):
|
||||
assert context.content
|
||||
assert len(context.called_copy_to) == 1
|
||||
assert debugmsg in upgradeinitramfsgenerator.api.current_logger.dbgmsg
|
||||
+
|
||||
+
|
||||
+def test_create_upgrade_hmac_from_target_hmac(monkeypatch):
|
||||
+ upgrade_hmac_written = False
|
||||
+
|
||||
+ def _read_file_mock(path):
|
||||
+ assert path == '/original-hmac'
|
||||
+ return ('ff00a9674033eea61bec48d21a1d2c27eaac9bd6ed4997e31dd0d9307c7a4770eb81df7116c'
|
||||
+ '4ace25d354a06dfdcd75e38f504f2ea7c1c4bdc95ea7083b701c0 vmlinuz-6.12.0-55.9.1.el10_0.x86_64')
|
||||
+
|
||||
+ def _write_file_mock(path, content):
|
||||
+ assert path == '/boot/.vmlinuz-upgrade.x86_64.hmac'
|
||||
+ expected_content = ('ff00a9674033eea61bec48d21a1d2c27eaac9bd6ed4997e31dd0d9307c7a4770eb81df7116c'
|
||||
+ '4ace25d354a06dfdcd75e38f504f2ea7c1c4bdc95ea7083b701c0 '
|
||||
+ 'vmlinuz-upgrade.x86_64\n')
|
||||
+ assert content == expected_content
|
||||
+ nonlocal upgrade_hmac_written
|
||||
+ upgrade_hmac_written = True
|
||||
+
|
||||
+ monkeypatch.setattr(upgradeinitramfsgenerator, '_read_file', _read_file_mock)
|
||||
+ monkeypatch.setattr(upgradeinitramfsgenerator, '_write_file', _write_file_mock)
|
||||
+ upgradeinitramfsgenerator.create_upgrade_hmac_from_target_hmac(
|
||||
+ '/original-hmac', '/boot/.vmlinuz-upgrade.x86_64.hmac', 'vmlinuz-upgrade.x86_64')
|
||||
+
|
||||
+ assert upgrade_hmac_written
|
||||
+
|
||||
+
|
||||
+def test_prepare_boot_files_for_livemode(monkeypatch):
|
||||
+ context_mock = MockedContext()
|
||||
+
|
||||
+ monkeypatch.setattr(upgradeinitramfsgenerator,
|
||||
+ '_get_target_kernel_version',
|
||||
+ lambda ctx: '6.18.3-100.fc42.x86_64')
|
||||
+
|
||||
+ monkeypatch.setattr(upgradeinitramfsgenerator,
|
||||
+ 'get_boot_artifact_names',
|
||||
+ lambda: ('vmlinuz-upgrade.x86_64', 'initramfs-upgrade.x86_64.img'))
|
||||
+
|
||||
+ upgrade_kernel_present = False
|
||||
+ initramfs_generated = False
|
||||
+ upgrade_initramfs_present = False
|
||||
+ upgrade_kernel_hmac_present = False
|
||||
+
|
||||
+ def copy_target_kernel_mock(context, target_kernel_ver, kernel_artifact_name):
|
||||
+ nonlocal upgrade_kernel_present
|
||||
+ upgrade_kernel_present = True
|
||||
+
|
||||
+ def _generate_initramfs_mock(context, userspace_initramfs_dest, target_kernel_ver):
|
||||
+ nonlocal initramfs_generated
|
||||
+ initramfs_generated = True
|
||||
+
|
||||
+ def create_upgrade_hmac_from_target_hmac_mock(uspace_kernel_hmac_path,
|
||||
+ upgrade_kernel_hmac_dest,
|
||||
+ kernel_artifact_name):
|
||||
+ assert upgrade_kernel_hmac_dest == '/boot/.vmlinuz-upgrade.x86_64.hmac'
|
||||
+ nonlocal upgrade_kernel_hmac_present
|
||||
+ upgrade_kernel_hmac_present = True
|
||||
+
|
||||
+ monkeypatch.setattr(upgradeinitramfsgenerator,
|
||||
+ 'copy_target_kernel_from_userspace_into_boot',
|
||||
+ copy_target_kernel_mock)
|
||||
+
|
||||
+ monkeypatch.setattr(upgradeinitramfsgenerator,
|
||||
+ 'create_upgrade_hmac_from_target_hmac',
|
||||
+ create_upgrade_hmac_from_target_hmac_mock)
|
||||
+
|
||||
+ monkeypatch.setattr(upgradeinitramfsgenerator,
|
||||
+ '_generate_livemode_initramfs',
|
||||
+ _generate_initramfs_mock)
|
||||
+
|
||||
+ boot_content = upgradeinitramfsgenerator.prepare_boot_files_for_livemode(context_mock)
|
||||
+
|
||||
+ upgrade_initramfs_present = context_mock.called_copy_from[0][1] == '/boot/initramfs-upgrade.x86_64.img'
|
||||
+
|
||||
+ assert upgrade_kernel_present
|
||||
+ assert initramfs_generated
|
||||
+ assert upgrade_initramfs_present
|
||||
+ assert upgrade_kernel_hmac_present
|
||||
+
|
||||
+ assert boot_content.kernel_path == '/boot/vmlinuz-upgrade.x86_64'
|
||||
+ assert boot_content.initram_path == '/boot/initramfs-upgrade.x86_64.img'
|
||||
+ assert boot_content.kernel_hmac_path == '/boot/.vmlinuz-upgrade.x86_64.hmac'
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,131 +0,0 @@
|
||||
From 0fc2075683ffe30b77e83c7d793815e9301fa41d Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Fri, 13 Mar 2026 10:03:19 +0100
|
||||
Subject: [PATCH 08/44] fix(livemode): make live.dir is relative to device root
|
||||
|
||||
Booting from an squashfs image (from a local block dev) requires to
|
||||
parameters:
|
||||
- identifier of the device where the squashfs image resides
|
||||
- path to the squashfs image on the given device (aka live.dir)
|
||||
Therefore, live.dir needs to be set up with a path that is relative to
|
||||
the device where the image resides. This patch fixes the current
|
||||
behavior where the path is being taken as it is, i.e., relative to the
|
||||
root of the source system.
|
||||
|
||||
Jira-ref: RHEL-104379
|
||||
---
|
||||
.../libraries/addupgradebootentry.py | 29 ++++++++++-----
|
||||
.../tests/unit_test_addupgradebootentry.py | 36 +++++++++++--------
|
||||
2 files changed, 43 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py b/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py
|
||||
index b28ec57c..5b635a83 100644
|
||||
--- a/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py
|
||||
+++ b/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py
|
||||
@@ -270,14 +270,26 @@ def local_os_stat(path):
|
||||
return os.stat(path)
|
||||
|
||||
|
||||
-def _get_device_uuid(path):
|
||||
+def _split_path_on_mount_point(path):
|
||||
+ """ Split a given path into a prefix where a device is mounted and suffix relative to the device root. """
|
||||
+ mount_point = path
|
||||
+ while not os.path.ismount(mount_point):
|
||||
+ mount_point = os.path.dirname(mount_point)
|
||||
+
|
||||
+ relative_suffix = path[len(mount_point):]
|
||||
+ if len(relative_suffix) == 0 or relative_suffix[0] != '/':
|
||||
+ # relative_suffix is '' if the squashfs dir is set to root (/)
|
||||
+ # relative_suffix does not start with '/' if the dir is located in /, i.e., /mydir
|
||||
+ relative_suffix = '/{}'.format(relative_suffix)
|
||||
+
|
||||
+ return (mount_point, relative_suffix)
|
||||
+
|
||||
+
|
||||
+def _get_device_uuid(mount_point):
|
||||
"""
|
||||
- Find the UUID of a device in which the given path is located.
|
||||
+ Find the UUID of a device mounted at a given mount point.
|
||||
"""
|
||||
- while not os.path.ismount(path):
|
||||
- path = os.path.dirname(path)
|
||||
-
|
||||
- needle_dev_id = local_os_stat(path).st_dev
|
||||
+ needle_dev_id = local_os_stat(mount_point).st_dev
|
||||
|
||||
for uuid in os.listdir('/dev/disk/by-uuid'):
|
||||
uuid_fullpath = os.path.join('/dev/disk/by-uuid/', uuid)
|
||||
@@ -333,8 +345,9 @@ def construct_cmdline_args_for_livemode():
|
||||
if livemode_config.url_to_load_squashfs_from:
|
||||
args['root'] = 'live:{}'.format(livemode_config.url_to_load_squashfs_from)
|
||||
else:
|
||||
- args['root'] = 'live:UUID={}'.format(_get_device_uuid(dir_path_containing_liveimg))
|
||||
- args['rd.live.dir'] = dir_path_containing_liveimg
|
||||
+ dev_mount_point, dir_location_on_dev = _split_path_on_mount_point(dir_path_containing_liveimg)
|
||||
+ args['root'] = 'live:UUID={}'.format(_get_device_uuid(dev_mount_point))
|
||||
+ args['rd.live.dir'] = dir_location_on_dev
|
||||
args['rd.live.squashimg'] = liveimg_filename
|
||||
|
||||
if livemode_config.dracut_network:
|
||||
diff --git a/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py b/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py
|
||||
index 7341602b..79c05a5d 100644
|
||||
--- a/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py
|
||||
+++ b/repos/system_upgrade/common/actors/addupgradebootentry/tests/unit_test_addupgradebootentry.py
|
||||
@@ -279,23 +279,31 @@ def test_get_rdlvm_arg_values(monkeypatch):
|
||||
assert args == ('A', 'B')
|
||||
|
||||
|
||||
+@pytest.mark.parametrize(
|
||||
+ ('path', 'mount_point', 'suffix'),
|
||||
+ [
|
||||
+ ('/', '/', '/'),
|
||||
+ ('/dir', '/', '/dir'),
|
||||
+ ('/dir/squashfs', '/', '/dir/squashfs'),
|
||||
+ ('/dir/squashfs', '/dir', '/squashfs'),
|
||||
+ ]
|
||||
+)
|
||||
+def test_split_path_on_mount_point(monkeypatch, path, mount_point, suffix):
|
||||
+ def is_mount_mock(_path):
|
||||
+ return _path == mount_point
|
||||
+
|
||||
+ monkeypatch.setattr(os.path, 'ismount', is_mount_mock)
|
||||
+
|
||||
+ ret_mount_point, ret_suffix = addupgradebootentry._split_path_on_mount_point(path)
|
||||
+ assert ret_mount_point == mount_point
|
||||
+ assert ret_suffix == suffix
|
||||
+
|
||||
+
|
||||
def test_get_device_uuid(monkeypatch):
|
||||
"""
|
||||
The file in question is /var/lib/file
|
||||
Underlying partition /var is a device /dev/sda1 (dev_id=10) linked to from /dev/disk/by-uuid/MY_UUID1
|
||||
"""
|
||||
-
|
||||
- execution_stats = {
|
||||
- 'is_mount_call_count': 0
|
||||
- }
|
||||
-
|
||||
- def is_mount_mock(path):
|
||||
- execution_stats['is_mount_call_count'] += 1
|
||||
- assert execution_stats['is_mount_call_count'] <= 3
|
||||
- return path == '/var'
|
||||
-
|
||||
- monkeypatch.setattr(os.path, 'ismount', is_mount_mock)
|
||||
-
|
||||
StatResult = namedtuple('StatResult', ('st_dev', 'st_rdev'))
|
||||
|
||||
def stat_mock(path):
|
||||
@@ -325,8 +333,8 @@ def test_get_device_uuid(monkeypatch):
|
||||
|
||||
monkeypatch.setattr(os, 'readlink', readlink_mock)
|
||||
|
||||
- path = '/var/lib/file'
|
||||
- uuid = addupgradebootentry._get_device_uuid(path)
|
||||
+ mount_point = '/var'
|
||||
+ uuid = addupgradebootentry._get_device_uuid(mount_point)
|
||||
|
||||
assert uuid == 'MY_UUID1'
|
||||
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
From 3a9cb366b7487bb5cc57e7650447af327c343b0d Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Wed, 18 Mar 2026 09:58:13 +0100
|
||||
Subject: [PATCH 09/44] fix(livemode): change location of source system tree
|
||||
|
||||
Before this patch, the generated squashfs image mounts the source system
|
||||
tree at /run/initramfs/live, which is the location used by dmsquash-live
|
||||
to mount the block device that holds the squashfs image. This device,
|
||||
however, might be arbitrary, e.g., it could be hosting /var of the
|
||||
source system. Therefore, the squashfs system would attempt to mount
|
||||
multiple things at /run/initramfs/live (/ and /var of the source
|
||||
system), creating problems. This patch changes the location of the
|
||||
source system tree to '/run/upgrade'.
|
||||
|
||||
Jira-ref: RHEL-104379
|
||||
---
|
||||
.../files/do-upgrade.sh | 4 ++--
|
||||
.../libraries/prepareliveimage.py | 12 ++++++++++--
|
||||
2 files changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/files/do-upgrade.sh b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/files/do-upgrade.sh
|
||||
index 4b2f9a1f..51ebddb5 100755
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/files/do-upgrade.sh
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/files/do-upgrade.sh
|
||||
@@ -28,8 +28,8 @@ export LEAPPHOME=/root/tmp_leapp_py3
|
||||
export LEAPP3_BIN=$LEAPPHOME/leapp3
|
||||
|
||||
# this was initially a dracut script, hence $NEWROOT.
|
||||
-# the rootfs is mounted on /run/initramfs/live when booted with dmsquash-live
|
||||
-export NEWROOT=/run/initramfs/live
|
||||
+# the rootfs is mounted on /run/upgrade when booted with dmsquash-live
|
||||
+export NEWROOT=/run/upgrade
|
||||
|
||||
NSPAWN_OPTS="--capability=all --bind=/dev --bind=/dev/pts --bind=/proc --bind=/run/udev --bind=/run/lock"
|
||||
[ -d /dev/mapper ] && NSPAWN_OPTS="$NSPAWN_OPTS --bind=/dev/mapper"
|
||||
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 2587bf89..96dadadf 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
|
||||
@@ -18,8 +18,16 @@ LEAPP_CONSOLE_SERVICE_FILE = 'console.service'
|
||||
LEAPP_STRACE_SERVICE_FILE = 'upgrade-strace.service'
|
||||
""" Service that executes the upgrade while strace-ing the corresponding Leapp's process tree. """
|
||||
|
||||
-SOURCE_ROOT_MOUNT_LOCATION = '/run/initramfs/live'
|
||||
-""" Controls where the source system's root will be mounted inside the upgrade image. """
|
||||
+SOURCE_ROOT_MOUNT_LOCATION = '/run/upgrade'
|
||||
+"""
|
||||
+Controls where the source system's root will be mounted inside the upgrade image.
|
||||
+
|
||||
+Note: This cannot be set to /run/initramfs/live as the path is used by
|
||||
+ dmsquash-live by default to mount the block device that holds the squashfs
|
||||
+ image. As this device can be arbitrary (e.g., it can be mounted as /var on the
|
||||
+ source system), using /run/initramfs/live would cause mounting problems - we
|
||||
+ would attempt to mount / and also (for example) /var on the same location.
|
||||
+"""
|
||||
|
||||
|
||||
def create_fstab_mounting_current_root_elsewhere(context, host_fstab):
|
||||
--
|
||||
2.53.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,86 +0,0 @@
|
||||
From f6838df00e3be7d8beec99bd9448ed47c7720853 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 18:25:09 +0100
|
||||
Subject: [PATCH 11/44] checkblacklistca: Respect distro name in reports
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../libraries/checkblacklistca.py | 28 +++++++++++++------
|
||||
.../tests/component_test_checkblacklistca.py | 9 ++++++
|
||||
2 files changed, 29 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkblacklistca/libraries/checkblacklistca.py b/repos/system_upgrade/el8toel9/actors/checkblacklistca/libraries/checkblacklistca.py
|
||||
index 53b912b8..635b3640 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkblacklistca/libraries/checkblacklistca.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkblacklistca/libraries/checkblacklistca.py
|
||||
@@ -1,4 +1,5 @@
|
||||
from leapp import reporting
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import BlackListCA, BlackListError
|
||||
|
||||
@@ -50,9 +51,14 @@ def process():
|
||||
reporting.Title('Distrusted CA certificates will be moved from blacklist to blocklist'),
|
||||
reporting.Summary(
|
||||
'The directories which store user and administrator supplied '
|
||||
- 'distrusted certificates have change names from blacklist in '
|
||||
- 'RHEL8 to blocklist in RHEL9. As a result {} and '
|
||||
- '{} will be deleted.'.format(reportString, deleteString)),
|
||||
+ 'distrusted certificates were renamed from blacklist in '
|
||||
+ '{source_distro} 8 to blocklist in {target_distro} 9. '
|
||||
+ 'As a result {report_string} and {delete_string} will be deleted.'.format(
|
||||
+ report_string=reportString,
|
||||
+ delete_string=deleteString,
|
||||
+ **DISTRO_REPORT_NAMES,
|
||||
+ )
|
||||
+ ),
|
||||
reporting.Severity(reporting.Severity.INFO),
|
||||
reporting.Groups([reporting.Groups.SECURITY]),
|
||||
reporting.Groups([reporting.Groups.AUTHENTICATION])
|
||||
@@ -63,11 +69,17 @@ def process():
|
||||
reporting.Summary(
|
||||
'The directories which stores user and administrator supplied '
|
||||
'distrusted certificates has change names from blacklist in '
|
||||
- 'RHEL8 to blocklist in RHEL9. But we are unable to access the '
|
||||
- 'RHEL8 directory {} because {}. You can clear this error by '
|
||||
- 'correcting the condition, or by moving the contents to {} '
|
||||
- 'and removing {} completely'
|
||||
- '. '.format(ble.sourceDir, ble.error, ble.targetDir, ble.sourceDir)),
|
||||
+ '{source_distro} 8 to blocklist in {target_distro} 9. '
|
||||
+ 'But we are unable to access the {source_distro} 8 directory '
|
||||
+ '{source_dir} because {error}. You can clear this error by '
|
||||
+ 'correcting the condition, or by moving the contents to '
|
||||
+ '{target_dir} and removing {source_dir} completely'.format(
|
||||
+ source_dir=ble.sourceDir,
|
||||
+ error=ble.error,
|
||||
+ target_dir=ble.targetDir,
|
||||
+ **DISTRO_REPORT_NAMES,
|
||||
+ )
|
||||
+ ),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.SECURITY]),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkblacklistca/tests/component_test_checkblacklistca.py b/repos/system_upgrade/el8toel9/actors/checkblacklistca/tests/component_test_checkblacklistca.py
|
||||
index 2fc27501..af7e6305 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkblacklistca/tests/component_test_checkblacklistca.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkblacklistca/tests/component_test_checkblacklistca.py
|
||||
@@ -1,7 +1,16 @@
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.common import distro
|
||||
from leapp.models import BlackListCA, BlackListError, Report
|
||||
from leapp.utils.report import is_inhibitor
|
||||
|
||||
|
||||
+@pytest.fixture(autouse=True)
|
||||
+def common_mocks(monkeypatch):
|
||||
+ monkeypatch.setattr(distro, 'get_source_distro_id', lambda: 'rhel')
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_id', lambda: 'rhel')
|
||||
+
|
||||
+
|
||||
def test_actor_execution_empty(current_actor_context):
|
||||
current_actor_context.feed()
|
||||
current_actor_context.run()
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,49 +0,0 @@
|
||||
From a2a3dfb9b14f9582b4c895bda28a3ecb604ea737 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 18:34:34 +0100
|
||||
Subject: [PATCH 12/44] blsgrubcfgonppc64: Respect distro name in reports
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../libraries/blsgrubcfgonppc64.py | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkblsgrubcfgonppc64/libraries/blsgrubcfgonppc64.py b/repos/system_upgrade/el8toel9/actors/checkblsgrubcfgonppc64/libraries/blsgrubcfgonppc64.py
|
||||
index d723df65..58d15e25 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkblsgrubcfgonppc64/libraries/blsgrubcfgonppc64.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkblsgrubcfgonppc64/libraries/blsgrubcfgonppc64.py
|
||||
@@ -1,6 +1,7 @@
|
||||
from leapp import reporting
|
||||
from leapp.libraries.common import grub
|
||||
from leapp.libraries.common.config import architecture
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import DefaultGrubInfo, FirmwareFacts, GrubCfgBios
|
||||
|
||||
@@ -31,8 +32,9 @@ def process():
|
||||
'Leapp cannot continue with upgrade on "ppc64le" bare metal systems'
|
||||
),
|
||||
reporting.Summary(
|
||||
- 'In-place upgrade to RHEL 9 is not supported on POWER8 and POWER9 bare metal systems. '
|
||||
- 'For more information, refer to the following article: {}'.format(URL)
|
||||
+ f'In-place upgrade to {DISTRO_REPORT_NAMES.target} 9 is not'
|
||||
+ ' supported on POWER8 and POWER9 bare metal systems. For more'
|
||||
+ ' information, refer to the attached article.'
|
||||
),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups(['inhibitor']),
|
||||
@@ -54,8 +56,9 @@ def process():
|
||||
'On "ppc64le" systems with BLS enabled, the GRUB configuration is not '
|
||||
'properly converted after the upgrade and Leapp has to run "grub2-mkconfig" '
|
||||
'-o /boot/grub2/grub.cfg command in order to fix an issue with booting into '
|
||||
- 'the RHEL 8 kernel instead of RHEL 9.'
|
||||
-
|
||||
+ 'the {source_distro} 8 kernel instead of {target_distro} 9.'.format_map(
|
||||
+ DISTRO_REPORT_NAMES
|
||||
+ )
|
||||
),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.BOOT]),
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
From b43ed18a6e4cea273def17c83c0c8d1742ba5145 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 16:16:17 +0100
|
||||
Subject: [PATCH 13/44] checkselinux: Respect distro name in report
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../common/actors/checkselinux/libraries/checkselinux.py | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkselinux/libraries/checkselinux.py b/repos/system_upgrade/common/actors/checkselinux/libraries/checkselinux.py
|
||||
index 2ef914ac..dbd79adf 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkselinux/libraries/checkselinux.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkselinux/libraries/checkselinux.py
|
||||
@@ -1,5 +1,6 @@
|
||||
from leapp import reporting
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import KernelCmdlineArg, SELinuxFacts, SelinuxPermissiveDecision, SelinuxRelabelDecision
|
||||
|
||||
@@ -20,10 +21,10 @@ def process():
|
||||
reporting.create_report([
|
||||
reporting.Title('LEAPP detected SELinux disabled in "/etc/selinux/config"'),
|
||||
reporting.Summary(
|
||||
- 'On RHEL 9, disabling SELinux in "/etc/selinux/config" is no longer possible. '
|
||||
- 'This way, the system starts with SELinux enabled but with no policy loaded. LEAPP '
|
||||
+ 'On {target_distro} 9, disabling SELinux in "/etc/selinux/config" is no longer possible. '
|
||||
+ 'This way, the system starts with SELinux enabled but with no policy loaded. Leapp '
|
||||
'will automatically disable SELinux using "SELINUX=0" kernel command line parameter. '
|
||||
- 'However, Red Hat strongly recommends to have SELinux enabled'
|
||||
+ 'However, it is strongly recommended to have SELinux enabled'.format_map(DISTRO_REPORT_NAMES)
|
||||
),
|
||||
reporting.Severity(reporting.Severity.INFO),
|
||||
reporting.Groups([reporting.Groups.SELINUX]),
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,92 +0,0 @@
|
||||
From 60e54a82da37bb0d2f1bee1a35d1d7fa01cf3df7 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 16:44:04 +0100
|
||||
Subject: [PATCH 14/44] checkosrelease: Respect distro name in report
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../common/actors/checkosrelease/actor.py | 2 +-
|
||||
.../actors/checkosrelease/libraries/checkosrelease.py | 10 +++++++---
|
||||
.../actors/checkosrelease/tests/test_checkosrelease.py | 4 +++-
|
||||
3 files changed, 11 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkosrelease/actor.py b/repos/system_upgrade/common/actors/checkosrelease/actor.py
|
||||
index 7747eb9b..8c60d968 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkosrelease/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkosrelease/actor.py
|
||||
@@ -6,7 +6,7 @@ from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
class CheckOSRelease(Actor):
|
||||
"""
|
||||
- Check if the current RHEL minor version is supported. If not, inhibit the upgrade process.
|
||||
+ Check if the current distro version is supported. If not, inhibit the upgrade process.
|
||||
|
||||
This check can be skipped by using the LEAPP_DEVEL_SKIP_CHECK_OS_RELEASE environment variable.
|
||||
"""
|
||||
diff --git a/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py b/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
index 1ee6e6ab..1ab89a8d 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkosrelease/libraries/checkosrelease.py
|
||||
@@ -2,6 +2,7 @@ import os
|
||||
|
||||
from leapp import reporting
|
||||
from leapp.libraries.common.config import version
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
|
||||
COMMON_REPORT_TAGS = [reporting.Groups.SANITY]
|
||||
FMT_LIST_SEPARATOR = '\n - '
|
||||
@@ -14,7 +15,9 @@ def skip_check():
|
||||
if os.getenv('LEAPP_DEVEL_SKIP_CHECK_OS_RELEASE'):
|
||||
reporting.create_report([
|
||||
reporting.Title('Skipped OS release check'),
|
||||
- reporting.Summary('Source RHEL release check skipped via LEAPP_DEVEL_SKIP_CHECK_OS_RELEASE env var.'),
|
||||
+ reporting.Summary(
|
||||
+ 'Source system release check skipped via LEAPP_DEVEL_SKIP_CHECK_OS_RELEASE env variable.'
|
||||
+ ),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups(COMMON_REPORT_TAGS)
|
||||
] + related)
|
||||
@@ -24,7 +27,7 @@ def skip_check():
|
||||
|
||||
|
||||
def check_os_version():
|
||||
- """ Check the RHEL minor version and inhibit the upgrade if it does not match the supported ones """
|
||||
+ """ Check the distro version and inhibit the upgrade if it does not match the supported ones """
|
||||
if not version.is_supported_version():
|
||||
supported_releases = []
|
||||
for rel in version.SUPPORTED_VERSIONS:
|
||||
@@ -33,7 +36,8 @@ def check_os_version():
|
||||
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'
|
||||
+ 'The installed OS version is not supported for the in-place upgrade'
|
||||
+ ' to the target {target_distro} version'.format_map(DISTRO_REPORT_NAMES)
|
||||
),
|
||||
reporting.Summary(
|
||||
'The supported OS releases for the upgrade process:'
|
||||
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 1ca8a1d7..c1c43065 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkosrelease/tests/test_checkosrelease.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkosrelease/tests/test_checkosrelease.py
|
||||
@@ -3,7 +3,8 @@ import os
|
||||
from leapp import reporting
|
||||
from leapp.libraries.actor import checkosrelease
|
||||
from leapp.libraries.common.config import version
|
||||
-from leapp.libraries.common.testutils import create_report_mocked, produce_mocked
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked, produce_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
from leapp.utils.report import is_inhibitor
|
||||
|
||||
|
||||
@@ -26,6 +27,7 @@ def test_no_skip_check(monkeypatch):
|
||||
|
||||
|
||||
def test_not_supported_release(monkeypatch):
|
||||
+ monkeypatch.setattr(api, "current_actor", CurrentActorMocked())
|
||||
monkeypatch.setattr(version, "is_supported_version", lambda: False)
|
||||
monkeypatch.setattr(version, "get_source_major_version", lambda: '8')
|
||||
monkeypatch.setattr(version, "current_version", lambda: ('bad', '8'))
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,113 +0,0 @@
|
||||
From ce379f96f128b60d93e02f95351e2f718940d2f2 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 23 Feb 2026 12:45:59 +0100
|
||||
Subject: [PATCH 15/44] rocecheck: Remove outadated check for source version
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../actors/rocecheck/libraries/rocecheck.py | 35 ++-----------------
|
||||
.../rocecheck/tests/unit_test_rocecheck.py | 22 ------------
|
||||
2 files changed, 3 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/rocecheck/libraries/rocecheck.py b/repos/system_upgrade/el8toel9/actors/rocecheck/libraries/rocecheck.py
|
||||
index 7549feb8..0ed2046a 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/rocecheck/libraries/rocecheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/rocecheck/libraries/rocecheck.py
|
||||
@@ -1,6 +1,6 @@
|
||||
from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
-from leapp.libraries.common.config import architecture, version
|
||||
+from leapp.libraries.common.config import architecture
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import KernelCmdline, RoceDetected
|
||||
|
||||
@@ -37,36 +37,8 @@ def _fmt_list(items):
|
||||
return ''.join([FMT_LIST_SEPARATOR.format(i) for i in items])
|
||||
|
||||
|
||||
-def _report_old_version(roce):
|
||||
+def _report_wrong_setup(roce):
|
||||
roce_nics = roce.roce_nics_connected + roce.roce_nics_connecting
|
||||
- reporting.create_report([
|
||||
- reporting.Title('A newer version of RHEL 8 is required for the upgrade with RoCE.'),
|
||||
- reporting.Summary(
|
||||
- 'The RHEL 9 system uses different network schemes for NIC names'
|
||||
- ' than RHEL 8.'
|
||||
- ' RHEL {version} does not provide functionality to be able'
|
||||
- ' to set the system configuration in a way the network interface'
|
||||
- ' names used by RoCE are persistent on both (RHEL 8 and RHEL 9)'
|
||||
- ' systems.'
|
||||
- ' The in-place upgrade from the current version of RHEL to RHEL 9'
|
||||
- ' will break the RoCE network configuration.'
|
||||
- '\n\nRoCE detected on following NICs:{nics}'
|
||||
- .format(
|
||||
- version=version.get_source_version(),
|
||||
- nics=_fmt_list(roce_nics)
|
||||
- )
|
||||
- ),
|
||||
- reporting.Remediation(hint=(
|
||||
- 'Update the system to RHEL 8.8 or newer using DNF and then reboot'
|
||||
- ' the system prior the in-place upgrade to RHEL 9.'
|
||||
- )),
|
||||
- reporting.Severity(reporting.Severity.HIGH),
|
||||
- reporting.Groups([
|
||||
- reporting.Groups.INHIBITOR,
|
||||
- reporting.Groups.ACCESSIBILITY,
|
||||
- reporting.Groups.SANITY,
|
||||
- ]),
|
||||
- ])
|
||||
|
||||
|
||||
def _report_wrong_setup(roce):
|
||||
@@ -128,7 +100,6 @@ def process():
|
||||
# No used RoCE detected - nothing to do
|
||||
api.current_logger().debug('Skipping RoCE checks: No RoCE card detected.')
|
||||
return
|
||||
- if version.matches_source_version('<= 8.6'):
|
||||
- _report_old_version(roce)
|
||||
+
|
||||
if not is_kernel_arg_set():
|
||||
_report_wrong_setup(roce)
|
||||
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 b5511d17..70e4a7b3 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
|
||||
@@ -52,7 +52,6 @@ def test_roce_noibmz(monkeypatch, arch):
|
||||
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(arch=arch))
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
- monkeypatch.setattr(rocecheck, '_report_old_version', mocked_do_not_call_me)
|
||||
monkeypatch.setattr(rocecheck, '_report_wrong_setup', mocked_do_not_call_me)
|
||||
monkeypatch.setattr(rocecheck, 'is_kernel_arg_set', mocked_do_not_call_me)
|
||||
monkeypatch.setattr(rocecheck.api, 'consume', mocked_do_not_call_me)
|
||||
@@ -76,27 +75,6 @@ def test_roce_ok(monkeypatch, msgs, version):
|
||||
assert not reporting.create_report.called
|
||||
|
||||
|
||||
-@pytest.mark.parametrize('msgs', (
|
||||
- [_kernel_cmdline(['net.naming-scheme=rhel-8.7']), _roce(['eno'], [])],
|
||||
- [_kernel_cmdline(['net.naming-scheme=rhel-8.7']), _roce([], ['eno'])],
|
||||
- [_kernel_cmdline(['net.naming-scheme=rhel-8.6']), _roce(['eno'], [])],
|
||||
- [_kernel_cmdline(['net.naming-scheme=rhel-8.6']), _roce(['eno', 'eno1'], ['enp'])],
|
||||
- [_kernel_cmdline(['foo=bar']), _roce(['eno'], [])],
|
||||
- [_kernel_cmdline(), _roce(['eno'], [])],
|
||||
-))
|
||||
-@pytest.mark.parametrize('version', ['8.0', '8.3', '8.6'])
|
||||
-def test_roce_old_rhel(monkeypatch, msgs, version):
|
||||
- curr_actor_mocked = CurrentActorMocked(arch=architecture.ARCH_S390X, src_ver=version, msgs=msgs)
|
||||
- monkeypatch.setattr(api, 'current_actor', curr_actor_mocked)
|
||||
- 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
|
||||
- )
|
||||
-
|
||||
-
|
||||
# NOTE: what about the situation when net.naming-scheme is configured multiple times???
|
||||
@pytest.mark.parametrize('msgs', (
|
||||
[_kernel_cmdline(['net.naming-scheme=rhel-8.6']), _roce(['eno'], [])],
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,114 +0,0 @@
|
||||
From 18fa991962cb1198173f0ad08a34de27467c32fe Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 23 Feb 2026 13:59:35 +0100
|
||||
Subject: [PATCH 16/44] rocecheck: Respect distro name in report
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../actors/rocecheck/libraries/rocecheck.py | 81 ++++++++++---------
|
||||
1 file changed, 44 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/rocecheck/libraries/rocecheck.py b/repos/system_upgrade/el8toel9/actors/rocecheck/libraries/rocecheck.py
|
||||
index 0ed2046a..5014a8db 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/rocecheck/libraries/rocecheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/rocecheck/libraries/rocecheck.py
|
||||
@@ -1,6 +1,7 @@
|
||||
from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
-from leapp.libraries.common.config import architecture
|
||||
+from leapp.libraries.common.config import architecture, get_target_distro_id
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import KernelCmdline, RoceDetected
|
||||
|
||||
@@ -40,45 +41,51 @@ def _fmt_list(items):
|
||||
def _report_wrong_setup(roce):
|
||||
roce_nics = roce.roce_nics_connected + roce.roce_nics_connecting
|
||||
|
||||
+ summary = (
|
||||
+ 'The {target_distro} 9 system uses different network schemes for NIC names'
|
||||
+ ' than {source_distro} 8.'
|
||||
+ ' The below listed RoCE NICs need to be reconfigured to the new'
|
||||
+ ' interface naming scheme in order to prevent loss of network'
|
||||
+ ' access to your system via these interfaces after the upgrade.'
|
||||
+ ' For more information, see: {url}'
|
||||
+ '\n\nRoCE detected on the following NICs:{nics}'
|
||||
+ ).format(
|
||||
+ nics=_fmt_list(roce_nics),
|
||||
+ url=DOC_URL,
|
||||
+ **DISTRO_REPORT_NAMES,
|
||||
+ )
|
||||
+ remmediation_hint = (
|
||||
+ 'Prerequisite for upgrading to {target_distro} {target_version}:'
|
||||
+ 'In {source_distro} 8, all RoCE cards must be configured with the interface'
|
||||
+ ' names they should have in {target_distro} {target_version}.\n'
|
||||
+ 'For more information, see chapter 1.4 of the RHEL 8 Product'
|
||||
+ ' Documentation (see the attached link) and follow these steps:\n'
|
||||
+ '1.) determine the current interface device names of the RoCE'
|
||||
+ ' cards that are in "connected to" or in "connecting" state\n'
|
||||
+ '2.) determine if UID uniqueness is set for these cards\n'
|
||||
+ '3.) compute new interface device names from the UID or the'
|
||||
+ ' function ID, respectively\n'
|
||||
+ '4.) change the network interface device names in ifcfg'
|
||||
+ ' files\n'
|
||||
+ '5.) set the kernel parameter net.naming-scheme=rhel-8.7 in the'
|
||||
+ ' effective .conf file in /boot/loader/entries\n'
|
||||
+ '6.) adjust other settings that rely on the interface device names'
|
||||
+ ' (e.g. firewall) by changing the interface device names'
|
||||
+ ' accordingly\n'
|
||||
+ '7.) run `zipl -V` and reboot the system\n'
|
||||
+ '8.) check your network connectivity\n'
|
||||
+ '\n'
|
||||
+ 'Caution: Creating an incorrect configuration might cause the loss'
|
||||
+ ' of your network connection after reboot!'
|
||||
+ ).format(
|
||||
+ target_version="9" if get_target_distro_id() == "centos" else "9.x",
|
||||
+ **DISTRO_REPORT_NAMES,
|
||||
+ )
|
||||
|
||||
-def _report_wrong_setup(roce):
|
||||
- roce_nics = roce.roce_nics_connected + roce.roce_nics_connecting
|
||||
reporting.create_report([
|
||||
reporting.Title('Invalid RoCE configuration for the in-place upgrade'),
|
||||
- reporting.Summary(
|
||||
- 'The RHEL 9 system uses different network schemes for NIC names'
|
||||
- ' than RHEL 8.'
|
||||
- ' The below listed RoCE NICs need to be reconfigured to the new'
|
||||
- ' interface naming scheme in order to prevent loss of network'
|
||||
- ' access to your system via these interfaces after the upgrade.'
|
||||
- ' For more information, see: {url}'
|
||||
- '\n\nRoCE detected on the following NICs:{nics}'
|
||||
- .format(nics=_fmt_list(roce_nics), url=DOC_URL)
|
||||
- ),
|
||||
- reporting.Remediation(hint=(
|
||||
- 'Prerequisite for upgrading to RHEL9.x:'
|
||||
- 'In RHEL 8, all RoCE cards must be configured with the interface'
|
||||
- ' names they should have in RHEL9.x.\n'
|
||||
- 'For more information, see chapter 1.4 of the RHEL8 Product'
|
||||
- ' Documentation (see the attached link) and follow these steps:\n'
|
||||
- '1.) determine the current interface device names of the RoCE'
|
||||
- ' cards that are in "connected to" or in "connecting" state\n'
|
||||
- '2.) determine if UID uniqueness is set for these cards\n'
|
||||
- '3.) compute new interface device names from the UID or the'
|
||||
- ' function ID, respectively\n'
|
||||
- '4.) change the network interface device names in ifcfg'
|
||||
- ' files\n'
|
||||
- '5.) set the kernel parameter net.naming-scheme=rhel-8.7 in the'
|
||||
- ' effective .conf file in /boot/loader/entries\n'
|
||||
- '6.) adjust other settings that rely on the interface device names'
|
||||
- ' (e.g. firewall) by changing the interface device names'
|
||||
- ' accordingly\n'
|
||||
- '7.) run `zipl -V` and reboot the system\n'
|
||||
- '8.) check your network connectivity\n'
|
||||
- '\n'
|
||||
- 'Caution: Creating an incorrect configuration might cause the loss'
|
||||
- ' of your network connection after reboot!'
|
||||
- )),
|
||||
+ reporting.Summary(summary),
|
||||
+ reporting.Remediation(hint=remmediation_hint),
|
||||
reporting.ExternalLink(
|
||||
title='Predictable network interface device names on the System z platform',
|
||||
url=DOC_URL),
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,101 +0,0 @@
|
||||
From 71aa340ff3c2b5b9cd25e0aa731ace1b87e46d7f Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 23 Feb 2026 14:15:18 +0100
|
||||
Subject: [PATCH 17/44] opensshpermitrootlogincheck: Remove 7to8 related code
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../opensshpermitrootlogincheck/actor.py | 64 +------------------
|
||||
1 file changed, 2 insertions(+), 62 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
index 98d329ab..3aedfd5e 100644
|
||||
--- a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
@@ -1,7 +1,7 @@
|
||||
from leapp import reporting
|
||||
from leapp.actors import Actor
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
-from leapp.libraries.actor.opensshpermitrootlogincheck import global_value, semantics_changes
|
||||
+from leapp.libraries.actor.opensshpermitrootlogincheck import global_value
|
||||
from leapp.libraries.common.config.version import get_source_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import OpenSshConfig, Report
|
||||
@@ -46,73 +46,13 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
'Could not check openssh configuration', details={'details': 'No OpenSshConfig facts found.'}
|
||||
)
|
||||
|
||||
- if get_source_major_version() == '7':
|
||||
- self.process7to8(config)
|
||||
- elif get_source_major_version() == '8':
|
||||
+ if get_source_major_version() == '8':
|
||||
self.process8to9(config)
|
||||
elif int(get_source_major_version()) >= 9:
|
||||
pass
|
||||
else:
|
||||
api.current_logger().warning('Unknown source major version: {}'.format(get_source_major_version()))
|
||||
|
||||
- @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:
|
||||
- return
|
||||
-
|
||||
- # When the configuration does not contain *any* PermitRootLogin directive and
|
||||
- # the configuration file was locally modified, it will not get updated by
|
||||
- # RPM and the user might be locked away from the server with new default
|
||||
- if not config.permit_root_login:
|
||||
- create_report([
|
||||
- reporting.Title('Possible problems with remote login using root account'),
|
||||
- reporting.Summary(
|
||||
- 'OpenSSH configuration file does not explicitly state '
|
||||
- 'the option PermitRootLogin in sshd_config file, '
|
||||
- 'which will default in RHEL8 to "prohibit-password".'
|
||||
- ),
|
||||
- reporting.Severity(reporting.Severity.HIGH),
|
||||
- reporting.Groups(COMMON_REPORT_TAGS),
|
||||
- reporting.Remediation(
|
||||
- hint='If you depend on remote root logins using passwords, consider '
|
||||
- 'setting up a different user for remote administration or adding '
|
||||
- '"PermitRootLogin yes" to sshd_config. '
|
||||
- 'If this change is ok for you, add explicit '
|
||||
- '"PermitRootLogin prohibit-password" to your sshd_config '
|
||||
- 'to ignore this inhibitor'
|
||||
- ),
|
||||
- reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
- ] + COMMON_RESOURCES)
|
||||
- return
|
||||
-
|
||||
- # Check if there is at least one PermitRootLogin other than "no"
|
||||
- # in match blocks (other than Match All).
|
||||
- # This usually means some more complicated setup depending on the
|
||||
- # default value being globally "yes" and being overwritten by this
|
||||
- # match block
|
||||
- if semantics_changes(config):
|
||||
- create_report([
|
||||
- reporting.Title('OpenSSH configured to allow root login'),
|
||||
- reporting.Summary(
|
||||
- 'OpenSSH is configured to deny root logins in match '
|
||||
- 'blocks, but not explicitly enabled in global or '
|
||||
- '"Match all" context. This update changes the '
|
||||
- 'default to disable root logins using passwords '
|
||||
- 'so your server might get inaccessible.'
|
||||
- ),
|
||||
- reporting.Severity(reporting.Severity.HIGH),
|
||||
- reporting.Groups(COMMON_REPORT_TAGS),
|
||||
- reporting.Remediation(
|
||||
- hint='Consider using different user for administrative '
|
||||
- 'logins or make sure your configuration file '
|
||||
- 'contains the line "PermitRootLogin yes" '
|
||||
- 'in global context if desired.'
|
||||
- ),
|
||||
- reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
- ] + COMMON_RESOURCES)
|
||||
-
|
||||
@staticmethod
|
||||
def process8to9(config):
|
||||
# RHEL8 default sshd configuration file is not modified: It will get replaced by rpm and
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,60 +0,0 @@
|
||||
From d5edd261a729f0a83aa9642bf3655acf63f8808e Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 23 Feb 2026 14:15:38 +0100
|
||||
Subject: [PATCH 18/44] opensshpermitrootlogincheck: Respect target distro name
|
||||
in report
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../actors/opensshpermitrootlogincheck/actor.py | 17 ++++++++++-------
|
||||
1 file changed, 10 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
index 3aedfd5e..93ee5021 100644
|
||||
--- a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
@@ -3,6 +3,7 @@ from leapp.actors import Actor
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.actor.opensshpermitrootlogincheck import global_value
|
||||
from leapp.libraries.common.config.version import get_source_major_version
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import OpenSshConfig, Report
|
||||
from leapp.reporting import create_report
|
||||
@@ -62,12 +63,12 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
create_report([
|
||||
reporting.Title('Possible problems with remote login using root account'),
|
||||
reporting.Summary(
|
||||
- 'OpenSSH configuration file will get updated to RHEL9 '
|
||||
+ 'OpenSSH configuration file will get updated to {target_distro} 9 '
|
||||
'version, no longer allowing root login with password. '
|
||||
'It is a good practice to use non-root administrative '
|
||||
'user and non-password authentications, but if you rely '
|
||||
'on the remote root login, this change can lock you out '
|
||||
- 'of this system.'
|
||||
+ 'of this system.'.format_map(DISTRO_REPORT_NAMES)
|
||||
),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups(COMMON_REPORT_TAGS),
|
||||
@@ -93,11 +94,13 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
create_report([
|
||||
reporting.Title('Remote root logins globally allowed using password'),
|
||||
reporting.Summary(
|
||||
- 'RHEL9 no longer allows remote root logins, but the '
|
||||
- 'server configuration explicitly overrides this default. '
|
||||
- 'The configuration file will not be updated and root is '
|
||||
- 'still going to be allowed to login with password. '
|
||||
- 'This is not recommended and considered as a security risk.'
|
||||
+ '{target_distro} 9 no longer allows remote root logins, but '
|
||||
+ 'the server configuration explicitly overrides this default. '
|
||||
+ 'The configuration file will not be updated and root is still'
|
||||
+ 'going to be allowed to login with password. This is not '
|
||||
+ 'recommended and considered as a security risk. '.format_map(
|
||||
+ DISTRO_REPORT_NAMES
|
||||
+ )
|
||||
),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups(COMMON_REPORT_TAGS),
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,120 +0,0 @@
|
||||
From 61dc43540b15c71a8a2c2d5705c5952de059b6d8 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 18:05:37 +0100
|
||||
Subject: [PATCH 19/44] checkifcfg_ifcfg: Respect distro name in report
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../checkifcfg/libraries/checkifcfg_ifcfg.py | 37 +++++++++++++------
|
||||
.../checkifcfg/tests/unit_test_ifcfg.py | 9 ++++-
|
||||
2 files changed, 32 insertions(+), 14 deletions(-)
|
||||
|
||||
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 ed666350..79ede81e 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkifcfg/libraries/checkifcfg_ifcfg.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkifcfg/libraries/checkifcfg_ifcfg.py
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
|
||||
from leapp import reporting
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.common.rpms import has_package
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import IfCfg, InstalledRPM, RpmTransactionTasks
|
||||
@@ -8,6 +9,12 @@ from leapp.models import IfCfg, InstalledRPM, RpmTransactionTasks
|
||||
FMT_LIST_SEPARATOR = '\n - '
|
||||
|
||||
|
||||
+def _format_files_list(files):
|
||||
+ return "".join(
|
||||
+ ["{}{}".format(FMT_LIST_SEPARATOR, f) for f in files]
|
||||
+ )
|
||||
+
|
||||
+
|
||||
def process():
|
||||
TRUE_VALUES = ['yes', 'true', '1']
|
||||
TYPE_MAP = {
|
||||
@@ -74,12 +81,15 @@ def process():
|
||||
|
||||
if bad_type_files:
|
||||
title = 'Network configuration for unsupported device types detected'
|
||||
- summary = ('RHEL 9 does not support the legacy network-scripts'
|
||||
- ' package that was deprecated in RHEL 8 in favor of'
|
||||
- ' NetworkManager. Files for device types that are not'
|
||||
- ' supported by NetworkManager are present in the system.'
|
||||
- ' Files with the problematic configuration:{}').format(
|
||||
- ''.join(['{}{}'.format(FMT_LIST_SEPARATOR, bfile) for bfile in bad_type_files])
|
||||
+ summary = (
|
||||
+ "{target_distro} 9 does not support the legacy network-scripts"
|
||||
+ " package that was deprecated in {source_distro} 8 in favor of"
|
||||
+ " NetworkManager. Files for device types that are not"
|
||||
+ " supported by NetworkManager are present in the system."
|
||||
+ " Files with the problematic configuration:{bad_files}".format(
|
||||
+ bad_files=_format_files_list(bad_type_files),
|
||||
+ **DISTRO_REPORT_NAMES,
|
||||
+ )
|
||||
)
|
||||
remediation = ('Consult the nm-settings-ifcfg-rh(5) manual for'
|
||||
' valid types of ifcfg files. Remove configuration'
|
||||
@@ -104,12 +114,15 @@ def process():
|
||||
|
||||
if not_controlled_files:
|
||||
title = 'Network configuration with disabled NetworkManager support detected'
|
||||
- summary = ('RHEL 9 does not support the legacy network-scripts'
|
||||
- ' package that was deprecated in RHEL 8 in favor of'
|
||||
- ' NetworkManager. Configuration present in the system'
|
||||
- ' prohibit NetworkManager from loading it.'
|
||||
- ' Files with the problematic configuration:{}').format(
|
||||
- ''.join(['{}{}'.format(FMT_LIST_SEPARATOR, bfile) for bfile in not_controlled_files])
|
||||
+ summary = (
|
||||
+ '{target_distro} 9 does not support the legacy network-scripts'
|
||||
+ ' package that was deprecated in {source_distro} 8 in favor of'
|
||||
+ ' NetworkManager. Configuration present in the system'
|
||||
+ ' prohibit NetworkManager from loading it.'
|
||||
+ ' Files with the problematic configuration:{bad_files}'
|
||||
+ ).format(
|
||||
+ bad_files=_format_files_list(not_controlled_files),
|
||||
+ **DISTRO_REPORT_NAMES,
|
||||
)
|
||||
remediation = ('Ensure the ifcfg files comply with format described in'
|
||||
' nm-settings-ifcfg-rh(5) manual and remove the'
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkifcfg/tests/unit_test_ifcfg.py b/repos/system_upgrade/el8toel9/actors/checkifcfg/tests/unit_test_ifcfg.py
|
||||
index ddabedf2..02ffc65c 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkifcfg/tests/unit_test_ifcfg.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkifcfg/tests/unit_test_ifcfg.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+from leapp.libraries.common import distro
|
||||
from leapp.models import IfCfg, IfCfgProperty, InstalledRPM, RPM, RpmTransactionTasks
|
||||
from leapp.reporting import Report
|
||||
from leapp.utils.report import is_inhibitor
|
||||
@@ -85,10 +86,12 @@ def test_ifcfg_good_type(current_actor_context):
|
||||
assert rpm_transaction.to_install == ["NetworkManager"]
|
||||
|
||||
|
||||
-def test_ifcfg_not_controlled(current_actor_context):
|
||||
+def test_ifcfg_not_controlled(monkeypatch, current_actor_context):
|
||||
"""
|
||||
Report if there's a NM_CONTROLLED=no file.
|
||||
"""
|
||||
+ monkeypatch.setattr(distro, 'get_source_distro_id', lambda: 'rhel')
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_id', lambda: 'rhel')
|
||||
|
||||
current_actor_context.feed(IfCfg(
|
||||
filename="/NM/ifcfg-eth0",
|
||||
@@ -105,10 +108,12 @@ def test_ifcfg_not_controlled(current_actor_context):
|
||||
assert "disabled NetworkManager" in report_fields['title']
|
||||
|
||||
|
||||
-def test_ifcfg_unknown_type(current_actor_context):
|
||||
+def test_ifcfg_unknown_type(monkeypatch, current_actor_context):
|
||||
"""
|
||||
Report if there's configuration for a type we don't recognize.
|
||||
"""
|
||||
+ monkeypatch.setattr(distro, 'get_source_distro_id', lambda: 'rhel')
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_id', lambda: 'rhel')
|
||||
|
||||
current_actor_context.feed(IfCfg(
|
||||
filename="/NM/ifcfg-pigeon0",
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,155 +0,0 @@
|
||||
From 747e4467aafe7c97b2a02b67527af70083a89e91 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 18:11:02 +0100
|
||||
Subject: [PATCH 20/44] opensslproviders: Use distro name in the leapp comment
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../libraries/add_provider.py | 13 ++--
|
||||
.../tests/test_add_provider.py | 66 ++++++++++++-------
|
||||
2 files changed, 53 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/opensslproviders/libraries/add_provider.py b/repos/system_upgrade/el8toel9/actors/opensslproviders/libraries/add_provider.py
|
||||
index 91462f18..3bf4cbf8 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/opensslproviders/libraries/add_provider.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/opensslproviders/libraries/add_provider.py
|
||||
@@ -2,13 +2,13 @@ import re
|
||||
|
||||
from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
|
||||
# The openssl configuration file
|
||||
# TODO copied from opensslconfigscanner/libraries/readconf.py
|
||||
CONFIG = '/etc/pki/tls/openssl.cnf'
|
||||
|
||||
-LEAPP_COMMENT = '# Modified by leapp during upgrade to RHEL 9\n'
|
||||
APPEND_STRING = (
|
||||
'[provider_sect]\n'
|
||||
'default = default_sect\n'
|
||||
@@ -22,6 +22,11 @@ APPEND_STRING = (
|
||||
)
|
||||
|
||||
|
||||
+def _get_leapp_comment():
|
||||
+ # cannot access DISTRO_REPORT_NAMES at top level
|
||||
+ return f"# Modified by leapp during upgrade to {DISTRO_REPORT_NAMES.target} 9\n"
|
||||
+
|
||||
+
|
||||
def _add_lines(lines, add):
|
||||
"""
|
||||
Add lines to the list of lines. Breaking possible newlines onto separate items
|
||||
@@ -76,12 +81,12 @@ def _modify_file(f, fail_on_error=True):
|
||||
lines = f.readlines()
|
||||
lines = _replace(lines, r"openssl_conf\s*=\s*default_modules",
|
||||
"openssl_conf = openssl_init",
|
||||
- LEAPP_COMMENT, True, fail_on_error)
|
||||
+ _get_leapp_comment(), True, fail_on_error)
|
||||
lines = _replace(lines, r"\[\s*default_modules\s*\]",
|
||||
"[openssl_init]\n"
|
||||
"providers = provider_sect",
|
||||
- LEAPP_COMMENT, True, fail_on_error)
|
||||
- lines = _append(lines, APPEND_STRING, LEAPP_COMMENT)
|
||||
+ _get_leapp_comment(), True, fail_on_error)
|
||||
+ lines = _append(lines, APPEND_STRING, _get_leapp_comment())
|
||||
f.seek(0)
|
||||
f.write(''.join(lines))
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/opensslproviders/tests/test_add_provider.py b/repos/system_upgrade/el8toel9/actors/opensslproviders/tests/test_add_provider.py
|
||||
index 78f2e9c6..c6e31c29 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/opensslproviders/tests/test_add_provider.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/opensslproviders/tests/test_add_provider.py
|
||||
@@ -3,12 +3,14 @@ import pytest
|
||||
from leapp.libraries.actor.add_provider import (
|
||||
_add_lines,
|
||||
_append,
|
||||
+ _get_leapp_comment,
|
||||
_modify_file,
|
||||
_replace,
|
||||
APPEND_STRING,
|
||||
- LEAPP_COMMENT,
|
||||
NotFoundException
|
||||
)
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
|
||||
testdata = (
|
||||
([], 'one', ['one\n']),
|
||||
@@ -80,32 +82,52 @@ class MockFile:
|
||||
|
||||
|
||||
testdata = (
|
||||
- ('', ''),
|
||||
- ('openssl_conf=default_modules\n',
|
||||
- '{}# openssl_conf=default_modules\nopenssl_conf = openssl_init\n'.format(LEAPP_COMMENT)),
|
||||
- ('openssl_conf = default_modules\n',
|
||||
- '{}# openssl_conf = default_modules\nopenssl_conf = openssl_init\n'.format(LEAPP_COMMENT)),
|
||||
- ('openssl_conf = default_modules\n',
|
||||
- '{}# openssl_conf = default_modules\nopenssl_conf = openssl_init\n'.format(LEAPP_COMMENT)),
|
||||
- (' openssl_conf = default_modules \n',
|
||||
- '{}# openssl_conf = default_modules \nopenssl_conf = openssl_init\n'.format(LEAPP_COMMENT)),
|
||||
- ('[default_modules]\n',
|
||||
- '{}# [default_modules]\n[openssl_init]\nproviders = provider_sect\n'.format(LEAPP_COMMENT)),
|
||||
- ('[ default_modules ]\n',
|
||||
- '{}# [ default_modules ]\n[openssl_init]\nproviders = provider_sect\n'.format(LEAPP_COMMENT)),
|
||||
- (' [ default_modules ] \n',
|
||||
- '{}# [ default_modules ] \n[openssl_init]\nproviders = provider_sect\n'.format(LEAPP_COMMENT)),
|
||||
- ('openssl_conf=default_modules\n[default_modules]\n',
|
||||
- '{c}# openssl_conf=default_modules\nopenssl_conf = openssl_init\n'
|
||||
- '{c}# [default_modules]\n[openssl_init]\nproviders = provider_sect\n'.format(c=LEAPP_COMMENT)),
|
||||
+ ("", ""),
|
||||
+ (
|
||||
+ "openssl_conf=default_modules\n",
|
||||
+ "{c}# openssl_conf=default_modules\nopenssl_conf = openssl_init\n",
|
||||
+ ),
|
||||
+ (
|
||||
+ "openssl_conf = default_modules\n",
|
||||
+ "{c}# openssl_conf = default_modules\nopenssl_conf = openssl_init\n",
|
||||
+ ),
|
||||
+ (
|
||||
+ "openssl_conf = default_modules\n",
|
||||
+ "{c}# openssl_conf = default_modules\nopenssl_conf = openssl_init\n",
|
||||
+ ),
|
||||
+ (
|
||||
+ " openssl_conf = default_modules \n",
|
||||
+ "{c}# openssl_conf = default_modules \nopenssl_conf = openssl_init\n",
|
||||
+ ),
|
||||
+ (
|
||||
+ "[default_modules]\n",
|
||||
+ "{c}# [default_modules]\n[openssl_init]\nproviders = provider_sect\n",
|
||||
+ ),
|
||||
+ (
|
||||
+ "[ default_modules ]\n",
|
||||
+ "{c}# [ default_modules ]\n[openssl_init]\nproviders = provider_sect\n",
|
||||
+ ),
|
||||
+ (
|
||||
+ " [ default_modules ] \n",
|
||||
+ "{c}# [ default_modules ] \n[openssl_init]\nproviders = provider_sect\n",
|
||||
+ ),
|
||||
+ (
|
||||
+ "openssl_conf=default_modules\n[default_modules]\n",
|
||||
+ "{c}# openssl_conf=default_modules\nopenssl_conf = openssl_init\n"
|
||||
+ "{c}# [default_modules]\n[openssl_init]\nproviders = provider_sect\n",
|
||||
+ ),
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('file_content,expected', testdata)
|
||||
-def test_modify_file(file_content, expected):
|
||||
- f = MockFile(file_content)
|
||||
+def test_modify_file(monkeypatch, file_content, expected):
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+
|
||||
+ f = MockFile(file_content.format(c=_get_leapp_comment()))
|
||||
|
||||
# Test separate replaces and do not fail if pattern is not found
|
||||
_modify_file(f, False)
|
||||
|
||||
- assert f.content == "{}{}{}\n".format(expected, LEAPP_COMMENT, APPEND_STRING)
|
||||
+ assert f.content == "{}{}{}\n".format(
|
||||
+ expected.format(c=_get_leapp_comment()), _get_leapp_comment(), APPEND_STRING
|
||||
+ )
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
From 35ea535848223e32bd01d726a838abd2ae84fa3e Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 18:30:51 +0100
|
||||
Subject: [PATCH 21/44] opensslconfigcheck: Dont make the recommendation as
|
||||
redhat if not rhel target
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../opensslconfigcheck/libraries/opensslconfigcheck.py | 9 +++++++--
|
||||
.../tests/component_test_opensslconfigcheck.py | 7 +++++--
|
||||
2 files changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
index 07c1b22f..a686a7f2 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
@@ -1,4 +1,5 @@
|
||||
from leapp import reporting
|
||||
+from leapp.libraries.common.config import get_target_distro_id
|
||||
from leapp.libraries.stdlib import api
|
||||
|
||||
|
||||
@@ -228,14 +229,18 @@ def check_crypto_policies(config):
|
||||
path=("default_modules", "ssl_conf", "ssl_module",
|
||||
"system_default", "crypto_policy", ".include"),
|
||||
value="/etc/crypto-policies/back-ends/opensslcnf.config"):
|
||||
+
|
||||
reporting.create_report([
|
||||
reporting.Title('The OpenSSL configuration is missing the crypto policies integration'),
|
||||
+
|
||||
reporting.Summary(
|
||||
'The OpenSSL configuration file `/etc/pki/tls/openssl.cnf` does not contain the '
|
||||
'directive to include the system-wide crypto policies. This is not recommended '
|
||||
- 'by Red Hat and can lead to decreasing overall system security and inconsistent '
|
||||
+ '{} can lead to decreasing overall system security and inconsistent '
|
||||
'behavior between applications. If you need to adjust the crypto policies to your '
|
||||
- 'needs, it is recommended to use custom crypto policies.'
|
||||
+ 'needs, it is recommended to use custom crypto policies.'.format(
|
||||
+ "by Red Hat and" if get_target_distro_id() == "rhel" else "as it"
|
||||
+ )
|
||||
),
|
||||
reporting.Severity(reporting.Severity.MEDIUM),
|
||||
reporting.Groups([
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/tests/component_test_opensslconfigcheck.py b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/tests/component_test_opensslconfigcheck.py
|
||||
index d3363def..892cb7f1 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/tests/component_test_opensslconfigcheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/tests/component_test_opensslconfigcheck.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+from leapp.libraries.actor import opensslconfigcheck
|
||||
from leapp.models import OpenSslConfig, OpenSslConfigBlock, OpenSslConfigPair, Report
|
||||
|
||||
|
||||
@@ -12,7 +13,8 @@ def test_actor_execution_empty(current_actor_context):
|
||||
assert not current_actor_context.consume(Report)
|
||||
|
||||
|
||||
-def test_actor_execution_empty_modified(current_actor_context):
|
||||
+def test_actor_execution_empty_modified(current_actor_context, monkeypatch):
|
||||
+ monkeypatch.setattr(opensslconfigcheck, 'get_target_distro_id', lambda: 'rhel')
|
||||
current_actor_context.feed(
|
||||
OpenSslConfig(
|
||||
blocks=[],
|
||||
@@ -25,7 +27,8 @@ def test_actor_execution_empty_modified(current_actor_context):
|
||||
assert 'missing the crypto policies integration' in r[0].report['title']
|
||||
|
||||
|
||||
-def test_actor_execution_default_modified(current_actor_context):
|
||||
+def test_actor_execution_default_modified(current_actor_context, monkeypatch):
|
||||
+ monkeypatch.setattr(opensslconfigcheck, 'get_target_distro_id', lambda: 'rhel')
|
||||
current_actor_context.feed(
|
||||
OpenSslConfig(
|
||||
openssl_conf='default_modules',
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,73 +0,0 @@
|
||||
From 367654a5eeaa1a13d857ff04acdc1e7890550fc1 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 17:35:53 +0100
|
||||
Subject: [PATCH 22/44] checkmicroarchitecture: Respect distro name in report
|
||||
|
||||
Also add stable report key, the title used for key computation was using
|
||||
target major ver == 8:
|
||||
'Current x86-64 microarchitecture is unsupported in RHEL8'
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../libraries/checkmicroarchitecture.py | 17 ++++++++++-------
|
||||
1 file changed, 10 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmicroarchitecture/libraries/checkmicroarchitecture.py b/repos/system_upgrade/common/actors/checkmicroarchitecture/libraries/checkmicroarchitecture.py
|
||||
index a063b534..3011f906 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmicroarchitecture/libraries/checkmicroarchitecture.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmicroarchitecture/libraries/checkmicroarchitecture.py
|
||||
@@ -3,6 +3,7 @@ from collections import namedtuple
|
||||
from leapp import reporting
|
||||
from leapp.libraries.common.config.architecture import ARCH_X86_64, matches_architecture
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import CPUInfo
|
||||
|
||||
@@ -13,11 +14,11 @@ X86_64_V3_FLAGS = ['avx2', 'bmi1', 'bmi2', 'f16c', 'fma', 'abm', 'movbe', 'xsave
|
||||
MicroarchInfo = namedtuple('MicroarchInfo', ('required_flags', 'extra_report_fields', 'microarch_ver'))
|
||||
|
||||
|
||||
-def _inhibit_upgrade(missing_flags, target_rhel, microarch_ver, extra_report_fields=None):
|
||||
- title = 'Current x86-64 microarchitecture is unsupported in {0}'.format(target_rhel)
|
||||
+def _inhibit_upgrade(missing_flags, target_distro, microarch_ver, extra_report_fields=None):
|
||||
+ title = 'Current x86-64 microarchitecture is unsupported in the target OS'
|
||||
summary = ('{0} has a higher CPU requirement than older versions, it now requires a CPU '
|
||||
'compatible with {1} instruction set or higher.\n\n'
|
||||
- 'Missings flags detected are: {2}\n').format(target_rhel, microarch_ver, ', '.join(missing_flags))
|
||||
+ 'Missings flags detected are: {2}\n').format(target_distro, microarch_ver, ', '.join(missing_flags))
|
||||
|
||||
report_fields = [
|
||||
reporting.Title(title),
|
||||
@@ -28,7 +29,8 @@ def _inhibit_upgrade(missing_flags, target_rhel, microarch_ver, extra_report_fie
|
||||
reporting.Remediation(hint=('If a case of using virtualization, virtualization platforms often allow '
|
||||
'configuring a minimum denominator CPU model for compatibility when migrating '
|
||||
'between different CPU models. Ensure that minimum requirements are not below '
|
||||
- 'that of {0}\n').format(target_rhel)),
|
||||
+ 'that of {0}\n').format(target_distro)),
|
||||
+ reporting.Key('0f48cdbe5aa2584e2ca7f4eb470b9b79da9e515d')
|
||||
]
|
||||
|
||||
if extra_report_fields:
|
||||
@@ -69,14 +71,15 @@ def process():
|
||||
|
||||
microarch_info = rhel_major_to_microarch_reqs.get(get_target_major_version())
|
||||
if not microarch_info:
|
||||
- api.current_logger().info('No known microarchitecture requirements are known for target RHEL%s.',
|
||||
- get_target_major_version())
|
||||
+ api.current_logger().info(
|
||||
+ 'No known microarchitecture requirements are known'
|
||||
+ ' for target {target_distro} {version}.'.format(**DISTRO_REPORT_NAMES, version=get_target_major_version()))
|
||||
return
|
||||
|
||||
missing_flags = [flag for flag in microarch_info.required_flags if flag not in cpuinfo.flags]
|
||||
api.current_logger().debug('Required flags missing: %s', missing_flags)
|
||||
if missing_flags:
|
||||
_inhibit_upgrade(missing_flags,
|
||||
- 'RHEL{0}'.format(get_target_major_version()),
|
||||
+ '{target_distro} {version}'.format(**DISTRO_REPORT_NAMES, version=get_target_major_version()),
|
||||
microarch_info.microarch_ver,
|
||||
extra_report_fields=microarch_info.extra_report_fields)
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,88 +0,0 @@
|
||||
From 0e250cdc4672263d753209c420c15a33f9ae90eb Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 17:45:16 +0100
|
||||
Subject: [PATCH 23/44] checkmemory: Respect distro name in reports
|
||||
|
||||
Also add stable key to the report, the distro key was computed as if for
|
||||
7->8 upgrade, the title:
|
||||
'Minimum memory requirements for RHEL 8 are not met'
|
||||
|
||||
as the reports for 8->9 and 9->10 are unified with the above report, the
|
||||
following keys are no longer used:
|
||||
Minimum memory requirements for RHEL 9 are not met -> e3066f6fae135718b3158597145554c4f22b9372
|
||||
Minimum memory requirements for RHEL 10 are not met -> ccf14c3ac899f3cdc3123dadac399cafe28ce2ef
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../checkmemory/libraries/checkmemory.py | 33 ++++++++++---------
|
||||
.../checkmemory/tests/test_checkmemory.py | 2 +-
|
||||
2 files changed, 18 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
index 040b404b..cdf8faa6 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
@@ -1,6 +1,6 @@
|
||||
from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
-from leapp.libraries.common.config import architecture, version
|
||||
+from leapp.libraries.common.config import architecture
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import MemoryInfo
|
||||
|
||||
@@ -32,23 +32,24 @@ def process():
|
||||
minimum_req_error = _check_memory(memoryinfo)
|
||||
|
||||
if minimum_req_error:
|
||||
- title = 'Minimum memory requirements for RHEL {} are not met'.format(version.get_target_major_version())
|
||||
+ title = "Minimum memory requirements for the target OS are not met"
|
||||
summary = 'Memory detected: {} MiB, required: {} MiB'.format(
|
||||
int(minimum_req_error['detected'] / 1024),
|
||||
int(minimum_req_error['minimal_req'] / 1024),
|
||||
)
|
||||
reporting.create_report([
|
||||
- reporting.Title(title),
|
||||
- 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'
|
||||
- ),
|
||||
- ])
|
||||
+ reporting.Title(title),
|
||||
+ 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'
|
||||
+ ),
|
||||
+ reporting.Key('be50646b45beb8304c13daf5380d836a4be8e1cc'),
|
||||
+ ])
|
||||
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 79158dc6..38ddfa33 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 9 are not met'
|
||||
+ title_msg = 'Minimum memory requirements for the target OS 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())
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,126 +0,0 @@
|
||||
From 73b2a3f76e6f808c381a29253ef7e1cd5bfd4f69 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 18:11:43 +0100
|
||||
Subject: [PATCH 24/44] targetuserspacecreator: Respect distro name in report
|
||||
|
||||
Also add stable report key for no base repos inhibitor. The key was
|
||||
computed with 'Cannot find required basic RHEL target repositories.' as
|
||||
the title.
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../libraries/userspacegen.py | 34 ++++++++++---------
|
||||
.../tests/unit_test_targetuserspacecreator.py | 10 +++---
|
||||
2 files changed, 23 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 7dbadae2..2475aad4 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -844,9 +844,8 @@ def _inhibit_if_no_base_repos(distro_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.'),
|
||||
+ report = [
|
||||
+ reporting.Title('Cannot find required basic target OS repositories.'),
|
||||
reporting.Summary(
|
||||
'This can happen when a repository ID was entered incorrectly either while using the --enablerepo'
|
||||
' option of leapp or in a third party actor that produces a CustomTargetRepositoryMessage.'
|
||||
@@ -854,17 +853,6 @@ def _inhibit_if_no_base_repos(distro_repoids):
|
||||
reporting.Groups([reporting.Groups.REPOSITORY]),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
- reporting.Remediation(hint=(
|
||||
- 'It is required to have RHEL repositories on the system'
|
||||
- ' provided by the subscription-manager unless the --no-rhsm'
|
||||
- ' option is specified. You might be missing a valid SKU for'
|
||||
- ' the target system or have a failed network connection.'
|
||||
- ' Check whether your system is attached to a valid SKU that is'
|
||||
- ' providing RHEL {} repositories.'
|
||||
- ' If you are using Red Hat Satellite, read the upgrade documentation'
|
||||
- ' 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'
|
||||
@@ -874,8 +862,22 @@ def _inhibit_if_no_base_repos(distro_repoids):
|
||||
# https://red.ht/preparing-for-upgrade-to-rhel9
|
||||
# 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')
|
||||
- ])
|
||||
+ title='Preparing for the upgrade'),
|
||||
+ reporting.Key('f5770a56e540f27d370da7b697cb4a2e81e2c30d'),
|
||||
+ ]
|
||||
+ if get_target_distro_id() == 'rhel':
|
||||
+ report.append(reporting.Remediation(hint=(
|
||||
+ 'It is required to have RHEL repositories on the system'
|
||||
+ ' provided by the subscription-manager unless the --no-rhsm'
|
||||
+ ' option is specified. You might be missing a valid SKU for'
|
||||
+ ' the target system or have a failed network connection.'
|
||||
+ ' Check whether your system is attached to a valid SKU that is'
|
||||
+ ' providing RHEL {} repositories.'
|
||||
+ ' If you are using Red Hat Satellite, read the upgrade documentation'
|
||||
+ ' to set up Satellite and the system properly.'
|
||||
+ .format(target_major_version)))
|
||||
+ )
|
||||
+ reporting.create_report(report)
|
||||
raise StopActorExecution()
|
||||
|
||||
|
||||
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 e8853979..b49eff56 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
|
||||
@@ -1103,7 +1103,7 @@ def test_gather_target_repositories_none_available(monkeypatch):
|
||||
reports = [m.report for m in mocked_produce.model_instances if isinstance(m, reporting.Report)]
|
||||
inhibitors = [m for m in reports if 'INHIBITOR' in m.get('flags', ())]
|
||||
assert len(inhibitors) == 1
|
||||
- assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
+ assert inhibitors[0].get('title', '') == 'Cannot find required basic target OS repositories.'
|
||||
|
||||
|
||||
@suppress_deprecation(models.RHELTargetRepository)
|
||||
@@ -1166,7 +1166,7 @@ def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
reports = [m.report for m in mocked_produce.model_instances if isinstance(m, reporting.Report)]
|
||||
inhibitors = [m for m in reports if 'inhibitor' in m.get('groups', ())]
|
||||
assert len(inhibitors) == 1
|
||||
- assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
+ assert inhibitors[0].get('title', '') == 'Cannot find required basic target OS repositories.'
|
||||
# Now test the case when either of AppStream and BaseOs is not available, upgrade should be inhibited
|
||||
mocked_produce = produce_mocked()
|
||||
monkeypatch.setattr(userspacegen.api, 'current_actor', CurrentActorMocked())
|
||||
@@ -1181,7 +1181,7 @@ def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
reports = [m.report for m in mocked_produce.model_instances if isinstance(m, reporting.Report)]
|
||||
inhibitors = [m for m in reports if 'inhibitor' in m.get('groups', ())]
|
||||
assert len(inhibitors) == 1
|
||||
- assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
+ assert inhibitors[0].get('title', '') == 'Cannot find required basic target OS repositories.'
|
||||
mocked_produce = produce_mocked()
|
||||
monkeypatch.setattr(userspacegen.api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(userspacegen.api.current_actor(), 'produce', mocked_produce)
|
||||
@@ -1195,7 +1195,7 @@ def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
reports = [m.report for m in mocked_produce.model_instances if isinstance(m, reporting.Report)]
|
||||
inhibitors = [m for m in reports if 'inhibitor' in m.get('groups', ())]
|
||||
assert len(inhibitors) == 1
|
||||
- assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
+ assert inhibitors[0].get('title', '') == 'Cannot find required basic target OS repositories.'
|
||||
|
||||
|
||||
def test__get_distro_available_repoids_norhsm_norhui(monkeypatch):
|
||||
@@ -1254,7 +1254,7 @@ def test__get_distro_available_repoids_nobaserepos_inhibit(
|
||||
# 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 "Cannot find required basic target OS repositories" in report["title"]
|
||||
assert reporting.Groups.INHIBITOR in report["groups"]
|
||||
|
||||
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,241 +0,0 @@
|
||||
From 8e0aad41201e080482fbc279fd2d58bc11c20e91 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 18:46:16 +0100
|
||||
Subject: [PATCH 25/44] checkdetecteddevicesanddirvers: Respect distro name in
|
||||
reports
|
||||
|
||||
Also add stable keys to all reports, the keys were generated as if on
|
||||
7->8 upgrade (target major version == 8), the exact titles used for
|
||||
computation:
|
||||
- 'Leapp detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed.'
|
||||
- 'Leapp detected devices which are no longer supported in RHEL 8. Upgrade cannot proceed.'
|
||||
- 'Leapp detected a processor which is no longer supported in RHEL 8. Upgrade cannot proceed.'
|
||||
- 'Leapp detected loaded kernel drivers which are no longer maintained in RHEL 8.'
|
||||
- 'Leapp detected devices which are no longer maintained in RHEL 8'
|
||||
- 'Leapp detected a processor which is no longer maintained in RHEL 8.'
|
||||
|
||||
The following report titles and keys are no longer used as they've been
|
||||
unified with the reports above and now also use the respective keys:
|
||||
|
||||
Leapp detected loaded kernel drivers which have been removed in RHEL 9. Upgrade cannot proceed.
|
||||
- 7ae2961239eec9905e2580fa6309a589b1dca953
|
||||
Leapp detected devices which are no longer supported in RHEL 9. Upgrade cannot proceed.
|
||||
- 0e042eba4d14bd1f1ae691db6389621f778f21ad
|
||||
Leapp detected a processor which is no longer supported in RHEL 9. Upgrade cannot proceed.
|
||||
- f79672290945c09de12a14b28906b98d5c8ed68a
|
||||
Leapp detected loaded kernel drivers which are no longer maintained in RHEL 9.
|
||||
- b03c306f274b33b4cf3c7cd3764366c599681481
|
||||
Leapp detected devices which are no longer maintained in RHEL 9
|
||||
- 65ac6710649c928288162900e8df8316ac8e1bda
|
||||
Leapp detected a processor which is no longer maintained in RHEL 9.
|
||||
- 93f6cf039f01095a59ebaf581ced33316e034ef8
|
||||
Leapp detected loaded kernel drivers which have been removed in RHEL 10. Upgrade cannot proceed.
|
||||
- 48e04852631245aa4afee9adcdc7c2375b8cffb8
|
||||
Leapp detected devices which are no longer supported in RHEL 10. Upgrade cannot proceed.
|
||||
- fa9da5bf370c8477eb4f8366b68ffac2aaae6374
|
||||
Leapp detected a processor which is no longer supported in RHEL 10. Upgrade cannot proceed.
|
||||
- f6199d8526ee41c3e89b4ed11b3f8ee90cfc6f9f
|
||||
Leapp detected loaded kernel drivers which are no longer maintained in RHEL 10.
|
||||
- fbb11ae5828d624c4e4c91e73d766c8e27b066d9
|
||||
Leapp detected devices which are no longer maintained in RHEL 10
|
||||
- 93f67baabd93c00625fce5ad47edbf19972e41a0
|
||||
Leapp detected a processor which is no longer maintained in RHEL 10.
|
||||
- 9dde4bcd8b458bd6803462216785df3a1476c1f8
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../libraries/checkdddd.py | 70 +++++++++++--------
|
||||
1 file changed, 41 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdetecteddevicesanddrivers/libraries/checkdddd.py b/repos/system_upgrade/common/actors/checkdetecteddevicesanddrivers/libraries/checkdddd.py
|
||||
index 1f01adde..22a39c29 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkdetecteddevicesanddrivers/libraries/checkdddd.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkdetecteddevicesanddrivers/libraries/checkdddd.py
|
||||
@@ -3,6 +3,7 @@ from enum import IntEnum
|
||||
|
||||
from leapp import reporting
|
||||
from leapp.libraries.common.config.version import get_source_major_version, get_target_major_version
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import DetectedDeviceOrDriver
|
||||
|
||||
@@ -22,17 +23,19 @@ def create_inhibitors(inhibiting_entries):
|
||||
if drivers:
|
||||
reporting.create_report([
|
||||
reporting.Title(
|
||||
- 'Leapp detected loaded kernel drivers which have been removed '
|
||||
- 'in RHEL {}. Upgrade cannot proceed.'.format(get_target_major_version())
|
||||
+ 'Leapp detected loaded kernel drivers that have been removed in'
|
||||
+ ' the target OS. Upgrade cannot proceed.'
|
||||
),
|
||||
reporting.Summary(
|
||||
(
|
||||
- 'Support for the following RHEL {source} device drivers has been removed in RHEL {target}:\n'
|
||||
+ 'Support for the following {source_distro} {source_version} device drivers has'
|
||||
+ ' been removed in {target_distro} {target_version}:\n'
|
||||
' - {drivers}\n'
|
||||
).format(
|
||||
drivers='\n - '.join([entry.driver_name for entry in drivers]),
|
||||
- target=get_target_major_version(),
|
||||
- source=get_source_major_version(),
|
||||
+ target_version=get_target_major_version(),
|
||||
+ source_version=get_source_major_version(),
|
||||
+ **DISTRO_REPORT_NAMES
|
||||
)
|
||||
),
|
||||
reporting.ExternalLink(
|
||||
@@ -52,52 +55,57 @@ def create_inhibitors(inhibiting_entries):
|
||||
reporting.Audience('sysadmin'),
|
||||
reporting.Groups([reporting.Groups.KERNEL, reporting.Groups.DRIVERS]),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
- reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
+ reporting.Key('f08a07da902958defa4f5c2699fae9ec2eb67c5b'),
|
||||
])
|
||||
|
||||
devices = inhibiting_entries.get(MessagingClass.DEVICES)
|
||||
if devices:
|
||||
reporting.create_report([
|
||||
reporting.Title(
|
||||
- 'Leapp detected devices which are no longer supported in RHEL {}. Upgrade cannot proceed.'.format(
|
||||
- get_target_major_version())
|
||||
+ 'Leapp detected devices no longer supported by the target OS.'
|
||||
+ ' Upgrade cannot proceed.'
|
||||
),
|
||||
reporting.Summary(
|
||||
(
|
||||
- 'Support for the following devices has been removed in RHEL {target}:\n'
|
||||
+ 'Support for the following devices has been removed in {target_distro} {version}:\n'
|
||||
' - {devices}\n'
|
||||
).format(
|
||||
devices='\n - '.join(['{name} ({pci})'.format(name=entry.device_name,
|
||||
pci=entry.device_id) for entry in devices]),
|
||||
- target=get_target_major_version(),
|
||||
+ version=get_target_major_version(),
|
||||
+ **DISTRO_REPORT_NAMES
|
||||
)
|
||||
),
|
||||
reporting.Audience('sysadmin'),
|
||||
reporting.Groups([reporting.Groups.KERNEL]),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
- reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
+ reporting.Key('ccfc28592c82123649fc824c6c1c89cabfceae7c'),
|
||||
])
|
||||
|
||||
cpus = inhibiting_entries.get(MessagingClass.CPUS)
|
||||
if cpus:
|
||||
reporting.create_report([
|
||||
reporting.Title(
|
||||
- 'Leapp detected a processor which is no longer supported in RHEL {}. Upgrade cannot proceed.'.format(
|
||||
- get_target_major_version())
|
||||
+ 'Leapp detected a processor no longer supported by the target OS.'
|
||||
+ ' Upgrade cannot proceed.'
|
||||
),
|
||||
reporting.Summary(
|
||||
(
|
||||
- 'Support for the following processors has been removed in RHEL {target}:\n'
|
||||
+ 'Support for the following processors has been removed in {target_distro} {version}:\n'
|
||||
' - {processors}\n'
|
||||
).format(
|
||||
processors='\n - '.join([entry.device_name for entry in cpus]),
|
||||
- target=get_target_major_version(),
|
||||
+ version=get_target_major_version(),
|
||||
+ **DISTRO_REPORT_NAMES
|
||||
)
|
||||
),
|
||||
reporting.Audience('sysadmin'),
|
||||
reporting.Groups([reporting.Groups.KERNEL, reporting.Groups.BOOT]),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
- reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
+ reporting.Key('e3e9e4d2566733e2f843db9823c8568b9b6922f9'),
|
||||
])
|
||||
|
||||
|
||||
@@ -109,65 +117,69 @@ def create_warnings(unmaintained_entries):
|
||||
if drivers:
|
||||
reporting.create_report([
|
||||
reporting.Title(
|
||||
- 'Leapp detected loaded kernel drivers which are no longer maintained in RHEL {}.'.format(
|
||||
- get_target_major_version())
|
||||
+ 'Leapp detected loaded kernel drivers no longer maintained in the target OS'
|
||||
),
|
||||
reporting.Summary(
|
||||
(
|
||||
- 'The following RHEL {source} device drivers are no longer maintained RHEL {target}:\n'
|
||||
+ 'The following {source_distro} {source_version} device drivers are no longer'
|
||||
+ ' maintained {target_distro} {target_version}:\n'
|
||||
' - {drivers}\n'
|
||||
).format(
|
||||
drivers='\n - '.join([entry.driver_name for entry in drivers]),
|
||||
- target=get_target_major_version(),
|
||||
- source=get_source_major_version(),
|
||||
+ target_version=get_target_major_version(),
|
||||
+ source_version=get_source_major_version(),
|
||||
+ **DISTRO_REPORT_NAMES
|
||||
)
|
||||
),
|
||||
reporting.Audience('sysadmin'),
|
||||
reporting.Groups([reporting.Groups.KERNEL, reporting.Groups.DRIVERS]),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Key('0ff2413fd3cb0358736bf9be597f4dbdf58f2c4d'),
|
||||
])
|
||||
|
||||
devices = unmaintained_entries.get(MessagingClass.DEVICES)
|
||||
if devices:
|
||||
reporting.create_report([
|
||||
reporting.Title(
|
||||
- 'Leapp detected devices which are no longer maintained in RHEL {}'.format(
|
||||
- get_target_major_version())
|
||||
+ 'Leapp detected devices no longer maintained in the target OS'
|
||||
),
|
||||
reporting.Summary(
|
||||
(
|
||||
- 'The support for the following devices has been removed in RHEL {target} and '
|
||||
+ 'The support for the following devices has been removed in {target_distro} {version} and '
|
||||
'are no longer maintained:\n - {devices}\n'
|
||||
).format(
|
||||
devices='\n - '.join(['{name} ({pci})'.format(name=entry.device_name,
|
||||
pci=entry.device_id) for entry in devices]),
|
||||
- target=get_target_major_version(),
|
||||
+ version=get_target_major_version(),
|
||||
+ **DISTRO_REPORT_NAMES
|
||||
)
|
||||
),
|
||||
reporting.Audience('sysadmin'),
|
||||
reporting.Groups([reporting.Groups.KERNEL]),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Key('261e3e55a3a80346f2fcc2a1e59c64f7a4caa263'),
|
||||
])
|
||||
|
||||
cpus = unmaintained_entries.get(MessagingClass.CPUS)
|
||||
if cpus:
|
||||
reporting.create_report([
|
||||
reporting.Title(
|
||||
- 'Leapp detected a processor which is no longer maintained in RHEL {}.'.format(
|
||||
- get_target_major_version())
|
||||
+ 'Leapp detected a processor no longer maintained in the target OS'
|
||||
),
|
||||
reporting.Summary(
|
||||
(
|
||||
- 'The following processors are no longer maintained in RHEL {target}:\n'
|
||||
+ 'The following processors are no longer maintained in {target_distro} {version}:\n'
|
||||
' - {processors}\n'
|
||||
).format(
|
||||
processors='\n - '.join([entry.device_name for entry in cpus]),
|
||||
- target=get_target_major_version(),
|
||||
+ version=get_target_major_version(),
|
||||
+ **DISTRO_REPORT_NAMES
|
||||
)
|
||||
),
|
||||
reporting.Audience('sysadmin'),
|
||||
reporting.Groups([reporting.Groups.KERNEL, reporting.Groups.BOOT]),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Key('61eb181bbc56328fbe03b5229d25a8ea5ebdc7a2'),
|
||||
])
|
||||
|
||||
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,140 +0,0 @@
|
||||
From e9fa8aac4b32baaaf171c1cd6cd25f88a78d36a0 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 2 Mar 2026 19:01:02 +0100
|
||||
Subject: [PATCH 26/44] reportleftoverpackages: Respect distro name in reports
|
||||
|
||||
The actors is also moved from the reportleftoverpackages actor
|
||||
subdirectory to the root actor directory.
|
||||
|
||||
Also add stable report keys to the reports. The keys were computed using
|
||||
titles:
|
||||
- 'Leftover RHEL packages have been removed'
|
||||
- 'Some RHEL packages have not been upgraded'
|
||||
|
||||
Jira: RHEL-130950
|
||||
---
|
||||
.../{reportleftoverpackages => }/actor.py | 8 ++++----
|
||||
.../libraries/reportleftoverpackages.py | 17 +++++++++++------
|
||||
.../tests/test_reportleftoverpackages.py | 9 ++++++---
|
||||
3 files changed, 21 insertions(+), 13 deletions(-)
|
||||
rename repos/system_upgrade/common/actors/reportleftoverpackages/{reportleftoverpackages => }/actor.py (61%)
|
||||
rename repos/system_upgrade/common/actors/reportleftoverpackages/{reportleftoverpackages => }/libraries/reportleftoverpackages.py (73%)
|
||||
rename repos/system_upgrade/common/actors/reportleftoverpackages/{reportleftoverpackages => }/tests/test_reportleftoverpackages.py (86%)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/actor.py b/repos/system_upgrade/common/actors/reportleftoverpackages/actor.py
|
||||
similarity index 61%
|
||||
rename from repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/actor.py
|
||||
rename to repos/system_upgrade/common/actors/reportleftoverpackages/actor.py
|
||||
index 58573451..d0640774 100644
|
||||
--- a/repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/reportleftoverpackages/actor.py
|
||||
@@ -7,11 +7,11 @@ from leapp.tags import IPUWorkflowTag, RPMUpgradePhaseTag
|
||||
|
||||
class ReportLeftoverPackages(Actor):
|
||||
"""
|
||||
- Collect messages about leftover RHEL packages from older major versions and generate a report.
|
||||
+ Generate a report about leftover distribution packages from older major versions.
|
||||
|
||||
- Depending on execution of previous actors,
|
||||
- generated report contains information that there are still old RHEL packages
|
||||
- present on the system, which makes it unsupported or lists packages that have been removed.
|
||||
+ Generated report informs about old distribution packages present on the system,
|
||||
+ which makes it unsupported, and lists packages that have been removed if there
|
||||
+ were any.
|
||||
"""
|
||||
|
||||
name = 'report_leftover_packages'
|
||||
diff --git a/repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/libraries/reportleftoverpackages.py b/repos/system_upgrade/common/actors/reportleftoverpackages/libraries/reportleftoverpackages.py
|
||||
similarity index 73%
|
||||
rename from repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/libraries/reportleftoverpackages.py
|
||||
rename to repos/system_upgrade/common/actors/reportleftoverpackages/libraries/reportleftoverpackages.py
|
||||
index 51bda931..cd45ac87 100644
|
||||
--- a/repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/libraries/reportleftoverpackages.py
|
||||
+++ b/repos/system_upgrade/common/actors/reportleftoverpackages/libraries/reportleftoverpackages.py
|
||||
@@ -1,4 +1,5 @@
|
||||
from leapp import reporting
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import LeftoverPackages, RemovedPackages
|
||||
|
||||
@@ -11,15 +12,16 @@ def process():
|
||||
leftover_pkgs_to_remove = ['-'.join([pkg.name, pkg.version, pkg.release]) for pkg in leftover_packages.items]
|
||||
|
||||
if removed_packages and removed_packages.items:
|
||||
- title = 'Leftover RHEL packages have been removed'
|
||||
+ title = 'Leftover packages from the original OS have been removed'
|
||||
removed = ['-'.join([pkg.name, pkg.version, pkg.release]) for pkg in removed_packages.items]
|
||||
summary = (
|
||||
- 'Following packages have been removed:{sep}{list}\n'
|
||||
+ 'Following {source_distro} packages have been removed:{sep}{list}\n'
|
||||
'Dependent packages may have been removed as well, please check that you are not missing '
|
||||
'any packages.'
|
||||
.format(
|
||||
sep=FMT_LIST_SEPARATOR,
|
||||
- list=FMT_LIST_SEPARATOR.join(removed)
|
||||
+ list=FMT_LIST_SEPARATOR.join(removed),
|
||||
+ **DISTRO_REPORT_NAMES
|
||||
)
|
||||
)
|
||||
reporting.create_report([
|
||||
@@ -27,23 +29,26 @@ def process():
|
||||
reporting.Summary(summary),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.SANITY]),
|
||||
+ reporting.Key('5afbad560709afa4e40a160e40dfd44788ba9c3b'),
|
||||
] + [reporting.RelatedResource('package', pkg.name) for pkg in removed_packages.items])
|
||||
return
|
||||
|
||||
if leftover_packages and leftover_packages.items:
|
||||
summary = (
|
||||
- 'Following RHEL packages have not been upgraded:{sep}{list}\n'
|
||||
+ 'Following {source_distro} packages have not been upgraded:{sep}{list}\n'
|
||||
'Please remove these packages to keep your system in supported state.'
|
||||
.format(
|
||||
sep=FMT_LIST_SEPARATOR,
|
||||
- list=FMT_LIST_SEPARATOR.join(leftover_pkgs_to_remove)
|
||||
+ list=FMT_LIST_SEPARATOR.join(leftover_pkgs_to_remove),
|
||||
+ **DISTRO_REPORT_NAMES
|
||||
)
|
||||
)
|
||||
reporting.create_report([
|
||||
- reporting.Title('Some RHEL packages have not been upgraded'),
|
||||
+ reporting.Title('Some packages from the original OS have not been upgraded'),
|
||||
reporting.Summary(summary),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.SANITY]),
|
||||
+ reporting.Key('d424c3132ed78a8632b5c73d919909e453107c06'),
|
||||
] + [reporting.RelatedResource('package', pkg.name) for pkg in leftover_packages.items])
|
||||
else:
|
||||
api.current_logger().info('No leftover packages, skipping...')
|
||||
diff --git a/repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/tests/test_reportleftoverpackages.py b/repos/system_upgrade/common/actors/reportleftoverpackages/tests/test_reportleftoverpackages.py
|
||||
similarity index 86%
|
||||
rename from repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/tests/test_reportleftoverpackages.py
|
||||
rename to repos/system_upgrade/common/actors/reportleftoverpackages/tests/test_reportleftoverpackages.py
|
||||
index ff493c57..9502bfd2 100644
|
||||
--- a/repos/system_upgrade/common/actors/reportleftoverpackages/reportleftoverpackages/tests/test_reportleftoverpackages.py
|
||||
+++ b/repos/system_upgrade/common/actors/reportleftoverpackages/tests/test_reportleftoverpackages.py
|
||||
@@ -27,7 +27,10 @@ def test_no_removed_packages_leftover_present(monkeypatch):
|
||||
reportleftoverpackages.process()
|
||||
|
||||
assert reporting.create_report.called == 1
|
||||
- assert 'Some RHEL packages have not been upgraded' in reporting.create_report.report_fields['title']
|
||||
+ assert (
|
||||
+ 'Some packages from the original OS have not been upgraded'
|
||||
+ in reporting.create_report.report_fields['title']
|
||||
+ )
|
||||
assert 'Following RHEL packages have not been upgraded' in reporting.create_report.report_fields['summary']
|
||||
summary = 'Please remove these packages to keep your system in supported state.'
|
||||
assert summary in reporting.create_report.report_fields['summary']
|
||||
@@ -44,6 +47,6 @@ def test_removed_packages(monkeypatch):
|
||||
reportleftoverpackages.process()
|
||||
|
||||
assert reporting.create_report.called == 1
|
||||
- assert 'Leftover RHEL packages have been removed' in reporting.create_report.report_fields['title']
|
||||
- assert 'Following packages have been removed' in reporting.create_report.report_fields['summary']
|
||||
+ assert 'Leftover packages from the original OS have been removed' in reporting.create_report.report_fields['title']
|
||||
+ assert 'Following RHEL packages have been removed' in reporting.create_report.report_fields['summary']
|
||||
assert 'rpm-1.0-1.el7' in reporting.create_report.report_fields['summary']
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
From 9f0cbbcb5a75f77b226cf385b6179f93fbdf9bc0 Mon Sep 17 00:00:00 2001
|
||||
From: Sergii Golovatiuk <sgolovat@redhat.com>
|
||||
Date: Wed, 18 Mar 2026 17:19:38 +0100
|
||||
Subject: [PATCH 27/44] fix(overlaygen): exclude hugetlbfs from overlay mounts
|
||||
|
||||
hugetlbfs should not be mounted in the overlay environment during the
|
||||
upgrade. It's not a regular mount point. This patch adds it to the
|
||||
OVERLAY_DO_NOT_MOUNT exclusion list.
|
||||
|
||||
Resolves: RHEL-156902
|
||||
|
||||
Signed-off-by: Sergii Golovatiuk <sgolovat@redhat.com>
|
||||
---
|
||||
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 3091ab5b..9fdaadf9 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -10,7 +10,7 @@ from leapp.libraries.common.config import get_env
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
|
||||
-OVERLAY_DO_NOT_MOUNT = ('tmpfs', 'devtmpfs', 'devpts', 'sysfs', 'proc', 'cramfs', 'sysv', 'vfat')
|
||||
+OVERLAY_DO_NOT_MOUNT = ('tmpfs', 'devtmpfs', 'devpts', 'sysfs', 'proc', 'cramfs', 'sysv', 'vfat', 'hugetlbfs')
|
||||
|
||||
# NOTE(pstodulk): what about using more closer values and than just multiply
|
||||
# the final result by magical constant?... this number is most likely going to
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,121 +0,0 @@
|
||||
From 4c303cb3d30f891aa5d5d3ff4b3675deb41c6385 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Mon, 16 Mar 2026 23:10:49 +0100
|
||||
Subject: [PATCH 28/44] biosdevname: Fix check of naming scheme and tests
|
||||
|
||||
The original check matched also NIC names with suffixes that do not
|
||||
correspond to biosdevname naming scheme (e.g. "em0net"). Make the
|
||||
check strict for the whole ^string$ and update tests to cover the
|
||||
scenario.
|
||||
|
||||
Also I made small refactorings in tests
|
||||
* so in case of failure it's visible what input data caused the
|
||||
failure
|
||||
* minimize changes needed to do with planned update of Interface model
|
||||
---
|
||||
.../biosdevname/libraries/biosdevname.py | 4 +-
|
||||
.../biosdevname/tests/test_biosdevname.py | 73 ++++++++-----------
|
||||
2 files changed, 31 insertions(+), 46 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/biosdevname/libraries/biosdevname.py b/repos/system_upgrade/common/actors/biosdevname/libraries/biosdevname.py
|
||||
index a6b4a242..e2f4b1d1 100644
|
||||
--- a/repos/system_upgrade/common/actors/biosdevname/libraries/biosdevname.py
|
||||
+++ b/repos/system_upgrade/common/actors/biosdevname/libraries/biosdevname.py
|
||||
@@ -27,8 +27,8 @@ def is_vendor_dell():
|
||||
|
||||
def all_interfaces_biosdevname(interfaces):
|
||||
# Biosdevname supports two naming schemes
|
||||
- emx = re.compile('em[0-9]+')
|
||||
- pxpy = re.compile('p[0-9]+p[0-9]+')
|
||||
+ emx = re.compile('^em[0-9]+$')
|
||||
+ pxpy = re.compile('^p[0-9]+p[0-9]+$')
|
||||
|
||||
for i in interfaces:
|
||||
if emx.match(i.name) is None and pxpy.match(i.name) is None:
|
||||
diff --git a/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py b/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
||||
index 427eea54..3aa8c614 100644
|
||||
--- a/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
||||
+++ b/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
||||
@@ -59,50 +59,35 @@ def test_is_vendor_is_not_dell(monkeypatch):
|
||||
assert not biosdevname.is_vendor_dell()
|
||||
|
||||
|
||||
-def test_all_interfaces_biosdevname(monkeypatch):
|
||||
- pci_info = PCIAddress(domain="domain", function="function", bus="bus", device="device")
|
||||
-
|
||||
- interfaces = [
|
||||
- Interface(
|
||||
- name="eth0", mac="mac", vendor="dell", pci_info=pci_info, devpath="path", driver="drv"
|
||||
- )
|
||||
- ]
|
||||
- assert not biosdevname.all_interfaces_biosdevname(interfaces)
|
||||
- interfaces = [
|
||||
- Interface(
|
||||
- name="em0", mac="mac", vendor="dell", pci_info=pci_info, devpath="path", driver="drv"
|
||||
- )
|
||||
- ]
|
||||
- assert biosdevname.all_interfaces_biosdevname(interfaces)
|
||||
- interfaces = [
|
||||
- Interface(
|
||||
- name="p0p22", mac="mac", vendor="dell", pci_info=pci_info, devpath="path", driver="drv"
|
||||
- )
|
||||
- ]
|
||||
- assert biosdevname.all_interfaces_biosdevname(interfaces)
|
||||
-
|
||||
- interfaces = [
|
||||
- Interface(
|
||||
- name="p1p2", mac="mac", vendor="dell", pci_info=pci_info, devpath="path", driver="drv"
|
||||
- ),
|
||||
- Interface(
|
||||
- name="em2", mac="mac", vendor="dell", pci_info=pci_info, devpath="path", driver="drv"
|
||||
- ),
|
||||
- ]
|
||||
- assert biosdevname.all_interfaces_biosdevname(interfaces)
|
||||
-
|
||||
- interfaces = [
|
||||
- Interface(
|
||||
- name="p1p2", mac="mac", vendor="dell", pci_info=pci_info, devpath="path", driver="drv"
|
||||
- ),
|
||||
- Interface(
|
||||
- name="em2", mac="mac", vendor="dell", pci_info=pci_info, devpath="path", driver="drv"
|
||||
- ),
|
||||
- Interface(
|
||||
- name="eth0", mac="mac", vendor="dell", pci_info=pci_info, devpath="path", driver="drv"
|
||||
- ),
|
||||
- ]
|
||||
- assert not biosdevname.all_interfaces_biosdevname(interfaces)
|
||||
+def _gen_ifaces_by_names(names):
|
||||
+ pci = PCIAddress(domain="0000", bus="3e", function="00", device="PCI bridge")
|
||||
+ interfaces = []
|
||||
+ for nic_name in names:
|
||||
+ interfaces.append(Interface(
|
||||
+ name=nic_name,
|
||||
+ devpath="path",
|
||||
+ driver="drv",
|
||||
+ mac="52:54:00:0b:4a:6d",
|
||||
+ pci_info=pci,
|
||||
+ vendor="dell",
|
||||
+ ))
|
||||
+ return interfaces
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(("interface_names", "expected_result"), (
|
||||
+ (["eth0"], False),
|
||||
+ (["preem0"], False),
|
||||
+ (["em0post"], False),
|
||||
+ (["prep0p22"], False),
|
||||
+ (["p0p22post"], False),
|
||||
+ (["em0"], True),
|
||||
+ (["p0p22"], True),
|
||||
+ (["em2", "p1p22"], True),
|
||||
+ (["p1p2", "em2", "eth0"], False)
|
||||
+))
|
||||
+def test_all_interfaces_biosdevname(interface_names, expected_result):
|
||||
+ interfaces = _gen_ifaces_by_names(interface_names)
|
||||
+ assert biosdevname.all_interfaces_biosdevname(interfaces) == expected_result
|
||||
|
||||
|
||||
def test_enable_biosdevname(monkeypatch):
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,340 +0,0 @@
|
||||
From 8d8774c34518a6269d56f100c2fc312ec0bbbde1 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Fri, 13 Mar 2026 16:15:20 +0100
|
||||
Subject: [PATCH 29/44] persistentnetnamesdisable: refactoring + fix ethX
|
||||
detection
|
||||
|
||||
The original check of ethX interfaces was buggy as it detected all
|
||||
interfaces with the eth[0-9] substring:
|
||||
* eth0
|
||||
* preeth0
|
||||
* eth0post
|
||||
...
|
||||
The check has been corrected to search just for ethX kernel names,
|
||||
skipping NIC names with additional prefixes or suffixes. Added test
|
||||
for the ethX_count function. Tests have been slightly refactored to
|
||||
minimize planned changes in the Interface model.
|
||||
|
||||
Also the actor has been originally executed in incorrect phase.
|
||||
Moving the actor to CheckPhase where it should be. Also I refactorred
|
||||
the actor a little bit, moving the code to the private library to
|
||||
follow current best practices.
|
||||
|
||||
Jira: RHEL-3370
|
||||
---
|
||||
.../actors/persistentnetnamesdisable/actor.py | 63 +----------
|
||||
.../libraries/persistentnetnamesdisable.py | 75 +++++++++++++
|
||||
.../tests/test_persistentnetnamesdisable.py | 104 ++++++++++++++----
|
||||
3 files changed, 163 insertions(+), 79 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
index b0182982..15c43141 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
@@ -1,11 +1,8 @@
|
||||
-import re
|
||||
-
|
||||
-from leapp import reporting
|
||||
from leapp.actors import Actor
|
||||
-from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.libraries.actor import persistentnetnamesdisable
|
||||
from leapp.models import KernelCmdlineArg, PersistentNetNamesFacts
|
||||
-from leapp.reporting import create_report, Report
|
||||
-from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
|
||||
class PersistentNetNamesDisable(Actor):
|
||||
@@ -16,57 +13,7 @@ class PersistentNetNamesDisable(Actor):
|
||||
name = 'persistentnetnamesdisable'
|
||||
consumes = (PersistentNetNamesFacts,)
|
||||
produces = (KernelCmdlineArg, Report)
|
||||
- tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
-
|
||||
- @staticmethod
|
||||
- def ethX_count(interfaces):
|
||||
- ethX = re.compile('eth[0-9]+')
|
||||
- count = 0
|
||||
-
|
||||
- for i in interfaces:
|
||||
- if ethX.match(i.name):
|
||||
- count = count + 1
|
||||
- return count
|
||||
-
|
||||
- @staticmethod
|
||||
- def single_eth0(interfaces):
|
||||
- return len(interfaces) == 1 and interfaces[0].name == 'eth0'
|
||||
-
|
||||
- def disable_persistent_naming(self):
|
||||
- self.log.info("Single eth0 network interface detected. Appending 'net.ifnames=0' to RHEL-8 kernel commandline")
|
||||
- self.produce(KernelCmdlineArg(**{'key': 'net.ifnames', 'value': '0'}))
|
||||
+ tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
|
||||
def process(self):
|
||||
- interfaces = next(self.consume(PersistentNetNamesFacts)).interfaces
|
||||
-
|
||||
- if self.single_eth0(interfaces):
|
||||
- self.disable_persistent_naming()
|
||||
- elif len(interfaces) > 1 and self.ethX_count(interfaces) > 0:
|
||||
- report_entries = [
|
||||
- reporting.Title('Unsupported network configuration'),
|
||||
- reporting.Summary(
|
||||
- 'Detected multiple physical network interfaces where one or more use kernel naming (e.g. eth0). '
|
||||
- 'Upgrade process can not continue because stability of names can not be guaranteed. '
|
||||
- ),
|
||||
- reporting.ExternalLink(
|
||||
- title='How to Perform an In-Place Upgrade when Using Kernel-Assigned NIC Names',
|
||||
- url='https://access.redhat.com/solutions/4067471'
|
||||
- ),
|
||||
- reporting.Remediation(
|
||||
- hint='Rename all ethX network interfaces following the attached KB solution article.'
|
||||
- ),
|
||||
- reporting.Severity(reporting.Severity.HIGH),
|
||||
- reporting.Groups([reporting.Groups.NETWORK]),
|
||||
- reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
- ]
|
||||
-
|
||||
- if get_target_major_version() == '9':
|
||||
- report_entries.append(
|
||||
- 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'
|
||||
- )
|
||||
- )
|
||||
-
|
||||
- create_report(report_entries)
|
||||
+ persistentnetnamesdisable.process()
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
new file mode 100644
|
||||
index 00000000..0d1a90e2
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
@@ -0,0 +1,75 @@
|
||||
+import re
|
||||
+
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import KernelCmdlineArg, PersistentNetNamesFacts
|
||||
+from leapp.reporting import create_report
|
||||
+
|
||||
+
|
||||
+def ethX_count(interfaces):
|
||||
+ """
|
||||
+ Count how many network interfaces with ethX naming is present.
|
||||
+ """
|
||||
+ ethX = re.compile('^eth[0-9]+$')
|
||||
+ count = 0
|
||||
+
|
||||
+ for i in interfaces:
|
||||
+ if ethX.match(i.name):
|
||||
+ count = count + 1
|
||||
+ return count
|
||||
+
|
||||
+
|
||||
+def single_eth0(interfaces):
|
||||
+ return len(interfaces) == 1 and interfaces[0].name == 'eth0'
|
||||
+
|
||||
+
|
||||
+def disable_persistent_naming():
|
||||
+ api.current_logger().info(
|
||||
+ "Single eth0 network interface detected."
|
||||
+ " Appending 'net.ifnames=0' for the target system kernel commandline"
|
||||
+ )
|
||||
+ api.produce(KernelCmdlineArg(**{'key': 'net.ifnames', 'value': '0'}))
|
||||
+
|
||||
+
|
||||
+def report_ethX_ifaces():
|
||||
+ report_entries = [
|
||||
+ reporting.Title('Unsupported network configuration'),
|
||||
+ reporting.Summary(
|
||||
+ 'Detected multiple physical network interfaces where one or more'
|
||||
+ ' use kernel naming (e.g. eth0). Upgrade process cannot continue'
|
||||
+ ' because stability of names can not be guaranteed.'
|
||||
+ ),
|
||||
+ reporting.ExternalLink(
|
||||
+ title='How to Perform an In-Place Upgrade when Using Kernel-Assigned NIC Names',
|
||||
+ url='https://access.redhat.com/solutions/4067471'
|
||||
+ ),
|
||||
+ reporting.Remediation(
|
||||
+ hint='Rename all ethX network interfaces following the attached KB solution article.'
|
||||
+ ),
|
||||
+ reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Groups([reporting.Groups.NETWORK]),
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
+ ]
|
||||
+
|
||||
+ if get_target_major_version() == '9':
|
||||
+ report_entries.append(
|
||||
+ 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'
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ create_report(report_entries)
|
||||
+
|
||||
+
|
||||
+def process():
|
||||
+ interfaces = next(api.consume(PersistentNetNamesFacts)).interfaces
|
||||
+
|
||||
+ if single_eth0(interfaces):
|
||||
+ disable_persistent_naming()
|
||||
+ return
|
||||
+
|
||||
+ if len(interfaces) > 1 and ethX_count(interfaces):
|
||||
+ report_ethX_ifaces()
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
index 95b695c0..2369e80f 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
@@ -1,17 +1,53 @@
|
||||
import pytest
|
||||
|
||||
-from leapp.libraries.common.config import version
|
||||
+from leapp.libraries.actor import persistentnetnamesdisable
|
||||
from leapp.models import Interface, KernelCmdlineArg, PCIAddress, PersistentNetNamesFacts
|
||||
from leapp.reporting import Report
|
||||
from leapp.snactor.fixture import current_actor_context
|
||||
from leapp.utils.report import is_inhibitor
|
||||
|
||||
|
||||
+def _gen_ifaces_by_names(names):
|
||||
+ pci = PCIAddress(domain="0000", bus="3e", function="00", device="PCI bridge")
|
||||
+ interfaces = []
|
||||
+ for nic_name in names:
|
||||
+ interfaces.append(Interface(
|
||||
+ name=nic_name,
|
||||
+ devpath="/devices/platform/usb/cdc-wdm0",
|
||||
+ driver="pcieport",
|
||||
+ mac="52:54:00:0b:4a:6d",
|
||||
+ pci_info=pci,
|
||||
+ vendor="redhat",
|
||||
+ ))
|
||||
+ return interfaces
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(('interfaces', 'exp_result'), (
|
||||
+ (_gen_ifaces_by_names(['eno1', 'eno2', 'myfoo00', 'nicname']), 0),
|
||||
+ (_gen_ifaces_by_names(['preeth0', 'eth2post', 'preeth0post']), 0),
|
||||
+ (_gen_ifaces_by_names(['eth0']), 1),
|
||||
+ (_gen_ifaces_by_names(['eth0', 'eth1', 'eth01', 'eth4980']), 4),
|
||||
+ (_gen_ifaces_by_names(['myeth0', 'eth0', 'something']), 1),
|
||||
+))
|
||||
+def test_ethX_count(interfaces, exp_result):
|
||||
+ """
|
||||
+ Test the correct detection of ethX interfaces.
|
||||
+
|
||||
+ It tests the bug causing https://issues.redhat.com/browse/RHEL-3370
|
||||
+ """
|
||||
+ assert persistentnetnamesdisable.ethX_count(interfaces) == exp_result
|
||||
+
|
||||
+
|
||||
def test_actor_single_eth0(current_actor_context):
|
||||
pci = PCIAddress(domain="0000", bus="3e", function="00", device="PCI bridge")
|
||||
- interface = [Interface(name="eth0", mac="52:54:00:0b:4a:6d", vendor="redhat",
|
||||
- driver="pcieport", pci_info=pci,
|
||||
- devpath="/devices/platform/usb/cdc-wdm0")]
|
||||
+ interface = [Interface(
|
||||
+ name="eth0",
|
||||
+ mac="52:54:00:0b:4a:6d",
|
||||
+ vendor="redhat",
|
||||
+ driver="pcieport",
|
||||
+ pci_info=pci,
|
||||
+ devpath="/devices/platform/usb/cdc-wdm0"
|
||||
+ )]
|
||||
current_actor_context.feed(PersistentNetNamesFacts(interfaces=interface))
|
||||
current_actor_context.run()
|
||||
assert not current_actor_context.consume(Report)
|
||||
@@ -21,15 +57,25 @@ def test_actor_single_eth0(current_actor_context):
|
||||
'target_version', ['9', '10']
|
||||
)
|
||||
def test_actor_more_ethX(monkeypatch, current_actor_context, target_version):
|
||||
- monkeypatch.setattr(version, 'get_target_major_version', lambda: target_version)
|
||||
+ monkeypatch.setattr(persistentnetnamesdisable, 'get_target_major_version', lambda: target_version)
|
||||
pci1 = PCIAddress(domain="0000", bus="3e", function="00", device="PCI bridge")
|
||||
pci2 = PCIAddress(domain="0000", bus="3d", function="00", device="Serial controller")
|
||||
- interface = [Interface(name="eth0", mac="52:54:00:0b:4a:6d", vendor="redhat",
|
||||
- driver="pcieport", pci_info=pci1,
|
||||
- devpath="/devices/platform/usb/cdc-wdm0"),
|
||||
- Interface(name="eth1", mac="52:54:00:0b:4a:6a", vendor="redhat",
|
||||
- driver="serial", pci_info=pci2,
|
||||
- devpath="/devices/hidraw/hidraw0")]
|
||||
+ interface = [
|
||||
+ Interface(
|
||||
+ name="eth0",
|
||||
+ mac="52:54:00:0b:4a:6d",
|
||||
+ vendor="redhat",
|
||||
+ driver="pcieport",
|
||||
+ pci_info=pci1,
|
||||
+ devpath="/devices/platform/usb/cdc-wdm0"),
|
||||
+ Interface(
|
||||
+ name="eth1",
|
||||
+ mac="52:54:00:0b:4a:6a",
|
||||
+ vendor="redhat",
|
||||
+ driver="serial",
|
||||
+ pci_info=pci2,
|
||||
+ devpath="/devices/hidraw/hidraw0")
|
||||
+ ]
|
||||
current_actor_context.feed(PersistentNetNamesFacts(interfaces=interface))
|
||||
current_actor_context.run()
|
||||
|
||||
@@ -50,9 +96,15 @@ def test_actor_more_ethX(monkeypatch, current_actor_context, target_version):
|
||||
|
||||
def test_actor_single_int_not_ethX(current_actor_context):
|
||||
pci = PCIAddress(domain="0000", bus="3e", function="00", device="PCI bridge")
|
||||
- interface = [Interface(name="tap0", mac="52:54:00:0b:4a:60", vendor="redhat",
|
||||
- driver="pcieport", pci_info=pci,
|
||||
- devpath="/devices/platform/usb/cdc-wdm0")]
|
||||
+ interface = [
|
||||
+ Interface(
|
||||
+ name="tap0",
|
||||
+ mac="52:54:00:0b:4a:60",
|
||||
+ vendor="redhat",
|
||||
+ driver="pcieport",
|
||||
+ pci_info=pci,
|
||||
+ devpath="/devices/platform/usb/cdc-wdm0")
|
||||
+ ]
|
||||
current_actor_context.feed(PersistentNetNamesFacts(interfaces=interface))
|
||||
current_actor_context.run()
|
||||
assert not current_actor_context.consume(Report)
|
||||
@@ -62,15 +114,25 @@ def test_actor_single_int_not_ethX(current_actor_context):
|
||||
'target_version', ['9', '10']
|
||||
)
|
||||
def test_actor_ethX_and_not_ethX(monkeypatch, current_actor_context, target_version):
|
||||
- monkeypatch.setattr(version, 'get_target_major_version', lambda: target_version)
|
||||
+ monkeypatch.setattr(persistentnetnamesdisable, 'get_target_major_version', lambda: target_version)
|
||||
pci1 = PCIAddress(domain="0000", bus="3e", function="00", device="PCI bridge")
|
||||
pci2 = PCIAddress(domain="0000", bus="3d", function="00", device="Serial controller")
|
||||
- interface = [Interface(name="virbr0", mac="52:54:00:0b:4a:6d", vendor="redhat",
|
||||
- driver="pcieport", pci_info=pci1,
|
||||
- devpath="/devices/platform/usb/cdc-wdm0"),
|
||||
- Interface(name="eth0", mac="52:54:00:0b:4a:6a", vendor="redhat",
|
||||
- driver="serial", pci_info=pci2,
|
||||
- devpath="/devices/hidraw/hidraw0")]
|
||||
+ interface = [
|
||||
+ Interface(
|
||||
+ name="virbr0",
|
||||
+ mac="52:54:00:0b:4a:6d",
|
||||
+ vendor="redhat",
|
||||
+ driver="pcieport",
|
||||
+ pci_info=pci1,
|
||||
+ devpath="/devices/platform/usb/cdc-wdm0"),
|
||||
+ Interface(
|
||||
+ name="eth0",
|
||||
+ mac="52:54:00:0b:4a:6a",
|
||||
+ vendor="redhat",
|
||||
+ driver="serial",
|
||||
+ pci_info=pci2,
|
||||
+ devpath="/devices/hidraw/hidraw0")
|
||||
+ ]
|
||||
current_actor_context.feed(PersistentNetNamesFacts(interfaces=interface))
|
||||
current_actor_context.run()
|
||||
assert current_actor_context.consume(Report)
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,518 +0,0 @@
|
||||
From cdbb91156d1b87883523eed476c9a5d16b4b4e20 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Wed, 21 Feb 2024 20:55:54 +0100
|
||||
Subject: [PATCH 30/44] Fix scan of net interfaces: non-PCI, conflicting,
|
||||
broken
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Non-PCI network devices (present usually on IBM Z architecture)
|
||||
does not have ID_VENDOR_ID attribute and also there is nothing
|
||||
we could put into Interface.pci_info about them.
|
||||
For such devices:
|
||||
* set empty string for Interface.vendor field
|
||||
* and None value for pci_info.
|
||||
The Interface model has been updated, allowing None value for
|
||||
pci_info field.
|
||||
|
||||
Also some interfaces do not have to be "managed" by udev or can
|
||||
provide incomplete data. This can happen e.g. in situations when
|
||||
udev want to assign a NIC name that is already used by another
|
||||
network interface. Such an interface stays with kernel name (ethX)
|
||||
and udev DB contains only elementary information about it. This
|
||||
led originally to a skip of the interface during system scanning
|
||||
by leapp actors and such systems bypassed checks for presence of
|
||||
ethX NIC names later. Usually such interfaces have been renamed after
|
||||
the upgrade (either to a new non-ethX name, or they had a different
|
||||
ethX value) which led to another issues.
|
||||
|
||||
The new solution requires just bare-minimum details to be always
|
||||
present (like NIC name and device path; if missing, the skip is used
|
||||
again). For other values we set an empty strings if missing.
|
||||
|
||||
Tests have been updated and extended to cover new changes, using
|
||||
mainly real input data collected from affected systems.
|
||||
|
||||
Jira: RHEL-22371, RHEL-72140
|
||||
|
||||
Co-authored-by: Michal Hečko <michal.sk.com@gmail.com>
|
||||
---
|
||||
.../tests/test_persistentnetnames.py | 5 +
|
||||
.../tests/test_persistentnetnamesinitramfs.py | 6 +
|
||||
.../common/libraries/persistentnetnames.py | 35 ++-
|
||||
.../tests/test_persistentnetnames_library.py | 243 ++++++++++++++++--
|
||||
.../common/models/persistentnetnamesfacts.py | 57 +++-
|
||||
5 files changed, 314 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py b/repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py
|
||||
index ffea5983..a47eeabe 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnames/tests/test_persistentnetnames.py
|
||||
@@ -32,6 +32,11 @@ class interfaces_mocked:
|
||||
|
||||
@pytest.mark.parametrize('count', [0, 1, 8, 256])
|
||||
def test_run(monkeypatch, current_actor_context, count):
|
||||
+ """
|
||||
+ Basic test of interface scanner actor
|
||||
+
|
||||
+ Full testing of underlying function is covered in tests of common library.
|
||||
+ """
|
||||
monkeypatch.setattr(persistentnetnames, 'interfaces', interfaces_mocked(count))
|
||||
current_actor_context.run()
|
||||
assert len(current_actor_context.consume(PersistentNetNamesFacts)[0].interfaces) == count
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesinitramfs/tests/test_persistentnetnamesinitramfs.py b/repos/system_upgrade/common/actors/persistentnetnamesinitramfs/tests/test_persistentnetnamesinitramfs.py
|
||||
index f149502b..5605af4b 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesinitramfs/tests/test_persistentnetnamesinitramfs.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesinitramfs/tests/test_persistentnetnamesinitramfs.py
|
||||
@@ -32,6 +32,12 @@ class interfaces_mocked:
|
||||
|
||||
@pytest.mark.parametrize('count', [0, 1, 8, 256])
|
||||
def test_run(monkeypatch, current_actor_context, count):
|
||||
+ """
|
||||
+ Basic functionality test.
|
||||
+
|
||||
+ The full testing of the underlying scanner function is covered by the common
|
||||
+ library.
|
||||
+ """
|
||||
monkeypatch.setattr(persistentnetnames, 'interfaces', interfaces_mocked(count))
|
||||
current_actor_context.run()
|
||||
assert len(current_actor_context.consume(PersistentNetNamesFactsInitramfs)[0].interfaces) == count
|
||||
diff --git a/repos/system_upgrade/common/libraries/persistentnetnames.py b/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
index 7fdf7eaa..48dee5f8 100644
|
||||
--- a/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
+++ b/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
@@ -41,16 +41,41 @@ def interfaces():
|
||||
try:
|
||||
attrs['name'] = dev.sys_name
|
||||
attrs['devpath'] = dev.device_path
|
||||
- attrs['driver'] = dev['ID_NET_DRIVER']
|
||||
- attrs['vendor'] = dev['ID_VENDOR_ID']
|
||||
- attrs['pci_info'] = PCIAddress(**pci_info(dev['ID_PATH']))
|
||||
- attrs['mac'] = dev.attributes.get('address')
|
||||
+
|
||||
+ # can be missing when the interface is not "managed" by udev
|
||||
+ # TODO(pstodulk): check the MAC, I think that that one should be
|
||||
+ # actually always in DB.
|
||||
+ attrs['driver'] = dev.get('ID_NET_DRIVER', '')
|
||||
+ attrs['mac'] = dev.attributes.get('address', '')
|
||||
if isinstance(attrs['mac'], bytes):
|
||||
attrs['mac'] = attrs['mac'].decode()
|
||||
+
|
||||
+ # pci info is not provided for cards that do not use PCI bus,
|
||||
+ # also it can be missing if the interface is not "managed" by udev.
|
||||
+ # Also vendor can be provided only for cards on PCI bus.
|
||||
+ attrs['vendor'] = dev.get('ID_VENDOR_ID', '')
|
||||
+ attrs['pci_info'] = None # default for non-PCI card
|
||||
+ if dev.get('ID_PATH', '').startswith('pci-'):
|
||||
+ attrs['pci_info'] = PCIAddress(**pci_info(dev['ID_PATH']))
|
||||
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: %s', e)
|
||||
+ net_name = attrs.get('name', 'unknown-interface')
|
||||
+ api.current_logger().warning(
|
||||
+ 'Failed to gather information about network interface %s: "%s"',
|
||||
+ net_name, str(e)
|
||||
+ )
|
||||
+ # NOTE(pstodulk): skipping the interface as it's really broken
|
||||
+ # or unknown from the code in leapp-repository pov and another
|
||||
+ # processing would lead now to a broken upgrades.
|
||||
+ # Other values that are usually expected but can be missing
|
||||
+ # in some situations are covered and do not raise this exception.
|
||||
continue
|
||||
|
||||
+ if not all([attrs['driver'], attrs['mac']]):
|
||||
+ api.current_logger().warning(
|
||||
+ 'Information in udev about %s network interface is incomplete.',
|
||||
+ attrs['name']
|
||||
+ )
|
||||
+
|
||||
yield Interface(**attrs)
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_persistentnetnames_library.py b/repos/system_upgrade/common/libraries/tests/test_persistentnetnames_library.py
|
||||
index 74aa08fa..b45863d9 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_persistentnetnames_library.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_persistentnetnames_library.py
|
||||
@@ -1,57 +1,252 @@
|
||||
+import pytest
|
||||
+
|
||||
from leapp.libraries.common import persistentnetnames
|
||||
from leapp.libraries.common.testutils import produce_mocked
|
||||
from leapp.libraries.stdlib import api
|
||||
+from leapp.models import PCIAddress
|
||||
|
||||
|
||||
-class AttributesTest:
|
||||
- def __init__(self):
|
||||
- self.attributes = {
|
||||
- 'address': b'fa:16:3e:cd:26:5a'
|
||||
- }
|
||||
+class AttributesMocked:
|
||||
+ def __init__(self, attributes):
|
||||
+ self._attributes = attributes
|
||||
|
||||
- def get(self, attribute):
|
||||
- if attribute in self.attributes:
|
||||
- return self.attributes[attribute]
|
||||
- raise KeyError
|
||||
+ def get(self, key, default=None):
|
||||
+ return self._attributes.get(key, default)
|
||||
|
||||
|
||||
-class DeviceTest:
|
||||
- def __init__(self):
|
||||
- self.dict_data = {
|
||||
- 'ID_NET_DRIVER': 'virtio_net',
|
||||
- 'ID_VENDOR_ID': '0x1af4',
|
||||
- 'ID_PATH': 'pci-0000:00:03.0',
|
||||
- }
|
||||
+class DeviceMocked:
|
||||
+ def __init__(self, properties, attributes):
|
||||
+ self.dict_data = properties
|
||||
+ self._attributes = attributes
|
||||
|
||||
def __getitem__(self, key):
|
||||
+ return self.dict_data[key]
|
||||
+
|
||||
+ def get(self, key, default=None):
|
||||
if key in self.dict_data:
|
||||
return self.dict_data[key]
|
||||
- raise KeyError
|
||||
+ return default
|
||||
|
||||
@property
|
||||
def sys_name(self):
|
||||
- return 'eth'
|
||||
+ return self.dict_data['INTERFACE']
|
||||
|
||||
@property
|
||||
def device_path(self):
|
||||
- return '/devices/pci0000:00/0000:00:03.0/virtio0/net/eth0'
|
||||
+ return self.dict_data['DEVPATH']
|
||||
|
||||
@property
|
||||
def attributes(self):
|
||||
- return AttributesTest()
|
||||
+ return AttributesMocked(self._attributes)
|
||||
+
|
||||
|
||||
+@pytest.mark.parametrize('input_mac', ('fa:16:3e:cd:26:5a', b'fa:16:3e:cd:26:5a'))
|
||||
+def test_getting_interfaces_complete_good(monkeypatch, input_mac):
|
||||
+ """
|
||||
+ Detailed parsing of physical net interface with complete data
|
||||
+ """
|
||||
+ def mocked_physical_interfaces():
|
||||
+ properties = {
|
||||
+ 'CURRENT_TAGS': ':systemd:',
|
||||
+ 'DEVPATH': '/devices/pci0000:17/0000:17:02.0/0000:19:00.0/net/eno3',
|
||||
+ 'ID_BUS': 'pci',
|
||||
+ 'ID_MM_CANDIDATE': '1',
|
||||
+ 'ID_MODEL_FROM_DATABASE': 'NetXtreme BCM5720 Gigabit Ethernet PCIe',
|
||||
+ 'ID_MODEL_ID': '0x165f',
|
||||
+ 'ID_NET_DRIVER': 'tg3',
|
||||
+ 'ID_NET_LABEL_ONBOARD': 'NIC3',
|
||||
+ 'ID_NET_LINK_FILE': '/usr/lib/systemd/network/99-default.link',
|
||||
+ 'ID_NET_NAME': 'eno3',
|
||||
+ 'ID_NET_NAME_MAC': 'enx34735a9920fe',
|
||||
+ 'ID_NET_NAME_ONBOARD': 'eno3',
|
||||
+ 'ID_NET_NAME_PATH': 'enp25s0f0',
|
||||
+ 'ID_NET_NAMING_SCHEME': 'rhel-9.0',
|
||||
+ 'ID_OUI_FROM_DATABASE': 'Dell Inc.',
|
||||
+ 'ID_PATH': 'pci-0000:19:00.0',
|
||||
+ 'ID_PATH_TAG': 'pci-0000_19_00_0',
|
||||
+ 'ID_PCI_CLASS_FROM_DATABASE': 'Network controller',
|
||||
+ 'ID_PCI_SUBCLASS_FROM_DATABASE': 'Ethernet controller',
|
||||
+ 'ID_VENDOR_FROM_DATABASE': 'Broadcom Inc. and subsidiaries',
|
||||
+ 'ID_VENDOR_ID': '0x14e4',
|
||||
+ 'IFINDEX': '4',
|
||||
+ 'INTERFACE': 'eno3',
|
||||
+ 'SUBSYSTEM': 'net',
|
||||
+ 'SYSTEMD_ALIAS': '/sys/subsystem/net/devices/eno3',
|
||||
+ 'TAGS': ':systemd:',
|
||||
+ 'USEC_INITIALIZED': '16690226'
|
||||
+ }
|
||||
+ attributes = {
|
||||
+ 'address': input_mac
|
||||
+ }
|
||||
+ return [DeviceMocked(properties, attributes)]
|
||||
+
|
||||
+ monkeypatch.setattr(persistentnetnames, 'physical_interfaces', mocked_physical_interfaces)
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ interface = next(persistentnetnames.interfaces())
|
||||
|
||||
-def provide_test_interfaces():
|
||||
- return [DeviceTest()]
|
||||
+ assert interface.name == 'eno3'
|
||||
+ assert interface.devpath == '/devices/pci0000:17/0000:17:02.0/0000:19:00.0/net/eno3'
|
||||
+ assert interface.driver == 'tg3'
|
||||
+ assert interface.vendor == '0x14e4'
|
||||
+ assert interface.mac == 'fa:16:3e:cd:26:5a'
|
||||
+ assert interface.pci_info == PCIAddress(
|
||||
+ domain='0000',
|
||||
+ bus='19',
|
||||
+ device='00',
|
||||
+ function='0'
|
||||
+ )
|
||||
|
||||
|
||||
-def test_getting_interfaces(monkeypatch):
|
||||
- monkeypatch.setattr(persistentnetnames, 'physical_interfaces', provide_test_interfaces)
|
||||
+def test_getting_interfaces_complete_good_roce(monkeypatch):
|
||||
+ """
|
||||
+ ROCE net interface parsing
|
||||
+ """
|
||||
+ def mocked_physical_interfaces():
|
||||
+ properties = {
|
||||
+ 'CURRENT_TAGS': ':systemd:',
|
||||
+ 'DEVPATH': '/devices/pci0201:00/0201:00:00.0/net/eno513',
|
||||
+ 'ID_BUS': 'pci',
|
||||
+ 'ID_MODEL_FROM_DATABASE': 'ConnectX Family mlx5Gen Virtual Function',
|
||||
+ 'ID_MODEL_ID': '0x101e',
|
||||
+ 'ID_NET_DRIVER': 'mlx5_core',
|
||||
+ 'ID_NET_LINK_FILE': '/etc/systemd/network/10-anaconda-ifname-eno513.link',
|
||||
+ 'ID_NET_NAME': 'eno513',
|
||||
+ 'ID_NET_NAME_MAC': 'enx2219aef66069',
|
||||
+ 'ID_NET_NAME_ONBOARD': 'eno513',
|
||||
+ 'ID_NET_NAME_PATH': 'enP513p0s0',
|
||||
+ 'ID_NET_NAME_SLOT': 'ens5912',
|
||||
+ 'ID_NET_NAMING_SCHEME': 'rhel-9.0',
|
||||
+ 'ID_PATH': 'pci-0201:00:00.0',
|
||||
+ 'ID_PATH_TAG': 'pci-0201_00_00_0',
|
||||
+ 'ID_PCI_CLASS_FROM_DATABASE': 'Network controller',
|
||||
+ 'ID_PCI_SUBCLASS_FROM_DATABASE': 'Ethernet controller',
|
||||
+ 'ID_VENDOR_FROM_DATABASE': 'Mellanox Technologies',
|
||||
+ 'ID_VENDOR_ID': '0x15b3',
|
||||
+ 'IFINDEX': '2',
|
||||
+ 'INTERFACE': 'eno513',
|
||||
+ 'SUBSYSTEM': 'net',
|
||||
+ 'SYSTEMD_ALIAS': '/sys/subsystem/net/devices/eno513',
|
||||
+ 'TAGS': ':systemd:',
|
||||
+ 'USEC_INITIALIZED': '26747014'
|
||||
+ }
|
||||
+ attributes = {
|
||||
+ 'address': b'22:19:ae:f6:60:69'
|
||||
+ }
|
||||
+
|
||||
+ return [DeviceMocked(properties, attributes)]
|
||||
+
|
||||
+ monkeypatch.setattr(persistentnetnames, 'physical_interfaces', mocked_physical_interfaces)
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
interface = next(persistentnetnames.interfaces())
|
||||
+
|
||||
assert interface.name
|
||||
assert interface.devpath
|
||||
assert interface.driver
|
||||
assert interface.vendor
|
||||
+ assert interface.mac
|
||||
assert interface.pci_info
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(('properties', 'attributes'), (
|
||||
+ (
|
||||
+ {
|
||||
+ # artificial data
|
||||
+ 'CURRENT_TAGS': ':systemd:',
|
||||
+ 'DEVPATH': '/devices/whatever/net/eno3',
|
||||
+ 'ID_MM_CANDIDATE': '1',
|
||||
+ 'ID_MODEL_FROM_DATABASE': 'Foo',
|
||||
+ 'ID_MODEL_ID': '0x0000',
|
||||
+ 'ID_NET_DRIVER': 'tg3',
|
||||
+ 'ID_NET_LABEL_ONBOARD': 'NIC3',
|
||||
+ 'ID_NET_LINK_FILE': '/usr/lib/systemd/network/99-default.link',
|
||||
+ 'ID_NET_NAME': 'eno3',
|
||||
+ 'ID_NET_NAME_MAC': 'enx34735a9920fe',
|
||||
+ 'ID_NET_NAME_ONBOARD': 'eno3',
|
||||
+ 'ID_NET_NAME_PATH': 'enp25s0f0',
|
||||
+ 'ID_NET_NAMING_SCHEME': 'rhel-9.0',
|
||||
+ 'ID_OUI_FROM_DATABASE': 'Dell Inc.',
|
||||
+ 'IFINDEX': '4',
|
||||
+ 'INTERFACE': 'eno3',
|
||||
+ 'SUBSYSTEM': 'net',
|
||||
+ 'SYSTEMD_ALIAS': '/sys/subsystem/net/devices/eno3',
|
||||
+ 'TAGS': ':systemd:',
|
||||
+ 'USEC_INITIALIZED': '16690226'
|
||||
+ }, {
|
||||
+ 'address': b'fa:16:3e:cd:26:5a'
|
||||
+ }
|
||||
+ ), (
|
||||
+ {
|
||||
+ 'CURRENT_TAGS': ':systemd:',
|
||||
+ 'DEVPATH': '/devices/css0/0.0.0001/0.0.0001/virtio1/net/enc1',
|
||||
+ 'ID_NET_DRIVER': 'virtio_net',
|
||||
+ 'ID_NET_LINK_FILE': '/usr/lib/systemd/network/99-default.link',
|
||||
+ 'ID_NET_NAME': 'enc1',
|
||||
+ 'ID_NET_NAME_MAC': 'enx001738010124',
|
||||
+ 'ID_NET_NAME_PATH': 'enc1',
|
||||
+ 'ID_NET_NAMING_SCHEME': 'rhel-9.0',
|
||||
+ 'ID_OUI_FROM_DATABASE': 'International Business Machines',
|
||||
+ 'ID_PATH': 'ccw-0.0.0001',
|
||||
+ 'ID_PATH_TAG': 'ccw-0_0_0001',
|
||||
+ 'IFINDEX': '2',
|
||||
+ 'INTERFACE': 'enc1',
|
||||
+ 'SUBSYSTEM': 'net',
|
||||
+ 'SYSTEMD_ALIAS': '/sys/subsystem/net/devices/enc1',
|
||||
+ 'TAGS': ':systemd:',
|
||||
+ 'USEC_INITIALIZED': '3423981'
|
||||
+ }, {
|
||||
+ 'address': b'00:17:38:01:01:24'
|
||||
+ }
|
||||
+ )
|
||||
+))
|
||||
+def test_getting_interfaces_nonpci_good(monkeypatch, properties, attributes):
|
||||
+ """
|
||||
+ Processing of net interface with incomplete data
|
||||
+ """
|
||||
+ def mocked_physical_interfaces():
|
||||
+ return [DeviceMocked(properties, attributes)]
|
||||
+
|
||||
+ monkeypatch.setattr(persistentnetnames, 'physical_interfaces', mocked_physical_interfaces)
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ interface = next(persistentnetnames.interfaces())
|
||||
+
|
||||
+ assert interface.name
|
||||
+ assert interface.devpath
|
||||
+ assert interface.driver
|
||||
+ assert not interface.vendor
|
||||
+ assert interface.mac
|
||||
+ assert not interface.pci_info
|
||||
+
|
||||
+
|
||||
+def test_getting_interfaces_incomplete_udev_conflict(monkeypatch):
|
||||
+ """
|
||||
+ Test parsing of conflicting interface.
|
||||
+
|
||||
+ Such interface is not managed by udev and the information we could get
|
||||
+ about it is limited.
|
||||
+ """
|
||||
+ def mocked_physical_interfaces():
|
||||
+ properties = {
|
||||
+ 'DEVPATH': '/devices/pci0000:ae/0000:ae:00.0/0000:af:00.0/0000:b0:04.0/0000:b2:00.1/net/eth3',
|
||||
+ 'IFINDEX': '9',
|
||||
+ 'INTERFACE': 'eth3',
|
||||
+ 'SUBSYSTEM': 'net'
|
||||
+ }
|
||||
+ attributes = {
|
||||
+ 'address': b'fa:16:3e:cd:26:5a'
|
||||
+ }
|
||||
+ return [DeviceMocked(properties, attributes)]
|
||||
+
|
||||
+ monkeypatch.setattr(persistentnetnames, 'physical_interfaces', mocked_physical_interfaces)
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ interface = next(persistentnetnames.interfaces())
|
||||
+
|
||||
+ assert interface.name
|
||||
+ assert interface.devpath
|
||||
+ assert not interface.driver
|
||||
+ assert not interface.vendor
|
||||
assert interface.mac
|
||||
+ assert not interface.pci_info
|
||||
diff --git a/repos/system_upgrade/common/models/persistentnetnamesfacts.py b/repos/system_upgrade/common/models/persistentnetnamesfacts.py
|
||||
index 395b26f0..3c71cdcd 100644
|
||||
--- a/repos/system_upgrade/common/models/persistentnetnamesfacts.py
|
||||
+++ b/repos/system_upgrade/common/models/persistentnetnamesfacts.py
|
||||
@@ -4,7 +4,10 @@ from leapp.topics import SystemInfoTopic
|
||||
|
||||
class PCIAddress(Model):
|
||||
"""
|
||||
- TODO: tbd
|
||||
+ Network Interface PCI address.
|
||||
+
|
||||
+ This model should not be produced nor consumed by actors directly.
|
||||
+ It's part of the Interface model.
|
||||
"""
|
||||
topic = SystemInfoTopic
|
||||
|
||||
@@ -16,16 +19,49 @@ class PCIAddress(Model):
|
||||
|
||||
class Interface(Model):
|
||||
"""
|
||||
- TODO: tbd - Interface or NetworkInterface?
|
||||
+ Physical network interface
|
||||
+
|
||||
+ Contains information about a network interface collected from udev.
|
||||
+ Data can be incomplete in case of issues or when the interface is not
|
||||
+ managed by udev.
|
||||
+
|
||||
+ This model should not be produced or consumed by actors directly.
|
||||
+ See PersistentNetNamesFacts or PersistentNetNamesFactsInitramfs.
|
||||
"""
|
||||
topic = SystemInfoTopic
|
||||
|
||||
name = fields.String()
|
||||
+ """
|
||||
+ Name of the interface.
|
||||
+ """
|
||||
+
|
||||
devpath = fields.String()
|
||||
+ """
|
||||
+ Path to the device.
|
||||
+ """
|
||||
+
|
||||
driver = fields.String()
|
||||
+ """
|
||||
+ Network interface driver identifier.
|
||||
+ """
|
||||
+
|
||||
vendor = fields.String()
|
||||
- pci_info = fields.Model(PCIAddress)
|
||||
+ """
|
||||
+ Numeric identifier of the hardware vendor on PCI bus.
|
||||
+ """
|
||||
+
|
||||
+ pci_info = fields.Nullable(fields.Model(PCIAddress))
|
||||
+ """
|
||||
+ Parsed PCI address of the network interface.
|
||||
+
|
||||
+ The value is None if the network interface is not connected via PCI or it is not managed
|
||||
+ by udev.
|
||||
+ """
|
||||
+
|
||||
mac = fields.String()
|
||||
+ """
|
||||
+ MAC address of the network interface.
|
||||
+ """
|
||||
|
||||
|
||||
class PersistentNetNamesFacts(Model):
|
||||
@@ -34,6 +70,9 @@ class PersistentNetNamesFacts(Model):
|
||||
"""
|
||||
topic = SystemInfoTopic
|
||||
interfaces = fields.List(fields.Model(Interface))
|
||||
+ """
|
||||
+ List of network interfaces with information collected from udev.
|
||||
+ """
|
||||
|
||||
|
||||
class PersistentNetNamesFactsInitramfs(PersistentNetNamesFacts):
|
||||
@@ -49,8 +88,17 @@ class RenamedInterface(Model):
|
||||
"""
|
||||
topic = SystemInfoTopic
|
||||
|
||||
+ # TODO(pstodulk) deprecate these fields and replace them by new ones
|
||||
+ # or deprecate the model completely.
|
||||
rhel7_name = fields.String()
|
||||
+ """
|
||||
+ Original interface name.
|
||||
+ """
|
||||
+
|
||||
rhel8_name = fields.String()
|
||||
+ """
|
||||
+ New interface name.
|
||||
+ """
|
||||
|
||||
|
||||
class RenamedInterfaces(Model):
|
||||
@@ -63,3 +111,6 @@ class RenamedInterfaces(Model):
|
||||
topic = SystemInfoTopic
|
||||
|
||||
renamed = fields.List(fields.Model(RenamedInterface))
|
||||
+ """
|
||||
+ The list of renamed interfaces.
|
||||
+ """
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,398 +0,0 @@
|
||||
From c60f657713f130d3accee7ceb303d7286b6180d5 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Wed, 18 Mar 2026 17:57:56 +0100
|
||||
Subject: [PATCH 31/44] persistentnetnamesconfig: Deprecate legacy
|
||||
functionality
|
||||
|
||||
The legacy solution to make NIC names persistent during the upgrade
|
||||
is buggy and usually it's not used nowadays. Creation of link files
|
||||
in the legacy solution breaks bonding configuration and also does not
|
||||
handle interfaces in case of InfiniBand and RDMA.
|
||||
|
||||
At this point, we plan to use of net naming scheme mandatory during
|
||||
the upgrade (or at least the only solution for persistent NIC names).
|
||||
Mark following symbols as deprecated:
|
||||
* LEAPP_DISABLE_NET_NAMING_SCHEMES (envar)
|
||||
* LEAPP_NO_NETWORK_RENAMING (envar)
|
||||
* RenamedInterfaces (model)
|
||||
* RenamedInterface (model)
|
||||
|
||||
Also the RenamedInterface model had fields `rhel7_name` & `rhel8_name`,
|
||||
which has not actually correspond to the real state. So the fields
|
||||
have been renamed instantly to `original_name` & `new_name`.
|
||||
|
||||
Also dropping the produce of InitrdInclude message in the actor as
|
||||
the model is deprecated for a long time.
|
||||
|
||||
We could possibly still think about reporting changed interface names,
|
||||
but such a report should happen in the last (FirstBoot) phase when
|
||||
the networking should be already fully initialized. Such a report
|
||||
would be just a check whether net naming scheme works as expected.
|
||||
But it's not considered at this very moment.
|
||||
---
|
||||
docs/source/configuring-ipu/envars.md | 20 +++++++-
|
||||
.../libraries-and-api/deprecations-list.md | 6 ++-
|
||||
.../actors/persistentnetnamesconfig/actor.py | 19 ++++---
|
||||
.../libraries/persistentnetnamesconfig.py | 27 +++++-----
|
||||
.../tests/test_persistentnetnamesconfig.py | 50 ++++++++++---------
|
||||
.../common/models/persistentnetnamesfacts.py | 21 ++++++--
|
||||
6 files changed, 93 insertions(+), 50 deletions(-)
|
||||
|
||||
diff --git a/docs/source/configuring-ipu/envars.md b/docs/source/configuring-ipu/envars.md
|
||||
index 72d00634..9fa37f4f 100644
|
||||
--- a/docs/source/configuring-ipu/envars.md
|
||||
+++ b/docs/source/configuring-ipu/envars.md
|
||||
@@ -6,11 +6,21 @@ Below is a list of the general and development variables available.
|
||||
### General variables
|
||||
|
||||
#### LEAPP_DISABLE_NET_NAMING_SCHEMES
|
||||
-On RHEL 8 to 9 upgrades, by default, net.naming-scheme is used to make network interface names immutable during the upgrade. In this case an extra RPM named `rhel-net-naming-sysattrs` is installed to the target system and target userspace container, providing the definitions of the "profiles" for net.naming-scheme.
|
||||
+The `net.naming-scheme` kernel command line option is used by default to make
|
||||
+network interface names immutable during the upgrade.
|
||||
+In this case an extra RPM named `rhel-net-naming-sysattrs` (or `net-naming-sysattrs`)
|
||||
+is installed to the target system and target userspace container, providing
|
||||
+the definitions of the "profiles" for `net.naming-scheme`.
|
||||
|
||||
-If set to `0`, the "legacy" mechanism is used where leapp writes .link files to prevent interfaces being renamed
|
||||
+If set to `0`, the legacy mechanism is used where leapp writes .link files to prevent interfaces being renamed
|
||||
after booting to post-upgrade system.
|
||||
|
||||
+```{warning}
|
||||
+The variable is deprecated as it is a part of the legacy solution for handling
|
||||
+NIC names during the upgrade. Current supported solution allows only using
|
||||
+the `net.naming-scheme`.
|
||||
+```
|
||||
+
|
||||
#### LEAPP_ENABLE_REPOS
|
||||
Specify repositories (repoids) split by comma, that should be used during the in-place upgrade to the target system. It‘s overwritten automatically in case the --enablerepo option is used. It‘s recommended to use the --enablerepo option instead of the envar.
|
||||
|
||||
@@ -26,6 +36,12 @@ If set to `1`, Leapp does not register the system into Red Hat Lightspeed automa
|
||||
#### 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.
|
||||
|
||||
+```{warning}
|
||||
+The variable is deprecated as it is a part of the legacy solution for
|
||||
+handling NIC names during the upgrade. Current supported solution allows only
|
||||
+using of the `net.naming-scheme`.
|
||||
+```
|
||||
+
|
||||
##### LEAPP_NO_RHSM
|
||||
If set to `1`, Leapp does not use Red Hat Subscription Management for the upgrade. It‘s equivalent to the --no-rhsm leapp option.
|
||||
|
||||
diff --git a/docs/source/libraries-and-api/deprecations-list.md b/docs/source/libraries-and-api/deprecations-list.md
|
||||
index 679bf489..a074ebc1 100644
|
||||
--- a/docs/source/libraries-and-api/deprecations-list.md
|
||||
+++ b/docs/source/libraries-and-api/deprecations-list.md
|
||||
@@ -13,7 +13,11 @@ framework, see {ref}`deprecation:list of the deprecated functionality in leapp`.
|
||||
Only the versions in which a deprecation has been made are listed.
|
||||
|
||||
## Next release <span style="font-size:0.5em; font-weight:normal">(till TODO date)</span>
|
||||
-- Note: nothing new deprecated yet
|
||||
+- Environment variables
|
||||
+ - **`LEAPP_DISABLE_NET_NAMING_SCHEMES`** - The `net.naming-scheme` kernel argument provides much better alternative to the legacy solution enabled using this variable. Hence the legacy solution is deprecated together with this environment variable.
|
||||
+ - **`LEAPP_NO_NETWORK_RENAMING`** - It becomes obsoleted by the solution based on `net.naming-scheme` which replaces the legacy solution based on created udev link files correcting NIC names during the upgrade.
|
||||
+- Models:
|
||||
+ - **`RenamedInterfaces`** - Information provided in this message is not always complete and it's not used since the `net.naming-scheme` kernel command line argument is set during the upgrade.
|
||||
|
||||
## v0.24.0 <span style="font-size:0.5em; font-weight:normal">(till September 2026)</span>
|
||||
- Shared libraries
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/actor.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/actor.py
|
||||
index 2689d837..7a21b43a 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/actor.py
|
||||
@@ -1,7 +1,6 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import persistentnetnamesconfig
|
||||
from leapp.models import (
|
||||
- InitrdIncludes,
|
||||
PersistentNetNamesFacts,
|
||||
PersistentNetNamesFactsInitramfs,
|
||||
RenamedInterfaces,
|
||||
@@ -11,21 +10,27 @@ from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag
|
||||
from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
|
||||
-@suppress_deprecation(InitrdIncludes)
|
||||
+@suppress_deprecation(RenamedInterfaces)
|
||||
class PersistentNetNamesConfig(Actor):
|
||||
"""
|
||||
Generate udev persistent network naming configuration
|
||||
|
||||
- This actor generates systemd-udevd link files for each physical ethernet interface present on RHEL-7
|
||||
- in case we notice that interface name differs on RHEL-8. Link file configuration will assign RHEL-7 version of
|
||||
- a name. Actors produces list of interfaces which changed name between RHEL-7 and RHEL-8.
|
||||
+ NOTE: This actor is deprecated and currently performs described actions
|
||||
+ only if LEAPP_NO_NETWORK_RENAMING != 1 and LEAPP_DISABLE_NET_NAMING_SCHEMES == 1.
|
||||
+
|
||||
+ This actor generates systemd-udevd link files for each physical network
|
||||
+ interface present on the original system if the interface name differs
|
||||
+ on the target OS. Link file configuration will assign original name that has
|
||||
+ been detected on the source OS.
|
||||
+
|
||||
+ Also produce list of interfaces which changed names during the upgrade
|
||||
+ process.
|
||||
"""
|
||||
|
||||
name = 'persistentnetnamesconfig'
|
||||
consumes = (PersistentNetNamesFacts, PersistentNetNamesFactsInitramfs)
|
||||
- produces = (RenamedInterfaces, InitrdIncludes, TargetInitramfsTasks)
|
||||
+ produces = (RenamedInterfaces, TargetInitramfsTasks)
|
||||
tags = (ApplicationsPhaseTag, IPUWorkflowTag)
|
||||
- initrd_files = []
|
||||
|
||||
def process(self):
|
||||
persistentnetnamesconfig.process()
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
index 189cd4d0..0618f090 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
@@ -2,10 +2,9 @@ import errno
|
||||
import os
|
||||
import re
|
||||
|
||||
-from leapp.libraries.common.config import get_env, version
|
||||
+from leapp.libraries.common.config import get_env
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
- InitrdIncludes,
|
||||
PersistentNetNamesFacts,
|
||||
PersistentNetNamesFactsInitramfs,
|
||||
RenamedInterface,
|
||||
@@ -37,18 +36,21 @@ def generate_link_file(interface):
|
||||
return link_file
|
||||
|
||||
|
||||
-@suppress_deprecation(InitrdIncludes)
|
||||
+@suppress_deprecation(RenamedInterfaces, RenamedInterface)
|
||||
def process():
|
||||
are_net_schemes_enabled = get_env('LEAPP_DISABLE_NET_NAMING_SCHEMES', '0') != '1'
|
||||
- is_upgrade_8to9 = version.get_target_major_version() == '9'
|
||||
|
||||
- if are_net_schemes_enabled and is_upgrade_8to9:
|
||||
- # For 8>9 we are using net.naming_scheme kernel arg by default - do not generate link files
|
||||
+ if are_net_schemes_enabled:
|
||||
msg = ('Skipping generation of .link files renaming NICs as net.naming-scheme '
|
||||
- '{LEAPP_DISABLE_NET_NAMING_SCHEMES != 1} is enabled and upgrade is 8>9')
|
||||
- api.current_logger().info(msg)
|
||||
+ '{LEAPP_DISABLE_NET_NAMING_SCHEMES != 1} is enabled.')
|
||||
+ api.current_logger().debug(msg)
|
||||
return
|
||||
|
||||
+ api.current_logger().warning(
|
||||
+ 'LEAPP_DISABLE_NET_NAMING_SCHEMES=1 - Using deprecated handling'
|
||||
+ ' of network interface names by creating link files.'
|
||||
+ )
|
||||
+
|
||||
if get_env('LEAPP_NO_NETWORK_RENAMING', '0') == '1':
|
||||
api.current_logger().info(
|
||||
'Skipping handling of possibly renamed network interfaces: leapp executed with LEAPP_NO_NETWORK_RENAMING=1'
|
||||
@@ -80,13 +82,13 @@ def process():
|
||||
)
|
||||
continue
|
||||
|
||||
- if source_name != target_name and get_env('LEAPP_NO_NETWORK_RENAMING', '0') != '1':
|
||||
+ if source_name != target_name:
|
||||
api.current_logger().warning('Detected interface rename {} -> {}.'.format(source_name, target_name))
|
||||
|
||||
- if re.search('eth[0-9]+', iface.name) is not None:
|
||||
+ 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': source_name,
|
||||
- 'rhel8_name': target_name}))
|
||||
+ renamed_interfaces.append(RenamedInterface(**{'original_name': source_name,
|
||||
+ 'new_name': target_name}))
|
||||
continue
|
||||
|
||||
initrd_files.append(generate_link_file(iface))
|
||||
@@ -108,7 +110,6 @@ def process():
|
||||
api.current_logger().warning(msg)
|
||||
|
||||
api.produce(RenamedInterfaces(renamed=renamed_interfaces))
|
||||
- api.produce(InitrdIncludes(files=initrd_files))
|
||||
# TODO: cover actor by tests in future. I am skipping writing of tests
|
||||
# now as some refactoring and bugfixing related to this actor
|
||||
# is planned already.
|
||||
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 c584c7ea..b107612b 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
@@ -7,7 +7,8 @@ from leapp.libraries.actor import persistentnetnamesconfig
|
||||
from leapp.libraries.common.config import mock_configs
|
||||
from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
from leapp.models import (
|
||||
- InitrdIncludes,
|
||||
+ EnvVar,
|
||||
+ IPUConfig,
|
||||
Interface,
|
||||
PCIAddress,
|
||||
PersistentNetNamesFacts,
|
||||
@@ -19,6 +20,19 @@ from leapp.models import (
|
||||
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
CUR_DIR = ""
|
||||
|
||||
+CONFIG_DISABLED_NAMING_SCHEMES = IPUConfig(
|
||||
+ leapp_env_vars=[
|
||||
+ EnvVar(name='LEAPP_DEVEL', value='0'),
|
||||
+ EnvVar(name='LEAPP_DISABLE_NET_NAMING_SCHEMES', value='1'),
|
||||
+ ],
|
||||
+ os_release=mock_configs.CONFIG.os_release,
|
||||
+ version=mock_configs.CONFIG.version,
|
||||
+ architecture=mock_configs.CONFIG.architecture,
|
||||
+ kernel=mock_configs.CONFIG.kernel,
|
||||
+ supported_upgrade_paths=mock_configs.CONFIG.supported_upgrade_paths,
|
||||
+ distro=mock_configs.CONFIG.distro
|
||||
+)
|
||||
+
|
||||
|
||||
@pytest.fixture
|
||||
def adjust_cwd():
|
||||
@@ -56,12 +70,10 @@ def test_identical(current_actor_context):
|
||||
interfaces = generate_interfaces(4)
|
||||
current_actor_context.feed(PersistentNetNamesFacts(interfaces=interfaces))
|
||||
current_actor_context.feed(PersistentNetNamesFactsInitramfs(interfaces=interfaces))
|
||||
- current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ current_actor_context.run(config_model=CONFIG_DISABLED_NAMING_SCHEMES)
|
||||
|
||||
renamed_interfaces = current_actor_context.consume(RenamedInterfaces)[0]
|
||||
- initrd_files = current_actor_context.consume(InitrdIncludes)[0]
|
||||
t_initrafms_tasks = current_actor_context.consume(TargetInitramfsTasks)[0]
|
||||
- assert initrd_files.files == t_initrafms_tasks.include_files
|
||||
assert not renamed_interfaces.renamed
|
||||
assert not t_initrafms_tasks.include_files
|
||||
|
||||
@@ -73,12 +85,10 @@ def test_renamed_single_noneth(monkeypatch, current_actor_context):
|
||||
current_actor_context.feed(PersistentNetNamesFacts(interfaces=interfaces))
|
||||
interfaces[0].name = 'n4'
|
||||
current_actor_context.feed(PersistentNetNamesFactsInitramfs(interfaces=interfaces))
|
||||
- current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ current_actor_context.run(config_model=CONFIG_DISABLED_NAMING_SCHEMES)
|
||||
|
||||
renamed_interfaces = current_actor_context.consume(RenamedInterfaces)[0]
|
||||
- initrd_files = current_actor_context.consume(InitrdIncludes)[0]
|
||||
t_initrafms_tasks = current_actor_context.consume(TargetInitramfsTasks)[0]
|
||||
- assert initrd_files.files == t_initrafms_tasks.include_files
|
||||
assert not renamed_interfaces.renamed
|
||||
assert len(t_initrafms_tasks.include_files) == 1
|
||||
assert '/etc/systemd/network/10-leapp-n0.link' in t_initrafms_tasks.include_files
|
||||
@@ -92,12 +102,10 @@ def test_renamed_swap_noneth(monkeypatch, current_actor_context):
|
||||
interfaces[0].name = 'n3'
|
||||
interfaces[3].name = 'n0'
|
||||
current_actor_context.feed(PersistentNetNamesFactsInitramfs(interfaces=interfaces))
|
||||
- current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ current_actor_context.run(config_model=CONFIG_DISABLED_NAMING_SCHEMES)
|
||||
|
||||
renamed_interfaces = current_actor_context.consume(RenamedInterfaces)[0]
|
||||
- initrd_files = current_actor_context.consume(InitrdIncludes)[0]
|
||||
t_initrafms_tasks = current_actor_context.consume(TargetInitramfsTasks)[0]
|
||||
- assert initrd_files.files == t_initrafms_tasks.include_files
|
||||
assert not renamed_interfaces.renamed
|
||||
assert len(t_initrafms_tasks.include_files) == 2
|
||||
assert '/etc/systemd/network/10-leapp-n0.link' in t_initrafms_tasks.include_files
|
||||
@@ -113,15 +121,13 @@ def test_renamed_single_eth(monkeypatch, current_actor_context):
|
||||
current_actor_context.feed(PersistentNetNamesFacts(interfaces=interfaces))
|
||||
interfaces[0].name = 'eth4'
|
||||
current_actor_context.feed(PersistentNetNamesFactsInitramfs(interfaces=interfaces))
|
||||
- current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ current_actor_context.run(config_model=CONFIG_DISABLED_NAMING_SCHEMES)
|
||||
|
||||
renamed_interfaces = current_actor_context.consume(RenamedInterfaces)[0]
|
||||
- initrd_files = current_actor_context.consume(InitrdIncludes)[0]
|
||||
t_initrafms_tasks = current_actor_context.consume(TargetInitramfsTasks)[0]
|
||||
- assert initrd_files.files == t_initrafms_tasks.include_files
|
||||
assert len(renamed_interfaces.renamed) == 1
|
||||
- assert renamed_interfaces.renamed[0].rhel7_name == 'eth0'
|
||||
- assert renamed_interfaces.renamed[0].rhel8_name == 'eth4'
|
||||
+ assert renamed_interfaces.renamed[0].original_name == 'eth0'
|
||||
+ assert renamed_interfaces.renamed[0].new_name == 'eth4'
|
||||
assert not t_initrafms_tasks.include_files
|
||||
|
||||
|
||||
@@ -135,18 +141,16 @@ def test_renamed_swap_eth(monkeypatch, current_actor_context):
|
||||
interfaces[0].name = 'eth3'
|
||||
interfaces[3].name = 'eth0'
|
||||
current_actor_context.feed(PersistentNetNamesFactsInitramfs(interfaces=interfaces))
|
||||
- current_actor_context.run(config_model=mock_configs.CONFIG)
|
||||
+ current_actor_context.run(config_model=CONFIG_DISABLED_NAMING_SCHEMES)
|
||||
|
||||
renamed_interfaces = current_actor_context.consume(RenamedInterfaces)[0]
|
||||
- initrd_files = current_actor_context.consume(InitrdIncludes)[0]
|
||||
t_initrafms_tasks = current_actor_context.consume(TargetInitramfsTasks)[0]
|
||||
- assert initrd_files.files == t_initrafms_tasks.include_files
|
||||
assert len(renamed_interfaces.renamed) == 2
|
||||
for interface in renamed_interfaces.renamed:
|
||||
- if interface.rhel7_name == 'eth0':
|
||||
- assert interface.rhel8_name == 'eth3'
|
||||
- elif interface.rhel7_name == 'eth3':
|
||||
- assert interface.rhel8_name == 'eth0'
|
||||
+ if interface.original_name == 'eth0':
|
||||
+ assert interface.new_name == 'eth3'
|
||||
+ elif interface.original_name == 'eth3':
|
||||
+ assert interface.new_name == 'eth0'
|
||||
assert not t_initrafms_tasks.include_files
|
||||
|
||||
|
||||
@@ -179,7 +183,7 @@ def test_bz_1899455_crash_iface(monkeypatch, adjust_cwd):
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'produce', produce_mocked())
|
||||
persistentnetnamesconfig.process()
|
||||
|
||||
- for prod_models in [RenamedInterfaces, InitrdIncludes, TargetInitramfsTasks]:
|
||||
+ for prod_models in [RenamedInterfaces, 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)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/models/persistentnetnamesfacts.py b/repos/system_upgrade/common/models/persistentnetnamesfacts.py
|
||||
index 3c71cdcd..e5cf979b 100644
|
||||
--- a/repos/system_upgrade/common/models/persistentnetnamesfacts.py
|
||||
+++ b/repos/system_upgrade/common/models/persistentnetnamesfacts.py
|
||||
@@ -1,5 +1,6 @@
|
||||
from leapp.models import fields, Model
|
||||
from leapp.topics import SystemInfoTopic
|
||||
+from leapp.utils.deprecation import deprecated
|
||||
|
||||
|
||||
class PCIAddress(Model):
|
||||
@@ -82,25 +83,37 @@ class PersistentNetNamesFactsInitramfs(PersistentNetNamesFacts):
|
||||
pass
|
||||
|
||||
|
||||
+@deprecated(
|
||||
+ since="2026-03-18",
|
||||
+ message=(
|
||||
+ "Information provided in this message is not always complete and it's"
|
||||
+ " not used nowadays when net naming scheme is set during the upgrade."
|
||||
+ )
|
||||
+)
|
||||
class RenamedInterface(Model):
|
||||
"""
|
||||
Provide original and new name of the network interface when renamed
|
||||
"""
|
||||
topic = SystemInfoTopic
|
||||
|
||||
- # TODO(pstodulk) deprecate these fields and replace them by new ones
|
||||
- # or deprecate the model completely.
|
||||
- rhel7_name = fields.String()
|
||||
+ original_name = fields.String()
|
||||
"""
|
||||
Original interface name.
|
||||
"""
|
||||
|
||||
- rhel8_name = fields.String()
|
||||
+ new_name = fields.String()
|
||||
"""
|
||||
New interface name.
|
||||
"""
|
||||
|
||||
|
||||
+@deprecated(
|
||||
+ since="2026-03-18",
|
||||
+ message=(
|
||||
+ "Information provided in this message is not always complete and it's"
|
||||
+ " not used nowadays when net naming scheme is set during the upgrade."
|
||||
+ )
|
||||
+)
|
||||
class RenamedInterfaces(Model):
|
||||
"""
|
||||
Provide list of renamed network interfaces
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,124 +0,0 @@
|
||||
From 0872576049715c7a909379d5de5cc53bab3a408a Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Fri, 20 Mar 2026 17:19:20 +0100
|
||||
Subject: [PATCH 32/44] persistentnetnamesdisable: Disable net.ifnames
|
||||
correctly for single eth
|
||||
|
||||
Original solution disabled net.ifnames only for the target kernel
|
||||
bootloader entry. But the upgrade initramfs stayed unhandled.
|
||||
So it could happen that a "false positive" detection of changed
|
||||
network interface names could been detected during the upgrade process
|
||||
even when the target system booted again with "eth0" net interface
|
||||
(because of net.ifnames=0). Set the parameter also for the upgrade
|
||||
environment to behave same as on the target system.
|
||||
|
||||
Also, actor originally produced just the KernelCmdlineArg msg,
|
||||
which is nowadays considered kind of obsoleted for this purpose
|
||||
- still valid, but obsoleted. So produce UpgradeKernelCmdlineArgTasks
|
||||
and TargetKernelCmdlineArgTasks msgs instead.
|
||||
---
|
||||
.../tests/test_persistentnetnamesconfig.py | 2 +-
|
||||
.../common/actors/persistentnetnamesdisable/actor.py | 8 ++++++--
|
||||
.../libraries/persistentnetnamesdisable.py | 11 +++++++++--
|
||||
.../tests/test_persistentnetnamesdisable.py | 10 +++++++++-
|
||||
4 files changed, 25 insertions(+), 6 deletions(-)
|
||||
|
||||
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 b107612b..f2519d77 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
@@ -8,8 +8,8 @@ from leapp.libraries.common.config import mock_configs
|
||||
from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
from leapp.models import (
|
||||
EnvVar,
|
||||
- IPUConfig,
|
||||
Interface,
|
||||
+ IPUConfig,
|
||||
PCIAddress,
|
||||
PersistentNetNamesFacts,
|
||||
PersistentNetNamesFactsInitramfs,
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
index 15c43141..741e2c86 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
@@ -1,6 +1,10 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import persistentnetnamesdisable
|
||||
-from leapp.models import KernelCmdlineArg, PersistentNetNamesFacts
|
||||
+from leapp.models import (
|
||||
+ PersistentNetNamesFacts,
|
||||
+ TargetKernelCmdlineArgTasks,
|
||||
+ UpgradeKernelCmdlineArgTasks
|
||||
+)
|
||||
from leapp.reporting import Report
|
||||
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
@@ -12,7 +16,7 @@ class PersistentNetNamesDisable(Actor):
|
||||
|
||||
name = 'persistentnetnamesdisable'
|
||||
consumes = (PersistentNetNamesFacts,)
|
||||
- produces = (KernelCmdlineArg, Report)
|
||||
+ produces = (Report, TargetKernelCmdlineArgTasks, UpgradeKernelCmdlineArgTasks)
|
||||
tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
|
||||
def process(self):
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
index 0d1a90e2..38eef133 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
@@ -3,7 +3,12 @@ import re
|
||||
from leapp import reporting
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
-from leapp.models import KernelCmdlineArg, PersistentNetNamesFacts
|
||||
+from leapp.models import (
|
||||
+ KernelCmdlineArg,
|
||||
+ PersistentNetNamesFacts,
|
||||
+ TargetKernelCmdlineArgTasks,
|
||||
+ UpgradeKernelCmdlineArgTasks
|
||||
+)
|
||||
from leapp.reporting import create_report
|
||||
|
||||
|
||||
@@ -29,7 +34,9 @@ def disable_persistent_naming():
|
||||
"Single eth0 network interface detected."
|
||||
" Appending 'net.ifnames=0' for the target system kernel commandline"
|
||||
)
|
||||
- api.produce(KernelCmdlineArg(**{'key': 'net.ifnames', 'value': '0'}))
|
||||
+ k_arg = KernelCmdlineArg(key='net.ifnames', value='0')
|
||||
+ api.produce(UpgradeKernelCmdlineArgTasks(to_add=[k_arg]))
|
||||
+ api.produce(TargetKernelCmdlineArgTasks(to_add=[k_arg]))
|
||||
|
||||
|
||||
def report_ethX_ifaces():
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
index 2369e80f..81b5a28c 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
@@ -1,7 +1,13 @@
|
||||
import pytest
|
||||
|
||||
from leapp.libraries.actor import persistentnetnamesdisable
|
||||
-from leapp.models import Interface, KernelCmdlineArg, PCIAddress, PersistentNetNamesFacts
|
||||
+from leapp.models import (
|
||||
+ Interface,
|
||||
+ PCIAddress,
|
||||
+ PersistentNetNamesFacts,
|
||||
+ TargetKernelCmdlineArgTasks,
|
||||
+ UpgradeKernelCmdlineArgTasks
|
||||
+)
|
||||
from leapp.reporting import Report
|
||||
from leapp.snactor.fixture import current_actor_context
|
||||
from leapp.utils.report import is_inhibitor
|
||||
@@ -51,6 +57,8 @@ def test_actor_single_eth0(current_actor_context):
|
||||
current_actor_context.feed(PersistentNetNamesFacts(interfaces=interface))
|
||||
current_actor_context.run()
|
||||
assert not current_actor_context.consume(Report)
|
||||
+ assert current_actor_context.consume(UpgradeKernelCmdlineArgTasks)
|
||||
+ assert current_actor_context.consume(TargetKernelCmdlineArgTasks)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,303 +0,0 @@
|
||||
From 806e65d67cac9e16c0341f366133ae3c14844fcd Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Wed, 25 Mar 2026 15:57:37 +0100
|
||||
Subject: [PATCH 33/44] persistentnetnamesdisable: Mention net.naming-scheme in
|
||||
report
|
||||
|
||||
Since RHEL 8 it's possible to specifcy net.naming-scheme to have
|
||||
a consistent NIC names across RHEL major releases. When a specific
|
||||
net.naming-scheme is not specified in kernel cmdline, suggest people
|
||||
this option as well.
|
||||
---
|
||||
.../actors/persistentnetnamesdisable/actor.py | 15 +++-
|
||||
.../libraries/persistentnetnamesdisable.py | 86 +++++++++++++++----
|
||||
.../tests/test_persistentnetnamesdisable.py | 78 ++++++++++++++++-
|
||||
3 files changed, 158 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
index 741e2c86..0bcc3827 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
@@ -1,6 +1,7 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import persistentnetnamesdisable
|
||||
from leapp.models import (
|
||||
+ KernelCmdline,
|
||||
PersistentNetNamesFacts,
|
||||
TargetKernelCmdlineArgTasks,
|
||||
UpgradeKernelCmdlineArgTasks
|
||||
@@ -11,11 +12,21 @@ from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
class PersistentNetNamesDisable(Actor):
|
||||
"""
|
||||
- Disable systemd-udevd persistent network naming on machine with single eth0 NIC
|
||||
+ Check whether the system has any (physical) NICs with kernel naming (ethX)
|
||||
+
|
||||
+ The kernel naming is in general unstable - there is no guarantee of persistent
|
||||
+ NIC names between reboots, so eth0 can becaome eth3 and vice versa. If the
|
||||
+ system has more than one physical network interface, the kernel naming must
|
||||
+ not be used otherwise the upgrade is inhibited. The report contains remediation
|
||||
+ hints for user to resolve the problem before the upgrade.
|
||||
+
|
||||
+ On systems with only one physical network interface with eth0 NIC, register
|
||||
+ task to disable systemd-udevd persistent network naming (set `net.ifnames=0`
|
||||
+ on kernel cmdline for the upgrade environment and the upgraded system.
|
||||
"""
|
||||
|
||||
name = 'persistentnetnamesdisable'
|
||||
- consumes = (PersistentNetNamesFacts,)
|
||||
+ consumes = (PersistentNetNamesFacts, KernelCmdline)
|
||||
produces = (Report, TargetKernelCmdlineArgTasks, UpgradeKernelCmdlineArgTasks)
|
||||
tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
index 38eef133..0a4209b8 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/libraries/persistentnetnamesdisable.py
|
||||
@@ -1,9 +1,11 @@
|
||||
import re
|
||||
|
||||
from leapp import reporting
|
||||
-from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.common.config.version import get_source_major_version, get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
+ KernelCmdline,
|
||||
KernelCmdlineArg,
|
||||
PersistentNetNamesFacts,
|
||||
TargetKernelCmdlineArgTasks,
|
||||
@@ -29,6 +31,40 @@ def single_eth0(interfaces):
|
||||
return len(interfaces) == 1 and interfaces[0].name == 'eth0'
|
||||
|
||||
|
||||
+def is_kernel_arg_present(key, value=None):
|
||||
+ """
|
||||
+ Return True if requested argument is set in kernel cmdline. Return False otherwise.
|
||||
+
|
||||
+ If the `value` is specified, check also whether the specific value is set.
|
||||
+ The function consumes :class:`KernelCmdline`.
|
||||
+
|
||||
+ :param key: The kernel argument to search for
|
||||
+ :type key: str
|
||||
+ :param value: If string is specified, check for a specific string as well.
|
||||
+ :type value: str|None
|
||||
+ :rtype: bool
|
||||
+ """
|
||||
+ # NOTE(pstodulk): with small update a possible candidate to move into the
|
||||
+ # kernel shared library. For now, keeping it just in this actor.
|
||||
+ k_cmdline = next(api.consume(KernelCmdline), None)
|
||||
+ if not k_cmdline:
|
||||
+ # NOTE(pstodulk): this hypothetical situation, skipping coverage by
|
||||
+ # unit tests
|
||||
+ raise StopActorExecutionError(
|
||||
+ message='Missing information about current kernel command line.',
|
||||
+ details={
|
||||
+ 'details': 'Missing the KernelCmdline message.'
|
||||
+ }
|
||||
+ )
|
||||
+
|
||||
+ for k_arg in k_cmdline.parameters:
|
||||
+ if k_arg.key != key:
|
||||
+ continue
|
||||
+ if value is None or k_arg.value == value:
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
+
|
||||
def disable_persistent_naming():
|
||||
api.current_logger().info(
|
||||
"Single eth0 network interface detected."
|
||||
@@ -40,27 +76,30 @@ def disable_persistent_naming():
|
||||
|
||||
|
||||
def report_ethX_ifaces():
|
||||
- report_entries = [
|
||||
- reporting.Title('Unsupported network configuration'),
|
||||
- reporting.Summary(
|
||||
- 'Detected multiple physical network interfaces where one or more'
|
||||
- ' use kernel naming (e.g. eth0). Upgrade process cannot continue'
|
||||
- ' because stability of names can not be guaranteed.'
|
||||
- ),
|
||||
+ url_title_kb = 'How to Perform an In-Place Upgrade when Using Kernel-Assigned NIC Names'
|
||||
+ hint_text = f'Rename all ethX network interfaces following the "{url_title_kb}" solution article.'
|
||||
+ report_external_links = [
|
||||
reporting.ExternalLink(
|
||||
- title='How to Perform an In-Place Upgrade when Using Kernel-Assigned NIC Names',
|
||||
+ title=url_title_kb,
|
||||
url='https://access.redhat.com/solutions/4067471'
|
||||
- ),
|
||||
- reporting.Remediation(
|
||||
- hint='Rename all ethX network interfaces following the attached KB solution article.'
|
||||
- ),
|
||||
- reporting.Severity(reporting.Severity.HIGH),
|
||||
- reporting.Groups([reporting.Groups.NETWORK]),
|
||||
- reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
+ )
|
||||
]
|
||||
+ if not is_kernel_arg_present('net.naming-scheme') and not is_kernel_arg_present('net.ifnames', '0'):
|
||||
+ hint_text += (
|
||||
+ ' If the detected ethX interfaces are not manually configured, it is'
|
||||
+ ' possible that new names were not assigned due to a naming conflict'
|
||||
+ ' in the current `net.naming-scheme`. This can be resolved by'
|
||||
+ ' configuring a newer naming scheme via the kernel argument.'
|
||||
+ ' For more information, see "Implementing consistent network interface naming".'
|
||||
+ )
|
||||
|
||||
+ # NOTE(pstodulk): the link is covered for RHEL 8, 9, 10
|
||||
+ report_external_links.append(reporting.ExternalLink(
|
||||
+ title='Implementing consistent network interface naming',
|
||||
+ url='https://red.ht/rhel-{}-consistent-nic-naming'.format(get_source_major_version())
|
||||
+ ))
|
||||
if get_target_major_version() == '9':
|
||||
- report_entries.append(
|
||||
+ report_external_links.append(
|
||||
reporting.ExternalLink(
|
||||
title='RHEL 8 to RHEL 9: inplace upgrade fails at '
|
||||
'"Network configuration for unsupported device types detected"',
|
||||
@@ -68,6 +107,19 @@ def report_ethX_ifaces():
|
||||
)
|
||||
)
|
||||
|
||||
+ report_entries = [
|
||||
+ reporting.Title('Unsupported network configuration'),
|
||||
+ reporting.Summary(
|
||||
+ 'Detected multiple physical network interfaces where one or more'
|
||||
+ ' use kernel naming (e.g. eth0). Upgrade process cannot continue'
|
||||
+ ' because stability of names can not be guaranteed.'
|
||||
+ ),
|
||||
+ reporting.Remediation(hint=hint_text),
|
||||
+ reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Groups([reporting.Groups.NETWORK]),
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
+ ] + report_external_links
|
||||
+
|
||||
create_report(report_entries)
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
index 81b5a28c..4b8669bb 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/tests/test_persistentnetnamesdisable.py
|
||||
@@ -1,8 +1,11 @@
|
||||
import pytest
|
||||
|
||||
from leapp.libraries.actor import persistentnetnamesdisable
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked
|
||||
from leapp.models import (
|
||||
Interface,
|
||||
+ KernelCmdline,
|
||||
+ KernelCmdlineArg,
|
||||
PCIAddress,
|
||||
PersistentNetNamesFacts,
|
||||
TargetKernelCmdlineArgTasks,
|
||||
@@ -65,6 +68,7 @@ def test_actor_single_eth0(current_actor_context):
|
||||
'target_version', ['9', '10']
|
||||
)
|
||||
def test_actor_more_ethX(monkeypatch, current_actor_context, target_version):
|
||||
+ monkeypatch.setattr(persistentnetnamesdisable, 'get_source_major_version', lambda: str(int(target_version) - 1))
|
||||
monkeypatch.setattr(persistentnetnamesdisable, 'get_target_major_version', lambda: target_version)
|
||||
pci1 = PCIAddress(domain="0000", bus="3e", function="00", device="PCI bridge")
|
||||
pci2 = PCIAddress(domain="0000", bus="3d", function="00", device="Serial controller")
|
||||
@@ -84,7 +88,10 @@ def test_actor_more_ethX(monkeypatch, current_actor_context, target_version):
|
||||
pci_info=pci2,
|
||||
devpath="/devices/hidraw/hidraw0")
|
||||
]
|
||||
- current_actor_context.feed(PersistentNetNamesFacts(interfaces=interface))
|
||||
+ current_actor_context.feed(
|
||||
+ PersistentNetNamesFacts(interfaces=interface),
|
||||
+ KernelCmdline(parameters=[KernelCmdlineArg(key='what', value='ever')])
|
||||
+ )
|
||||
current_actor_context.run()
|
||||
|
||||
report_fields = current_actor_context.consume(Report)[0].report
|
||||
@@ -122,6 +129,7 @@ def test_actor_single_int_not_ethX(current_actor_context):
|
||||
'target_version', ['9', '10']
|
||||
)
|
||||
def test_actor_ethX_and_not_ethX(monkeypatch, current_actor_context, target_version):
|
||||
+ monkeypatch.setattr(persistentnetnamesdisable, 'get_source_major_version', lambda: str(int(target_version) - 1))
|
||||
monkeypatch.setattr(persistentnetnamesdisable, 'get_target_major_version', lambda: target_version)
|
||||
pci1 = PCIAddress(domain="0000", bus="3e", function="00", device="PCI bridge")
|
||||
pci2 = PCIAddress(domain="0000", bus="3d", function="00", device="Serial controller")
|
||||
@@ -141,7 +149,10 @@ def test_actor_ethX_and_not_ethX(monkeypatch, current_actor_context, target_vers
|
||||
pci_info=pci2,
|
||||
devpath="/devices/hidraw/hidraw0")
|
||||
]
|
||||
- current_actor_context.feed(PersistentNetNamesFacts(interfaces=interface))
|
||||
+ current_actor_context.feed(
|
||||
+ PersistentNetNamesFacts(interfaces=interface),
|
||||
+ KernelCmdline(parameters=[KernelCmdlineArg(key='what', value='ever')])
|
||||
+ )
|
||||
current_actor_context.run()
|
||||
assert current_actor_context.consume(Report)
|
||||
|
||||
@@ -158,3 +169,66 @@ def test_actor_ethX_and_not_ethX(monkeypatch, current_actor_context, target_vers
|
||||
assert rhel8to9_present
|
||||
else:
|
||||
assert not rhel8to9_present
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(('result_expected', 'key', 'value'), (
|
||||
+ (True, 'net.ifnames', None),
|
||||
+ (True, 'net.ifnames', '0'),
|
||||
+ (False, 'net.ifname', None),
|
||||
+ (False, 'inet.ifnames', None),
|
||||
+ (False, 'missing', None),
|
||||
+ (False, 'missing', 'whatever'),
|
||||
+ (False, 'net.ifnames', '1'),
|
||||
+))
|
||||
+def test_is_kernel_arg_present(monkeypatch, result_expected, key, value):
|
||||
+ k_args = [
|
||||
+ KernelCmdlineArg(key='Foo', value='0'),
|
||||
+ KernelCmdlineArg(key='net.ifnames', value='0'),
|
||||
+ KernelCmdlineArg(key='Something', value='None'),
|
||||
+ ]
|
||||
+ curr_actor_mocked = CurrentActorMocked(
|
||||
+ msgs=[KernelCmdline(parameters=k_args)]
|
||||
+ )
|
||||
+ monkeypatch.setattr(persistentnetnamesdisable.api, 'current_actor', curr_actor_mocked)
|
||||
+ assert result_expected is persistentnetnamesdisable.is_kernel_arg_present(key, value)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(('naming_expected', 'k_args'), (
|
||||
+ (False, [KernelCmdlineArg(key='net.ifnames', value='0')]),
|
||||
+ (True, [KernelCmdlineArg(key='net.ifnames', value='1')]),
|
||||
+ (True, [KernelCmdlineArg(key='net.naming-scheme-foo', value='rhel-8.10')]),
|
||||
+ (
|
||||
+ # NOTE(pstodulk): this is kind of nonsense, but let's test it
|
||||
+ False,
|
||||
+ [
|
||||
+ KernelCmdlineArg(key='net.naming-scheme', value='rhel-8.10'),
|
||||
+ KernelCmdlineArg(key='net.ifnames', value='0'),
|
||||
+ ]
|
||||
+ ),
|
||||
+ (False, [KernelCmdlineArg(key='net.naming-scheme', value='rhel-8.10')]),
|
||||
+ (False, [KernelCmdlineArg(key='net.naming-scheme', value='rhel-9.10')]),
|
||||
+))
|
||||
+@pytest.mark.parametrize('src_ver', ('8.10', '9.8', '10.6'))
|
||||
+def test_report_ethx_ifaces_scheme(monkeypatch, naming_expected, src_ver, k_args):
|
||||
+ _v_split = src_ver.split('.')
|
||||
+ dst_ver = '{}.{}'.format(int(_v_split[0]) + 1, _v_split[1])
|
||||
+ curr_actor_mocked = CurrentActorMocked(
|
||||
+ msgs=[KernelCmdline(parameters=k_args)],
|
||||
+ src_ver=src_ver,
|
||||
+ dst_ver=dst_ver
|
||||
+ )
|
||||
+ monkeypatch.setattr(persistentnetnamesdisable, 'create_report', create_report_mocked())
|
||||
+ monkeypatch.setattr(persistentnetnamesdisable.api, 'current_actor', curr_actor_mocked)
|
||||
+
|
||||
+ persistentnetnamesdisable.report_ethX_ifaces()
|
||||
+ assert persistentnetnamesdisable.create_report.called
|
||||
+ report = persistentnetnamesdisable.create_report.reports[0]
|
||||
+
|
||||
+ if naming_expected:
|
||||
+ url = 'https://red.ht/rhel-{}-consistent-nic-naming'.format(_v_split[0])
|
||||
+ assert any(url == link['url'] for link in report['detail']['external'])
|
||||
+ assert 'net.naming-scheme' in report['detail']['remediations'][0]['context']
|
||||
+ else:
|
||||
+ url_str = 'consistent-nic-naming'
|
||||
+ assert not any(url_str in link['url'] for link in report['detail']['external'])
|
||||
+ assert 'net.naming-scheme' not in report['detail']['remediations'][0]['context']
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From 0706cb54f4d1ba953de5e348cb03f9553b952669 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Tue, 17 Mar 2026 13:01:17 +0100
|
||||
Subject: [PATCH 34/44] fix quoting in list representation of commands
|
||||
|
||||
Removed redundant quotes included due to incorrect handling of command
|
||||
conversion to string representation in leapp framework's reporting
|
||||
module. The reporting module is fixed by RHEL-156521 and this patch is a
|
||||
followup that fixes usage of the module so that the commands are
|
||||
propagated to the leapp-report.txt correctly.
|
||||
|
||||
Jira: RHEL-155517, RHEL-155515
|
||||
---
|
||||
.../actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py | 2 +-
|
||||
repos/system_upgrade/common/actors/checkrootsymlinks/actor.py | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
index ce705361..be169e7e 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
@@ -21,7 +21,7 @@ def check_dnf_pluginpath(dnf_pluginpath_detected):
|
||||
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]],
|
||||
+ commands=[['sed', '-i', 's/^pluginpath[[:space:]]*=/#pluginpath=/', DNF_CONFIG_PATH]],
|
||||
),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
diff --git a/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py b/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
index 7b89bf7a..bee672bf 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
@@ -55,7 +55,7 @@ class CheckRootSymlinks(Actor):
|
||||
os.path.relpath(item.target, '/'),
|
||||
os.path.join('/', item.name)])
|
||||
commands.append(command)
|
||||
- rem_commands = [['sh', '-c', '"{}"'.format(' && '.join(commands))]]
|
||||
+ rem_commands = [['sh', '-c', '{}'.format(' && '.join(commands))]]
|
||||
# Generate reports about non-utf8 absolute links presence
|
||||
nonutf_count = len(absolute_links_nonutf)
|
||||
if nonutf_count > 0:
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,116 +0,0 @@
|
||||
From a71fb36ca529b323a904adc2e9048a93074bf723 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Wed, 25 Mar 2026 18:01:42 +0100
|
||||
Subject: [PATCH 35/44] fixup! fix quoting in list representation of commands
|
||||
|
||||
---
|
||||
packaging/leapp-repository.spec | 2 +-
|
||||
.../common/actors/checkrootsymlinks/actor.py | 6 +++---
|
||||
.../libraries/checkyumpluginsenabled.py | 2 +-
|
||||
.../common/actors/verifydialogs/libraries/verifydialogs.py | 7 ++++---
|
||||
.../actors/inhibitcgroupsv1/libraries/inhibitcgroupsv1.py | 6 +++---
|
||||
.../actors/inhibitcgroupsv1/tests/test_inhibitcgroupsv1.py | 4 ++--
|
||||
6 files changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/packaging/leapp-repository.spec b/packaging/leapp-repository.spec
|
||||
index 97bc261a..3ffafafa 100644
|
||||
--- a/packaging/leapp-repository.spec
|
||||
+++ b/packaging/leapp-repository.spec
|
||||
@@ -120,7 +120,7 @@ Requires: leapp-repository-dependencies = %{leapp_repo_deps}
|
||||
|
||||
# IMPORTANT: this is capability provided by the leapp framework rpm.
|
||||
# Check that 'version' instead of the real framework rpm version.
|
||||
-Requires: leapp-framework >= 6.2, leapp-framework < 7
|
||||
+Requires: leapp-framework >= 6.4, leapp-framework < 7
|
||||
|
||||
# Since we provide sub-commands for the leapp utility, we expect the leapp
|
||||
# tool to be installed as well.
|
||||
diff --git a/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py b/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
index bee672bf..2e805542 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
@@ -52,10 +52,10 @@ class CheckRootSymlinks(Actor):
|
||||
for item in absolute_links:
|
||||
command = ' '.join(['ln',
|
||||
'-snf',
|
||||
- os.path.relpath(item.target, '/'),
|
||||
- os.path.join('/', item.name)])
|
||||
+ f"'{os.path.relpath(item.target, '/')}'",
|
||||
+ f"'{os.path.join('/', item.name)}'"])
|
||||
commands.append(command)
|
||||
- rem_commands = [['sh', '-c', '{}'.format(' && '.join(commands))]]
|
||||
+ rem_commands = [['bash', '-c', '{}'.format(' && '.join(commands))]]
|
||||
# Generate reports about non-utf8 absolute links presence
|
||||
nonutf_count = len(absolute_links_nonutf)
|
||||
if nonutf_count > 0:
|
||||
diff --git a/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py b/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
index 87ff6511..9afa51ac 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
@@ -53,7 +53,7 @@ def check_required_dnf_plugins_enabled(pkg_manager_info):
|
||||
.format(dnf_conf_path, plugin_configs_dir)
|
||||
),
|
||||
# Provide all commands as one due to problems with satellites
|
||||
- commands=[['bash', '-c', '"{0}"'.format('; '.join(remediation_commands))]]
|
||||
+ commands=[['bash', '-c', '{0}'.format('; '.join(remediation_commands))]]
|
||||
),
|
||||
reporting.ExternalLink(
|
||||
url='https://access.redhat.com/solutions/7028063',
|
||||
diff --git a/repos/system_upgrade/common/actors/verifydialogs/libraries/verifydialogs.py b/repos/system_upgrade/common/actors/verifydialogs/libraries/verifydialogs.py
|
||||
index a79079b1..84b745ca 100644
|
||||
--- a/repos/system_upgrade/common/actors/verifydialogs/libraries/verifydialogs.py
|
||||
+++ b/repos/system_upgrade/common/actors/verifydialogs/libraries/verifydialogs.py
|
||||
@@ -13,13 +13,14 @@ def check_dialogs(inhibit_if_no_userchoice=True):
|
||||
dialogs_remediation = ('Please register user choices with leapp answer cli command or by manually editing '
|
||||
'the answerfile.')
|
||||
# FIXME: Enable more choices once we can do multi-command remediations
|
||||
- cmd_remediation = [['leapp', 'answer', '--section', "{}={}".format(s, choice)]
|
||||
- for s, choices in dialog.answerfile_sections.items() for choice in choices[:1]]
|
||||
+ cmd_remediations = [['leapp', 'answer', '--section', '{}={}'.format(s, choice)]
|
||||
+ for s, choices in dialog.answerfile_sections.items()
|
||||
+ for choice in choices[:1]]
|
||||
report_data = [reporting.Title('Missing required answers in the answer file'),
|
||||
reporting.Severity(reporting.Severity.HIGH),
|
||||
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.Remediation(hint=dialogs_remediation, commands=cmd_remediations),
|
||||
reporting.ExternalLink(
|
||||
url='https://access.redhat.com/solutions/7035321',
|
||||
title='Leapp upgrade fail with error "Inhibitor: Missing required answers '
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/inhibitcgroupsv1/libraries/inhibitcgroupsv1.py b/repos/system_upgrade/el9toel10/actors/inhibitcgroupsv1/libraries/inhibitcgroupsv1.py
|
||||
index 6ae41be2..a54883b2 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/inhibitcgroupsv1/libraries/inhibitcgroupsv1.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/inhibitcgroupsv1/libraries/inhibitcgroupsv1.py
|
||||
@@ -49,9 +49,9 @@ def process():
|
||||
# remove the args from commandline, the defaults are the desired values
|
||||
commands=[
|
||||
[
|
||||
- "grubby",
|
||||
- "--update-kernel=ALL",
|
||||
- '--remove-args="{}"'.format(" ".join(remediation_cmd_args)),
|
||||
+ 'grubby',
|
||||
+ '--update-kernel', 'ALL',
|
||||
+ '--remove-args', '{}'.format(' '.join(remediation_cmd_args))
|
||||
],
|
||||
],
|
||||
),
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/inhibitcgroupsv1/tests/test_inhibitcgroupsv1.py b/repos/system_upgrade/el9toel10/actors/inhibitcgroupsv1/tests/test_inhibitcgroupsv1.py
|
||||
index 9b3ec96f..629e8798 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/inhibitcgroupsv1/tests/test_inhibitcgroupsv1.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/inhibitcgroupsv1/tests/test_inhibitcgroupsv1.py
|
||||
@@ -39,9 +39,9 @@ def test_inhibit_should_inhibit(monkeypatch, cmdline_params):
|
||||
assert reporting.Groups.INHIBITOR in report["groups"]
|
||||
|
||||
command = [r for r in report["detail"]["remediations"] if r["type"] == "command"][0]
|
||||
- assert "systemd.unified_cgroup_hierarchy" in command['context'][2]
|
||||
+ assert "systemd.unified_cgroup_hierarchy" in command['context'][4]
|
||||
if len(cmdline_params) == 2:
|
||||
- assert "systemd.legacy_systemd_cgroup_controller" in command['context'][2]
|
||||
+ assert "systemd.legacy_systemd_cgroup_controller" in command['context'][4]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,533 +0,0 @@
|
||||
From 7d29232bdc45e15401d24a86f5508c3b3de826d1 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Pelka <tpelka@redhat.com>
|
||||
Date: Thu, 2 Apr 2026 09:24:33 +0200
|
||||
Subject: [PATCH 36/44] pulseaudiocheck: Add PulseAudio config check for RHEL 9
|
||||
to 10 upgrade
|
||||
|
||||
PulseAudio is replaced by PipeWire in RHEL 10. Add a scanner/checker
|
||||
actor pair that detects custom PulseAudio configuration which won't
|
||||
carry over after the upgrade.
|
||||
|
||||
The scanner (FactsCollectionPhase) checks for:
|
||||
- Modified default config files via RPM verification
|
||||
- Drop-in fragments in /etc/pulse/default.pa.d/ and system.pa.d/
|
||||
- Per-user configuration in ~/.config/pulse/
|
||||
|
||||
The checker (ChecksPhase) consumes the scan results and produces
|
||||
a report with a link to the PipeWire migration guide.
|
||||
|
||||
Resolves: DESKTOP-1151
|
||||
---
|
||||
.../pulseaudiocheck/checkpulseaudio/actor.py | 20 +++
|
||||
.../libraries/checkpulseaudio.py | 86 ++++++++++++
|
||||
.../tests/test_checkpulseaudio.py | 127 ++++++++++++++++++
|
||||
.../pulseaudiocheck/scanpulseaudio/actor.py | 20 +++
|
||||
.../libraries/scanpulseaudio.py | 98 ++++++++++++++
|
||||
.../tests/test_scanpulseaudio.py | 77 +++++++++++
|
||||
.../models/pulseaudioconfiguration.py | 24 ++++
|
||||
7 files changed, 452 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/actor.py
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/libraries/checkpulseaudio.py
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/tests/test_checkpulseaudio.py
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/actor.py
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/libraries/scanpulseaudio.py
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/tests/test_scanpulseaudio.py
|
||||
create mode 100644 repos/system_upgrade/el9toel10/models/pulseaudioconfiguration.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/actor.py b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..9417d6d6
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/actor.py
|
||||
@@ -0,0 +1,20 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.checkpulseaudio import check_pulseaudio
|
||||
+from leapp.models import DistributionSignedRPM, PulseAudioConfiguration, Report
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class CheckPulseAudio(Actor):
|
||||
+ """
|
||||
+ Check for custom PulseAudio configuration that won't carry over after upgrade.
|
||||
+
|
||||
+ PulseAudio is replaced by PipeWire with the pipewire-pulseaudio compatibility
|
||||
+ plugin in RHEL 10. Custom PulseAudio configuration will not be applied.
|
||||
+ """
|
||||
+ name = 'check_pulseaudio'
|
||||
+ consumes = (DistributionSignedRPM, PulseAudioConfiguration)
|
||||
+ produces = (Report,)
|
||||
+ tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ check_pulseaudio()
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/libraries/checkpulseaudio.py b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/libraries/checkpulseaudio.py
|
||||
new file mode 100644
|
||||
index 00000000..0453ca05
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/libraries/checkpulseaudio.py
|
||||
@@ -0,0 +1,86 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.common.distro import DISTRO_REPORT_NAMES
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM, PulseAudioConfiguration
|
||||
+
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
+
|
||||
+
|
||||
+def _report_custom_pulseaudio_config(modified_defaults, dropin_dirs, user_config_dirs):
|
||||
+ """
|
||||
+ Create a report warning about custom PulseAudio configuration.
|
||||
+
|
||||
+ :param modified_defaults: list of modified default config files
|
||||
+ :type modified_defaults: list
|
||||
+ :param dropin_dirs: list of drop-in directories with content
|
||||
+ :type dropin_dirs: list
|
||||
+ :param user_config_dirs: list of per-user config directories
|
||||
+ :type user_config_dirs: list
|
||||
+ """
|
||||
+ details = []
|
||||
+ if modified_defaults:
|
||||
+ details.append(
|
||||
+ 'The following default PulseAudio configuration files have been modified:{sep}{files}'.format(
|
||||
+ sep=FMT_LIST_SEPARATOR,
|
||||
+ files=FMT_LIST_SEPARATOR.join(modified_defaults),
|
||||
+ )
|
||||
+ )
|
||||
+ if dropin_dirs:
|
||||
+ details.append(
|
||||
+ 'The following PulseAudio drop-in configuration directories contain custom '
|
||||
+ 'fragments:{sep}{dirs}'.format(
|
||||
+ sep=FMT_LIST_SEPARATOR,
|
||||
+ dirs=FMT_LIST_SEPARATOR.join(dropin_dirs),
|
||||
+ )
|
||||
+ )
|
||||
+ if user_config_dirs:
|
||||
+ details.append(
|
||||
+ 'Per-user PulseAudio configuration was found in:{sep}{dirs}'.format(
|
||||
+ sep=FMT_LIST_SEPARATOR,
|
||||
+ dirs=FMT_LIST_SEPARATOR.join(user_config_dirs),
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ summary = (
|
||||
+ 'PulseAudio is replaced by PipeWire in {target_distro} 10. The PipeWire pipewire-pulseaudio plugin provides '
|
||||
+ 'compatibility with the default PulseAudio configuration, but custom PulseAudio configuration will '
|
||||
+ 'not be applied after the upgrade. Review your PulseAudio configuration and migrate any custom '
|
||||
+ 'settings to PipeWire equivalents after upgrading.'
|
||||
+ ).format_map(DISTRO_REPORT_NAMES)
|
||||
+ if details:
|
||||
+ summary += '\n\n' + '\n\n'.join(details)
|
||||
+
|
||||
+ all_paths = modified_defaults + dropin_dirs + user_config_dirs
|
||||
+ reporting.create_report([
|
||||
+ reporting.Title('Custom PulseAudio configuration detected'),
|
||||
+ reporting.Summary(summary),
|
||||
+ reporting.Severity(reporting.Severity.MEDIUM),
|
||||
+ reporting.Groups([reporting.Groups.SERVICES]),
|
||||
+ reporting.ExternalLink(title='Migrate PulseAudio to PipeWire',
|
||||
+ url='https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Migrate-PulseAudio'),
|
||||
+ reporting.Remediation(
|
||||
+ hint='Review your PulseAudio configuration and plan to migrate custom settings to PipeWire '
|
||||
+ 'after the upgrade. The pipewire-pulseaudio plugin handles default configuration automatically.'
|
||||
+ ),
|
||||
+ reporting.RelatedResource('package', 'pulseaudio'),
|
||||
+ ] + [reporting.RelatedResource('file', f) for f in all_paths])
|
||||
+
|
||||
+
|
||||
+def check_pulseaudio():
|
||||
+ """
|
||||
+ Consume PulseAudioConfiguration and generate report if custom config is found.
|
||||
+ """
|
||||
+ if not has_package(DistributionSignedRPM, 'pulseaudio'):
|
||||
+ api.current_logger().debug('PulseAudio is not installed, skipping check.')
|
||||
+ return
|
||||
+
|
||||
+ msg = next(api.consume(PulseAudioConfiguration), None)
|
||||
+ if not msg:
|
||||
+ api.current_logger().debug('No PulseAudioConfiguration message received.')
|
||||
+ return
|
||||
+
|
||||
+ if msg.modified_defaults or msg.dropin_dirs or msg.user_config_dirs:
|
||||
+ _report_custom_pulseaudio_config(msg.modified_defaults, msg.dropin_dirs, msg.user_config_dirs)
|
||||
+ else:
|
||||
+ api.current_logger().info('No custom PulseAudio configuration detected.')
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/tests/test_checkpulseaudio.py b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/tests/test_checkpulseaudio.py
|
||||
new file mode 100644
|
||||
index 00000000..518bfb73
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/checkpulseaudio/tests/test_checkpulseaudio.py
|
||||
@@ -0,0 +1,127 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.actor.checkpulseaudio import check_pulseaudio
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM, PulseAudioConfiguration, RPM
|
||||
+
|
||||
+
|
||||
+def _generate_rpm_with_name(name):
|
||||
+ """
|
||||
+ Generate new RPM model item with given name.
|
||||
+
|
||||
+ :param name: rpm name
|
||||
+ :type name: str
|
||||
+ :return: new RPM object with name parameter set
|
||||
+ :rtype: RPM
|
||||
+ """
|
||||
+ return RPM(name=name,
|
||||
+ version='0.1',
|
||||
+ release='1.sm01',
|
||||
+ epoch='1',
|
||||
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51',
|
||||
+ packager='Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>',
|
||||
+ arch='noarch')
|
||||
+
|
||||
+
|
||||
+class TestCheckPulseaudio:
|
||||
+ """Tests for check_pulseaudio checker function."""
|
||||
+
|
||||
+ def test_pulseaudio_not_installed(self, monkeypatch):
|
||||
+ rpms = [_generate_rpm_with_name('some-other-package')]
|
||||
+ msg = PulseAudioConfiguration(modified_defaults=['/etc/pulse/daemon.conf'])
|
||||
+ curr_actor_mocked = CurrentActorMocked(msgs=[DistributionSignedRPM(items=rpms), msg])
|
||||
+ monkeypatch.setattr(api, 'current_actor', curr_actor_mocked)
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ check_pulseaudio()
|
||||
+
|
||||
+ assert not reporting.create_report.called
|
||||
+
|
||||
+ def test_no_message(self, monkeypatch):
|
||||
+ rpms = [_generate_rpm_with_name('pulseaudio')]
|
||||
+ curr_actor_mocked = CurrentActorMocked(msgs=[DistributionSignedRPM(items=rpms)])
|
||||
+ monkeypatch.setattr(api, 'current_actor', curr_actor_mocked)
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ check_pulseaudio()
|
||||
+
|
||||
+ assert not reporting.create_report.called
|
||||
+
|
||||
+ def test_no_custom_config(self, monkeypatch):
|
||||
+ rpms = [_generate_rpm_with_name('pulseaudio')]
|
||||
+ msg = PulseAudioConfiguration()
|
||||
+ curr_actor_mocked = CurrentActorMocked(msgs=[DistributionSignedRPM(items=rpms), msg])
|
||||
+ monkeypatch.setattr(api, 'current_actor', curr_actor_mocked)
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ check_pulseaudio()
|
||||
+
|
||||
+ assert not reporting.create_report.called
|
||||
+
|
||||
+ def test_modified_defaults(self, monkeypatch):
|
||||
+ rpms = [_generate_rpm_with_name('pulseaudio')]
|
||||
+ msg = PulseAudioConfiguration(
|
||||
+ modified_defaults=['/etc/pulse/daemon.conf'],
|
||||
+ )
|
||||
+ curr_actor_mocked = CurrentActorMocked(msgs=[DistributionSignedRPM(items=rpms), msg])
|
||||
+ monkeypatch.setattr(api, 'current_actor', curr_actor_mocked)
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ check_pulseaudio()
|
||||
+
|
||||
+ assert reporting.create_report.called == 1
|
||||
+ report_fields = reporting.create_report.report_fields
|
||||
+ assert 'Custom PulseAudio configuration detected' in report_fields['title']
|
||||
+ assert '/etc/pulse/daemon.conf' in report_fields['summary']
|
||||
+
|
||||
+ def test_dropin_dirs(self, monkeypatch):
|
||||
+ rpms = [_generate_rpm_with_name('pulseaudio')]
|
||||
+ msg = PulseAudioConfiguration(
|
||||
+ dropin_dirs=['/etc/pulse/default.pa.d'],
|
||||
+ )
|
||||
+ curr_actor_mocked = CurrentActorMocked(msgs=[DistributionSignedRPM(items=rpms), msg])
|
||||
+ monkeypatch.setattr(api, 'current_actor', curr_actor_mocked)
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ check_pulseaudio()
|
||||
+
|
||||
+ assert reporting.create_report.called == 1
|
||||
+ report_fields = reporting.create_report.report_fields
|
||||
+ assert '/etc/pulse/default.pa.d' in report_fields['summary']
|
||||
+
|
||||
+ def test_user_config_dirs(self, monkeypatch):
|
||||
+ rpms = [_generate_rpm_with_name('pulseaudio')]
|
||||
+ msg = PulseAudioConfiguration(
|
||||
+ user_config_dirs=['/home/admin/.config/pulse'],
|
||||
+ )
|
||||
+ curr_actor_mocked = CurrentActorMocked(msgs=[DistributionSignedRPM(items=rpms), msg])
|
||||
+ monkeypatch.setattr(api, 'current_actor', curr_actor_mocked)
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ check_pulseaudio()
|
||||
+
|
||||
+ assert reporting.create_report.called == 1
|
||||
+ report_fields = reporting.create_report.report_fields
|
||||
+ assert '/home/admin/.config/pulse' in report_fields['summary']
|
||||
+
|
||||
+ def test_report_all_sources(self, monkeypatch):
|
||||
+ rpms = [_generate_rpm_with_name('pulseaudio')]
|
||||
+ msg = PulseAudioConfiguration(
|
||||
+ modified_defaults=['/etc/pulse/daemon.conf'],
|
||||
+ dropin_dirs=['/etc/pulse/default.pa.d'],
|
||||
+ user_config_dirs=['/root/.config/pulse'],
|
||||
+ )
|
||||
+ curr_actor_mocked = CurrentActorMocked(msgs=[DistributionSignedRPM(items=rpms), msg])
|
||||
+ monkeypatch.setattr(api, 'current_actor', curr_actor_mocked)
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ check_pulseaudio()
|
||||
+
|
||||
+ assert reporting.create_report.called == 1
|
||||
+ report_fields = reporting.create_report.report_fields
|
||||
+ resources = report_fields['detail']['related_resources']
|
||||
+ pkg_resources = [r for r in resources if r['scheme'] == 'package']
|
||||
+ file_resources = [r for r in resources if r['scheme'] == 'file']
|
||||
+ assert len(pkg_resources) == 1
|
||||
+ assert pkg_resources[0]['title'] == 'pulseaudio'
|
||||
+ assert len(file_resources) == 3
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/actor.py b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..5614c802
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/actor.py
|
||||
@@ -0,0 +1,20 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.scanpulseaudio import scan_pulseaudio
|
||||
+from leapp.models import PulseAudioConfiguration
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class ScanPulseAudio(Actor):
|
||||
+ """
|
||||
+ Scan the system for PulseAudio custom configuration.
|
||||
+
|
||||
+ Detects whether PulseAudio is installed and checks for custom
|
||||
+ configuration that will not carry over to PipeWire after upgrade.
|
||||
+ """
|
||||
+ name = 'scan_pulseaudio'
|
||||
+ consumes = ()
|
||||
+ produces = (PulseAudioConfiguration,)
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ self.produce(scan_pulseaudio())
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/libraries/scanpulseaudio.py b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/libraries/scanpulseaudio.py
|
||||
new file mode 100644
|
||||
index 00000000..e5c2be53
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/libraries/scanpulseaudio.py
|
||||
@@ -0,0 +1,98 @@
|
||||
+import os
|
||||
+import pwd
|
||||
+
|
||||
+from leapp.libraries.common.rpms import check_file_modification
|
||||
+from leapp.models import PulseAudioConfiguration
|
||||
+
|
||||
+# System-wide PulseAudio configuration directory
|
||||
+PULSEAUDIO_CONFIG_DIR = '/etc/pulse'
|
||||
+
|
||||
+# Drop-in directories included from default.pa and system.pa
|
||||
+_DROPIN_DIRS = (
|
||||
+ '/etc/pulse/default.pa.d',
|
||||
+ '/etc/pulse/system.pa.d',
|
||||
+)
|
||||
+
|
||||
+# Files that are part of the default PulseAudio installation
|
||||
+_DEFAULT_CONFIG_FILES = frozenset((
|
||||
+ 'client.conf',
|
||||
+ 'daemon.conf',
|
||||
+ 'default.pa',
|
||||
+ 'system.pa',
|
||||
+))
|
||||
+
|
||||
+# Per-user PulseAudio config directory relative to home
|
||||
+_USER_CONFIG_SUBDIR = '.config/pulse'
|
||||
+
|
||||
+
|
||||
+def _get_dropin_dirs_with_content():
|
||||
+ """
|
||||
+ Return list of drop-in directories that exist and contain files.
|
||||
+
|
||||
+ PulseAudio includes fragments from /etc/pulse/default.pa.d/ and
|
||||
+ /etc/pulse/system.pa.d/ via .include directives. These directories
|
||||
+ do not exist by default.
|
||||
+
|
||||
+ :return: list of drop-in directory paths that contain files
|
||||
+ :rtype: list
|
||||
+ """
|
||||
+ found = []
|
||||
+ for dropin_dir in _DROPIN_DIRS:
|
||||
+ if os.path.isdir(dropin_dir) and os.listdir(dropin_dir):
|
||||
+ found.append(dropin_dir)
|
||||
+ return found
|
||||
+
|
||||
+
|
||||
+def _get_user_config_dirs():
|
||||
+ """
|
||||
+ Return list of user home directories that contain PulseAudio configuration.
|
||||
+
|
||||
+ Checks ~/.config/pulse/ for each user with a valid home directory.
|
||||
+
|
||||
+ :return: list of per-user PulseAudio config directory paths
|
||||
+ :rtype: list
|
||||
+ """
|
||||
+ found = []
|
||||
+ for user in pwd.getpwall():
|
||||
+ pulse_dir = os.path.join(user.pw_dir, _USER_CONFIG_SUBDIR)
|
||||
+ if os.path.isdir(pulse_dir) and os.listdir(pulse_dir):
|
||||
+ found.append(pulse_dir)
|
||||
+ return sorted(found)
|
||||
+
|
||||
+
|
||||
+def _check_default_configs_modified():
|
||||
+ """
|
||||
+ Check whether any of the default PulseAudio config files have been modified.
|
||||
+
|
||||
+ Uses RPM verification to detect changes to files owned by the pulseaudio
|
||||
+ package. Returns list of modified default config file paths.
|
||||
+
|
||||
+ :return: list of modified default config file paths
|
||||
+ :rtype: list
|
||||
+ """
|
||||
+ modified = []
|
||||
+ for filename in sorted(_DEFAULT_CONFIG_FILES):
|
||||
+ filepath = os.path.join(PULSEAUDIO_CONFIG_DIR, filename)
|
||||
+ if os.path.isfile(filepath):
|
||||
+ if check_file_modification(filepath):
|
||||
+ modified.append(filepath)
|
||||
+
|
||||
+ return modified
|
||||
+
|
||||
+
|
||||
+def scan_pulseaudio():
|
||||
+ """
|
||||
+ Scan the system for PulseAudio configuration and return findings.
|
||||
+
|
||||
+ :return: PulseAudioConfiguration message with scan results
|
||||
+ :rtype: PulseAudioConfiguration
|
||||
+ """
|
||||
+ modified_defaults = _check_default_configs_modified()
|
||||
+ dropin_dirs = _get_dropin_dirs_with_content()
|
||||
+ user_config_dirs = _get_user_config_dirs()
|
||||
+
|
||||
+ return PulseAudioConfiguration(
|
||||
+ modified_defaults=modified_defaults,
|
||||
+ dropin_dirs=dropin_dirs,
|
||||
+ user_config_dirs=user_config_dirs,
|
||||
+ )
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/tests/test_scanpulseaudio.py b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/tests/test_scanpulseaudio.py
|
||||
new file mode 100644
|
||||
index 00000000..f499aafe
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/pulseaudiocheck/scanpulseaudio/tests/test_scanpulseaudio.py
|
||||
@@ -0,0 +1,77 @@
|
||||
+import os
|
||||
+
|
||||
+from leapp.libraries.actor import scanpulseaudio
|
||||
+from leapp.libraries.actor.scanpulseaudio import _get_dropin_dirs_with_content, _get_user_config_dirs, scan_pulseaudio
|
||||
+
|
||||
+
|
||||
+class TestGetDropinDirsWithContent:
|
||||
+ """Tests for _get_dropin_dirs_with_content."""
|
||||
+
|
||||
+ def test_no_dropin_dirs(self, monkeypatch):
|
||||
+ monkeypatch.setattr(os.path, 'isdir', lambda _: False)
|
||||
+ assert _get_dropin_dirs_with_content() == []
|
||||
+
|
||||
+ def test_empty_dropin_dirs(self, monkeypatch):
|
||||
+ monkeypatch.setattr(os.path, 'isdir', lambda _: True)
|
||||
+ monkeypatch.setattr(os, 'listdir', lambda _: [])
|
||||
+ assert _get_dropin_dirs_with_content() == []
|
||||
+
|
||||
+ def test_dropin_dirs_with_content(self, monkeypatch):
|
||||
+ monkeypatch.setattr(os.path, 'isdir', lambda _: True)
|
||||
+ monkeypatch.setattr(os, 'listdir', lambda _: ['custom.conf'])
|
||||
+ result = _get_dropin_dirs_with_content()
|
||||
+ assert result == ['/etc/pulse/default.pa.d', '/etc/pulse/system.pa.d']
|
||||
+
|
||||
+ def test_only_one_dropin_dir_exists(self, monkeypatch):
|
||||
+ monkeypatch.setattr(os.path, 'isdir', lambda path: path == '/etc/pulse/default.pa.d')
|
||||
+ monkeypatch.setattr(os, 'listdir', lambda _: ['custom.conf'])
|
||||
+ result = _get_dropin_dirs_with_content()
|
||||
+ assert result == ['/etc/pulse/default.pa.d']
|
||||
+
|
||||
+
|
||||
+class TestGetUserConfigDirs:
|
||||
+ """Tests for _get_user_config_dirs."""
|
||||
+
|
||||
+ def test_no_user_config(self, monkeypatch):
|
||||
+ monkeypatch.setattr(os.path, 'isdir', lambda _: False)
|
||||
+ assert _get_user_config_dirs() == []
|
||||
+
|
||||
+ def test_user_config_found(self, monkeypatch):
|
||||
+ monkeypatch.setattr(os.path, 'isdir', lambda path: path == '/home/testuser/.config/pulse')
|
||||
+ monkeypatch.setattr(os, 'listdir', lambda _: ['default.pa'])
|
||||
+
|
||||
+ class FakeUser:
|
||||
+ pw_dir = '/home/testuser'
|
||||
+
|
||||
+ monkeypatch.setattr(scanpulseaudio.pwd, 'getpwall', lambda: [FakeUser()])
|
||||
+ result = _get_user_config_dirs()
|
||||
+ assert result == ['/home/testuser/.config/pulse']
|
||||
+
|
||||
+
|
||||
+class TestScanPulseaudio:
|
||||
+ """Tests for scan_pulseaudio main function."""
|
||||
+
|
||||
+ def test_no_custom_config(self, monkeypatch):
|
||||
+ monkeypatch.setattr(scanpulseaudio, '_check_default_configs_modified', lambda: [])
|
||||
+ monkeypatch.setattr(scanpulseaudio, '_get_dropin_dirs_with_content', lambda: [])
|
||||
+ monkeypatch.setattr(scanpulseaudio, '_get_user_config_dirs', lambda: [])
|
||||
+
|
||||
+ result = scan_pulseaudio()
|
||||
+
|
||||
+ assert result.modified_defaults == []
|
||||
+ assert result.dropin_dirs == []
|
||||
+ assert result.user_config_dirs == []
|
||||
+
|
||||
+ def test_with_all_findings(self, monkeypatch):
|
||||
+ monkeypatch.setattr(scanpulseaudio, '_check_default_configs_modified',
|
||||
+ lambda: ['/etc/pulse/daemon.conf'])
|
||||
+ monkeypatch.setattr(scanpulseaudio, '_get_dropin_dirs_with_content',
|
||||
+ lambda: ['/etc/pulse/default.pa.d'])
|
||||
+ monkeypatch.setattr(scanpulseaudio, '_get_user_config_dirs',
|
||||
+ lambda: ['/root/.config/pulse'])
|
||||
+
|
||||
+ result = scan_pulseaudio()
|
||||
+
|
||||
+ assert result.modified_defaults == ['/etc/pulse/daemon.conf']
|
||||
+ assert result.dropin_dirs == ['/etc/pulse/default.pa.d']
|
||||
+ assert result.user_config_dirs == ['/root/.config/pulse']
|
||||
diff --git a/repos/system_upgrade/el9toel10/models/pulseaudioconfiguration.py b/repos/system_upgrade/el9toel10/models/pulseaudioconfiguration.py
|
||||
new file mode 100644
|
||||
index 00000000..bfb7aa22
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/models/pulseaudioconfiguration.py
|
||||
@@ -0,0 +1,24 @@
|
||||
+from leapp.models import fields, Model
|
||||
+from leapp.topics import SystemInfoTopic
|
||||
+
|
||||
+
|
||||
+class PulseAudioConfiguration(Model):
|
||||
+ """
|
||||
+ Model describing the state of PulseAudio configuration on the system.
|
||||
+ """
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ modified_defaults = fields.List(fields.String(), default=[])
|
||||
+ """
|
||||
+ Default config files modified from RPM originals (full paths)
|
||||
+ """
|
||||
+
|
||||
+ dropin_dirs = fields.List(fields.String(), default=[])
|
||||
+ """
|
||||
+ Drop-in directories that exist and contain files (full paths)
|
||||
+ """
|
||||
+
|
||||
+ user_config_dirs = fields.List(fields.String(), default=[])
|
||||
+ """
|
||||
+ Per-user config directories that exist and contain files (full paths)
|
||||
+ """
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
From 87c192519e8764f59516cca563816f062428a533 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Thu, 2 Apr 2026 16:28:48 +0200
|
||||
Subject: [PATCH 37/44] fix(checkyumpluginsenabled): correctly create
|
||||
remediation command
|
||||
|
||||
The remediation command for the inhibitor triggered when required dnf
|
||||
plugins are not enabled was created incorrectly. This patch fixes the
|
||||
command creation.
|
||||
---
|
||||
.../libraries/checkyumpluginsenabled.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py b/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
index 9afa51ac..869e2a88 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
@@ -36,8 +36,8 @@ def check_required_dnf_plugins_enabled(pkg_manager_info):
|
||||
product_id_plugin_conf = os.path.join(plugin_configs_dir, 'product-id.conf')
|
||||
|
||||
remediation_commands = [
|
||||
- f"sed -i 's/^plugins=0/plugins=1/' '{dnf_conf_path}'"
|
||||
- f"sed -i 's/^enabled=0/enabled=1/' '{rhsm_plugin_conf}'"
|
||||
+ f"sed -i 's/^plugins=0/plugins=1/' '{dnf_conf_path}'",
|
||||
+ f"sed -i 's/^enabled=0/enabled=1/' '{rhsm_plugin_conf}'",
|
||||
f"sed -i 's/^enabled=0/enabled=1/' '{product_id_plugin_conf}'"
|
||||
]
|
||||
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,201 +0,0 @@
|
||||
From 0cfeee9fa113690c7e58877edf65842aad7d7ce5 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Fri, 27 Mar 2026 13:53:49 +0100
|
||||
Subject: [PATCH 38/44] fix(rhui): consider source clients always signed
|
||||
|
||||
Previously, all RHUI clients mentioned in the cloud map in the rhui.py
|
||||
library were considered as signed by RH. However, configs allow using
|
||||
clients that are not known to leapp, and, therefore, such clients would
|
||||
not be considered as signed. Consequently, these packages would not be
|
||||
removed, causing the upgrade to fail. This patch changes this behavior
|
||||
so that all source clients mentioned in the RHUIInfo message are
|
||||
considered as signed.
|
||||
---
|
||||
.../filterrpmtransactionevents/actor.py | 12 +-
|
||||
.../tests/test_filterrpmtransactionevents.py | 120 +++++++++++++++++-
|
||||
2 files changed, 125 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/filterrpmtransactionevents/actor.py b/repos/system_upgrade/common/actors/filterrpmtransactionevents/actor.py
|
||||
index 582a5821..aa735da3 100644
|
||||
--- a/repos/system_upgrade/common/actors/filterrpmtransactionevents/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/filterrpmtransactionevents/actor.py
|
||||
@@ -1,8 +1,11 @@
|
||||
from leapp.actors import Actor
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
from leapp.models import (
|
||||
DistributionSignedRPM,
|
||||
FilteredRpmTransactionTasks,
|
||||
+ InstalledRPM,
|
||||
PESRpmTransactionTasks,
|
||||
+ RHUIInfo,
|
||||
RpmTransactionTasks
|
||||
)
|
||||
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
@@ -18,7 +21,7 @@ class FilterRpmTransactionTasks(Actor):
|
||||
"""
|
||||
|
||||
name = 'check_rpm_transaction_events'
|
||||
- consumes = (PESRpmTransactionTasks, RpmTransactionTasks, DistributionSignedRPM,)
|
||||
+ consumes = (PESRpmTransactionTasks, RpmTransactionTasks, DistributionSignedRPM, RHUIInfo, InstalledRPM)
|
||||
produces = (FilteredRpmTransactionTasks,)
|
||||
tags = (IPUWorkflowTag, ChecksPhaseTag)
|
||||
|
||||
@@ -27,6 +30,13 @@ class FilterRpmTransactionTasks(Actor):
|
||||
for rpm_pkgs in self.consume(DistributionSignedRPM):
|
||||
installed_pkgs.update([pkg.name for pkg in rpm_pkgs.items])
|
||||
|
||||
+ # Consider all RHUI source clients as signed, so that we can always remove them
|
||||
+ rhui_info = next(self.consume(RHUIInfo), None)
|
||||
+ if rhui_info:
|
||||
+ for source_client in rhui_info.src_client_pkg_names:
|
||||
+ if has_package(InstalledRPM, source_client):
|
||||
+ installed_pkgs.add(source_client)
|
||||
+
|
||||
local_rpms = set()
|
||||
to_install = set()
|
||||
to_remove = set()
|
||||
diff --git a/repos/system_upgrade/common/actors/filterrpmtransactionevents/tests/test_filterrpmtransactionevents.py b/repos/system_upgrade/common/actors/filterrpmtransactionevents/tests/test_filterrpmtransactionevents.py
|
||||
index 7173805e..a228ed07 100644
|
||||
--- a/repos/system_upgrade/common/actors/filterrpmtransactionevents/tests/test_filterrpmtransactionevents.py
|
||||
+++ b/repos/system_upgrade/common/actors/filterrpmtransactionevents/tests/test_filterrpmtransactionevents.py
|
||||
@@ -1,7 +1,37 @@
|
||||
-from leapp.models import DistributionSignedRPM, FilteredRpmTransactionTasks, Module, RPM, RpmTransactionTasks
|
||||
+from leapp.models import (
|
||||
+ DistributionSignedRPM,
|
||||
+ FilteredRpmTransactionTasks,
|
||||
+ InstalledRPM,
|
||||
+ Module,
|
||||
+ RHUIInfo,
|
||||
+ RPM,
|
||||
+ RpmTransactionTasks,
|
||||
+ TargetRHUIPostInstallTasks,
|
||||
+ TargetRHUIPreInstallTasks,
|
||||
+ TargetRHUISetupInfo
|
||||
+)
|
||||
from leapp.snactor.fixture import current_actor_context
|
||||
|
||||
RH_PACKAGER = 'Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>'
|
||||
+UNSIGNED_PACKAGER = 'Third Party <third@party.com>'
|
||||
+
|
||||
+
|
||||
+def _make_rpm(name, packager=RH_PACKAGER):
|
||||
+ return RPM(name=name, version='0.1', release='1.sm01', epoch='1',
|
||||
+ packager=packager, arch='noarch', pgpsig='SOME_PGP_SIG')
|
||||
+
|
||||
+
|
||||
+def _make_rhui_info(src_clients, target_clients, provider='azure'):
|
||||
+ setup_info = TargetRHUISetupInfo(
|
||||
+ preinstall_tasks=TargetRHUIPreInstallTasks(),
|
||||
+ postinstall_tasks=TargetRHUIPostInstallTasks(),
|
||||
+ )
|
||||
+ return RHUIInfo(
|
||||
+ provider=provider,
|
||||
+ src_client_pkg_names=src_clients,
|
||||
+ target_client_pkg_names=target_clients,
|
||||
+ target_client_setup_info=setup_info,
|
||||
+ )
|
||||
|
||||
|
||||
def test_actor_execution(current_actor_context):
|
||||
@@ -10,11 +40,7 @@ def test_actor_execution(current_actor_context):
|
||||
|
||||
|
||||
def test_actor_execution_with_sample_data(current_actor_context):
|
||||
- installed_rpm = [
|
||||
- RPM(name='sample01', version='0.1', release='1.sm01', epoch='1', packager=RH_PACKAGER, arch='noarch',
|
||||
- pgpsig='SOME_PGP_SIG'),
|
||||
- RPM(name='sample02', version='0.1', release='1.sm01', epoch='1', packager=RH_PACKAGER, arch='noarch',
|
||||
- pgpsig='SOME_PGP_SIG')]
|
||||
+ installed_rpm = [_make_rpm('sample01'), _make_rpm('sample02')]
|
||||
modules_to_enable = [Module(name='enable', stream='1'), Module(name='enable', stream='2')]
|
||||
modules_to_reset = [Module(name='reset', stream='1'), Module(name='reset', stream='2')]
|
||||
current_actor_context.feed(DistributionSignedRPM(items=installed_rpm))
|
||||
@@ -43,3 +69,85 @@ def test_actor_execution_with_sample_data(current_actor_context):
|
||||
assert all(m.name == 'reset' for m in result[0].modules_to_reset)
|
||||
assert '1' in {m.stream for m in result[0].modules_to_reset}
|
||||
assert '2' in {m.stream for m in result[0].modules_to_reset}
|
||||
+
|
||||
+
|
||||
+def test_rhui_source_client_treated_as_signed(current_actor_context):
|
||||
+ """Installed RHUI source clients should be removable even if they are not distribution-signed."""
|
||||
+ rhui_client_rpm = _make_rpm('rhui-azure-rhel8', packager=UNSIGNED_PACKAGER)
|
||||
+ signed_rpm = _make_rpm('sample01')
|
||||
+
|
||||
+ current_actor_context.feed(DistributionSignedRPM(items=[signed_rpm]))
|
||||
+ current_actor_context.feed(InstalledRPM(items=[rhui_client_rpm, signed_rpm]))
|
||||
+ current_actor_context.feed(_make_rhui_info(['rhui-azure-rhel8'], ['rhui-azure-rhel9']))
|
||||
+ current_actor_context.feed(RpmTransactionTasks(to_remove=['rhui-azure-rhel8']))
|
||||
+ current_actor_context.run()
|
||||
+
|
||||
+ result = current_actor_context.consume(FilteredRpmTransactionTasks)
|
||||
+ assert len(result) == 1
|
||||
+ assert 'rhui-azure-rhel8' in result[0].to_remove
|
||||
+
|
||||
+
|
||||
+def test_rhui_source_client_not_installed_is_ignored(current_actor_context):
|
||||
+ """RHUI source clients that are not installed should not be added to the installed set."""
|
||||
+ signed_rpm = _make_rpm('sample01')
|
||||
+
|
||||
+ current_actor_context.feed(DistributionSignedRPM(items=[signed_rpm]))
|
||||
+ current_actor_context.feed(InstalledRPM(items=[signed_rpm]))
|
||||
+ current_actor_context.feed(_make_rhui_info(['rhui-azure-rhel8'], ['rhui-azure-rhel9']))
|
||||
+ current_actor_context.feed(RpmTransactionTasks(to_remove=['rhui-azure-rhel8']))
|
||||
+ current_actor_context.run()
|
||||
+
|
||||
+ result = current_actor_context.consume(FilteredRpmTransactionTasks)
|
||||
+ assert len(result) == 1
|
||||
+ assert 'rhui-azure-rhel8' not in result[0].to_remove
|
||||
+
|
||||
+
|
||||
+def test_no_rhui_info_unsigned_pkg_not_removable(current_actor_context):
|
||||
+ """Without RHUIInfo, unsigned packages should not be removable (baseline behavior)."""
|
||||
+ unsigned_rpm = _make_rpm('some-unsigned-pkg', packager=UNSIGNED_PACKAGER)
|
||||
+ signed_rpm = _make_rpm('sample01')
|
||||
+
|
||||
+ current_actor_context.feed(DistributionSignedRPM(items=[signed_rpm]))
|
||||
+ current_actor_context.feed(InstalledRPM(items=[unsigned_rpm, signed_rpm]))
|
||||
+ current_actor_context.feed(RpmTransactionTasks(to_remove=['some-unsigned-pkg']))
|
||||
+ current_actor_context.run()
|
||||
+
|
||||
+ result = current_actor_context.consume(FilteredRpmTransactionTasks)
|
||||
+ assert len(result) == 1
|
||||
+ assert 'some-unsigned-pkg' not in result[0].to_remove
|
||||
+
|
||||
+
|
||||
+def test_rhui_multiple_source_clients(current_actor_context):
|
||||
+ """Multiple RHUI source clients should all be treated as signed when installed."""
|
||||
+ client_rpms = [
|
||||
+ _make_rpm('rhui-client-a', packager=UNSIGNED_PACKAGER),
|
||||
+ _make_rpm('rhui-client-b', packager=UNSIGNED_PACKAGER),
|
||||
+ ]
|
||||
+
|
||||
+ current_actor_context.feed(DistributionSignedRPM(items=[]))
|
||||
+ current_actor_context.feed(InstalledRPM(items=client_rpms))
|
||||
+ current_actor_context.feed(_make_rhui_info(['rhui-client-a', 'rhui-client-b'], ['rhui-client-target']))
|
||||
+ current_actor_context.feed(RpmTransactionTasks(
|
||||
+ to_remove=['rhui-client-a', 'rhui-client-b'],
|
||||
+ ))
|
||||
+ current_actor_context.run()
|
||||
+
|
||||
+ result = current_actor_context.consume(FilteredRpmTransactionTasks)
|
||||
+ assert len(result) == 1
|
||||
+ assert 'rhui-client-a' in result[0].to_remove
|
||||
+ assert 'rhui-client-b' in result[0].to_remove
|
||||
+
|
||||
+
|
||||
+def test_rhui_source_client_ends_up_in_upgrade_if_not_removed(current_actor_context):
|
||||
+ """An installed RHUI source client not in to_remove/to_install should be upgraded."""
|
||||
+ rhui_client_rpm = _make_rpm('rhui-azure-rhel8', packager=UNSIGNED_PACKAGER)
|
||||
+
|
||||
+ current_actor_context.feed(DistributionSignedRPM(items=[]))
|
||||
+ current_actor_context.feed(InstalledRPM(items=[rhui_client_rpm]))
|
||||
+ current_actor_context.feed(_make_rhui_info(['rhui-azure-rhel8'], ['rhui-azure-rhel9']))
|
||||
+ current_actor_context.feed(RpmTransactionTasks())
|
||||
+ current_actor_context.run()
|
||||
+
|
||||
+ result = current_actor_context.consume(FilteredRpmTransactionTasks)
|
||||
+ assert len(result) == 1
|
||||
+ assert 'rhui-azure-rhel8' in result[0].to_upgrade
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From f11f7c4c022b990f3cad15eff5149591e747a27b Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Thu, 2 Apr 2026 10:57:55 +0200
|
||||
Subject: [PATCH 39/44] Ensure that greenboot rpms are removed during IPU
|
||||
|
||||
The greenboot packages have a value just for rpm-ostree based systems.
|
||||
However, if someone install them anyway (e.g. configuration mistake..),
|
||||
they would damage the upgraded systems - mainly in case IPU 8.10 -> 9.8+.
|
||||
Systemd fails with error:
|
||||
```
|
||||
Failed to isolate the default target.
|
||||
```
|
||||
|
||||
Due to bugs in greenboot scriptlets, that do not count with DNF
|
||||
execution inside container, nor with the update of greenboot packages
|
||||
from 0.14.x to 0.16.x and newer.
|
||||
|
||||
As there is not value to have these packages on rpm based system
|
||||
at all, just remove them during the upgrade to stay on a safe side.
|
||||
---
|
||||
etc/leapp/transaction/to_remove | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/etc/leapp/transaction/to_remove b/etc/leapp/transaction/to_remove
|
||||
index 0feb7827..420078f4 100644
|
||||
--- a/etc/leapp/transaction/to_remove
|
||||
+++ b/etc/leapp/transaction/to_remove
|
||||
@@ -1,3 +1,11 @@
|
||||
### List of packages (each on new line) to be removed from the upgrade transaction
|
||||
# Removing initial-setup package to avoid it asking for EULA acceptance during upgrade - OAMG-1531
|
||||
initial-setup
|
||||
+
|
||||
+# greenboot packages have a value just for rpm-ostree based systems
|
||||
+# however, if someone would install them anyway, they would damage
|
||||
+# the upgraded systems (mainly in case IPU 8.10 -> 9.8+).
|
||||
+# As there is not value for of these packages on systems upgraded by leapp
|
||||
+# (rpm based only), let's just remove them to stay safe
|
||||
+greenboot
|
||||
+greenboot-default-health-checks
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,205 +0,0 @@
|
||||
From 83540ae7dbd6cb030a024249d6308c56f0d3216d Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Tue, 31 Mar 2026 17:23:39 +0200
|
||||
Subject: [PATCH 40/44] Regenerate grub config during 8->9 conversions
|
||||
|
||||
This is mainly a preventative action to make sure that the grub config
|
||||
is compatible with the target grub.
|
||||
|
||||
The actor only runs grub2-mkconfig when BLS is enabled in
|
||||
/etc/default/grub. When BLS is disabled, the regeneration is taken care
|
||||
of by the grub kernel install scripts (in /usr/lib/kernel/install/),
|
||||
which do call grub2-mkconfig as required.
|
||||
|
||||
On 9to10 conversions the kernel install scripts handle regeneration
|
||||
whether the BLS is enabled or not.
|
||||
|
||||
Note that in some cases grub2-mkconfig might be ran twice, as there are
|
||||
2 more actors that run it (ensurevalidgrubcfghybrid and
|
||||
grub2mkconfigonppc64). This shouldn't be a problem since the generation
|
||||
is quick. However a better solution could be designed in the future.
|
||||
|
||||
Jira: RHEL-110712
|
||||
---
|
||||
.../actors/regenerategrubcfg/actor.py | 23 ++++
|
||||
.../libraries/regenerategrubcfg.py | 28 +++++
|
||||
.../tests/test_regenerategrubcfg.py | 102 ++++++++++++++++++
|
||||
3 files changed, 153 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el8toel9/actors/regenerategrubcfg/actor.py
|
||||
create mode 100644 repos/system_upgrade/el8toel9/actors/regenerategrubcfg/libraries/regenerategrubcfg.py
|
||||
create mode 100644 repos/system_upgrade/el8toel9/actors/regenerategrubcfg/tests/test_regenerategrubcfg.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/actor.py b/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..d87e9c7b
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/actor.py
|
||||
@@ -0,0 +1,23 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import regenerategrubcfg
|
||||
+from leapp.models import DefaultGrubInfo, TransactionCompleted
|
||||
+from leapp.tags import ApplicationsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class RegenerateGrubCfg(Actor):
|
||||
+ """
|
||||
+ Regenerate GRUB2 configuration during conversion from EL8 to EL9.
|
||||
+
|
||||
+ During distribution conversions (e.g. CentOS to RHEL), the GRUB2
|
||||
+ configuration may need to be regenerated to ensure compatibility
|
||||
+ with the target distribution's GRUB2 tooling. This actor runs
|
||||
+ grub2-mkconfig when BLS is enabled in /etc/default/grub.
|
||||
+ """
|
||||
+
|
||||
+ name = 'regenerate_grub_cfg'
|
||||
+ consumes = (DefaultGrubInfo, TransactionCompleted)
|
||||
+ produces = ()
|
||||
+ tags = (IPUWorkflowTag, ApplicationsPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ regenerategrubcfg.process()
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/libraries/regenerategrubcfg.py b/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/libraries/regenerategrubcfg.py
|
||||
new file mode 100644
|
||||
index 00000000..bedd0897
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/libraries/regenerategrubcfg.py
|
||||
@@ -0,0 +1,28 @@
|
||||
+from leapp.libraries.common import grub
|
||||
+from leapp.libraries.common.config import architecture, is_conversion
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
+from leapp.models import DefaultGrubInfo
|
||||
+
|
||||
+GRUB_CFG_PATH = '/boot/grub2/grub.cfg'
|
||||
+
|
||||
+
|
||||
+def process():
|
||||
+ if architecture.matches_architecture(architecture.ARCH_S390X):
|
||||
+ return
|
||||
+
|
||||
+ if not is_conversion():
|
||||
+ return
|
||||
+
|
||||
+ default_grub_msg = next(api.consume(DefaultGrubInfo), None)
|
||||
+ if not default_grub_msg:
|
||||
+ api.current_logger().warning('No DefaultGrubInfo message, skipping GRUB config regeneration.')
|
||||
+ return
|
||||
+
|
||||
+ if not grub.is_blscfg_enabled_in_defaultgrub(default_grub_msg):
|
||||
+ return
|
||||
+
|
||||
+ api.current_logger().info('Conversion detected with BLS enabled, regenerating GRUB config')
|
||||
+ try:
|
||||
+ run(['grub2-mkconfig', '-o', GRUB_CFG_PATH])
|
||||
+ except CalledProcessError as e:
|
||||
+ api.current_logger().error('Failed to regenerate GRUB config: {}'.format(e))
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/tests/test_regenerategrubcfg.py b/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/tests/test_regenerategrubcfg.py
|
||||
new file mode 100644
|
||||
index 00000000..7d8fb6f3
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/regenerategrubcfg/tests/test_regenerategrubcfg.py
|
||||
@@ -0,0 +1,102 @@
|
||||
+from unittest import mock
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import regenerategrubcfg
|
||||
+from leapp.libraries.common.config import architecture
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.models import DefaultGrub, DefaultGrubInfo
|
||||
+
|
||||
+GRUB2_MKCONFIG_CMD = ['grub2-mkconfig', '-o', '/boot/grub2/grub.cfg']
|
||||
+
|
||||
+BLS_ENABLED = DefaultGrubInfo(
|
||||
+ default_grub_info=[DefaultGrub(name='GRUB_ENABLE_BLSCFG', value='true')]
|
||||
+)
|
||||
+BLS_DISABLED = DefaultGrubInfo(
|
||||
+ default_grub_info=[DefaultGrub(name='GRUB_ENABLE_BLSCFG', value='false')]
|
||||
+)
|
||||
+
|
||||
+
|
||||
+@pytest.fixture
|
||||
+def mocked_run():
|
||||
+ with mock.patch.object(regenerategrubcfg, 'run') as m:
|
||||
+ yield m
|
||||
+
|
||||
+
|
||||
+@pytest.fixture(autouse=True)
|
||||
+def mocked_logger():
|
||||
+ with mock.patch.object(api, 'current_logger', logger_mocked()):
|
||||
+ yield api.current_logger
|
||||
+
|
||||
+
|
||||
+@pytest.fixture
|
||||
+def mock_actor(monkeypatch):
|
||||
+
|
||||
+ def make_mock(msgs, arch=architecture.ARCH_X86_64, is_conversion=False):
|
||||
+ instance = CurrentActorMocked(
|
||||
+ msgs=msgs,
|
||||
+ arch=arch,
|
||||
+ src_ver="8.10",
|
||||
+ dst_ver="9.6",
|
||||
+ )
|
||||
+ monkeypatch.setattr(api, 'current_actor', instance)
|
||||
+ # let's use this to cover all conversion paths
|
||||
+ monkeypatch.setattr(regenerategrubcfg, 'is_conversion', lambda: is_conversion)
|
||||
+ return instance
|
||||
+
|
||||
+ return make_mock
|
||||
+
|
||||
+
|
||||
+def test_conversion_bls_enabled_regenerates(mock_actor, mocked_run):
|
||||
+ """Conversion with BLS enabled -> regenerate."""
|
||||
+ mock_actor([BLS_ENABLED], is_conversion=True)
|
||||
+ regenerategrubcfg.process()
|
||||
+ mocked_run.assert_called_once_with(GRUB2_MKCONFIG_CMD)
|
||||
+
|
||||
+
|
||||
+def test_conversion_bls_disabled_skips(mock_actor, mocked_run):
|
||||
+ """Conversion with BLS not enabled -> skip."""
|
||||
+ mock_actor([BLS_DISABLED], is_conversion=True)
|
||||
+ regenerategrubcfg.process()
|
||||
+ mocked_run.assert_not_called()
|
||||
+
|
||||
+
|
||||
+def test_non_conversion_skips(mock_actor, mocked_run):
|
||||
+ """Non-conversion upgrade -> skip."""
|
||||
+ mock_actor([BLS_ENABLED])
|
||||
+ regenerategrubcfg.process()
|
||||
+ mocked_run.assert_not_called()
|
||||
+
|
||||
+
|
||||
+def test_s390x_skips(mock_actor, mocked_run):
|
||||
+ """s390x -> skip (uses ZIPL)."""
|
||||
+ mock_actor([BLS_ENABLED], arch=architecture.ARCH_S390X)
|
||||
+ regenerategrubcfg.process()
|
||||
+ mocked_run.assert_not_called()
|
||||
+
|
||||
+
|
||||
+def test_no_default_grub_info_skips(mock_actor, mocked_run, mocked_logger):
|
||||
+ """No DefaultGrubInfo -> skip."""
|
||||
+ mock_actor([], is_conversion=True)
|
||||
+ regenerategrubcfg.process()
|
||||
+ mocked_run.assert_not_called()
|
||||
+ assert any(
|
||||
+ "No DefaultGrubInfo message, skipping GRUB config regeneration." in msg
|
||||
+ for msg in mocked_logger.warnmsg
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def test_failure_nonfatal(mock_actor, mocked_run, mocked_logger):
|
||||
+ """grub2-mkconfig failure -> non-fatal, logs error."""
|
||||
+ mocked_run.side_effect = CalledProcessError(
|
||||
+ message='A Leapp Command Error occurred.',
|
||||
+ command=GRUB2_MKCONFIG_CMD,
|
||||
+ result={'signal': None, 'exit_code': 1, 'pid': 0, 'stdout': 'fake', 'stderr': 'fake'}
|
||||
+ )
|
||||
+ mock_actor([BLS_ENABLED], is_conversion=True)
|
||||
+
|
||||
+ regenerategrubcfg.process()
|
||||
+
|
||||
+ mocked_run.assert_called_once_with(GRUB2_MKCONFIG_CMD)
|
||||
+ assert any('Failed to regenerate GRUB config' in msg for msg in mocked_logger.errmsg)
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
From 971e5e329290d8e5047ac85c6c85943dfadd5fe6 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Tue, 14 Apr 2026 11:25:01 +0200
|
||||
Subject: [PATCH 41/44] python tests deps: update version requirements per
|
||||
python
|
||||
|
||||
tl;dr; We haven't updated the requirements.txt file for a long time
|
||||
(basically since IPU 7 -> 8; if we do not count some minor updates).
|
||||
Let's update dependencies to use newer python modules for newer
|
||||
versions of python.
|
||||
|
||||
* Pytest
|
||||
Originally we required pytest v6.2.5 for any python 3.6+. This is
|
||||
pretty old requirement coming from time of python ~ 3.8 and recently
|
||||
a CVE-2025-71176 occuared, which is fix in pytest v9.0.3.
|
||||
So let's update ranges to actually allow use of newer pytest on newer
|
||||
systems:
|
||||
|
||||
+----------------+---------------+
|
||||
| pytest version | python range |
|
||||
+----------------+---------------+
|
||||
| 6.2.5 | 3.6.x - 3.7.x |
|
||||
| 7.4.4 | 3.8.x - 3.9.x |
|
||||
| 9.0.3 | 3.10+ |
|
||||
+----------------+---------------+
|
||||
Note that Pytest 8.x is messing with imports which breaks leapp
|
||||
import handling unfortunately (race-condition). Seems that these
|
||||
problems are fixed for Pytest 9 with Python 3.10+. In case we
|
||||
figure out problems anyway, pytest will need to be executed with
|
||||
additional parameters to use old import style again. As there is
|
||||
no high demand for newer pytest on python 3.9, let's stick just
|
||||
with working pytest versions.
|
||||
|
||||
* Pyudev
|
||||
The original v0.22 is used up to CS 9 (pyton 3.9-). Use 0.24.1 for
|
||||
python 3.10+ (reflects CS 10 as well)
|
||||
|
||||
* Distro
|
||||
The original v1.5.0 can be used till CS 9 (python 3.9 included) safely
|
||||
as nowadays. Let's use version 1.9.0 for Python 3.10+
|
||||
|
||||
* Drop unsued dependencies (old python that is no longer supported
|
||||
in the project).
|
||||
---
|
||||
requirements.txt | 13 +++++++------
|
||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/requirements.txt b/requirements.txt
|
||||
index 3c79b23d..e4294718 100644
|
||||
--- a/requirements.txt
|
||||
+++ b/requirements.txt
|
||||
@@ -5,13 +5,14 @@ isort
|
||||
funcsigs==1.0.2
|
||||
mock==2.0.0
|
||||
pylint
|
||||
-pytest==4.6.11; python_version < '3.0'
|
||||
-pytest==6.2.5; python_version >= '3.6'
|
||||
-pyudev==0.22.0
|
||||
-distro==1.5.0
|
||||
+pytest==6.2.5; python_version >= '3.6' and python_version < '3.8'
|
||||
+pytest==7.4.4; python_version >= '3.8' and python_version < '3.10'
|
||||
+pytest==9.0.3; python_version >= '3.10'
|
||||
+pyudev==0.22.0; python_version < '3.10'
|
||||
+pyudev==0.24.1; python_version >= '3.10'
|
||||
+distro==1.5.0; python_version < '3.10'
|
||||
+distro==1.9.0; python_version >= '3.10'
|
||||
ipaddress==1.0.23
|
||||
git+https://github.com/oamg/leapp
|
||||
requests
|
||||
-# pinning a py27 troublemaking transitive dependency
|
||||
-lazy-object-proxy==1.5.2; python_version < '3'
|
||||
rpm
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,149 +0,0 @@
|
||||
From 0f0be8e4ca80721173d289a3db0b170334529c2c Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 29 Oct 2025 19:31:00 +0100
|
||||
Subject: [PATCH 42/44] Drop dependency on mock
|
||||
|
||||
The mock library is now a part of the Python standard library since
|
||||
Python 3.3 and is available as the unittest.mock. The 'mock' library is
|
||||
only a backport which is not needed anymore.
|
||||
|
||||
Also remove some unnecessary imports.
|
||||
---
|
||||
commands/tests/test_upgrade_paths.py | 2 +-
|
||||
.../common/actors/biosdevname/tests/test_biosdevname.py | 3 ++-
|
||||
.../actors/cephvolumescan/tests/test_cephvolumescan.py | 5 +----
|
||||
.../tests/test_distributionsignedrpmscanner.py | 3 +--
|
||||
.../actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py | 2 +-
|
||||
.../common/actors/scanmemory/tests/test_scanmemory.py | 3 ++-
|
||||
.../tests/component_test_selinuxcontentscanner.py | 4 +---
|
||||
.../el8toel9/actors/nisscanner/tests/test_nisscan.py | 3 ++-
|
||||
requirements.txt | 1 -
|
||||
9 files changed, 11 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/commands/tests/test_upgrade_paths.py b/commands/tests/test_upgrade_paths.py
|
||||
index 773cdf1c..83e8b7f9 100644
|
||||
--- a/commands/tests/test_upgrade_paths.py
|
||||
+++ b/commands/tests/test_upgrade_paths.py
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import resource
|
||||
+import unittest.mock as mock
|
||||
|
||||
-import mock
|
||||
import pytest
|
||||
|
||||
from leapp.cli.commands import command_utils
|
||||
diff --git a/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py b/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
||||
index 3aa8c614..1b11174f 100644
|
||||
--- a/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
||||
+++ b/repos/system_upgrade/common/actors/biosdevname/tests/test_biosdevname.py
|
||||
@@ -1,7 +1,8 @@
|
||||
+from unittest.mock import mock_open, patch
|
||||
+
|
||||
import pytest
|
||||
import pyudev
|
||||
import six
|
||||
-from mock import mock_open, patch
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.actor import biosdevname
|
||||
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 168b8fc2..14e1f359 100644
|
||||
--- a/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
+++ b/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
@@ -1,9 +1,6 @@
|
||||
-import pytest
|
||||
-from mock import Mock, patch
|
||||
+from unittest.mock import patch
|
||||
|
||||
from leapp.libraries.actor import cephvolumescan
|
||||
-from leapp.models import InstalledRPM, LsblkEntry, RPM, StorageInfo
|
||||
-from leapp.reporting import Report
|
||||
|
||||
CONT_PS_COMMAND_OUTPUT = {
|
||||
"stdout":
|
||||
diff --git a/repos/system_upgrade/common/actors/distributionsignedrpmscanner/tests/test_distributionsignedrpmscanner.py b/repos/system_upgrade/common/actors/distributionsignedrpmscanner/tests/test_distributionsignedrpmscanner.py
|
||||
index b0c616cb..e5db0c8f 100644
|
||||
--- a/repos/system_upgrade/common/actors/distributionsignedrpmscanner/tests/test_distributionsignedrpmscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/distributionsignedrpmscanner/tests/test_distributionsignedrpmscanner.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
|
||||
from leapp.libraries.common import rpms
|
||||
from leapp.libraries.common.config import mock_configs
|
||||
@@ -8,7 +8,6 @@ from leapp.models import (
|
||||
fields,
|
||||
InstalledRPM,
|
||||
InstalledUnsignedRPM,
|
||||
- IPUConfig,
|
||||
Model,
|
||||
OSRelease,
|
||||
RPM,
|
||||
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 d996de84..bef3d485 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,9 +1,9 @@
|
||||
import errno
|
||||
import textwrap
|
||||
+import unittest.mock as mock
|
||||
from io import StringIO
|
||||
from os.path import basename
|
||||
|
||||
-import mock
|
||||
import six
|
||||
|
||||
from leapp.libraries.actor import ifcfgscanner
|
||||
diff --git a/repos/system_upgrade/common/actors/scanmemory/tests/test_scanmemory.py b/repos/system_upgrade/common/actors/scanmemory/tests/test_scanmemory.py
|
||||
index 13e4e724..20fa8e91 100644
|
||||
--- a/repos/system_upgrade/common/actors/scanmemory/tests/test_scanmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/scanmemory/tests/test_scanmemory.py
|
||||
@@ -1,4 +1,5 @@
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
+
|
||||
import six
|
||||
|
||||
from leapp.libraries.actor import scanmemory
|
||||
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 802e038a..15aef5d8 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
|
||||
@@ -4,9 +4,7 @@ import pytest
|
||||
|
||||
from leapp.libraries.common.config import mock_configs
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import SELinuxCustom, SELinuxFacts, SELinuxModule, SELinuxModules, SELinuxRequestRPMs
|
||||
-from leapp.reporting import Report
|
||||
-from leapp.snactor.fixture import current_actor_context
|
||||
+from leapp.models import SELinuxCustom, SELinuxFacts, SELinuxModules, SELinuxRequestRPMs
|
||||
|
||||
# compat module ensures compatibility with newer systems and is not part of testing
|
||||
TEST_MODULES = [
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/nisscanner/tests/test_nisscan.py b/repos/system_upgrade/el8toel9/actors/nisscanner/tests/test_nisscan.py
|
||||
index ed000ce0..d7e77a28 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/nisscanner/tests/test_nisscan.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/nisscanner/tests/test_nisscan.py
|
||||
@@ -1,4 +1,5 @@
|
||||
-import mock
|
||||
+import unittest.mock as mock
|
||||
+
|
||||
import pytest
|
||||
import six
|
||||
|
||||
diff --git a/requirements.txt b/requirements.txt
|
||||
index e4294718..ee1d9006 100644
|
||||
--- a/requirements.txt
|
||||
+++ b/requirements.txt
|
||||
@@ -3,7 +3,6 @@
|
||||
flake8
|
||||
isort
|
||||
funcsigs==1.0.2
|
||||
-mock==2.0.0
|
||||
pylint
|
||||
pytest==6.2.5; python_version >= '3.6' and python_version < '3.8'
|
||||
pytest==7.4.4; python_version >= '3.8' and python_version < '3.10'
|
||||
--
|
||||
2.53.0
|
||||
|
||||
@ -1,194 +0,0 @@
|
||||
From d8c82c9460e2ab08ac735c7af06ec4a73a9b4de4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Peter=20Mo=C4=8D=C3=A1ry?=
|
||||
<68905580+PeterMocary@users.noreply.github.com>
|
||||
Date: Thu, 16 Apr 2026 23:00:14 +0200
|
||||
Subject: [PATCH 43/44] remove single quoting from remediation commands (#1520)
|
||||
|
||||
The framework now uses shlex.quote to always make literals out of
|
||||
remediation command arguments. Some of the existing remediation commands used single
|
||||
quotes in their subcommands so the resulting command in leapp-report.txt used
|
||||
unintuitive escaping of single quotes.
|
||||
|
||||
The chackrootsymlinks can still end up with a single quote if the user
|
||||
has it in one of the symlinks that need to be adjusted. However, it is
|
||||
not possible to handle this differently without introducing side effects.
|
||||
|
||||
jira: RHEL-156521
|
||||
---
|
||||
packaging/leapp-repository.spec | 2 +-
|
||||
.../common/actors/checkrootsymlinks/actor.py | 53 +--------------
|
||||
.../libraries/checkrootsymlinks.py | 65 +++++++++++++++++++
|
||||
.../libraries/checkyumpluginsenabled.py | 6 +-
|
||||
4 files changed, 71 insertions(+), 55 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkrootsymlinks/libraries/checkrootsymlinks.py
|
||||
|
||||
diff --git a/packaging/leapp-repository.spec b/packaging/leapp-repository.spec
|
||||
index 3ffafafa..70b1d7d3 100644
|
||||
--- a/packaging/leapp-repository.spec
|
||||
+++ b/packaging/leapp-repository.spec
|
||||
@@ -120,7 +120,7 @@ Requires: leapp-repository-dependencies = %{leapp_repo_deps}
|
||||
|
||||
# IMPORTANT: this is capability provided by the leapp framework rpm.
|
||||
# Check that 'version' instead of the real framework rpm version.
|
||||
-Requires: leapp-framework >= 6.4, leapp-framework < 7
|
||||
+Requires: leapp-framework >= 6.5, leapp-framework < 7
|
||||
|
||||
# Since we provide sub-commands for the leapp utility, we expect the leapp
|
||||
# tool to be installed as well.
|
||||
diff --git a/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py b/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
index 2e805542..391e5589 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkrootsymlinks/actor.py
|
||||
@@ -1,8 +1,5 @@
|
||||
-import os
|
||||
-
|
||||
-from leapp import reporting
|
||||
from leapp.actors import Actor
|
||||
-from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.actor import checkrootsymlinks
|
||||
from leapp.models import Report, RootDirectory
|
||||
from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
@@ -20,50 +17,4 @@ class CheckRootSymlinks(Actor):
|
||||
tags = (IPUWorkflowTag, ChecksPhaseTag)
|
||||
|
||||
def process(self):
|
||||
- rootdir = next(self.consume(RootDirectory), None)
|
||||
- if not rootdir:
|
||||
- raise StopActorExecutionError('Cannot check root symlinks',
|
||||
- details={'Problem': 'Did not receive a message with '
|
||||
- 'root subdirectories'})
|
||||
- absolute_links = [item for item in rootdir.items if item.target and os.path.isabs(item.target)]
|
||||
- absolute_links_nonutf = [item for item in rootdir.invalid_items if item.target and os.path.isabs(item.target)]
|
||||
- if not absolute_links and not absolute_links_nonutf:
|
||||
- return
|
||||
-
|
||||
- report_fields = [
|
||||
- reporting.Title('Upgrade requires links in root directory to be relative'),
|
||||
- reporting.Summary(
|
||||
- 'After rebooting, parts of the upgrade process can fail if symbolic links in / '
|
||||
- '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])]
|
||||
-
|
||||
- # Generate reports about absolute links presence
|
||||
- rem_commands = []
|
||||
- if absolute_links:
|
||||
- commands = []
|
||||
- for item in absolute_links:
|
||||
- command = ' '.join(['ln',
|
||||
- '-snf',
|
||||
- f"'{os.path.relpath(item.target, '/')}'",
|
||||
- f"'{os.path.join('/', item.name)}'"])
|
||||
- commands.append(command)
|
||||
- rem_commands = [['bash', '-c', '{}'.format(' && '.join(commands))]]
|
||||
- # Generate reports about non-utf8 absolute links presence
|
||||
- nonutf_count = len(absolute_links_nonutf)
|
||||
- if nonutf_count > 0:
|
||||
- # for non-utf encoded filenames can't provide a remediation command, so will mention this fact in a hint
|
||||
- rem_hint = ("{} symbolic links point to absolute paths that have non-utf8 encoding and need to be"
|
||||
- " fixed additionally".format(nonutf_count))
|
||||
- report_fields.append(reporting.Remediation(hint=rem_hint, commands=rem_commands))
|
||||
- else:
|
||||
- report_fields.append(reporting.Remediation(commands=rem_commands))
|
||||
-
|
||||
- reporting.create_report(report_fields)
|
||||
+ checkrootsymlinks.process()
|
||||
diff --git a/repos/system_upgrade/common/actors/checkrootsymlinks/libraries/checkrootsymlinks.py b/repos/system_upgrade/common/actors/checkrootsymlinks/libraries/checkrootsymlinks.py
|
||||
new file mode 100644
|
||||
index 00000000..2c5676bd
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkrootsymlinks/libraries/checkrootsymlinks.py
|
||||
@@ -0,0 +1,65 @@
|
||||
+import os
|
||||
+
|
||||
+from leapp import reporting
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import RootDirectory
|
||||
+
|
||||
+
|
||||
+def _dquote(s):
|
||||
+ """Double-quote a string for use inside a non-interactive shell script."""
|
||||
+ escaped = (s.replace('\\', '\\\\')
|
||||
+ .replace('"', '\\"')
|
||||
+ .replace('$', '\\$')
|
||||
+ .replace('`', '\\`'))
|
||||
+ return '"{}"'.format(escaped)
|
||||
+
|
||||
+
|
||||
+def process():
|
||||
+ rootdir = next(api.consume(RootDirectory), None)
|
||||
+ if not rootdir:
|
||||
+ raise StopActorExecutionError('Cannot check root symlinks',
|
||||
+ details={'Problem': 'Did not receive a message with '
|
||||
+ 'root subdirectories'})
|
||||
+ absolute_links = [item for item in rootdir.items if item.target and os.path.isabs(item.target)]
|
||||
+ absolute_links_nonutf = [item for item in rootdir.invalid_items if item.target and os.path.isabs(item.target)]
|
||||
+ if not absolute_links and not absolute_links_nonutf:
|
||||
+ return
|
||||
+
|
||||
+ report_fields = [
|
||||
+ reporting.Title('Upgrade requires links in root directory to be relative'),
|
||||
+ reporting.Summary(
|
||||
+ 'After rebooting, parts of the upgrade process can fail if symbolic links in / '
|
||||
+ '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])]
|
||||
+
|
||||
+ # Generate reports about absolute links presence
|
||||
+ rem_commands = []
|
||||
+ if absolute_links:
|
||||
+ commands = []
|
||||
+ for item in absolute_links:
|
||||
+ command = ' '.join(['ln',
|
||||
+ '-snf',
|
||||
+ _dquote(os.path.relpath(item.target, '/')),
|
||||
+ _dquote(os.path.join('/', item.name))])
|
||||
+ commands.append(command)
|
||||
+ rem_commands = [['bash', '-c', '{}'.format(' && '.join(commands))]]
|
||||
+ # Generate reports about non-utf8 absolute links presence
|
||||
+ nonutf_count = len(absolute_links_nonutf)
|
||||
+ if nonutf_count > 0:
|
||||
+ # for non-utf encoded filenames can't provide a remediation command, so will mention this fact in a hint
|
||||
+ rem_hint = ("{} symbolic links point to absolute paths that have non-utf8 encoding and need to be"
|
||||
+ " fixed additionally".format(nonutf_count))
|
||||
+ report_fields.append(reporting.Remediation(hint=rem_hint, commands=rem_commands))
|
||||
+ else:
|
||||
+ report_fields.append(reporting.Remediation(commands=rem_commands))
|
||||
+
|
||||
+ reporting.create_report(report_fields)
|
||||
diff --git a/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py b/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
index 869e2a88..5c99a0d9 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkyumpluginsenabled/libraries/checkyumpluginsenabled.py
|
||||
@@ -36,9 +36,9 @@ def check_required_dnf_plugins_enabled(pkg_manager_info):
|
||||
product_id_plugin_conf = os.path.join(plugin_configs_dir, 'product-id.conf')
|
||||
|
||||
remediation_commands = [
|
||||
- f"sed -i 's/^plugins=0/plugins=1/' '{dnf_conf_path}'",
|
||||
- f"sed -i 's/^enabled=0/enabled=1/' '{rhsm_plugin_conf}'",
|
||||
- f"sed -i 's/^enabled=0/enabled=1/' '{product_id_plugin_conf}'"
|
||||
+ f'sed -i "s/^plugins=0/plugins=1/" "{dnf_conf_path}"',
|
||||
+ f'sed -i "s/^enabled=0/enabled=1/" "{rhsm_plugin_conf}"',
|
||||
+ f'sed -i "s/^enabled=0/enabled=1/" "{product_id_plugin_conf}"',
|
||||
]
|
||||
|
||||
reporting.create_report([
|
||||
--
|
||||
2.53.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
7
gating.yaml
Normal file
7
gating.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
||||
|
||||
@ -7,19 +7,9 @@
|
||||
%if 0%{?rhel} == 7
|
||||
%define leapp_python_sitelib %{python2_sitelib}
|
||||
%define lpr_name leapp-upgrade-el7toel8
|
||||
%define repo_shortname el7toel8
|
||||
%define next_major_ver 8
|
||||
%else
|
||||
%define leapp_python_sitelib %{python3_sitelib}
|
||||
%if 0%{?rhel} == 8
|
||||
%define lpr_name leapp-upgrade-el8toel9
|
||||
%define repo_shortname el8toel9
|
||||
%define next_major_ver 9
|
||||
%else
|
||||
%define lpr_name leapp-upgrade-el9toel10
|
||||
%define repo_shortname el9toel10
|
||||
%define next_major_ver 10
|
||||
%endif
|
||||
%define lpr_name leapp-upgrade-el8toel9
|
||||
|
||||
# This drops autogenerated deps on
|
||||
# - /usr/libexec/platform-python (rhel-8 buildroot)
|
||||
@ -51,64 +41,71 @@ py2_byte_compile "%1" "%2"}
|
||||
# RHEL 8+ packages to be consistent with other leapp projects in future.
|
||||
|
||||
Name: leapp-repository
|
||||
Version: 0.24.0
|
||||
Release: 2%{?dist}
|
||||
Version: 0.20.0
|
||||
Release: 4%{?dist}
|
||||
Summary: Repositories for leapp
|
||||
|
||||
License: ASL 2.0
|
||||
URL: https://oamg.github.io/leapp/
|
||||
Source0: https://github.com/oamg/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
Source1: deps-pkgs-13.tar.gz
|
||||
Source1: deps-pkgs-10.tar.gz
|
||||
|
||||
# NOTE: Our packages must be noarch. Do no drop this in any way.
|
||||
BuildArch: noarch
|
||||
|
||||
### PATCHES HERE
|
||||
# Patch0001: filename.patch
|
||||
Patch0001: 0001-Remove-legacy-overlay-solution-leftovers.patch
|
||||
Patch0002: 0002-update-upgrade-paths-8.10-9.9-10.3.patch
|
||||
Patch0003: 0003-Enable-logrotate.timer-during-8to9-IPU.patch
|
||||
Patch0004: 0004-feat-net-naming-scheme-enable-by-default-on-CS-9to10.patch
|
||||
Patch0005: 0005-Leapp_resume.service-Silence-AVC-SELinux-warnings.patch
|
||||
Patch0006: 0006-Add-API-to-get-a-distro-report-name.patch
|
||||
Patch0007: 0007-livemode-copy-upgrade-kernel-s-hmac-into-boot.patch
|
||||
Patch0008: 0008-fix-livemode-make-live.dir-is-relative-to-device-roo.patch
|
||||
Patch0009: 0009-fix-livemode-change-location-of-source-system-tree.patch
|
||||
Patch00010: 0010-Respect-distro-names-in-reports.patch
|
||||
Patch00011: 0011-checkblacklistca-Respect-distro-name-in-reports.patch
|
||||
Patch00012: 0012-blsgrubcfgonppc64-Respect-distro-name-in-reports.patch
|
||||
Patch00013: 0013-checkselinux-Respect-distro-name-in-report.patch
|
||||
Patch00014: 0014-checkosrelease-Respect-distro-name-in-report.patch
|
||||
Patch00015: 0015-rocecheck-Remove-outadated-check-for-source-version.patch
|
||||
Patch00016: 0016-rocecheck-Respect-distro-name-in-report.patch
|
||||
Patch00017: 0017-opensshpermitrootlogincheck-Remove-7to8-related-code.patch
|
||||
Patch00018: 0018-opensshpermitrootlogincheck-Respect-target-distro-na.patch
|
||||
Patch00019: 0019-checkifcfg_ifcfg-Respect-distro-name-in-report.patch
|
||||
Patch00020: 0020-opensslproviders-Use-distro-name-in-the-leapp-commen.patch
|
||||
Patch00021: 0021-opensslconfigcheck-Dont-make-the-recommendation-as-r.patch
|
||||
Patch00022: 0022-checkmicroarchitecture-Respect-distro-name-in-report.patch
|
||||
Patch00023: 0023-checkmemory-Respect-distro-name-in-reports.patch
|
||||
Patch00024: 0024-targetuserspacecreator-Respect-distro-name-in-report.patch
|
||||
Patch00025: 0025-checkdetecteddevicesanddirvers-Respect-distro-name-i.patch
|
||||
Patch00026: 0026-reportleftoverpackages-Respect-distro-name-in-report.patch
|
||||
Patch00027: 0027-fix-overlaygen-exclude-hugetlbfs-from-overlay-mounts.patch
|
||||
Patch00028: 0028-biosdevname-Fix-check-of-naming-scheme-and-tests.patch
|
||||
Patch00029: 0029-persistentnetnamesdisable-refactoring-fix-ethX-detec.patch
|
||||
Patch00030: 0030-Fix-scan-of-net-interfaces-non-PCI-conflicting-broke.patch
|
||||
Patch00031: 0031-persistentnetnamesconfig-Deprecate-legacy-functional.patch
|
||||
Patch00032: 0032-persistentnetnamesdisable-Disable-net.ifnames-correc.patch
|
||||
Patch00033: 0033-persistentnetnamesdisable-Mention-net.naming-scheme-.patch
|
||||
Patch00034: 0034-fix-quoting-in-list-representation-of-commands.patch
|
||||
Patch00035: 0035-fixup-fix-quoting-in-list-representation-of-commands.patch
|
||||
Patch00036: 0036-pulseaudiocheck-Add-PulseAudio-config-check-for-RHEL.patch
|
||||
Patch00037: 0037-fix-checkyumpluginsenabled-correctly-create-remediat.patch
|
||||
Patch00038: 0038-fix-rhui-consider-source-clients-always-signed.patch
|
||||
Patch00039: 0039-Ensure-that-greenboot-rpms-are-removed-during-IPU.patch
|
||||
Patch00040: 0040-Regenerate-grub-config-during-8-9-conversions.patch
|
||||
Patch00041: 0041-python-tests-deps-update-version-requirements-per-py.patch
|
||||
Patch00042: 0042-Drop-dependency-on-mock.patch
|
||||
Patch00043: 0043-remove-single-quoting-from-remediation-commands-1520.patch
|
||||
Patch00044: 0044-Update-leapp-data-data-stream-4.3-CTC-1.patch
|
||||
|
||||
Patch0001: 0001-rhui-do-not-bootstrap-target-client-on-aws.patch
|
||||
Patch0002: 0002-Packit-Drop-tests-for-obsoleted-upgrade-paths-restru.patch
|
||||
Patch0003: 0003-silence-use-yield-from-from-pylint-3.1.patch
|
||||
Patch0004: 0004-rocescanner-Actually-call-process-in-test_roce_notib.patch
|
||||
Patch0005: 0005-Fix-incorrect-parsing-of-lscpu-output.patch
|
||||
Patch0006: 0006-Add-unit-tests-for-actor-udevamdinfo.patch
|
||||
Patch0007: 0007-Add-unit-tests-for-scansourcefiles-actor-1190.patch
|
||||
Patch0008: 0008-pes_events_scanner-overwrite-repositories-when-apply.patch
|
||||
Patch0009: 0009-Modify-upgrade-not-terminate-after-lockfile-detected.patch
|
||||
Patch0010: 0010-Make-the-reboot-required-text-more-visible-in-the-co.patch
|
||||
Patch0011: 0011-check_grub_legacy-inhibit-when-GRUB-legacy-is-presen.patch
|
||||
Patch0012: 0012-Default-channel-to-GA-is-not-specified-otherwise-120.patch
|
||||
Patch0013: 0013-Enhance-grub2-install-failure-message.patch
|
||||
Patch0014: 0014-boot-check-first-partition-offset-on-GRUB-devices.patch
|
||||
Patch0015: 0015-boot-Skip-checks-of-first-partition-offset-for-for-g.patch
|
||||
Patch0016: 0016-repomapping-Add-RHEL7-ELS-repos.patch
|
||||
Patch0017: 0017-bump-required-repomap-version.patch
|
||||
Patch0018: 0018-fixup-bump-required-repomap-version.patch
|
||||
Patch0019: 0019-Fix-incorrect-command-formulation.patch
|
||||
Patch0020: 0020-mention-Report-in-produces-of-transitionsystemdservi.patch
|
||||
Patch0021: 0021-Update-packit-config-after-tier-redefinition.patch
|
||||
Patch0022: 0022-Update-reboot-msg-Note-the-console-access.patch
|
||||
Patch0023: 0023-Fix-kernel-cmdline-args-we-add-not-being-propogated-.patch
|
||||
Patch0024: 0024-kernelcmdlineconfig-add-newline-in-etc-kernel-cmdlin.patch
|
||||
Patch0025: 0025-Data-Update-DDDD.json-fixed-incorrect-data-add-craft.patch
|
||||
Patch0026: 0026-Data-Update-PES-data-to-cover-up-to-date-changes.patch
|
||||
Patch0027: 0027-Move-common-Satellite-Upgrade-code-to-common.patch
|
||||
Patch0028: 0028-Add-el8toel9-upgrade-facts-for-Satellite.patch
|
||||
Patch0029: 0029-Refresh-collation-version-if-pulp-ansible-is-present.patch
|
||||
Patch0030: 0030-Refactor-satellite_upgrade_services-to-use-SystemdSe.patch
|
||||
Patch0031: 0031-mount-usr-Implement-try-sleep-loop-add-time-for-stor.patch
|
||||
Patch0032: 0032-Add-additional-KB-resources.patch
|
||||
Patch0033: 0033-storage-initialisation-apply-sleep-always.patch
|
||||
Patch0034: 0034-Add-renovate-to-track-github-actions-deps.patch
|
||||
Patch0035: 0035-chore-deps-update-redhat-plumbers-in-action-differen.patch
|
||||
Patch0036: 0036-chore-deps-update-actions-checkout-action-to-v4.patch
|
||||
Patch0037: 0037-chore-deps-update-dependency-ubuntu-to-v22.patch
|
||||
Patch0038: 0038-Fix-E0606-errors-reported-by-pylint.patch
|
||||
Patch0039: 0039-Fix-W0135-reported-by-pylint.patch
|
||||
Patch0040: 0040-chore-deps-update-peter-evans-create-or-update-comme.patch
|
||||
Patch0041: 0041-properly-indent-the-list-of-supported-OSes.patch
|
||||
Patch0042: 0042-report-which-OS-release-was-detected-as-unsupported.patch
|
||||
Patch0043: 0043-Fix-typo-in-.packit.yaml.patch
|
||||
Patch0044: 0044-drop-unused-packager-field-from-distro-metadata.patch
|
||||
Patch0045: 0045-Add-environment-information-to-leappdb.patch
|
||||
Patch0046: 0046-chore-deps-update-actions-github-script-action-to-v7.patch
|
||||
Patch0047: 0047-fix-some-typos-spotted-by-codespell.patch
|
||||
Patch0048: 0048-BZ-2283067-don-t-remove-Tomcat-during-Satellite-7to8.patch
|
||||
Patch0049: 0049-Add-product-certs-and-target-for-9.5.patch
|
||||
|
||||
|
||||
%description
|
||||
%{summary}
|
||||
@ -137,24 +134,14 @@ Obsoletes: leapp-repository-sos-plugin <= 0.10.0
|
||||
Conflicts: leapp-upgrade-el8toel9
|
||||
|
||||
%else
|
||||
######### RHEL 8+ (and newer) ############
|
||||
######### RHEL 8 ############
|
||||
BuildRequires: python3-devel
|
||||
Requires: python3-leapp
|
||||
|
||||
# NOTE(pstodulk): else if / elif has been implemented quite late. as we still
|
||||
# want to build on RHEL 7 too, go in the old way. Ref:
|
||||
# https://github.com/rpm-software-management/rpm/issues/311
|
||||
%if 0%{?rhel} == 8
|
||||
######### RHEL 8 ############
|
||||
|
||||
# Same as the conflict above - we want to be sure our packages are untouched
|
||||
# during the whole IPU process
|
||||
Conflicts: leapp-upgrade-el7toel8
|
||||
Conflicts: leapp-upgrade-el9toel10
|
||||
%else
|
||||
######### RHEL 9 ############
|
||||
Conflicts: leapp-upgrade-el8toel9
|
||||
%endif
|
||||
|
||||
%endif
|
||||
|
||||
# IMPORTANT: every time the requirements are changed, increment number by one
|
||||
@ -163,7 +150,7 @@ Requires: leapp-repository-dependencies = %{leapp_repo_deps}
|
||||
|
||||
# IMPORTANT: this is capability provided by the leapp framework rpm.
|
||||
# Check that 'version' instead of the real framework rpm version.
|
||||
Requires: leapp-framework >= 6.5
|
||||
Requires: leapp-framework >= 5.0
|
||||
|
||||
# Since we provide sub-commands for the leapp utility, we expect the leapp
|
||||
# tool to be installed as well.
|
||||
@ -173,10 +160,6 @@ Requires: leapp
|
||||
# uncompressing redhat-release package from the ISO.
|
||||
Requires: cpio
|
||||
|
||||
# Subpackage for managing fapolicyd rules for %{lpr_name} installed only if
|
||||
# fapolicyd is present on the system
|
||||
Requires: (%{lpr_name}-fapolicyd = %{version}-%{release} if fapolicyd)
|
||||
|
||||
# The leapp-repository rpm is renamed to %%{lpr_name}
|
||||
Obsoletes: leapp-repository < 0.14.0-5
|
||||
Provides: leapp-repository = %{version}-%{release}
|
||||
@ -258,12 +241,6 @@ Requires: dracut
|
||||
Requires: NetworkManager-libnm
|
||||
Requires: python3-gobject-base
|
||||
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} == 9
|
||||
############# RHEL 9 dependencies (when the source system is RHEL 9) ##########
|
||||
# Required to convert pam_userdb database from BerkeleyDB to GDBM
|
||||
Requires: libdb-utils
|
||||
%endif
|
||||
##################################################
|
||||
# end requirement
|
||||
@ -274,68 +251,69 @@ Requires: libdb-utils
|
||||
%{summary}
|
||||
|
||||
|
||||
%package -n %{lpr_name}-fapolicyd
|
||||
Summary: Manage fapolicyd rules for %{lpr_name} during the upgrade
|
||||
|
||||
Requires: fapolicyd
|
||||
|
||||
%description -n %{lpr_name}-fapolicyd
|
||||
%{summary}
|
||||
|
||||
|
||||
%prep
|
||||
%setup -n %{name}-%{version}
|
||||
%setup -q -n %{name}-%{version} -D -T -a 1
|
||||
|
||||
# APPLY PATCHES HERE
|
||||
# %%patch -P 0001 -p1
|
||||
%patch -P 0001 -p1
|
||||
%patch -P 0002 -p1
|
||||
%patch -P 0003 -p1
|
||||
%patch -P 0004 -p1
|
||||
%patch -P 0005 -p1
|
||||
%patch -P 0006 -p1
|
||||
%patch -P 0007 -p1
|
||||
%patch -P 0008 -p1
|
||||
%patch -P 0009 -p1
|
||||
%patch -P 0010 -p1
|
||||
%patch -P 0011 -p1
|
||||
%patch -P 0012 -p1
|
||||
%patch -P 0013 -p1
|
||||
%patch -P 0014 -p1
|
||||
%patch -P 0015 -p1
|
||||
%patch -P 0016 -p1
|
||||
%patch -P 0017 -p1
|
||||
%patch -P 0018 -p1
|
||||
%patch -P 0019 -p1
|
||||
%patch -P 0020 -p1
|
||||
%patch -P 0021 -p1
|
||||
%patch -P 0022 -p1
|
||||
%patch -P 0023 -p1
|
||||
%patch -P 0024 -p1
|
||||
%patch -P 0025 -p1
|
||||
%patch -P 0026 -p1
|
||||
%patch -P 0027 -p1
|
||||
%patch -P 0028 -p1
|
||||
%patch -P 0029 -p1
|
||||
%patch -P 0030 -p1
|
||||
%patch -P 0031 -p1
|
||||
%patch -P 0032 -p1
|
||||
%patch -P 0033 -p1
|
||||
%patch -P 0034 -p1
|
||||
%patch -P 0035 -p1
|
||||
%patch -P 0036 -p1
|
||||
%patch -P 0037 -p1
|
||||
%patch -P 0038 -p1
|
||||
%patch -P 0039 -p1
|
||||
%patch -P 0040 -p1
|
||||
%patch -P 0041 -p1
|
||||
%patch -P 0042 -p1
|
||||
%patch -P 0043 -p1
|
||||
%patch -P 0044 -p1
|
||||
# %%patch0001 -p1
|
||||
%patch0001 -p1
|
||||
%patch0002 -p1
|
||||
%patch0003 -p1
|
||||
%patch0004 -p1
|
||||
%patch0005 -p1
|
||||
%patch0006 -p1
|
||||
%patch0007 -p1
|
||||
%patch0008 -p1
|
||||
%patch0009 -p1
|
||||
%patch0010 -p1
|
||||
%patch0011 -p1
|
||||
%patch0012 -p1
|
||||
%patch0013 -p1
|
||||
%patch0014 -p1
|
||||
%patch0015 -p1
|
||||
%patch0016 -p1
|
||||
%patch0017 -p1
|
||||
%patch0018 -p1
|
||||
%patch0019 -p1
|
||||
%patch0020 -p1
|
||||
%patch0021 -p1
|
||||
%patch0022 -p1
|
||||
%patch0023 -p1
|
||||
%patch0024 -p1
|
||||
%patch0025 -p1
|
||||
%patch0026 -p1
|
||||
%patch0027 -p1
|
||||
%patch0028 -p1
|
||||
%patch0029 -p1
|
||||
%patch0030 -p1
|
||||
%patch0031 -p1
|
||||
%patch0032 -p1
|
||||
%patch0033 -p1
|
||||
%patch0034 -p1
|
||||
%patch0035 -p1
|
||||
%patch0036 -p1
|
||||
%patch0037 -p1
|
||||
%patch0038 -p1
|
||||
%patch0039 -p1
|
||||
%patch0040 -p1
|
||||
%patch0041 -p1
|
||||
%patch0042 -p1
|
||||
%patch0043 -p1
|
||||
%patch0044 -p1
|
||||
%patch0045 -p1
|
||||
%patch0046 -p1
|
||||
%patch0047 -p1
|
||||
%patch0048 -p1
|
||||
%patch0049 -p1
|
||||
|
||||
|
||||
%build
|
||||
cp -a leapp*deps*el%{next_major_ver}.noarch.rpm repos/system_upgrade/%{repo_shortname}/files/bundled-rpms/
|
||||
%if 0%{?rhel} == 7
|
||||
cp -a leapp*deps*el8.noarch.rpm repos/system_upgrade/el7toel8/files/bundled-rpms/
|
||||
%else
|
||||
cp -a leapp*deps*el9.noarch.rpm repos/system_upgrade/el8toel9/files/bundled-rpms/
|
||||
%endif
|
||||
|
||||
|
||||
%install
|
||||
@ -343,19 +321,11 @@ install -m 0755 -d %{buildroot}%{custom_repositorydir}
|
||||
install -m 0755 -d %{buildroot}%{repositorydir}
|
||||
cp -r repos/* %{buildroot}%{repositorydir}/
|
||||
install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/repos.d/
|
||||
# NOTE(pstodulk): drop transaction dir and its content if replaced by config files before RHEL 10
|
||||
install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/transaction/
|
||||
install -m 0755 -d %{buildroot}%{_sysconfdir}/leapp/files/
|
||||
install -m 0644 etc/leapp/transaction/* %{buildroot}%{_sysconfdir}/leapp/transaction
|
||||
install -m 0644 etc/leapp/files/* %{buildroot}%{_sysconfdir}/leapp/files
|
||||
|
||||
# install rules necessary for fapolicy
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/fapolicyd/rules.d/
|
||||
install -m 0644 etc/fapolicyd/rules.d/31-leapp-repository.rules %{buildroot}%{_sysconfdir}/fapolicyd/rules.d
|
||||
|
||||
# uncomment to install existing configs if any exists
|
||||
#install -m 0644 etc/leapp/actor_conf.d/* %%{buildroot}%%{_sysconfdir}/leapp/actor_conf.d
|
||||
|
||||
# install CLI commands for the leapp utility on the expected path
|
||||
install -m 0755 -d %{buildroot}%{leapp_python_sitelib}/leapp/cli/
|
||||
cp -r commands %{buildroot}%{leapp_python_sitelib}/leapp/cli/
|
||||
@ -363,10 +333,11 @@ rm -rf %{buildroot}%{leapp_python_sitelib}/leapp/cli/commands/tests
|
||||
|
||||
# Remove irrelevant repositories - We don't want to ship them for the particular
|
||||
# RHEL version
|
||||
for i in el7toel8 el8toel9 el9toel10;
|
||||
do
|
||||
[ "$i" != "%{repo_shortname}" ] && rm -rf %{buildroot}%{repositorydir}/system_upgrade/$i
|
||||
done
|
||||
%if 0%{?rhel} == 7
|
||||
rm -rf %{buildroot}%{repositorydir}/system_upgrade/el8toel9
|
||||
%else
|
||||
rm -rf %{buildroot}%{repositorydir}/system_upgrade/el7toel8
|
||||
%endif
|
||||
|
||||
# remove component/unit tests, Makefiles, ... stuff that related to testing only
|
||||
rm -rf %{buildroot}%{repositorydir}/common/actors/testactor
|
||||
@ -374,9 +345,6 @@ find %{buildroot}%{repositorydir}/common -name "test.py" -delete
|
||||
rm -rf `find %{buildroot}%{repositorydir} -name "tests" -type d`
|
||||
find %{buildroot}%{repositorydir} -name "Makefile" -delete
|
||||
find %{buildroot} -name "*.py.orig" -delete
|
||||
# .gitkeep file is used to have a directory in the repo. but we do not want these
|
||||
# files in the resulting RPM
|
||||
find %{buildroot} -name .gitkeep -delete
|
||||
|
||||
for DIRECTORY in $(find %{buildroot}%{repositorydir}/ -mindepth 1 -maxdepth 1 -type d);
|
||||
do
|
||||
@ -395,12 +363,6 @@ done;
|
||||
%endif
|
||||
|
||||
|
||||
%posttrans -n %{lpr_name}-fapolicyd
|
||||
if systemctl is-active --quiet fapolicyd; then
|
||||
systemctl restart fapolicyd
|
||||
fi
|
||||
|
||||
|
||||
%files -n %{lpr_name}
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
@ -411,8 +373,6 @@ fi
|
||||
%dir %{custom_repositorydir}
|
||||
%dir %{leapp_python_sitelib}/leapp/cli/commands
|
||||
%config %{_sysconfdir}/leapp/files/*
|
||||
# uncomment to package installed configs
|
||||
#%%config %%{_sysconfdir}/leapp/actor_conf.d/*
|
||||
%{_sysconfdir}/leapp/repos.d/*
|
||||
%{_sysconfdir}/leapp/transaction/*
|
||||
%{repositorydir}/*
|
||||
@ -422,185 +382,7 @@ fi
|
||||
%files -n %{lpr_name}-deps
|
||||
# no files here
|
||||
|
||||
|
||||
%files -n %{lpr_name}-fapolicyd
|
||||
%attr(644, root, fapolicyd) %config %{_sysconfdir}/fapolicyd/rules.d/31-leapp-repository.rules
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Apr 17 2026 Matej Matuska <mmatuska@redhat.com> - 0.24.0-2
|
||||
- Introduce new upgrade paths 8.10 -> 9.9
|
||||
- Requires leapp-framework 6.5+
|
||||
- Modify keys for several reports that have been inconsistent between major releases. The keys are now independent of the used upgrade path.
|
||||
- Enable the logrotate timer automatically
|
||||
- Fix AVC SELinux warnings caused by leapp execution
|
||||
- Fix the upgrade with LiveMode on systems with FIPS
|
||||
- Livemode: Fix the upgrade on systems where the generated live image is not in rootfs
|
||||
- Fix failing upgrades with hugetlbfs file systems specified in FSTAB
|
||||
- Fix scan of physical network interfaces and ethX detection
|
||||
- Fix detection of network interfaces with biosdevname naming on Dell machines
|
||||
- Fix quoting in list representation of remediation commands
|
||||
- Consider RHUI source clients as signed by distribution vendor
|
||||
- Ensure that greenboot packages are removed during the upgrade
|
||||
- Respect names of distributions used for the IPU in preupgrade reports
|
||||
- Minor updates in reports
|
||||
- Regenerate GRUB2 config during conversions
|
||||
- Update leapp data files
|
||||
- Introduce DISTRO_REPORT_NAMES in the distro library to provide unified names for linux distributions for the use in leapp reports
|
||||
- Resolves: RHEL-3370, RHEL-17361, RHEL-104379, RHEL-110712, RHEL-129571, RHEL-130948
|
||||
|
||||
* Tue Feb 10 2026 Matej Matuska <mmatuska@redhat.com> - 0.24.0-1
|
||||
- Rebase to new upstream 0.24.0
|
||||
- Introduce new IPU path 8.10 -> 9.8
|
||||
- Remove obsoleted IPU paths
|
||||
- Fix the upgrade for systems with installed kernel-rt
|
||||
- Enable php:8.2 module stream if enabled on the source system
|
||||
- Skip check for required baseos & appstream repos when upgrading from CS 8
|
||||
- Improve the error message when a problematic DNF repository definition is detected
|
||||
- Process enabled DNF module-streams correctly during the upgrade
|
||||
- Fix the leapp rerun command when upgrading using LiveMode
|
||||
- Ignore trailing slashes when checking that required mountpoints are persistent
|
||||
- Wait until filesystems defined in FSTAB are initialized and mounted when booting into the upgrade environment
|
||||
- Drop inhibitor for use of LiveMode on aarch64, s390x, ppcle64 architectures
|
||||
- LiveMode: Do not install RPMs that are not essential in the initramfs by default
|
||||
- Added scan and checks for NVMe devices, inhibiting upgrades on known problematic setups
|
||||
- Handle the upgrade on systems with NVMe-FC storage
|
||||
- Migrate the UEFI configuration when converting to RHEL
|
||||
- Inhibit the upgrade when converting system to a different linux distribution with enabled Secure Boot
|
||||
- Resolves: RHEL-128267, RHEL-95215, RHEL-102361, RHEL-46807, RHEL-100961, RHEL-42609, RHEL-33661, RHEL-19249, RHEL-119516
|
||||
|
||||
* Wed Dec 17 2025 Matej Matuska <mmatuska@redhat.com> - 0.23.0-3
|
||||
- Fix handling of LVM and Multipath during the upgrade
|
||||
- Fix remediation command for making symlinks in root directory relative
|
||||
- Remove RPM GPG keys of the source distribution when upgrading and converting the system
|
||||
- Replace distro specific packages during upgrade and conversion
|
||||
- Improve error message when scanning invalid SSHD configuration
|
||||
- Update the leapp data files
|
||||
- Minor changes in logs and reports
|
||||
- Resolves: RHEL-14712, RHEL-30447, RHEL-19247, RHEL-127066, RHEL-124923, RHEL-119516
|
||||
|
||||
* Thu Nov 13 2025 Karolina Kula <kkula@redhat.com> - 0.23.0-2
|
||||
- Requires leapp-framework 6.2+
|
||||
- Detect potentially harmful third party python modules for the target python version
|
||||
- Fix detection of encrypted Ceph OSD containers
|
||||
- Fix unlocking of LUKS devices when applied on non-rootfs file systems
|
||||
- Inhibit the upgrade if pluginpath is configured explicitly in DNF
|
||||
- Introduce `--target-os` option to specify target distribution for possible conversion during the upgrade
|
||||
- Introduce the `--target-version` alias for the `--target` option
|
||||
- Minor changes in logs and reports
|
||||
- Modernize the storage initialization when booting to the upgrade environment
|
||||
- Prevent sssdupdate actor from rising errors that could stop the upgrade
|
||||
- Respect repomapping on CentOS-like distributions
|
||||
- Respect repomapping when converting the system to different Linux distribution
|
||||
- Skip empty lines when parsing dumped DNF config to prevent confusing warning log
|
||||
- Cover JBoss EAP repositories for the upgrade
|
||||
- Update the leapp data files
|
||||
- Resolves: RHEL-25838, RHEL-35446, RHEL-69601, RHEL-71882, RHEL-90098, RHEL-120328, RHEL-123886
|
||||
|
||||
* Thu Aug 14 2025 Karolina Kula <kkula@redhat.com> - 0.23.0-1
|
||||
- Rebase to new upstream 0.23.0
|
||||
- Enable in-place upgrades on CentOS Stream systems
|
||||
- Introduce leapp-upgrade-el8toel9-fapolicyd subpackage with fapolicyd rules for in-place upgrades
|
||||
- Ignore Red Hat subscription-manager actions on non-RHEL distros
|
||||
- Update leapp upgrade data files
|
||||
- Resolves: RHEL-65599, RHEL-67627
|
||||
|
||||
* Fri Jul 18 2025 Karolina Kula <kkula@redhat.com> - 0.22.0-5
|
||||
- Fix broken bootloader on Azure hybrid images for systems previously upgraded from RHEL 7
|
||||
- Load DNF configuration correctly when using DNF libraries
|
||||
- Disable localpkg_gpgcheck during the upgrade if set to allow installation of bundled leapp and leapp-repository deps packages
|
||||
- Add actor with recommendations for upgrade of MySQL
|
||||
- The HybridImage model has been replaced by ConvertGrubenvTask
|
||||
- Check the input format of the target version properly
|
||||
- Resolves: RHEL-5459, RHEL-38255, RHEL-39095, RHEL-47472, RHEL-96238
|
||||
|
||||
* Thu Jun 05 2025 Karolina Kula <kkula@redhat.com> - 0.22.0-4
|
||||
- Fix parsing of the kernel cmdline
|
||||
- Require leapp data with provided_data_streams 4.0+
|
||||
- Resolves: RHEL-67627
|
||||
|
||||
|
||||
* Wed May 14 2025 Petr Stodulka <pstodulk@redhat.com> - 0.22.0-3
|
||||
- Rebuild
|
||||
|
||||
* Tue May 13 2025 Petr Stodulka <pstodulk@redhat.com> - 0.22.0-2
|
||||
- Require leapp-framework >= 6.1
|
||||
- Simplified use of the LiveMode experimental feature with additional enhancements
|
||||
- Fix the check of deprecated PCI devices and drivers
|
||||
- Add RHEL 9.7 product certificates
|
||||
- Gracefully handle CentOS OS versioning style
|
||||
- Introduced the --enable-experimental-feature to simplify use of experimental features
|
||||
- Manage RPM GPG keys during the upgrade respecting used linux distributions
|
||||
- Minor fixes in reports
|
||||
- Prevent a crach during post-upgrade phases when no custom SELinux modules needs to be migrated
|
||||
- Update leapp upgrade data files
|
||||
- Resolves: RHEL-53801, RHEL-77945, RHEL-84978
|
||||
|
||||
* Fri Feb 14 2025 Petr Stodulka <pstodulk@redhat.com> - 0.22.0-1
|
||||
- Rebase to new upstream 0.22.0
|
||||
- Minor updates in generated reports
|
||||
- Resolves: RHEL-67621, RHEL-67719, RHEL-16881
|
||||
|
||||
* Wed Jan 29 2025 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-6
|
||||
- Raise an inhibitor if unsupported target version supplied instead of error
|
||||
- Prevent a possible crash with LiveMode when adding the upgrade boot entry on systems with LVM
|
||||
- Fix the bootloader workaround for upgrades on ARM machines - covering also differences on AWS
|
||||
- Resolves: RHEL-67621, RHEL-51072, RHEL-41193
|
||||
|
||||
* Fri Jan 17 2025 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-5
|
||||
- Fix pes events scanner crashing when there are duplicate packages in the received instructions
|
||||
- Fix pes events scanner not respecting user’s transaction configuration
|
||||
- Fix storage scanner crashing when command outputs contain colon character
|
||||
- Activate LVM VGs with `--sysinit` option to correct the use in the upgrade initramfs
|
||||
- Minor improvements in preupgrade reports
|
||||
- Resolves: RHEL-67621, RHEL-34570, RHEL-44596, RHEL-50076
|
||||
|
||||
* Tue Nov 19 2024 Matej Matuska <mmatuska@redhat.com> - 0.21.0-4
|
||||
- Use net.naming-scheme by default
|
||||
- Resolves: RHEL-23473
|
||||
|
||||
* Mon Nov 18 2024 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-3
|
||||
- Introduce upgrade path 8.10 -> 9.6
|
||||
- Require leapp-framework 6.0+
|
||||
- Update leapp-deps package to satisfy leapp-framework-dependencies 6
|
||||
- Add possibility to use net.naming-scheme during the upgrade
|
||||
- Cap max size of the sparse files to 1TiB for storage with large amount of free space
|
||||
- Enable upgrade for systems with LUKS bound to Clevis with TPM 2.0 token
|
||||
- Adjust resource limitations for leapp to be able to perform the upgrade
|
||||
- Fix problems with the bootloader when upgrading to RHEL 9.6 on ARM
|
||||
- Fix the report when handling broken parsing of kernel cmdline
|
||||
- Generate proper error message instead of ModelViolationError when parsing invalid repository definition
|
||||
- Handle default kernel cmdline when multiple boot entries for the default kernel are defined
|
||||
- Introduce a possibility to configure leapp actors covering RHUI on clouds
|
||||
- Skip checking of (PKI) `directory-hash` dir to speedup the upgrade process and clean logs
|
||||
- Update leapp upgrade data files
|
||||
- Resolves: RHEL-67621, RHEL-57064, RHEL-56251, RHEL-50686, RHEL-41193
|
||||
- Resolves: RHEL-34570, RHEL-26459, RHEL-23473, RHEL-16881, RHEL-3294
|
||||
|
||||
* Mon Aug 19 2024 Petr Stodulka <pstodulk@redhat.com> - 0.21.0-2
|
||||
- Updated SPEC file to drop leapp repositories unrelated to IPU 8 -> 9
|
||||
- Resolves: RHEL-27847
|
||||
|
||||
* Fri Aug 16 2024 Toshio Kuratomi <toshio@fedoraproject.org> - 0.21.0-1
|
||||
- Rebase to new upstream 0.21.0
|
||||
- Updated leapp data files.
|
||||
- Inhibit the upgrade to RHEL 9.5 on ARM architecture due to
|
||||
incompatibility between the RHEL 8 bootloader and RHEL 9.5 kernel.
|
||||
- Introduce experimental upgrades in 'live' mode for the testing.
|
||||
- Resolves: RHEL-27847, RHEL-52993, RHEL-45280, RHEL-49748, RHEL-52186
|
||||
|
||||
* Wed Jul 24 2024 Toshio Kuratomi <toshio@fedoraproject.org> - 0.20.0-5
|
||||
- Improve set_systemd_services_states logging
|
||||
- [IPU 7 -> 8] Fix detection of bootable device on RAID
|
||||
- Fix detection of valid sshd config with internal-sftp subsystem in Leapp
|
||||
- Handle a false positive GPG check error when TargetUserSpaceInfo is missing
|
||||
- Fix failing "update-ca-trust" command caused by missing util-linux package
|
||||
- Improve report when a system is unsupported
|
||||
- Fix handling of versions in RHUI configuration for ELS and SAP upgrades
|
||||
- Add missing RHUI GCP config info for RHEL for SAP
|
||||
- Fix upgrade on aarch64 via RHUI on AWS
|
||||
- Resolves: RHEL-33902, RHEL-38909, RHEL-30573, RHEL-43978, RHEL-39046, RHEL-39047, RHEL-39049
|
||||
|
||||
* Thu May 30 2024 Petr Stodulka <pstodulk@redhat.com> - 0.20.0-4
|
||||
- Enable new upgrade path RHEL 8.10 -> 9.5
|
||||
- Minor updates in reports
|
||||
4
plans/tier0.fmf
Normal file
4
plans/tier0.fmf
Normal file
@ -0,0 +1,4 @@
|
||||
summary: Foo
|
||||
execute:
|
||||
script: leapp --help
|
||||
|
||||
2
sources
Normal file
2
sources
Normal file
@ -0,0 +1,2 @@
|
||||
SHA512 (deps-pkgs-10.tar.gz) = e63f77e439456e0a8b0fc338b370ee7e2d7824b1d62c75f2209b283905c8c0641d504bfe910021317884fa1662429d952fd4c9b9ee457c48b34182e6f975aa0e
|
||||
SHA512 (leapp-repository-0.20.0.tar.gz) = 8f1732cda85a597e2401a67b69f347398e0270fb2a411079fb9de5261213809bb3323053c0663c0c1f731eb085be6083acabd0a46aaa24d5d3f6b024bd5f0e55
|
||||
Loading…
Reference in New Issue
Block a user