forked from rpms/leapp-repository
Compare commits
17 Commits
c8
...
a8-elevate
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4053cc724e | ||
| b1281ebeec | |||
|
|
c760b70d71 | ||
|
|
8719e7886c | ||
| 37f55f86cd | |||
|
|
3850071da9 | ||
|
|
db06b018c9 | ||
|
|
914831b294 | ||
| c6b0548ebd | |||
|
|
33566e267f | ||
| f53b53a68e | |||
|
|
ca41224a54 | ||
|
|
1d1276410e | ||
|
|
3c063417e2 | ||
|
|
2f853fc90e | ||
| 15fd026e53 | |||
|
|
476ebfeb49 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
SOURCES/deps-pkgs-13.tar.gz
|
||||
SOURCES/leapp-repository-0.24.0.tar.gz
|
||||
SOURCES/leapp-repository-0.23.0.tar.gz
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
3590b33b4a79ebe62f5cfa0eeca7efb41d526498 SOURCES/deps-pkgs-13.tar.gz
|
||||
2271b92541564ebd07a038a8b45e5a33d5f8b9c9 SOURCES/leapp-repository-0.24.0.tar.gz
|
||||
b5b541cc0c0372ee476f0ab6073a62e67290d031 SOURCES/leapp-repository-0.23.0.tar.gz
|
||||
|
||||
@ -0,0 +1,333 @@
|
||||
From dcf53c28ea9c3fdd03277abcdeb1d124660f7f8e Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 19 Aug 2025 09:48:11 +0200
|
||||
Subject: [PATCH 01/55] Add upgrade inhibitor for custom DNF pluginpath
|
||||
configuration
|
||||
|
||||
Implements detection and inhibition of the upgrade when DNF
|
||||
pluginpath is configured in /etc/dnf/dnf.conf:
|
||||
- Add DnfPluginPathDetected model to communicate detection results
|
||||
- Add ScanDnfPluginPath actor (FactsPhase) to scan DNF configuration
|
||||
- Add CheckDnfPluginPath actor (ChecksPhase) to create inhibitor report
|
||||
- Add related unit tests
|
||||
|
||||
Localisation of dnf plugins is not constant between system releases
|
||||
which can cause issues with the upgrade, so the user should remove
|
||||
this option or comment it out.
|
||||
|
||||
Jira: RHEL-69601
|
||||
---
|
||||
.../common/actors/checkdnfpluginpath/actor.py | 22 ++++++++
|
||||
.../libraries/checkdnfpluginpath.py | 35 ++++++++++++
|
||||
.../tests/test_checkdnfpluginpath.py | 34 ++++++++++++
|
||||
.../common/actors/scandnfpluginpath/actor.py | 21 ++++++++
|
||||
.../libraries/scandnfpluginpath.py | 30 +++++++++++
|
||||
.../files/dnf_config_incorrect_pluginpath | 7 +++
|
||||
.../tests/files/dnf_config_no_pluginpath | 6 +++
|
||||
.../tests/files/dnf_config_with_pluginpath | 7 +++
|
||||
.../tests/test_scandnfpluginpath.py | 53 +++++++++++++++++++
|
||||
.../common/models/dnfpluginpathdetected.py | 14 +++++
|
||||
10 files changed, 229 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
create mode 100644 repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
create mode 100644 repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..34055886
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/actor.py
|
||||
@@ -0,0 +1,22 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.checkdnfpluginpath import perform_check
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class CheckDnfPluginPath(Actor):
|
||||
+ """
|
||||
+ Inhibits the upgrade if a custom DNF plugin path is configured.
|
||||
+
|
||||
+ This actor checks whether the pluginpath option is configured in /etc/dnf/dnf.conf and produces a report if it is.
|
||||
+ If the option is detected with any value, the upgrade is inhibited.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_dnf_pluginpath'
|
||||
+ consumes = (DnfPluginPathDetected,)
|
||||
+ produces = (Report,)
|
||||
+ tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ perform_check()
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..ce705361
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/libraries/checkdnfpluginpath.py
|
||||
@@ -0,0 +1,35 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+DNF_CONFIG_PATH = '/etc/dnf/dnf.conf'
|
||||
+
|
||||
+
|
||||
+def check_dnf_pluginpath(dnf_pluginpath_detected):
|
||||
+ """Create an inhibitor when pluginpath is detected in DNF configuration."""
|
||||
+ if not dnf_pluginpath_detected.is_pluginpath_detected:
|
||||
+ return
|
||||
+ reporting.create_report([
|
||||
+ reporting.Title('Detected specified pluginpath in DNF configuration.'),
|
||||
+ reporting.Summary(
|
||||
+ 'The "pluginpath" option is set in the {} file. The path to DNF plugins differs between '
|
||||
+ 'system major releases due to different versions of Python. '
|
||||
+ 'This breaks the in-place upgrades if defined explicitly as DNF plugins '
|
||||
+ 'are stored on a different path on the new system.'
|
||||
+ .format(DNF_CONFIG_PATH)
|
||||
+ ),
|
||||
+ reporting.Remediation(
|
||||
+ hint='Remove or comment out the pluginpath option in the DNF '
|
||||
+ 'configuration file to be able to upgrade the system',
|
||||
+ commands=[['sed', '-i', '\'s/^pluginpath[[:space:]]*=/#pluginpath=/\'', DNF_CONFIG_PATH]],
|
||||
+ ),
|
||||
+ reporting.Severity(reporting.Severity.HIGH),
|
||||
+ reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
+ reporting.RelatedResource('file', DNF_CONFIG_PATH),
|
||||
+ ])
|
||||
+
|
||||
+
|
||||
+def perform_check():
|
||||
+ dnf_pluginpath_detected = next(api.consume(DnfPluginPathDetected), None)
|
||||
+ if dnf_pluginpath_detected:
|
||||
+ check_dnf_pluginpath(dnf_pluginpath_detected)
|
||||
diff --git a/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py b/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..7dd8bbf2
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkdnfpluginpath/tests/test_checkdnfpluginpath.py
|
||||
@@ -0,0 +1,34 @@
|
||||
+import pytest
|
||||
+
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.actor.checkdnfpluginpath import check_dnf_pluginpath, perform_check
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.utils.report import is_inhibitor
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('is_detected', [False, True])
|
||||
+def test_check_dnf_pluginpath(monkeypatch, is_detected):
|
||||
+ actor_reports = create_report_mocked()
|
||||
+ msg = DnfPluginPathDetected(is_pluginpath_detected=is_detected)
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[msg]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', actor_reports)
|
||||
+
|
||||
+ perform_check()
|
||||
+
|
||||
+ assert bool(actor_reports.called) == is_detected
|
||||
+
|
||||
+ if is_detected:
|
||||
+ assert is_inhibitor(actor_reports.report_fields)
|
||||
+
|
||||
+
|
||||
+def test_perform_check_no_message_available(monkeypatch):
|
||||
+ """Test perform_check when no DnfPluginPathDetected message is available."""
|
||||
+ actor_reports = create_report_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(reporting, 'create_report', actor_reports)
|
||||
+
|
||||
+ perform_check()
|
||||
+
|
||||
+ assert not actor_reports.called
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py b/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..e43a691e
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/actor.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.scandnfpluginpath import scan_dnf_pluginpath
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class ScanDnfPluginPath(Actor):
|
||||
+ """
|
||||
+ Scans DNF configuration for custom pluginpath option.
|
||||
+
|
||||
+ This actor collects information about whether the pluginpath option is configured in DNF configuration
|
||||
+ and produces a DnfPluginPathDetected message, containing the information.
|
||||
+ """
|
||||
+
|
||||
+ name = 'scan_dnf_pluginpath'
|
||||
+ consumes = ()
|
||||
+ produces = (DnfPluginPathDetected,)
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ scan_dnf_pluginpath()
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py b/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..818f7700
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/libraries/scandnfpluginpath.py
|
||||
@@ -0,0 +1,30 @@
|
||||
+import os
|
||||
+
|
||||
+from six.moves import configparser
|
||||
+
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+DNF_CONFIG_PATH = '/etc/dnf/dnf.conf'
|
||||
+
|
||||
+
|
||||
+def _is_pluginpath_set(config_path):
|
||||
+ """Check if pluginpath option is set in DNF configuration file."""
|
||||
+ if not os.path.isfile(config_path):
|
||||
+ api.current_logger().warning('The %s file is missing.', config_path)
|
||||
+ return False
|
||||
+
|
||||
+ parser = configparser.ConfigParser()
|
||||
+
|
||||
+ try:
|
||||
+ parser.read(config_path)
|
||||
+ return parser.has_option('main', 'pluginpath')
|
||||
+ except (configparser.Error, IOError) as e:
|
||||
+ api.current_logger().warning('The DNF config file %s couldn\'t be parsed: %s', config_path, e)
|
||||
+ return False
|
||||
+
|
||||
+
|
||||
+def scan_dnf_pluginpath():
|
||||
+ """Scan DNF configuration and produce DnfPluginPathDetected message."""
|
||||
+ is_detected = _is_pluginpath_set(DNF_CONFIG_PATH)
|
||||
+ api.produce(DnfPluginPathDetected(is_pluginpath_detected=is_detected))
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..aa29db09
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_incorrect_pluginpath
|
||||
@@ -0,0 +1,7 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
+pluginpathincorrect=/usr/lib/python3.6/site-packages/dnf-plugins
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..3d08d075
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_no_pluginpath
|
||||
@@ -0,0 +1,6 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
new file mode 100644
|
||||
index 00000000..09a81e64
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/files/dnf_config_with_pluginpath
|
||||
@@ -0,0 +1,7 @@
|
||||
+[main]
|
||||
+gpgcheck=1
|
||||
+installonly_limit=3
|
||||
+clean_requirements_on_remove=True
|
||||
+best=True
|
||||
+skip_if_unavailable=False
|
||||
+pluginpath=/usr/lib/python3.6/site-packages/dnf-plugins
|
||||
diff --git a/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
new file mode 100644
|
||||
index 00000000..fefb9d3f
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scandnfpluginpath/tests/test_scandnfpluginpath.py
|
||||
@@ -0,0 +1,53 @@
|
||||
+import os
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import scandnfpluginpath
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DnfPluginPathDetected
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('is_detected', [False, True])
|
||||
+def test_scan_detects_pluginpath(monkeypatch, is_detected):
|
||||
+ mocked_producer = produce_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(api, 'produce', mocked_producer)
|
||||
+
|
||||
+ monkeypatch.setattr(scandnfpluginpath, '_is_pluginpath_set',
|
||||
+ lambda path: is_detected)
|
||||
+
|
||||
+ scandnfpluginpath.scan_dnf_pluginpath()
|
||||
+
|
||||
+ assert mocked_producer.called == 1
|
||||
+ assert mocked_producer.model_instances[0].is_pluginpath_detected is is_detected
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(('config_file', 'result'), [
|
||||
+ ('files/dnf_config_no_pluginpath', False),
|
||||
+ ('files/dnf_config_with_pluginpath', True),
|
||||
+ ('files/dnf_config_incorrect_pluginpath', False),
|
||||
+ ('files/not_existing_file.conf', False)
|
||||
+])
|
||||
+def test_is_pluginpath_set(config_file, result):
|
||||
+ CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
+
|
||||
+ assert scandnfpluginpath._is_pluginpath_set(os.path.join(CUR_DIR, config_file)) == result
|
||||
+
|
||||
+
|
||||
+def test_scan_no_config_file(monkeypatch):
|
||||
+ mocked_producer = produce_mocked()
|
||||
+ logger = logger_mocked()
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
+ monkeypatch.setattr(api, 'produce', mocked_producer)
|
||||
+ monkeypatch.setattr(api, 'current_logger', lambda: logger)
|
||||
+
|
||||
+ filename = 'files/not_existing_file.conf'
|
||||
+ monkeypatch.setattr(scandnfpluginpath, 'DNF_CONFIG_PATH', filename)
|
||||
+ scandnfpluginpath.scan_dnf_pluginpath()
|
||||
+
|
||||
+ assert mocked_producer.called == 1
|
||||
+ assert mocked_producer.model_instances[0].is_pluginpath_detected is False
|
||||
+
|
||||
+ assert 'The %s file is missing.' in logger.warnmsg
|
||||
+ assert filename in logger.warnmsg
|
||||
diff --git a/repos/system_upgrade/common/models/dnfpluginpathdetected.py b/repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
new file mode 100644
|
||||
index 00000000..c5474857
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/models/dnfpluginpathdetected.py
|
||||
@@ -0,0 +1,14 @@
|
||||
+from leapp.models import fields, Model
|
||||
+from leapp.topics import SystemInfoTopic
|
||||
+
|
||||
+
|
||||
+class DnfPluginPathDetected(Model):
|
||||
+ """
|
||||
+ This model contains information about whether DNF pluginpath option is configured in /etc/dnf/dnf.conf.
|
||||
+ """
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ is_pluginpath_detected = fields.Boolean()
|
||||
+ """
|
||||
+ True if pluginpath option is found in /etc/dnf/dnf.conf, False otherwise.
|
||||
+ """
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,245 @@
|
||||
From 004cec5bd33025412df84f07590b6c5452d70ab6 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Wed, 17 Apr 2024 09:58:00 +0200
|
||||
Subject: [PATCH 02/55] Upgrade dracut module: Update /usr mounting solution
|
||||
|
||||
Originally we had implemented our own mount_usr.sh script, which
|
||||
took care about mounting the /usr when it is present on separate
|
||||
partition / mountpoint. It took care also about LVM activation.
|
||||
|
||||
However, it has been problematic in various cases (e.g. when device
|
||||
needed more time for initialisation - e.g. when connected using FC).
|
||||
Let's use instead existing system solutions, starting
|
||||
the upgrade.target after initrd-fs.target (instead of just
|
||||
basic.target). IOW, let's get as close to the standard booting
|
||||
procedure when speaking about the storage, as possible.
|
||||
|
||||
Note that the booting is still broken in this commit and needs
|
||||
additional changes made in followup commits. But due to complexity
|
||||
of the solution, keeping this separated.
|
||||
|
||||
jira: RHEL-3344, RHEL-35446
|
||||
---
|
||||
.../85sys-upgrade-redhat/module-setup.sh | 1 -
|
||||
.../dracut/85sys-upgrade-redhat/mount_usr.sh | 148 ------------------
|
||||
.../initrd-cleanup-override.conf | 3 +
|
||||
.../dracut/90sys-upgrade/module-setup.sh | 11 ++
|
||||
.../files/dracut/90sys-upgrade/upgrade.target | 4 +-
|
||||
5 files changed, 16 insertions(+), 151 deletions(-)
|
||||
delete mode 100755 repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
create mode 100644 repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
index d73060cb..45f98148 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/module-setup.sh
|
||||
@@ -102,7 +102,6 @@ install() {
|
||||
inst_binary grep
|
||||
|
||||
# script to actually run the upgrader binary
|
||||
- inst_hook upgrade 49 "$_moddir/mount_usr.sh"
|
||||
inst_hook upgrade 50 "$_moddir/do-upgrade.sh"
|
||||
|
||||
#NOTE: some clean up?.. ideally, everything should be inside the leapp*
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
deleted file mode 100755
|
||||
index 9366ac13..00000000
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/85sys-upgrade-redhat/mount_usr.sh
|
||||
+++ /dev/null
|
||||
@@ -1,148 +0,0 @@
|
||||
-#!/bin/sh
|
||||
-# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
-# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
-
|
||||
-type info >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
-
|
||||
-export NEWROOT=${NEWROOT:-"/sysroot"}
|
||||
-
|
||||
-filtersubvol() {
|
||||
- _oldifs="$IFS"
|
||||
- IFS=","
|
||||
- set "$@"
|
||||
- IFS="$_oldifs"
|
||||
- while [ $# -gt 0 ]; do
|
||||
- case $1 in
|
||||
- subvol=*) :;;
|
||||
- *) printf '%s' "${1}," ;;
|
||||
- esac
|
||||
- shift
|
||||
- done
|
||||
-}
|
||||
-
|
||||
-mount_usr()
|
||||
-{
|
||||
- #
|
||||
- # mount_usr [true | false]
|
||||
- # Expected a "true" value for the last attempt to mount /usr. On the last
|
||||
- # attempt, in case of failure drop to shell.
|
||||
- #
|
||||
- # Return 0 when everything is all right
|
||||
- # In case of failure and /usr has been detected:
|
||||
- # return 2 when $1 is "true" (drop to shell invoked)
|
||||
- # (note: possibly it's nonsense, but to be sure..)
|
||||
- # return 1 otherwise
|
||||
- #
|
||||
- _last_attempt="$1"
|
||||
- # check, if we have to mount the /usr filesystem
|
||||
- while read -r _dev _mp _fs _opts _freq _passno; do
|
||||
- [ "${_dev%%#*}" != "$_dev" ] && continue
|
||||
- if [ "$_mp" = "/usr" ]; then
|
||||
- case "$_dev" in
|
||||
- LABEL=*)
|
||||
- _dev="$(echo "$_dev" | sed 's,/,\\x2f,g')"
|
||||
- _dev="/dev/disk/by-label/${_dev#LABEL=}"
|
||||
- ;;
|
||||
- UUID=*)
|
||||
- _dev="${_dev#block:}"
|
||||
- _dev="/dev/disk/by-uuid/${_dev#UUID=}"
|
||||
- ;;
|
||||
- esac
|
||||
-
|
||||
- # shellcheck disable=SC2154 # Variable root is assigned by dracut
|
||||
- _root_dev=${root#block:}
|
||||
-
|
||||
- if strstr "$_opts" "subvol=" && \
|
||||
- [ "$(stat -c '%D:%i' "$_root_dev")" = "$(stat -c '%D:%i' "$_dev")" ] && \
|
||||
- [ -n "$rflags" ]; then
|
||||
- # for btrfs subvolumes we have to mount /usr with the same rflags
|
||||
- rflags=$(filtersubvol "$rflags")
|
||||
- rflags=${rflags%%,}
|
||||
- _opts="${_opts:+${_opts},}${rflags}"
|
||||
- elif getargbool 0 ro; then
|
||||
- # if "ro" is specified, we want /usr to be mounted read-only
|
||||
- _opts="${_opts:+${_opts},}ro"
|
||||
- elif getargbool 0 rw; then
|
||||
- # if "rw" is specified, we want /usr to be mounted read-write
|
||||
- _opts="${_opts:+${_opts},}rw"
|
||||
- fi
|
||||
- echo "$_dev ${NEWROOT}${_mp} $_fs ${_opts} $_freq $_passno"
|
||||
- _usr_found="1"
|
||||
- break
|
||||
- fi
|
||||
- done < "${NEWROOT}/etc/fstab" >> /etc/fstab
|
||||
-
|
||||
- if [ "$_usr_found" = "" ]; then
|
||||
- # nothing to do
|
||||
- return 0
|
||||
- fi
|
||||
-
|
||||
- info "Mounting /usr with -o $_opts"
|
||||
- mount "${NEWROOT}/usr" 2>&1 | vinfo
|
||||
- mount -o remount,rw "${NEWROOT}/usr"
|
||||
-
|
||||
- if ismounted "${NEWROOT}/usr"; then
|
||||
- # success!!
|
||||
- return 0
|
||||
- fi
|
||||
-
|
||||
- if [ "$_last_attempt" = "true" ]; then
|
||||
- warn "Mounting /usr to ${NEWROOT}/usr failed"
|
||||
- warn "*** Dropping you to a shell; the system will continue"
|
||||
- warn "*** when you leave the shell."
|
||||
- action_on_fail
|
||||
- return 2
|
||||
- fi
|
||||
-
|
||||
- return 1
|
||||
-}
|
||||
-
|
||||
-
|
||||
-try_to_mount_usr() {
|
||||
- _last_attempt="$1"
|
||||
- if [ ! -f "${NEWROOT}/etc/fstab" ]; then
|
||||
- warn "File ${NEWROOT}/etc/fstab doesn't exist."
|
||||
- return 1
|
||||
- fi
|
||||
-
|
||||
- # In case we have the LVM command available try make it activate all partitions
|
||||
- if command -v lvm 2>/dev/null 1>/dev/null; then
|
||||
- lvm vgchange --sysinit -a y || {
|
||||
- warn "Detected problem when tried to activate LVM VG."
|
||||
- if [ "$_last_attempt" != "true" ]; then
|
||||
- # this is not last execution, retry
|
||||
- return 1
|
||||
- fi
|
||||
- # NOTE(pstodulk):
|
||||
- # last execution, so call mount_usr anyway
|
||||
- # I am not 100% about lvm vgchange exit codes and I am aware of
|
||||
- # possible warnings, in this last run, let's keep it on mount_usr
|
||||
- # anyway..
|
||||
- }
|
||||
- fi
|
||||
-
|
||||
- mount_usr "$1"
|
||||
-}
|
||||
-
|
||||
-_sleep_timeout=15
|
||||
-_last_attempt="false"
|
||||
-for i in 0 1 2 3 4 5 6 7 8 9 10 11; do
|
||||
- info "Storage initialisation: Attempt $i of 11. Wait $_sleep_timeout seconds."
|
||||
- sleep $_sleep_timeout
|
||||
- if [ $i -eq 11 ]; then
|
||||
- _last_attempt="true"
|
||||
- fi
|
||||
- try_to_mount_usr "$_last_attempt" && break
|
||||
-
|
||||
- # something is wrong. In some cases, storage needs more time for the
|
||||
- # initialisation - especially in case of SAN.
|
||||
-
|
||||
- if [ "$_last_attempt" = "true" ]; then
|
||||
- warn "The last attempt to initialize storage has not been successful."
|
||||
- warn "Unknown state of the storage. It is possible that upgrade will be stopped."
|
||||
- break
|
||||
- fi
|
||||
-
|
||||
- warn "Failed attempt to initialize the storage. Retry..."
|
||||
-done
|
||||
-
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
new file mode 100644
|
||||
index 00000000..d24e0ef0
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/initrd-cleanup-override.conf
|
||||
@@ -0,0 +1,3 @@
|
||||
+[Service]
|
||||
+ExecStart=
|
||||
+ExecStart=-/usr/bin/true
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
index 06479fb5..30ae57b3 100755
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/module-setup.sh
|
||||
@@ -54,6 +54,17 @@ install() {
|
||||
ln -sf "../${s}.service" "$upgrade_wantsdir"
|
||||
done
|
||||
|
||||
+ # Setup modified initrd-cleanup.service in the upgrade initramfs to enable
|
||||
+ # storage initialisation using systemd-fstab-generator. We want to run the
|
||||
+ # initrd-parse-etc.service but this one triggers also the initrd-cleanup.service
|
||||
+ # which triggers the switch-root and isolated actions that basically kills
|
||||
+ # the original upgrade service when used.
|
||||
+ # The initrd-parse-etc.service has different content across RHEL systems,
|
||||
+ # so we override rather initrd-cleanup.service instead as we do not need
|
||||
+ # that one for the upgrade process.
|
||||
+ mkdir -p "${unitdir}/initrd-cleanup.service.d"
|
||||
+ inst_simple "${_moddir}/initrd-cleanup-override.conf" "${unitdir}/initrd-cleanup.service.d/initrd-cleanup-override.conf"
|
||||
+
|
||||
# just try : set another services into the wantsdir
|
||||
# sysroot.mount \
|
||||
# dracut-mount \
|
||||
diff --git a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
index 366b5cab..d2bf7313 100644
|
||||
--- a/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
+++ b/repos/system_upgrade/common/actors/commonleappdracutmodules/files/dracut/90sys-upgrade/upgrade.target
|
||||
@@ -2,7 +2,7 @@
|
||||
Description=System Upgrade
|
||||
Documentation=man:upgrade.target(7)
|
||||
# ##sysinit.target sockets.target initrd-root-fs.target initrd-root-device.target initrd-fs.target
|
||||
-Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target
|
||||
+Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target initrd-parse-etc.service
|
||||
Requires=basic.target sysroot.mount
|
||||
-After=basic.target sysroot.mount
|
||||
+After=basic.target sysroot.mount initrd-fs.target
|
||||
AllowIsolate=yes
|
||||
--
|
||||
2.51.1
|
||||
|
||||
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
|
||||
|
||||
@ -0,0 +1,132 @@
|
||||
From 04a2ec2574da233a41d32f70eab780b6c305ff31 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Thu, 19 Dec 2024 10:33:24 +0100
|
||||
Subject: [PATCH 03/55] feat(lvm_autoactivation): add lvm autoactivation
|
||||
|
||||
Add LVM autoactivation mechanism to the upgrade initramfs. The core
|
||||
of the mechanism is based on a special udev rule that is triggered
|
||||
when a new device is detected. The rule then calls two lvm binaries
|
||||
(which are also included into the upgrade initrams) to activate
|
||||
the volume groups and logical volumes.
|
||||
---
|
||||
.../enable_lvm_autoactivation/actor.py | 21 ++++++++
|
||||
.../libraries/enable_lvm_autoactivation.py | 21 ++++++++
|
||||
.../test_lvm_autoactivation_enablement.py | 50 +++++++++++++++++++
|
||||
3 files changed, 92 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..aba60645
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/actor.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import enable_lvm_autoactivation as enable_lvm_autoactivation_lib
|
||||
+from leapp.models import DistributionSignedRPM, UpgradeInitramfsTasks
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class EnableLVMAutoactivation(Actor):
|
||||
+ """
|
||||
+ Enable LVM autoactivation in upgrade initramfs.
|
||||
+
|
||||
+ Produce instructions for upgrade initramfs generation that will result in LVM
|
||||
+ autoactivation in the initramfs.
|
||||
+ """
|
||||
+
|
||||
+ name = 'enable_lvm_autoactivation'
|
||||
+ consumes = (DistributionSignedRPM,)
|
||||
+ produces = (UpgradeInitramfsTasks, )
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ enable_lvm_autoactivation_lib.emit_lvm_autoactivation_instructions()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
new file mode 100644
|
||||
index 00000000..e312277b
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/libraries/enable_lvm_autoactivation.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def emit_lvm_autoactivation_instructions():
|
||||
+ if not has_package(DistributionSignedRPM, 'lvm2'):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Upgrade initramfs will not autoenable LVM devices - `lvm2` RPM is not installed.'
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ # the 69-dm-lvm.rules trigger pvscan and vgchange when LVM device is detected
|
||||
+ files_to_include = [
|
||||
+ '/usr/sbin/pvscan',
|
||||
+ '/usr/sbin/vgchange',
|
||||
+ '/usr/lib/udev/rules.d/69-dm-lvm.rules'
|
||||
+ ]
|
||||
+ lvm_autoactivation_instructions = UpgradeInitramfsTasks(include_files=files_to_include)
|
||||
+
|
||||
+ api.produce(lvm_autoactivation_instructions)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
new file mode 100644
|
||||
index 00000000..c5150aea
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/enable_lvm_autoactivation/tests/test_lvm_autoactivation_enablement.py
|
||||
@@ -0,0 +1,50 @@
|
||||
+from leapp.libraries.actor import enable_lvm_autoactivation
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, produce_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM, RPM, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def test_emit_lvm_autoactivation_instructions_produces_correct_message(monkeypatch):
|
||||
+ """Test that emit_lvm_autoactivation_instructions produces UpgradeInitramfsTasks with correct files."""
|
||||
+ lvm_package = RPM(
|
||||
+ name='lvm2',
|
||||
+ version='2',
|
||||
+ release='1',
|
||||
+ epoch='1',
|
||||
+ packager='',
|
||||
+ arch='x86_64',
|
||||
+ pgpsig='RSA/SHA256, Mon 01 Jan 1970 00:00:00 AM -03, Key ID 199e2f91fd431d51'
|
||||
+ )
|
||||
+
|
||||
+ msgs = [
|
||||
+ DistributionSignedRPM(items=[lvm_package])
|
||||
+ ]
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ enable_lvm_autoactivation.emit_lvm_autoactivation_instructions()
|
||||
+
|
||||
+ assert api.produce.called == 1
|
||||
+
|
||||
+ produced_msg = api.produce.model_instances[0]
|
||||
+
|
||||
+ assert isinstance(produced_msg, UpgradeInitramfsTasks)
|
||||
+
|
||||
+ expected_files = [
|
||||
+ '/usr/sbin/pvscan',
|
||||
+ '/usr/sbin/vgchange',
|
||||
+ '/usr/lib/udev/rules.d/69-dm-lvm.rules'
|
||||
+ ]
|
||||
+ assert produced_msg.include_files == expected_files
|
||||
+
|
||||
+
|
||||
+def test_no_action_if_lvm_rpm_missing(monkeypatch):
|
||||
+ msgs = [
|
||||
+ DistributionSignedRPM(items=[])
|
||||
+ ]
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
+
|
||||
+ enable_lvm_autoactivation.emit_lvm_autoactivation_instructions()
|
||||
+
|
||||
+ assert api.produce.called == 0
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,658 @@
|
||||
From 47fce173e75408d9a7a26225d389161caf72e244 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Sun, 31 Aug 2025 23:49:57 +0200
|
||||
Subject: [PATCH 04/55] feat(mount_unit_gen): generate mount units for the
|
||||
upgrade initramfs
|
||||
|
||||
Run systemd-fstab-generator to produce mount units that correspond to
|
||||
the content of source system's fstab. The generated mount units are then
|
||||
modified to mount /target into /sysroot/target, to reflect that the root
|
||||
of the source system is mounted as /sysroot. These mount units are made
|
||||
dependencies of local-fs.target, and, therefore, will be triggered by
|
||||
systemd before the upgrade.
|
||||
|
||||
Assisted-by: Cursor (Claude Sonnet 4)
|
||||
Jira-ref: RHEL-35446
|
||||
|
||||
@pstodulk:
|
||||
Updated the code to cover also other systemd targets that can be
|
||||
covered by systemd-fstab-generator. Also cover the situation when
|
||||
a directory with systemd target (requires, wants) already exists.
|
||||
Tests have been updated.
|
||||
|
||||
Note that there are still possible issues hidden in the generate
|
||||
mount unit files as we update at this moment just the `Where` clause
|
||||
however we are not touching anything else. (Before, After,
|
||||
RequiresMountsFor, ...). But keeping that for future development and
|
||||
testing. The call for `mount -a` is still present, we expect followup
|
||||
PRs at this point.
|
||||
|
||||
Co-authored-by: Petr Stodulka <pstodulk@redhat.com>
|
||||
---
|
||||
.../initramfs/mount_units_generator/actor.py | 22 ++
|
||||
.../libraries/mount_unit_generator.py | 307 ++++++++++++++++++
|
||||
.../tests/test_mount_unit_generation.py | 269 +++++++++++++++
|
||||
3 files changed, 598 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..5fe25515
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -0,0 +1,22 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class MountUnitGenerator(Actor):
|
||||
+ """
|
||||
+ Sets up storage initialization using systemd's mount units in the upgrade container.
|
||||
+ """
|
||||
+
|
||||
+ name = 'mount_unit_generator'
|
||||
+ consumes = (
|
||||
+ TargetUserSpaceInfo,
|
||||
+ )
|
||||
+ produces = (
|
||||
+ UpgradeInitramfsTasks,
|
||||
+ )
|
||||
+ tags = (IPUWorkflowTag, InterimPreparationPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ mount_unit_generator_lib.setup_storage_initialization()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
new file mode 100644
|
||||
index 00000000..e1060559
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -0,0 +1,307 @@
|
||||
+import os
|
||||
+import shutil
|
||||
+import tempfile
|
||||
+
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.common import mounting
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def run_systemd_fstab_generator(output_directory):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Generating mount units for the source system into {}'.format(output_directory)
|
||||
+ )
|
||||
+
|
||||
+ try:
|
||||
+ generator_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_directory,
|
||||
+ output_directory,
|
||||
+ output_directory
|
||||
+ ]
|
||||
+ run(generator_cmd)
|
||||
+ except CalledProcessError as error:
|
||||
+ api.current_logger().error(
|
||||
+ 'Failed to generate mount units using systemd-fstab-generator. Error: {}'.format(error)
|
||||
+ )
|
||||
+ details = {'details': str(error)}
|
||||
+ raise StopActorExecutionError(
|
||||
+ 'Failed to generate mount units using systemd-fstab-generator',
|
||||
+ details
|
||||
+ )
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Mount units successfully generated into {}'.format(output_directory)
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def _read_unit_file_lines(unit_file_path): # Encapsulate IO for tests
|
||||
+ with open(unit_file_path) as unit_file:
|
||||
+ return unit_file.readlines()
|
||||
+
|
||||
+
|
||||
+def _write_unit_file_lines(unit_file_path, lines): # Encapsulate IO for tests
|
||||
+ with open(unit_file_path, 'w') as unit_file:
|
||||
+ unit_file.write('\n'.join(lines) + '\n')
|
||||
+
|
||||
+
|
||||
+def _delete_file(file_path):
|
||||
+ os.unlink(file_path)
|
||||
+
|
||||
+
|
||||
+def _prefix_mount_unit_with_sysroot(mount_unit_path, new_unit_destination):
|
||||
+ """
|
||||
+ Prefix the mount target with /sysroot as expected in the upgrade initramfs.
|
||||
+
|
||||
+ A new mount unit file is written to new_unit_destination.
|
||||
+ """
|
||||
+ # NOTE(pstodulk): Note that right now we update just the 'Where' key, however
|
||||
+ # what about RequiresMountsFor, .. there could be some hidden dragons.
|
||||
+ # In case of issues, investigate these values in generated unit files.
|
||||
+ api.current_logger().debug(
|
||||
+ 'Prefixing {}\'s mount target with /sysroot. Output will be written to {}'.format(
|
||||
+ mount_unit_path,
|
||||
+ new_unit_destination
|
||||
+ )
|
||||
+ )
|
||||
+ unit_lines = _read_unit_file_lines(mount_unit_path)
|
||||
+
|
||||
+ output_lines = []
|
||||
+ for line in unit_lines:
|
||||
+ line = line.strip()
|
||||
+ if not line.startswith('Where='):
|
||||
+ output_lines.append(line)
|
||||
+ continue
|
||||
+
|
||||
+ _, destination = line.split('=', 1)
|
||||
+ new_destination = os.path.join('/sysroot', destination.lstrip('/'))
|
||||
+
|
||||
+ output_lines.append('Where={}'.format(new_destination))
|
||||
+
|
||||
+ _write_unit_file_lines(new_unit_destination, output_lines)
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Done. Modified mount unit successfully written to {}'.format(new_unit_destination)
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def prefix_all_mount_units_with_sysroot(dir_containing_units):
|
||||
+ for unit_file_path in os.listdir(dir_containing_units):
|
||||
+ # systemd requires mount path to be in the unit name
|
||||
+ modified_unit_destination = 'sysroot-{}'.format(unit_file_path)
|
||||
+ modified_unit_destination = os.path.join(dir_containing_units, modified_unit_destination)
|
||||
+
|
||||
+ unit_file_path = os.path.join(dir_containing_units, unit_file_path)
|
||||
+
|
||||
+ if not unit_file_path.endswith('.mount'):
|
||||
+ api.current_logger().debug(
|
||||
+ 'Skipping {} when prefixing mount units with /sysroot - not a mount unit.'.format(
|
||||
+ unit_file_path
|
||||
+ )
|
||||
+ )
|
||||
+ continue
|
||||
+
|
||||
+ _prefix_mount_unit_with_sysroot(unit_file_path, modified_unit_destination)
|
||||
+
|
||||
+ _delete_file(unit_file_path)
|
||||
+ api.current_logger().debug('Original mount unit {} removed.'.format(unit_file_path))
|
||||
+
|
||||
+
|
||||
+def _fix_symlinks_in_dir(dir_containing_mount_units, target_dir):
|
||||
+ """
|
||||
+ Fix broken symlinks in given target_dir due to us modifying (renaming) the mount units.
|
||||
+
|
||||
+ The target_dir contains symlinks to the (mount) units that are required
|
||||
+ in order for the local-fs.target to be reached. However, we renamed these units to reflect
|
||||
+ that we have changed their mount destinations by prefixing the mount destination with /sysroot.
|
||||
+ Hence, we regenerate the symlinks.
|
||||
+ """
|
||||
+
|
||||
+ target_dir_path = os.path.join(dir_containing_mount_units, target_dir)
|
||||
+ if not os.path.exists(target_dir_path):
|
||||
+ api.current_logger().debug(
|
||||
+ 'The {} directory does not exist. Skipping'
|
||||
+ .format(target_dir)
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Removing the old {} directory from {}.'
|
||||
+ .format(target_dir, dir_containing_mount_units)
|
||||
+ )
|
||||
+
|
||||
+ shutil.rmtree(target_dir_path)
|
||||
+ os.mkdir(target_dir_path)
|
||||
+
|
||||
+ api.current_logger().debug('Populating {} with new symlinks.'.format(target_dir))
|
||||
+
|
||||
+ for unit_file in os.listdir(dir_containing_mount_units):
|
||||
+ if not unit_file.endswith('.mount'):
|
||||
+ continue
|
||||
+
|
||||
+ place_fastlink_at = os.path.join(target_dir_path, unit_file)
|
||||
+ fastlink_points_to = os.path.join('../', unit_file)
|
||||
+ try:
|
||||
+ run(['ln', '-s', fastlink_points_to, place_fastlink_at])
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Dependency on {} created.'.format(unit_file)
|
||||
+ )
|
||||
+ except CalledProcessError as err:
|
||||
+ err_descr = (
|
||||
+ 'Failed to create required unit dependencies under {} for the upgrade initramfs.'
|
||||
+ .format(target_dir)
|
||||
+ )
|
||||
+ details = {'details': str(err)}
|
||||
+ raise StopActorExecutionError(err_descr, details=details)
|
||||
+
|
||||
+
|
||||
+def fix_symlinks_in_targets(dir_containing_mount_units):
|
||||
+ """
|
||||
+ Fix broken symlinks in *.target.* directories caused by earlier modified mount units.
|
||||
+
|
||||
+ Generated mount unit files are part of one of systemd targets (list below),
|
||||
+ which means that a symlink from a systemd target to exists for each of
|
||||
+ them. Based on this, systemd knows when (local or remote file systems?)
|
||||
+ they must (".requires" suffix") or could (".wants" suffix) be mounted.
|
||||
+ See the man 5 systemd.mount for more details how mount units are split into
|
||||
+ these targets.
|
||||
+
|
||||
+ The list of possible target directories where these mount units could end:
|
||||
+ * local-fs.target.requires
|
||||
+ * local-fs.target.wants
|
||||
+ * local-fs-pre.target.requires
|
||||
+ * local-fs-pre.target.wants
|
||||
+ * remote-fs.target.requires
|
||||
+ * remote-fs.target.wants
|
||||
+ * remote-fs-pre.target.requires
|
||||
+ * remote-fs-pre.target.wants
|
||||
+ Most likely, unit files are not generated for "*pre*" targets, but to be
|
||||
+ sure really. Longer list does not cause any issues in this code.
|
||||
+
|
||||
+ In most cases, "local-fs.target.requires" is the only important directory
|
||||
+ for us during the upgrade. But in some (sometimes common) cases we will
|
||||
+ need some of the others as well.
|
||||
+
|
||||
+ These directories do not have to necessarily exists if there are no mount
|
||||
+ unit files that could be put there. But most likely "local-fs.target.requires"
|
||||
+ will always exists.
|
||||
+ """
|
||||
+ dir_list = [
|
||||
+ 'local-fs.target.requires',
|
||||
+ 'local-fs.target.wants',
|
||||
+ 'local-fs-pre.target.requires',
|
||||
+ 'local-fs-pre.target.wants',
|
||||
+ 'remote-fs.target.requires',
|
||||
+ 'remote-fs.target.wants',
|
||||
+ 'remote-fs-pre.target.requires',
|
||||
+ 'remote-fs-pre.target.wants',
|
||||
+ ]
|
||||
+ for tdir in dir_list:
|
||||
+ _fix_symlinks_in_dir(dir_containing_mount_units, tdir)
|
||||
+
|
||||
+
|
||||
+def copy_units_into_system_location(upgrade_container_ctx, dir_with_our_mount_units):
|
||||
+ """
|
||||
+ Copy units and their .wants/.requires directories into the target userspace container.
|
||||
+
|
||||
+ :return: A list of files in the target userspace that were created by copying.
|
||||
+ :rtype: list[str]
|
||||
+ """
|
||||
+ dest_inside_container = '/usr/lib/systemd/system'
|
||||
+
|
||||
+ api.current_logger().debug(
|
||||
+ 'Copying generated mount units for upgrade from {} to {}'.format(
|
||||
+ dir_with_our_mount_units,
|
||||
+ upgrade_container_ctx.full_path(dest_inside_container)
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ copied_files = []
|
||||
+ prefix_len_to_drop = len(upgrade_container_ctx.base_dir)
|
||||
+
|
||||
+ # We cannot rely on mounting library when copying into container
|
||||
+ # as we want to control what happens to symlinks and
|
||||
+ # shutil.copytree in Python3.6 fails if dst directory exists already
|
||||
+ # - which happens in some cases when copying these files.
|
||||
+ for root, dummy_dirs, files in os.walk(dir_with_our_mount_units):
|
||||
+ rel_path = os.path.relpath(root, dir_with_our_mount_units)
|
||||
+ if rel_path == '.':
|
||||
+ rel_path = ''
|
||||
+ dst_dir = os.path.join(upgrade_container_ctx.full_path(dest_inside_container), rel_path)
|
||||
+ os.makedirs(dst_dir, mode=0o755, exist_ok=True)
|
||||
+
|
||||
+ for file in files:
|
||||
+ src_file = os.path.join(root, file)
|
||||
+ dst_file = os.path.join(dst_dir, file)
|
||||
+ api.current_logger().debug(
|
||||
+ 'Copying mount unit file {} to {}'.format(src_file, dst_file)
|
||||
+ )
|
||||
+ if os.path.islink(dst_file):
|
||||
+ # If the target file already exists and it is a symlink, it will
|
||||
+ # fail and we want to overwrite this.
|
||||
+ # NOTE(pstodulk): You could think that it cannot happen, but
|
||||
+ # in future possibly it could happen, so let's rather be careful
|
||||
+ # and handle it. If the dst file exists, we want to overwrite it
|
||||
+ # for sure
|
||||
+ _delete_file(dst_file)
|
||||
+ shutil.copy2(src_file, dst_file, follow_symlinks=False)
|
||||
+ copied_files.append(dst_file[prefix_len_to_drop:])
|
||||
+
|
||||
+ return copied_files
|
||||
+
|
||||
+
|
||||
+def remove_units_for_targets_that_are_already_mounted_by_dracut(dir_with_our_mount_units):
|
||||
+ """
|
||||
+ Remove mount units for mount targets that are already mounted by dracut.
|
||||
+
|
||||
+ Namely, remove mount units:
|
||||
+ '-.mount' (mounts /)
|
||||
+ 'usr.mount' (mounts /usr)
|
||||
+ """
|
||||
+
|
||||
+ # NOTE: remount-fs.service creates dependency cycles that are nondeterministically broken
|
||||
+ # by systemd, causing unpredictable failures. The service is supposed to remount root
|
||||
+ # and /usr, reapplying mount options from /etc/fstab. However, the fstab file present in
|
||||
+ # the initramfs is not the fstab from the source system, and, therefore, it is pointless
|
||||
+ # to require the service. It would make sense after we switched root during normal boot
|
||||
+ # process.
|
||||
+ already_mounted_units = [
|
||||
+ '-.mount',
|
||||
+ 'usr.mount',
|
||||
+ 'local-fs.target.wants/systemd-remount-fs.service'
|
||||
+ ]
|
||||
+
|
||||
+ for unit in already_mounted_units:
|
||||
+ unit_location = os.path.join(dir_with_our_mount_units, unit)
|
||||
+
|
||||
+ if not os.path.exists(unit_location):
|
||||
+ api.current_logger().debug('The {} unit does not exists, no need to remove it.'.format(unit))
|
||||
+ continue
|
||||
+
|
||||
+ _delete_file(unit_location)
|
||||
+
|
||||
+
|
||||
+def request_units_inclusion_in_initramfs(files_to_include):
|
||||
+ api.current_logger().debug('Including the following files into initramfs: {}'.format(files_to_include))
|
||||
+
|
||||
+ additional_files = [
|
||||
+ '/usr/sbin/swapon' # If the system has swap, we have also generated a swap unit to activate it
|
||||
+ ]
|
||||
+
|
||||
+ tasks = UpgradeInitramfsTasks(include_files=files_to_include + additional_files)
|
||||
+ api.produce(tasks)
|
||||
+
|
||||
+
|
||||
+def setup_storage_initialization():
|
||||
+ userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
+
|
||||
+ with mounting.NspawnActions(base_dir=userspace_info.path) as upgrade_container_ctx:
|
||||
+ with tempfile.TemporaryDirectory(dir='/var/lib/leapp/', prefix='tmp_systemd_fstab_') as workspace_path:
|
||||
+ run_systemd_fstab_generator(workspace_path)
|
||||
+ remove_units_for_targets_that_are_already_mounted_by_dracut(workspace_path)
|
||||
+ prefix_all_mount_units_with_sysroot(workspace_path)
|
||||
+ fix_symlinks_in_targets(workspace_path)
|
||||
+ mount_unit_files = copy_units_into_system_location(upgrade_container_ctx, workspace_path)
|
||||
+ request_units_inclusion_in_initramfs(mount_unit_files)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
new file mode 100644
|
||||
index 00000000..b814f6ce
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -0,0 +1,269 @@
|
||||
+import os
|
||||
+import shutil
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.actor import mount_unit_generator
|
||||
+from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+
|
||||
+def test_run_systemd_fstab_generator_successful_generation(monkeypatch):
|
||||
+ """Test successful mount unit generation."""
|
||||
+
|
||||
+ output_dir = '/tmp/test_output'
|
||||
+ expected_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_dir,
|
||||
+ output_dir,
|
||||
+ output_dir
|
||||
+ ]
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ assert command == expected_cmd
|
||||
+
|
||||
+ return {
|
||||
+ "stdout": "",
|
||||
+ "stderr": "",
|
||||
+ "exit_code": 0,
|
||||
+ }
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+ mount_unit_generator.run_systemd_fstab_generator(output_dir)
|
||||
+
|
||||
+
|
||||
+def test_run_systemd_fstab_generator_failure(monkeypatch):
|
||||
+ """Test handling of systemd-fstab-generator failure."""
|
||||
+ output_dir = '/tmp/test_output'
|
||||
+ expected_cmd = [
|
||||
+ '/usr/lib/systemd/system-generators/systemd-fstab-generator',
|
||||
+ output_dir,
|
||||
+ output_dir,
|
||||
+ output_dir
|
||||
+ ]
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ assert command == expected_cmd
|
||||
+ raise CalledProcessError(message='Generator failed', command=['test'], result={'exit_code': 1})
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError):
|
||||
+ mount_unit_generator.run_systemd_fstab_generator(output_dir)
|
||||
+
|
||||
+
|
||||
+def test_prefix_mount_unit_with_sysroot(monkeypatch):
|
||||
+ """Test prefixing a single mount unit with /sysroot."""
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+
|
||||
+ input_content = [
|
||||
+ "[Unit]\n",
|
||||
+ "Description=Test Mount\n",
|
||||
+ "[Mount]\n",
|
||||
+ "Where=/home\n",
|
||||
+ "What=/dev/sda1\n"
|
||||
+ ]
|
||||
+
|
||||
+ expected_output_lines = [
|
||||
+ "[Unit]",
|
||||
+ "Description=Test Mount",
|
||||
+ "[Mount]",
|
||||
+ "Where=/sysroot/home",
|
||||
+ "What=/dev/sda1"
|
||||
+ ]
|
||||
+
|
||||
+ def mock_read_unit_file_lines(unit_file_path):
|
||||
+ return input_content
|
||||
+
|
||||
+ def mock_write_unit_file_lines(unit_file_path, lines):
|
||||
+ assert unit_file_path == '/test/output.mount'
|
||||
+ assert lines == expected_output_lines
|
||||
+
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_read_unit_file_lines', mock_read_unit_file_lines)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_write_unit_file_lines', mock_write_unit_file_lines)
|
||||
+
|
||||
+ mount_unit_generator._prefix_mount_unit_with_sysroot(
|
||||
+ '/test/input.mount',
|
||||
+ '/test/output.mount'
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def test_prefix_all_mount_units_with_sysroot(monkeypatch):
|
||||
+ """Test prefixing all mount units in a directory."""
|
||||
+
|
||||
+ expected_changes = {
|
||||
+ '/test/dir/home.mount': {
|
||||
+ 'new_unit_destination': '/test/dir/sysroot-home.mount',
|
||||
+ 'should_be_deleted': True,
|
||||
+ 'deleted': False,
|
||||
+ },
|
||||
+ '/test/dir/var.mount': {
|
||||
+ 'new_unit_destination': '/test/dir/sysroot-var.mount',
|
||||
+ 'should_be_deleted': True,
|
||||
+ 'deleted': False,
|
||||
+ },
|
||||
+ '/test/dir/not-a-mount.service': {
|
||||
+ 'new_unit_destination': None,
|
||||
+ 'should_be_deleted': False,
|
||||
+ 'deleted': False,
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ def mock_listdir(dir_path):
|
||||
+ return ['home.mount', 'var.mount', 'not-a-mount.service']
|
||||
+
|
||||
+ def mock_delete_file(file_path):
|
||||
+ assert file_path in expected_changes
|
||||
+ expected_changes[file_path]['deleted'] = True
|
||||
+
|
||||
+ def mock_prefix(unit_file_path, new_unit_destination):
|
||||
+ assert expected_changes[unit_file_path]['new_unit_destination'] == new_unit_destination
|
||||
+
|
||||
+ monkeypatch.setattr('os.listdir', mock_listdir)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_delete_file', mock_delete_file)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_prefix_mount_unit_with_sysroot', mock_prefix)
|
||||
+
|
||||
+ mount_unit_generator.prefix_all_mount_units_with_sysroot('/test/dir')
|
||||
+
|
||||
+ for original_mount_unit_location in expected_changes:
|
||||
+ should_be_deleted = expected_changes[original_mount_unit_location]['should_be_deleted']
|
||||
+ was_deleted = expected_changes[original_mount_unit_location]['deleted']
|
||||
+ assert should_be_deleted == was_deleted
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('dirname', (
|
||||
+ 'local-fs.target.requires',
|
||||
+ 'local-fs.target.wants',
|
||||
+ 'local-fs-pre.target.requires',
|
||||
+ 'local-fs-pre.target.wants',
|
||||
+ 'remote-fs.target.requires',
|
||||
+ 'remote-fs.target.wants',
|
||||
+ 'remote-fs-pre.target.requires',
|
||||
+ 'remote-fs-pre.target.wants',
|
||||
+))
|
||||
+def test_fix_symlinks_in_dir(monkeypatch, dirname):
|
||||
+ """Test fixing local-fs.target.requires symlinks."""
|
||||
+
|
||||
+ DIR_PATH = os.path.join('/test/dir/', dirname)
|
||||
+
|
||||
+ def mock_rmtree(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+
|
||||
+ def mock_mkdir(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+
|
||||
+ def mock_listdir(dir_path):
|
||||
+ return ['sysroot-home.mount', 'sysroot-var.mount', 'not-a-mount.service']
|
||||
+
|
||||
+ def mock_os_path_exist(dir_path):
|
||||
+ assert dir_path == DIR_PATH
|
||||
+ return dir_path == DIR_PATH
|
||||
+
|
||||
+ expected_calls = [
|
||||
+ ['ln', '-s', '../sysroot-home.mount', os.path.join(DIR_PATH, 'sysroot-home.mount')],
|
||||
+ ['ln', '-s', '../sysroot-var.mount', os.path.join(DIR_PATH, 'sysroot-var.mount')]
|
||||
+ ]
|
||||
+ call_count = 0
|
||||
+
|
||||
+ def mock_run(command):
|
||||
+ nonlocal call_count
|
||||
+ assert command in expected_calls
|
||||
+ call_count += 1
|
||||
+ return {
|
||||
+ "stdout": "",
|
||||
+ "stderr": "",
|
||||
+ "exit_code": 0,
|
||||
+ }
|
||||
+
|
||||
+ monkeypatch.setattr('shutil.rmtree', mock_rmtree)
|
||||
+ monkeypatch.setattr('os.mkdir', mock_mkdir)
|
||||
+ monkeypatch.setattr('os.listdir', mock_listdir)
|
||||
+ monkeypatch.setattr('os.path.exists', mock_os_path_exist)
|
||||
+ monkeypatch.setattr(mount_unit_generator, 'run', mock_run)
|
||||
+
|
||||
+ mount_unit_generator._fix_symlinks_in_dir('/test/dir', dirname)
|
||||
+
|
||||
+
|
||||
+# Test the copy_units_into_system_location function
|
||||
+def test_copy_units_mixed_content(monkeypatch):
|
||||
+ """Test copying units with mixed files and directories."""
|
||||
+
|
||||
+ def mock_walk(dir_path):
|
||||
+ tuples_to_yield = [
|
||||
+ ('/source/dir', ['local-fs.target.requires'], ['unit1.mount', 'unit2.mount']),
|
||||
+ ('/source/dir/local-fs.target.requires', [], ['unit1.mount', 'unit2.mount']),
|
||||
+ ]
|
||||
+ for i in tuples_to_yield:
|
||||
+ yield i
|
||||
+
|
||||
+ def mock_isdir(path):
|
||||
+ return 'local-fs.target.requires' in path
|
||||
+
|
||||
+ def _make_couple(sub_path):
|
||||
+ return (
|
||||
+ os.path.join('/source/dir/', sub_path),
|
||||
+ os.path.join('/container/usr/lib/systemd/system/', sub_path)
|
||||
+ )
|
||||
+
|
||||
+ def mock_copy2(src, dst, follow_symlinks=True):
|
||||
+ valid_combinations = [
|
||||
+ _make_couple('unit1.mount'),
|
||||
+ _make_couple('unit2.mount'),
|
||||
+ _make_couple('local-fs.target.requires/unit1.mount'),
|
||||
+ _make_couple('local-fs.target.requires/unit2.mount'),
|
||||
+ ]
|
||||
+ assert not follow_symlinks
|
||||
+ assert (src, dst) in valid_combinations
|
||||
+
|
||||
+ def mock_islink(file_path):
|
||||
+ return file_path == '/container/usr/lib/systemd/system/local-fs.target.requires/unit2.mount'
|
||||
+
|
||||
+ class MockedDeleteFile:
|
||||
+ def __init__(self):
|
||||
+ self.removal_called = False
|
||||
+
|
||||
+ def __call__(self, file_path):
|
||||
+ assert file_path == '/container/usr/lib/systemd/system/local-fs.target.requires/unit2.mount'
|
||||
+ self.removal_called = True
|
||||
+
|
||||
+ def mock_makedirs(dst_dir, mode=0o777, exist_ok=False):
|
||||
+ assert exist_ok
|
||||
+ assert mode == 0o755
|
||||
+
|
||||
+ allowed_paths = [
|
||||
+ '/container/usr/lib/systemd/system',
|
||||
+ '/container/usr/lib/systemd/system/local-fs.target.requires'
|
||||
+ ]
|
||||
+ assert dst_dir.rstrip('/') in allowed_paths
|
||||
+
|
||||
+ monkeypatch.setattr(os, 'walk', mock_walk)
|
||||
+ monkeypatch.setattr(os, 'makedirs', mock_makedirs)
|
||||
+ monkeypatch.setattr(os.path, 'isdir', mock_isdir)
|
||||
+ monkeypatch.setattr(os.path, 'islink', mock_islink)
|
||||
+ monkeypatch.setattr(mount_unit_generator, '_delete_file', MockedDeleteFile())
|
||||
+ monkeypatch.setattr(shutil, 'copy2', mock_copy2)
|
||||
+
|
||||
+ class MockedContainerContext:
|
||||
+ def __init__(self):
|
||||
+ self.base_dir = '/container'
|
||||
+
|
||||
+ def full_path(self, path):
|
||||
+ return os.path.join('/container', path.lstrip('/'))
|
||||
+
|
||||
+ mock_container = MockedContainerContext()
|
||||
+
|
||||
+ files = mount_unit_generator.copy_units_into_system_location(
|
||||
+ mock_container, '/source/dir'
|
||||
+ )
|
||||
+
|
||||
+ expected_files = [
|
||||
+ '/usr/lib/systemd/system/unit1.mount',
|
||||
+ '/usr/lib/systemd/system/unit2.mount',
|
||||
+ '/usr/lib/systemd/system/local-fs.target.requires/unit1.mount',
|
||||
+ '/usr/lib/systemd/system/local-fs.target.requires/unit2.mount',
|
||||
+ ]
|
||||
+ assert sorted(files) == sorted(expected_files)
|
||||
+ assert mount_unit_generator._delete_file.removal_called
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
101
SOURCES/0005-Prevent-sssdupdate-actor-from-rising-errors.patch
Normal file
101
SOURCES/0005-Prevent-sssdupdate-actor-from-rising-errors.patch
Normal file
@ -0,0 +1,101 @@
|
||||
From e26359877b1d90d1f95a424216a00e711c72c923 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 9 Sep 2025 13:56:37 +0200
|
||||
Subject: [PATCH 05/55] Prevent sssdupdate actor from rising errors
|
||||
|
||||
Potential error rise (StopActorExecutionError) is replaced with
|
||||
warning logs in the SSSD update file processing function. This
|
||||
prevents the upgrade from failing when accessing non-critical files.
|
||||
Also fix minor formatting nit picks.
|
||||
|
||||
Jira: RHEL-108992
|
||||
---
|
||||
.../sssd/sssdchecks/libraries/sssdchecks.py | 4 ++--
|
||||
.../sssd/sssdfacts/libraries/sssdfacts.py | 5 ++++-
|
||||
.../sssd/sssdupdate/libraries/sssdupdate.py | 18 +++++++-----------
|
||||
3 files changed, 13 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
index 0a86fa7b..cb95026c 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdchecks/libraries/sssdchecks.py
|
||||
@@ -15,8 +15,8 @@ def check_config(model):
|
||||
'SSSD\'s sss_ssh_knownhostsproxy tool is replaced by the more '
|
||||
'reliable sss_ssh_knownhosts tool. SSH\'s configuration will be updated '
|
||||
'to reflect this by updating every mention of sss_ssh_knownhostsproxy by '
|
||||
- 'the corresponding mention of sss_ssh_knownhosts, even those commented out.\n'
|
||||
- 'SSSD\'s ssh service will be enabled if not already done.\n'
|
||||
+ 'the corresponding mention of sss_ssh_knownhosts, even those commented out. '
|
||||
+ 'SSSD\'s ssh service will be enabled if not already done.\n\n'
|
||||
'The following files will be updated:{}{}'.format(
|
||||
FMT_LIST_SEPARATOR,
|
||||
FMT_LIST_SEPARATOR.join(model.sssd_config_files + model.ssh_config_files)
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
index 0ae9d93f..7d343229 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdfacts/libraries/sssdfacts.py
|
||||
@@ -19,7 +19,10 @@ def _does_file_contain_expression(file_path, expression):
|
||||
)
|
||||
return False
|
||||
except OSError as e:
|
||||
- raise StopActorExecutionError('Could not open file ' + file_path, details={'details': str(e)})
|
||||
+ raise StopActorExecutionError(
|
||||
+ 'Could not open configuration file',
|
||||
+ details={'details': 'Coudn\'t open {} file with error: {}.'.format(file_path, str(e))}
|
||||
+ )
|
||||
|
||||
|
||||
def _look_for_files(expression: str, path_list: list[str]) -> list[str]:
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py b/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
index 6d745ead..5b96bcc6 100644
|
||||
--- a/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/sssd/sssdupdate/libraries/sssdupdate.py
|
||||
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
-from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.stdlib import api
|
||||
|
||||
|
||||
def _process_knownhosts(line: str) -> str:
|
||||
@@ -29,30 +29,26 @@ def _process_enable_svc(line: str) -> str:
|
||||
|
||||
|
||||
def _update_file(filename, process_function):
|
||||
- newname = filename + '.new'
|
||||
- oldname = filename + '.old'
|
||||
+ newname = '{}.leappnew'.format(filename)
|
||||
+ oldname = '{}.leappsave'.format(filename)
|
||||
try:
|
||||
- with open(filename, 'r') as input_file, open(newname, 'x') as output_file:
|
||||
+ with open(filename, 'r') as input_file, open(newname, 'w') as output_file:
|
||||
istat = os.fstat(input_file.fileno())
|
||||
os.fchmod(output_file.fileno(), istat.st_mode)
|
||||
for line in input_file:
|
||||
try:
|
||||
output_file.write(process_function(line))
|
||||
except OSError as e:
|
||||
- raise StopActorExecutionError('Failed to write to {}'.format(newname),
|
||||
- details={'details': str(e)})
|
||||
+ api.current_logger().warning('Failed to write to {}'.format(newname), details={'details': str(e)})
|
||||
|
||||
- except FileExistsError as e:
|
||||
- raise StopActorExecutionError('Temporary file already exists: {}'.format(newname),
|
||||
- details={'details': str(e)})
|
||||
except OSError as e:
|
||||
try:
|
||||
os.unlink(newname)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
- raise StopActorExecutionError('Failed to access the required files', details={'details': str(e)})
|
||||
+ api.current_logger().error('Failed to access the required files', details={'details': str(e)})
|
||||
|
||||
- # Let's make sure the old configuration is preserverd if something goes wrong
|
||||
+ # Let's make sure the old configuration is preserved if something goes wrong
|
||||
os.replace(filename, oldname)
|
||||
os.replace(newname, filename)
|
||||
os.unlink(oldname)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
132
SOURCES/0006-Update-our-test-container-to-Fedora-42.patch
Normal file
132
SOURCES/0006-Update-our-test-container-to-Fedora-42.patch
Normal file
@ -0,0 +1,132 @@
|
||||
From 23d8f69509e692ceaa3dacc0de927349ec056189 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Tue, 19 Aug 2025 09:19:18 +0200
|
||||
Subject: [PATCH 06/55] Update our test container to Fedora 42
|
||||
|
||||
The distro.linux_distribution in createresumeservice test is replaced
|
||||
distro.id(). The distro.linux_distribution has been deprecated and on
|
||||
Fedora 42 containerized tests with python3.13 it doesn't work correctly
|
||||
and the createresumeservice tests don't get skipped.
|
||||
|
||||
Jira: RHELMISC-13271
|
||||
---
|
||||
Makefile | 19 +++++++++----------
|
||||
.../tests/test_createresumeservice.py | 2 +-
|
||||
.../{Containerfile.f34 => Containerfile.f42} | 4 ++--
|
||||
3 files changed, 12 insertions(+), 13 deletions(-)
|
||||
rename utils/container-tests/{Containerfile.f34 => Containerfile.f42} (84%)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 81b16376..e0fc7e00 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -165,7 +165,7 @@ help:
|
||||
@echo " MR=6 COPR_CONFIG='path/to/the/config/copr/file' make <target>"
|
||||
@echo " ACTOR=<actor> TEST_LIBS=y make test"
|
||||
@echo " BUILD_CONTAINER=rhel8 make build_container"
|
||||
- @echo " TEST_CONTAINER=f34 make test_container"
|
||||
+ @echo " TEST_CONTAINER=f42 make test_container"
|
||||
@echo " CONTAINER_TOOL=docker TEST_CONTAINER=rhel8 make test_container_no_lint"
|
||||
@echo ""
|
||||
|
||||
@@ -379,7 +379,6 @@ test_no_lint:
|
||||
done; \
|
||||
$(_PYTHON_VENV) -m pytest $(REPORT_ARG) $(TEST_PATHS) $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
|
||||
-
|
||||
test: lint test_no_lint
|
||||
|
||||
# container images act like a cache so that dependencies can only be downloaded once
|
||||
@@ -416,7 +415,7 @@ lint_container:
|
||||
@_TEST_CONT_TARGET="lint" $(MAKE) test_container
|
||||
|
||||
lint_container_all:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) lint_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -426,9 +425,9 @@ lint_container_all:
|
||||
# because e.g RHEL8 to RHEL9 IPU must work on python3.6 and python3.9.
|
||||
test_container:
|
||||
@case $(_TEST_CONTAINER) in \
|
||||
- f34) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.f34"; \
|
||||
- export _VENV="python3.9"; \
|
||||
+ f42) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.f42"; \
|
||||
+ export _VENV="python3.13"; \
|
||||
;; \
|
||||
rhel8) \
|
||||
export CONT_FILE="utils/container-tests/Containerfile.rhel8"; \
|
||||
@@ -439,7 +438,7 @@ test_container:
|
||||
export _VENV="python3.9"; \
|
||||
;; \
|
||||
*) \
|
||||
- echo "Error: Available containers are: f34, rhel8, rhel9"; exit 1; \
|
||||
+ echo "Error: Available containers are: f42, rhel8, rhel9"; exit 1; \
|
||||
;; \
|
||||
esac; \
|
||||
export TEST_IMAGE="leapp-repo-tests-$(_TEST_CONTAINER)"; \
|
||||
@@ -471,7 +470,7 @@ test_container:
|
||||
exit $$res
|
||||
|
||||
test_container_all:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -479,13 +478,13 @@ test_container_no_lint:
|
||||
@_TEST_CONT_TARGET="test_no_lint" $(MAKE) test_container
|
||||
|
||||
test_container_all_no_lint:
|
||||
- @for container in "f34" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "rhel8" "rhel9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container_no_lint || exit 1; \
|
||||
done
|
||||
|
||||
# clean all testing and building containers and their images
|
||||
clean_containers:
|
||||
- @for i in "leapp-repo-tests-f34" "leapp-repo-tests-rhel8" \
|
||||
+ @for i in "leapp-repo-tests-f42" "leapp-repo-tests-rhel8" \
|
||||
"leapp-repo-tests-rhel9" "leapp-repo-build-el8"; do \
|
||||
$(_CONTAINER_TOOL) kill "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rm "$$i-cont" || :; \
|
||||
diff --git a/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py b/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
index 5302cdd2..c1cefc37 100644
|
||||
--- a/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
+++ b/repos/system_upgrade/common/actors/createresumeservice/tests/test_createresumeservice.py
|
||||
@@ -6,7 +6,7 @@ import pytest
|
||||
|
||||
@pytest.mark.skipif(os.getuid() != 0, reason='User is not a root')
|
||||
@pytest.mark.skipif(
|
||||
- distro.linux_distribution()[0] == 'Fedora',
|
||||
+ distro.id() == 'fedora',
|
||||
reason='default.target.wants does not exists on Fedora distro',
|
||||
)
|
||||
def test_create_resume_service(current_actor_context):
|
||||
diff --git a/utils/container-tests/Containerfile.f34 b/utils/container-tests/Containerfile.f42
|
||||
similarity index 84%
|
||||
rename from utils/container-tests/Containerfile.f34
|
||||
rename to utils/container-tests/Containerfile.f42
|
||||
index a9346635..46f0f63a 100644
|
||||
--- a/utils/container-tests/Containerfile.f34
|
||||
+++ b/utils/container-tests/Containerfile.f42
|
||||
@@ -1,11 +1,11 @@
|
||||
-FROM fedora:34
|
||||
+FROM fedora:42
|
||||
|
||||
VOLUME /repo
|
||||
|
||||
RUN dnf update -y && \
|
||||
dnf install -y findutils make rsync python3-gobject-base NetworkManager-libnm
|
||||
|
||||
-ENV PYTHON_VENV python3.9
|
||||
+ENV PYTHON_VENV python3.13
|
||||
|
||||
COPY . /repocopy
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From db8d1f3fcc155b94b07d89d90eb82cd2a52d5cf9 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 20 Aug 2025 15:41:34 +0200
|
||||
Subject: [PATCH 07/55] networkmanagerconnectionscanner: Skip test on Python !=
|
||||
3.6
|
||||
|
||||
The test_nm_conn tests fails on at least Python >= 3.9 (not sure which
|
||||
version exactly).
|
||||
|
||||
Let's skip the test on Python != 3.6 as they never run on a different
|
||||
version - the actor is in the el8toel9 repo and is in FactsPhase.
|
||||
---
|
||||
.../unit_test_networkmanagerconnectionscanner.py | 12 +++++++++++-
|
||||
1 file changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py b/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
index 46af07c1..7558b307 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/networkmanagerconnectionscanner/tests/unit_test_networkmanagerconnectionscanner.py
|
||||
@@ -1,4 +1,5 @@
|
||||
import errno
|
||||
+import sys
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
@@ -57,7 +58,16 @@ def test_no_conf(monkeypatch):
|
||||
assert not api.produce.called
|
||||
|
||||
|
||||
-@pytest.mark.skipif(not nmconnscanner.libnm_available, reason="NetworkManager g-ir not installed")
|
||||
+@pytest.mark.skipif(
|
||||
+ sys.version_info.major != 3 or sys.version_info.minor != 6,
|
||||
+ # On Python > 3.6 the GLib and NM libraries apparently behave differently and
|
||||
+ # the test fails. Let's skip it since the actor it's only ever run with
|
||||
+ # Python3.6 (el8toel9 repo and FactsPhase)
|
||||
+ reason="Only runs on Python 3.6",
|
||||
+)
|
||||
+@pytest.mark.skipif(
|
||||
+ not nmconnscanner.libnm_available, reason="NetworkManager g-ir not installed"
|
||||
+)
|
||||
def test_nm_conn(monkeypatch):
|
||||
"""
|
||||
Check a basic keyfile
|
||||
--
|
||||
2.51.1
|
||||
|
||||
132
SOURCES/0008-Remove-unused-rh-el7-Containerfiles.patch
Normal file
132
SOURCES/0008-Remove-unused-rh-el7-Containerfiles.patch
Normal file
@ -0,0 +1,132 @@
|
||||
From c4c36a2abd0c83b021a20a450e66b8b1fe7be2da Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 27 Aug 2025 20:02:46 +0200
|
||||
Subject: [PATCH 08/55] Remove unused (rh)el7 Containerfiles
|
||||
|
||||
---
|
||||
utils/container-builds/Containerfile.centos7 | 15 -----------
|
||||
utils/container-tests/Containerfile.rhel7 | 24 ------------------
|
||||
utils/container-tests/Containerfile.ubi7 | 25 -------------------
|
||||
utils/container-tests/Containerfile.ubi7-lint | 25 -------------------
|
||||
4 files changed, 89 deletions(-)
|
||||
delete mode 100644 utils/container-builds/Containerfile.centos7
|
||||
delete mode 100644 utils/container-tests/Containerfile.rhel7
|
||||
delete mode 100644 utils/container-tests/Containerfile.ubi7
|
||||
delete mode 100644 utils/container-tests/Containerfile.ubi7-lint
|
||||
|
||||
diff --git a/utils/container-builds/Containerfile.centos7 b/utils/container-builds/Containerfile.centos7
|
||||
deleted file mode 100644
|
||||
index af00eddb..00000000
|
||||
--- a/utils/container-builds/Containerfile.centos7
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
-FROM centos:7
|
||||
-
|
||||
-VOLUME /repo
|
||||
-
|
||||
-# mirror.centos.org is dead, comment out mirrorlist and set baseurl to vault.centos.org
|
||||
-RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install -y rpm-build python-devel make git
|
||||
-
|
||||
-WORKDIR /repo
|
||||
-ENV DIST_VERSION 7
|
||||
-ENTRYPOINT make _build_local
|
||||
diff --git a/utils/container-tests/Containerfile.rhel7 b/utils/container-tests/Containerfile.rhel7
|
||||
deleted file mode 100644
|
||||
index 0a0c384a..00000000
|
||||
--- a/utils/container-tests/Containerfile.rhel7
|
||||
+++ /dev/null
|
||||
@@ -1,24 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /repo
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install -y python-virtualenv python-setuptools make git rsync
|
||||
-
|
||||
-# see ./Containerfile.ubi7 for explanation
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-ENV PYTHON_VENV python2.7
|
||||
-
|
||||
-COPY . /repocopy
|
||||
-
|
||||
-WORKDIR /repocopy
|
||||
-
|
||||
-RUN rm -rf tut*
|
||||
-
|
||||
-RUN make clean && make install-deps
|
||||
-
|
||||
-WORKDIR /
|
||||
-
|
||||
diff --git a/utils/container-tests/Containerfile.ubi7 b/utils/container-tests/Containerfile.ubi7
|
||||
deleted file mode 100644
|
||||
index 44625a76..00000000
|
||||
--- a/utils/container-tests/Containerfile.ubi7
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /payload
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install python-virtualenv python-setuptools make git -y
|
||||
-
|
||||
-# NOTE(ivasilev,pstodulk) We need at least pip v10.0.1, however centos:7
|
||||
-# provides just v8.1.2 (via EPEL). So do this: install epel repos -> install
|
||||
-# python2-pip -> use pip to update to specific pip version we require. period
|
||||
-# NOTE(pstodulk) I see we take care about pip for py3 inside the Makefile,
|
||||
-# however I am afraid of additional possible troubles in future because of the
|
||||
-# archaic pip3 version (v9.0.1). As we want to run tests for Py2 and Py3 in ci
|
||||
-# always anyway, let's put py3 installation here as well..
|
||||
-# Dropped Python3 as it is now added in its own container on RHEL8
|
||||
-
|
||||
-# This is some trickery: We install python27-python-pip from the scl, use the scl to bootstrap the python
|
||||
-# module of pip version 20.3.0 and then make it update to 20.3.4 resulting the 'pip' command to be available.
|
||||
-# The --target approach doesn't add it, but at least we now have pip 20.3.4 installed ;-)
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-WORKDIR /payload
|
||||
-ENTRYPOINT make install-deps && make test_no_lint
|
||||
diff --git a/utils/container-tests/Containerfile.ubi7-lint b/utils/container-tests/Containerfile.ubi7-lint
|
||||
deleted file mode 100644
|
||||
index ed548985..00000000
|
||||
--- a/utils/container-tests/Containerfile.ubi7-lint
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-FROM registry.access.redhat.com/ubi7/ubi:7.9
|
||||
-
|
||||
-VOLUME /payload
|
||||
-
|
||||
-RUN yum update -y && \
|
||||
- yum install python-virtualenv python-setuptools make git -y
|
||||
-
|
||||
-# NOTE(ivasilev,pstodulk) We need at least pip v10.0.1, however centos:7
|
||||
-# provides just v8.1.2 (via EPEL). So do this: install epel repos -> install
|
||||
-# python2-pip -> use pip to update to specific pip version we require. period
|
||||
-# NOTE(pstodulk) I see we take care about pip for py3 inside the Makefile,
|
||||
-# however I am afraid of additional possible troubles in future because of the
|
||||
-# archaic pip3 version (v9.0.1). As we want to run tests for Py2 and Py3 in ci
|
||||
-# always anyway, let's put py3 installation here as well..
|
||||
-# Dropped Python3 as it is now added in its own container on RHEL8
|
||||
-
|
||||
-# This is some trickery: We install python27-python-pip from the scl, use the scl to bootstrap the python
|
||||
-# module of pip version 20.3.0 and then make it update to 20.3.4 resulting the 'pip' command to be available.
|
||||
-# The --target approach doesn't add it, but at least we now have pip 20.3.4 installed ;-)
|
||||
-RUN yum -y install python27-python-pip && \
|
||||
- scl enable python27 -- pip install -U --target /usr/lib/python2.7/site-packages/ pip==20.3.0 && \
|
||||
- python -m pip install --ignore-installed pip==20.3.4 ipaddress virtualenv
|
||||
-
|
||||
-WORKDIR /payload
|
||||
-ENTRYPOINT make install-deps && make lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
239
SOURCES/0009-Rename-Containerfiles-to-consistent-names.patch
Normal file
239
SOURCES/0009-Rename-Containerfiles-to-consistent-names.patch
Normal file
@ -0,0 +1,239 @@
|
||||
From 29c7619f0368384dd2e266610098a1f8d7a13813 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 27 Aug 2025 20:04:28 +0200
|
||||
Subject: [PATCH 09/55] Rename Containerfiles to consistent names
|
||||
|
||||
The container files (both those used in CI and locally by the Makefile)
|
||||
and both build and test, use various base containers - Centos, UBIs.
|
||||
|
||||
This patch unifies the naming scheme to Containerfile.elX to avoid
|
||||
making the user remember which one is used by which command an at
|
||||
which version.
|
||||
|
||||
The containerfiles used by Github Actions are moved to separate
|
||||
folder to avoid name clashes.
|
||||
|
||||
Also, in the GitHub actions test workflow the
|
||||
--security-opt=seccomp=unconfined is removed. Not sure why it was set in
|
||||
the first place, but seems it's not needed anymore.
|
||||
---
|
||||
.github/workflows/unit-tests.yml | 24 ++++++++------
|
||||
Makefile | 31 +++++++++----------
|
||||
.../{Containerfile.ubi8 => Containerfile.el8} | 0
|
||||
.../{Containerfile.ubi9 => Containerfile.el9} | 0
|
||||
...{Containerfile.rhel8 => Containerfile.el8} | 0
|
||||
...{Containerfile.rhel9 => Containerfile.el9} | 0
|
||||
.../Containerfile.el8} | 0
|
||||
.../Containerfile.el8-lint} | 0
|
||||
.../Containerfile.el9} | 0
|
||||
.../Containerfile.el9-lint} | 0
|
||||
10 files changed, 30 insertions(+), 25 deletions(-)
|
||||
rename utils/container-builds/{Containerfile.ubi8 => Containerfile.el8} (100%)
|
||||
rename utils/container-builds/{Containerfile.ubi9 => Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.rhel8 => Containerfile.el8} (100%)
|
||||
rename utils/container-tests/{Containerfile.rhel9 => Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi8 => ci/Containerfile.el8} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi8-lint => ci/Containerfile.el8-lint} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi9 => ci/Containerfile.el9} (100%)
|
||||
rename utils/container-tests/{Containerfile.ubi9-lint => ci/Containerfile.el9-lint} (100%)
|
||||
|
||||
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
|
||||
index ed82e0e5..cfcec437 100644
|
||||
--- a/.github/workflows/unit-tests.yml
|
||||
+++ b/.github/workflows/unit-tests.yml
|
||||
@@ -19,36 +19,36 @@ jobs:
|
||||
- name: 'Unit tests (python:3.12; repos:el9toel10,common)'
|
||||
python: python3.12
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.12; repos:el9toel10,common)'
|
||||
python: python3.12
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
- name: 'Unit tests (python:3.9; repos:el9toel10,common)'
|
||||
python: python3.9
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.9; repos:el9toel10,common)'
|
||||
python: python3.9
|
||||
repos: 'el9toel10,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
# 8to9
|
||||
- name: 'Unit tests (python:3.9; repos:el8toel9,common)'
|
||||
python: python3.9
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi9
|
||||
+ container: el9
|
||||
- name: 'Linters (python:3.9; repos:el8toel9,common)'
|
||||
python: python3.9
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi9-lint
|
||||
+ container: el9-lint
|
||||
- name: 'Unit tests (python:3.6; repos:el8toel9,common)'
|
||||
python: python3.6
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi8
|
||||
+ container: el8
|
||||
- name: 'Linters (python:3.6; repos:el8toel9,common)'
|
||||
python: python3.6
|
||||
repos: 'el8toel9,common'
|
||||
- container: ubi8-lint
|
||||
+ container: el8-lint
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -63,4 +63,10 @@ jobs:
|
||||
run: |
|
||||
git branch -f main origin/main
|
||||
- name: ${{matrix.scenarios.name}}
|
||||
- run: script -e -c /bin/bash -c 'TERM=xterm podman build --security-opt=seccomp=unconfined -t leapp-tests -f utils/container-tests/Containerfile.${{matrix.scenarios.container}} utils/container-tests && PYTHON_VENV=${{matrix.scenarios.python}} REPOSITORIES=${{matrix.scenarios.repos}} podman run --security-opt=seccomp=unconfined --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV --env=REPOSITORIES leapp-tests'
|
||||
+ run: |
|
||||
+ script -e -c /bin/bash -c \
|
||||
+ 'TERM=xterm \
|
||||
+ podman build -t leapp-tests -f utils/container-tests/ci/Containerfile.${{matrix.scenarios.container}} . && \
|
||||
+ PYTHON_VENV=${{matrix.scenarios.python}} \
|
||||
+ REPOSITORIES=${{matrix.scenarios.repos}} \
|
||||
+ podman run --rm -ti -v ${PWD}:/payload --env=PYTHON_VENV --env=REPOSITORIES leapp-tests'
|
||||
diff --git a/Makefile b/Makefile
|
||||
index e0fc7e00..754c2c63 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -51,7 +51,7 @@ _COPR_CONFIG=$${COPR_CONFIG:-~/.config/copr_rh_oamg.conf}
|
||||
_CONTAINER_TOOL=$${CONTAINER_TOOL:-podman}
|
||||
|
||||
# container to run tests in
|
||||
-_TEST_CONTAINER=$${TEST_CONTAINER:-rhel8}
|
||||
+_TEST_CONTAINER=$${TEST_CONTAINER:-el8}
|
||||
|
||||
# In case just specific CHROOTs should be used for the COPR build, you can
|
||||
# set the multiple CHROOTs separated by comma in the COPR_CHROOT envar, e.g.
|
||||
@@ -129,7 +129,7 @@ help:
|
||||
@echo " test lint source code and run tests"
|
||||
@echo " test_no_lint run tests without linting the source code"
|
||||
@echo " test_container run lint and tests in container"
|
||||
- @echo " - default container is 'rhel8'"
|
||||
+ @echo " - default container is 'el8'"
|
||||
@echo " - can be changed by setting TEST_CONTAINER env"
|
||||
@echo " test_container_all run lint and tests in all available containers"
|
||||
@echo " test_container_no_lint run tests without linting in container, see test_container"
|
||||
@@ -164,9 +164,9 @@ help:
|
||||
@echo " PR=7 SUFFIX='my_additional_suffix' make <target>"
|
||||
@echo " MR=6 COPR_CONFIG='path/to/the/config/copr/file' make <target>"
|
||||
@echo " ACTOR=<actor> TEST_LIBS=y make test"
|
||||
- @echo " BUILD_CONTAINER=rhel8 make build_container"
|
||||
+ @echo " BUILD_CONTAINER=el8 make build_container"
|
||||
@echo " TEST_CONTAINER=f42 make test_container"
|
||||
- @echo " CONTAINER_TOOL=docker TEST_CONTAINER=rhel8 make test_container_no_lint"
|
||||
+ @echo " CONTAINER_TOOL=docker TEST_CONTAINER=el8 make test_container_no_lint"
|
||||
@echo ""
|
||||
|
||||
clean:
|
||||
@@ -252,10 +252,10 @@ build_container:
|
||||
echo "--- Build RPM ${PKGNAME}-${VERSION}-${RELEASE}.el$(DIST_VERSION).rpm in container ---";
|
||||
case "$(BUILD_CONTAINER)" in \
|
||||
el8) \
|
||||
- CONT_FILE="utils/container-builds/Containerfile.ubi8"; \
|
||||
+ CONT_FILE="utils/container-builds/Containerfile.el8"; \
|
||||
;; \
|
||||
el9) \
|
||||
- CONT_FILE="utils/container-builds/Containerfile.ubi9"; \
|
||||
+ CONT_FILE="utils/container-builds/Containerfile.el9"; \
|
||||
;; \
|
||||
"") \
|
||||
echo "BUILD_CONTAINER must be set"; \
|
||||
@@ -415,7 +415,7 @@ lint_container:
|
||||
@_TEST_CONT_TARGET="lint" $(MAKE) test_container
|
||||
|
||||
lint_container_all:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in f42 el{8,9}; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) lint_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -429,16 +429,16 @@ test_container:
|
||||
export CONT_FILE="utils/container-tests/Containerfile.f42"; \
|
||||
export _VENV="python3.13"; \
|
||||
;; \
|
||||
- rhel8) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.rhel8"; \
|
||||
+ el8) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.el8"; \
|
||||
export _VENV="python3.6"; \
|
||||
;; \
|
||||
- rhel9) \
|
||||
- export CONT_FILE="utils/container-tests/Containerfile.rhel9"; \
|
||||
+ el9) \
|
||||
+ export CONT_FILE="utils/container-tests/Containerfile.el9"; \
|
||||
export _VENV="python3.9"; \
|
||||
;; \
|
||||
*) \
|
||||
- echo "Error: Available containers are: f42, rhel8, rhel9"; exit 1; \
|
||||
+ echo "Error: Available containers are: f42, el8, el9"; exit 1; \
|
||||
;; \
|
||||
esac; \
|
||||
export TEST_IMAGE="leapp-repo-tests-$(_TEST_CONTAINER)"; \
|
||||
@@ -470,7 +470,7 @@ test_container:
|
||||
exit $$res
|
||||
|
||||
test_container_all:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in "f42" "el8" "el9"; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container || exit 1; \
|
||||
done
|
||||
|
||||
@@ -478,14 +478,13 @@ test_container_no_lint:
|
||||
@_TEST_CONT_TARGET="test_no_lint" $(MAKE) test_container
|
||||
|
||||
test_container_all_no_lint:
|
||||
- @for container in "f42" "rhel8" "rhel9"; do \
|
||||
+ @for container in f42 el{8,9}; do \
|
||||
TEST_CONTAINER=$$container $(MAKE) test_container_no_lint || exit 1; \
|
||||
done
|
||||
|
||||
# clean all testing and building containers and their images
|
||||
clean_containers:
|
||||
- @for i in "leapp-repo-tests-f42" "leapp-repo-tests-rhel8" \
|
||||
- "leapp-repo-tests-rhel9" "leapp-repo-build-el8"; do \
|
||||
+ @for i in leapp-repo-tests-f42 leapp-repo-tests-el{8,9} leapp-repo-build-el{8,9}; do \
|
||||
$(_CONTAINER_TOOL) kill "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rm "$$i-cont" || :; \
|
||||
$(_CONTAINER_TOOL) rmi "$$i" || :; \
|
||||
diff --git a/utils/container-builds/Containerfile.ubi8 b/utils/container-builds/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-builds/Containerfile.ubi8
|
||||
rename to utils/container-builds/Containerfile.el8
|
||||
diff --git a/utils/container-builds/Containerfile.ubi9 b/utils/container-builds/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-builds/Containerfile.ubi9
|
||||
rename to utils/container-builds/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.rhel8 b/utils/container-tests/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.rhel8
|
||||
rename to utils/container-tests/Containerfile.el8
|
||||
diff --git a/utils/container-tests/Containerfile.rhel9 b/utils/container-tests/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.rhel9
|
||||
rename to utils/container-tests/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.ubi8 b/utils/container-tests/ci/Containerfile.el8
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi8
|
||||
rename to utils/container-tests/ci/Containerfile.el8
|
||||
diff --git a/utils/container-tests/Containerfile.ubi8-lint b/utils/container-tests/ci/Containerfile.el8-lint
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi8-lint
|
||||
rename to utils/container-tests/ci/Containerfile.el8-lint
|
||||
diff --git a/utils/container-tests/Containerfile.ubi9 b/utils/container-tests/ci/Containerfile.el9
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi9
|
||||
rename to utils/container-tests/ci/Containerfile.el9
|
||||
diff --git a/utils/container-tests/Containerfile.ubi9-lint b/utils/container-tests/ci/Containerfile.el9-lint
|
||||
similarity index 100%
|
||||
rename from utils/container-tests/Containerfile.ubi9-lint
|
||||
rename to utils/container-tests/ci/Containerfile.el9-lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
80
SOURCES/0010-Replace-ubi-8-containers-with-centos-8.patch
Normal file
80
SOURCES/0010-Replace-ubi-8-containers-with-centos-8.patch
Normal file
@ -0,0 +1,80 @@
|
||||
From 17767238d038d36341181e1702b73681ae432439 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 20 Aug 2025 14:12:13 +0200
|
||||
Subject: [PATCH 10/55] Replace ubi:8 containers with centos:8
|
||||
|
||||
The networkmanagerconnectionscanner depends on NetworkManager-nmlib and
|
||||
python3-gobject. These are not available in the UBI 8 repos and the
|
||||
tests are skipped.
|
||||
|
||||
This patch changes the base container from UBI 8 to Centos 8 which has
|
||||
the packages available and the tests are not skipped.
|
||||
---
|
||||
commands/tests/test_upgrade_paths.py | 5 +++++
|
||||
utils/container-tests/Containerfile.el8 | 10 ++++++++--
|
||||
utils/container-tests/ci/Containerfile.el8 | 10 ++++++++--
|
||||
3 files changed, 21 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/commands/tests/test_upgrade_paths.py b/commands/tests/test_upgrade_paths.py
|
||||
index 89b5eb71..9bdf5792 100644
|
||||
--- a/commands/tests/test_upgrade_paths.py
|
||||
+++ b/commands/tests/test_upgrade_paths.py
|
||||
@@ -42,6 +42,11 @@ def test_get_target_version(mock_open, monkeypatch):
|
||||
},
|
||||
)
|
||||
def test_get_target_release(mock_open, monkeypatch): # do not remove mock_open
|
||||
+ # Make it look like it's RHEL even on centos, because that's what the test
|
||||
+ # assumes.
|
||||
+ # Otherwise the test, when ran on Centos, fails because it works
|
||||
+ # with MAJOR.MINOR version format while Centos uses MAJOR format.
|
||||
+ monkeypatch.setattr(command_utils, 'get_distro_id', lambda: 'rhel')
|
||||
monkeypatch.setattr(command_utils, 'get_os_release_version_id', lambda x: '8.6')
|
||||
|
||||
# make sure env var LEAPP_DEVEL_TARGET_RELEASE takes precedence
|
||||
diff --git a/utils/container-tests/Containerfile.el8 b/utils/container-tests/Containerfile.el8
|
||||
index 6f21839b..b92e8742 100644
|
||||
--- a/utils/container-tests/Containerfile.el8
|
||||
+++ b/utils/container-tests/Containerfile.el8
|
||||
@@ -1,9 +1,15 @@
|
||||
-FROM registry.access.redhat.com/ubi8/ubi:latest
|
||||
+FROM centos:8
|
||||
+
|
||||
+RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
|
||||
VOLUME /repo
|
||||
|
||||
RUN dnf update -y && \
|
||||
- dnf install -y python3-virtualenv python3-setuptools python3-pip make git rsync
|
||||
+ dnf install -y git make rsync \
|
||||
+ python3-virtualenv python3-setuptools python3-pip \
|
||||
+ python3-gobject NetworkManager-libnm
|
||||
|
||||
ENV PYTHON_VENV python3.6
|
||||
|
||||
diff --git a/utils/container-tests/ci/Containerfile.el8 b/utils/container-tests/ci/Containerfile.el8
|
||||
index 4da60c18..4a19092e 100644
|
||||
--- a/utils/container-tests/ci/Containerfile.el8
|
||||
+++ b/utils/container-tests/ci/Containerfile.el8
|
||||
@@ -1,9 +1,15 @@
|
||||
-FROM registry.access.redhat.com/ubi8/ubi:latest
|
||||
+FROM centos:8
|
||||
+
|
||||
+RUN sed -i s/mirror.centos.org/vault.centos.org/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^#\s*baseurl=http/baseurl=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
+RUN sed -i s/^mirrorlist=http/#mirrorlist=http/ /etc/yum.repos.d/CentOS-*.repo
|
||||
|
||||
VOLUME /payload
|
||||
|
||||
RUN dnf update -y && \
|
||||
- dnf install python3-virtualenv python3-setuptools python3-pip make git -y
|
||||
+ dnf install -y make git \
|
||||
+ python3-virtualenv python3-setuptools python3-pip \
|
||||
+ python3-gobject NetworkManager-libnm
|
||||
|
||||
WORKDIR /payload
|
||||
ENTRYPOINT make install-deps && make test_no_lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
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
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
From c4f3ace1ebb909dc53796e16959a2459a15d9d74 Mon Sep 17 00:00:00 2001
|
||||
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
|
||||
Date: Thu, 9 Oct 2025 13:30:16 +0000
|
||||
Subject: [PATCH 11/55] chore(deps): update actions/checkout action to v5
|
||||
|
||||
---
|
||||
.github/workflows/codespell.yml | 2 +-
|
||||
.github/workflows/differential-shellcheck.yml | 2 +-
|
||||
.github/workflows/unit-tests.yml | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml
|
||||
index 3e595e32..4b07e4b3 100644
|
||||
--- a/.github/workflows/codespell.yml
|
||||
+++ b/.github/workflows/codespell.yml
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- - uses: actions/checkout@v4
|
||||
+ - uses: actions/checkout@v5
|
||||
- uses: codespell-project/actions-codespell@v2
|
||||
with:
|
||||
ignore_words_list: ro,fo,couldn,repositor,zeor,bootup
|
||||
diff --git a/.github/workflows/differential-shellcheck.yml b/.github/workflows/differential-shellcheck.yml
|
||||
index e1bafb93..6c81713c 100644
|
||||
--- a/.github/workflows/differential-shellcheck.yml
|
||||
+++ b/.github/workflows/differential-shellcheck.yml
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Repository checkout
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml
|
||||
index cfcec437..d1b8fb2a 100644
|
||||
--- a/.github/workflows/unit-tests.yml
|
||||
+++ b/.github/workflows/unit-tests.yml
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- uses: actions/checkout@v4
|
||||
+ uses: actions/checkout@v5
|
||||
with:
|
||||
# NOTE(ivasilev) fetch-depth 0 is critical here as leapp deps discovery depends on specific substring in
|
||||
# commit message and default 1 option will get us just merge commit which has an unrelevant message.
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,46 @@
|
||||
From 601c26f795a7b2f6cb553c656112235d17137b8f Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 16 Sep 2025 15:58:29 +0200
|
||||
Subject: [PATCH 12/55] LiveMode: Add /etc/crypttab file to the target
|
||||
userspace container
|
||||
|
||||
When upgrading with LiveMode, the auto-unlock of encrypted devices
|
||||
fails because the /etc/crypttab configuration file is not present inside
|
||||
the squashfs, causing the boot process to fail.
|
||||
|
||||
This change copy /etc/crypttab file to the target userspace container
|
||||
during the upgrade process, allowing encrypted devices to be properly
|
||||
unlocked.
|
||||
|
||||
Jira: RHEL-90098
|
||||
---
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index 57a94e9d..aac171a7 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -3,6 +3,7 @@ from leapp.libraries.common.config.version import get_source_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CephInfo,
|
||||
+ CopyFile,
|
||||
DracutModule,
|
||||
LuksDumps,
|
||||
StorageInfo,
|
||||
@@ -156,7 +157,10 @@ def check_invalid_luks_devices():
|
||||
'tpm2-tools',
|
||||
'tpm2-abrmd'
|
||||
]
|
||||
- api.produce(TargetUserSpaceUpgradeTasks(install_rpms=required_crypt_rpms))
|
||||
+ api.produce(TargetUserSpaceUpgradeTasks(
|
||||
+ copy_files=[CopyFile(src="/etc/crypttab")],
|
||||
+ install_rpms=required_crypt_rpms)
|
||||
+ )
|
||||
api.produce(UpgradeInitramfsTasks(include_dracut_modules=[
|
||||
DracutModule(name='clevis'),
|
||||
DracutModule(name='clevis-pin-tpm2')
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
From ae048a890ddd2169f3f46d9fbd1545fd65670e16 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 6 Oct 2025 15:56:16 +0200
|
||||
Subject: [PATCH 13/55] livemode: Include /etc/crypttab in upgrade initramfs
|
||||
|
||||
The /etc/crypttab file is sometimes not picked up automatically by
|
||||
dracut, this change includes it unconditionally. This is required for
|
||||
auto-unlocking encrypted devices in upgrade environment.
|
||||
|
||||
The upgradeinitramfsgenerator is modified to process
|
||||
UpgradeInitramfsTasksinclude's include_files when upgrading in livemode.
|
||||
|
||||
Jira: RHEL-90098
|
||||
---
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 4 +++-
|
||||
.../libraries/upgradeinitramfsgenerator.py | 3 +++
|
||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index aac171a7..d52b9e73 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -161,7 +161,9 @@ def check_invalid_luks_devices():
|
||||
copy_files=[CopyFile(src="/etc/crypttab")],
|
||||
install_rpms=required_crypt_rpms)
|
||||
)
|
||||
- api.produce(UpgradeInitramfsTasks(include_dracut_modules=[
|
||||
+ api.produce(UpgradeInitramfsTasks(
|
||||
+ include_files=['/etc/crypttab'],
|
||||
+ include_dracut_modules=[
|
||||
DracutModule(name='clevis'),
|
||||
DracutModule(name='clevis-pin-tpm2')
|
||||
])
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
index 02c3fd9d..3ad92167 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
@@ -436,6 +436,9 @@ def _generate_livemode_initramfs(context, userspace_initramfs_dest, target_kerne
|
||||
'--lvmconf', '--mdadmconf',
|
||||
'--kver', target_kernel_ver, '-f', userspace_initramfs_dest]
|
||||
|
||||
+ # Add included files
|
||||
+ cmd.extend(itertools.chain(*(('--install', file) for file in initramfs_includes.files)))
|
||||
+
|
||||
# Add dracut modules
|
||||
cmd.extend(itertools.chain(*(('--add', module) for module in dracut_modules)))
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From 8248f6afd54bedcfe9d9d639fda3760669360dbe Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 13 Oct 2025 13:39:14 +0200
|
||||
Subject: [PATCH 14/55] overlaygen: Fix not enough arguments for format string
|
||||
|
||||
---
|
||||
repos/system_upgrade/common/libraries/overlaygen.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index 867e3559..a048af2b 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -710,7 +710,7 @@ def _create_mount_disk_image_old(disk_images_directory, path):
|
||||
try:
|
||||
utils.call_with_oserror_handled(cmd=['/sbin/mkfs.ext4', '-F', diskimage_path])
|
||||
except CalledProcessError as e:
|
||||
- api.current_logger().error('Failed to create ext4 filesystem in %s', exc_info=True)
|
||||
+ api.current_logger().error('Failed to create ext4 filesystem in %s', diskimage_path, exc_info=True)
|
||||
raise StopActorExecutionError(
|
||||
message=str(e)
|
||||
)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
444
SOURCES/0015-Generalize-TargetRepositories.patch
Normal file
444
SOURCES/0015-Generalize-TargetRepositories.patch
Normal file
@ -0,0 +1,444 @@
|
||||
From 546d18f64deabe8440ac6d4ee707d7a5b69415db Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 15 Sep 2025 11:09:59 +0200
|
||||
Subject: [PATCH 15/55] Generalize TargetRepositories
|
||||
|
||||
The RHELTargetRepository model is deprecated and replaced by the
|
||||
DistroTargetRepository. The target TargetRepositories model is updated
|
||||
accordingly.
|
||||
|
||||
TargetRepositories.rhel_repos are only filled on RHEL.
|
||||
---
|
||||
.../libraries/checktargetrepos.py | 4 ++-
|
||||
.../tests/test_checktargetrepos.py | 32 +++++++++++++------
|
||||
.../cloud/checkrhui/libraries/checkrhui.py | 5 ++-
|
||||
.../tests/component_test_checkrhui.py | 1 +
|
||||
.../libraries/setuptargetrepos.py | 29 +++++++++++------
|
||||
.../libraries/setuptargetrepos_repomap.py | 4 +--
|
||||
.../tests/test_setuptargetrepos.py | 22 ++++++++++---
|
||||
.../libraries/userspacegen.py | 2 ++
|
||||
.../tests/unit_test_targetuserspacecreator.py | 7 ++++
|
||||
.../common/models/targetrepositories.py | 32 +++++++++++++++++--
|
||||
10 files changed, 107 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
index c286ed4f..141cf8e4 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
@@ -2,12 +2,14 @@ from leapp import reporting
|
||||
from leapp.libraries.common import config, rhsm
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
-from leapp.models import CustomTargetRepositoryFile, RHUIInfo, TargetRepositories
|
||||
+from leapp.models import CustomTargetRepositoryFile, RHELTargetRepository, RHUIInfo, TargetRepositories
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
# TODO: we need to provide this path in a shared library
|
||||
CUSTOM_REPO_PATH = '/etc/leapp/files/leapp_upgrade_repositories.repo'
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def _any_custom_repo_defined():
|
||||
for tr in api.consume(TargetRepositories):
|
||||
if tr.custom_repos:
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
index c1ca8cd1..ea93ce7e 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
@@ -8,12 +8,11 @@ from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
CustomTargetRepositoryFile,
|
||||
- EnvVar,
|
||||
- Report,
|
||||
- RepositoryData,
|
||||
+ DistroTargetRepository,
|
||||
RHELTargetRepository,
|
||||
TargetRepositories
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
from leapp.utils.report import is_inhibitor
|
||||
|
||||
|
||||
@@ -32,11 +31,21 @@ class MockedConsume(object):
|
||||
return iter([msg for msg in self._msgs if isinstance(msg, model)])
|
||||
|
||||
|
||||
-_RHEL_REPOS = [
|
||||
- RHELTargetRepository(repoid='repo1'),
|
||||
- RHELTargetRepository(repoid='repo2'),
|
||||
- RHELTargetRepository(repoid='repo3'),
|
||||
- RHELTargetRepository(repoid='repo4'),
|
||||
+@suppress_deprecation(RHELTargetRepository)
|
||||
+def _test_rhel_repos():
|
||||
+ return [
|
||||
+ RHELTargetRepository(repoid='repo1'),
|
||||
+ RHELTargetRepository(repoid='repo2'),
|
||||
+ RHELTargetRepository(repoid='repo3'),
|
||||
+ RHELTargetRepository(repoid='repo4'),
|
||||
+ ]
|
||||
+
|
||||
+
|
||||
+_DISTRO_REPOS = [
|
||||
+ DistroTargetRepository(repoid='repo1'),
|
||||
+ DistroTargetRepository(repoid='repo2'),
|
||||
+ DistroTargetRepository(repoid='repo3'),
|
||||
+ DistroTargetRepository(repoid='repo4'),
|
||||
]
|
||||
|
||||
_CUSTOM_REPOS = [
|
||||
@@ -46,8 +55,10 @@ _CUSTOM_REPOS = [
|
||||
CustomTargetRepository(repoid='repo4', name='repo4name', baseurl=None, enabled=True),
|
||||
]
|
||||
|
||||
-_TARGET_REPOS_CUSTOM = TargetRepositories(rhel_repos=_RHEL_REPOS, custom_repos=_CUSTOM_REPOS)
|
||||
-_TARGET_REPOS_NO_CUSTOM = TargetRepositories(rhel_repos=_RHEL_REPOS)
|
||||
+_TARGET_REPOS_CUSTOM = TargetRepositories(
|
||||
+ rhel_repos=_test_rhel_repos(), distro_repos=_DISTRO_REPOS, custom_repos=_CUSTOM_REPOS
|
||||
+)
|
||||
+_TARGET_REPOS_NO_CUSTOM = TargetRepositories(rhel_repos=_test_rhel_repos(), distro_repos=_DISTRO_REPOS)
|
||||
_CUSTOM_TARGET_REPOFILE = CustomTargetRepositoryFile(file='/etc/leapp/files/leapp_upgrade_repositories.repo')
|
||||
|
||||
|
||||
@@ -55,6 +66,7 @@ def test_checktargetrepos_rhsm(monkeypatch):
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: False)
|
||||
monkeypatch.setattr(api, 'consume', MockedConsume())
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(checktargetrepos, 'get_target_major_version', lambda: '8')
|
||||
checktargetrepos.process()
|
||||
assert reporting.create_report.called == 0
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
index ea154173..5dcdd967 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/libraries/checkrhui.py
|
||||
@@ -22,6 +22,7 @@ from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
DNFPluginTask,
|
||||
InstalledRPM,
|
||||
+ RHELTargetRepository,
|
||||
RHUIInfo,
|
||||
RpmTransactionTasks,
|
||||
TargetRepositories,
|
||||
@@ -30,6 +31,7 @@ from leapp.models import (
|
||||
TargetRHUISetupInfo,
|
||||
TargetUserSpacePreupgradeTasks
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
MatchingSetup = namedtuple('MatchingSetup', ['family', 'description'])
|
||||
|
||||
@@ -370,11 +372,12 @@ def emit_rhui_setup_tasks_based_on_config(rhui_config_dict):
|
||||
api.produce(rhui_info)
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def request_configured_repos_to_be_enabled(rhui_config):
|
||||
config_repos_to_enable = rhui_config[RhuiTargetRepositoriesToUse.name]
|
||||
custom_repos = [CustomTargetRepository(repoid=repoid) for repoid in config_repos_to_enable]
|
||||
if custom_repos:
|
||||
- target_repos = TargetRepositories(custom_repos=custom_repos, rhel_repos=[])
|
||||
+ target_repos = TargetRepositories(custom_repos=custom_repos, rhel_repos=[], distro_repos=[])
|
||||
api.produce(target_repos)
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
index 3ac9c1b8..02ca352e 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
@@ -468,6 +468,7 @@ def test_request_configured_repos_to_be_enabled(monkeypatch):
|
||||
|
||||
target_repos = api.produce.model_instances[0]
|
||||
assert isinstance(target_repos, TargetRepositories)
|
||||
+ assert not target_repos.distro_repos
|
||||
assert not target_repos.rhel_repos
|
||||
|
||||
custom_repoids = sorted(custom_repo_model.repoid for custom_repo_model in target_repos.custom_repos)
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
index a6073aa3..9e5b1334 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos.py
|
||||
@@ -1,9 +1,10 @@
|
||||
-
|
||||
from leapp.libraries.actor import setuptargetrepos_repomap
|
||||
+from leapp.libraries.common.config import get_distro_id
|
||||
from leapp.libraries.common.config.version import get_source_major_version, get_source_version, get_target_version
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import (
|
||||
CustomTargetRepository,
|
||||
+ DistroTargetRepository,
|
||||
InstalledRPM,
|
||||
RepositoriesBlacklisted,
|
||||
RepositoriesFacts,
|
||||
@@ -15,6 +16,7 @@ from leapp.models import (
|
||||
TargetRepositories,
|
||||
UsedRepositories
|
||||
)
|
||||
+from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810 = {
|
||||
'rhui-microsoft-azure-rhel8-sapapps': 'rhui-microsoft-azure-rhel8-base-sap-apps',
|
||||
@@ -80,6 +82,7 @@ def _get_mapped_repoids(repomap, src_repoids):
|
||||
return mapped_repoids
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository)
|
||||
def process():
|
||||
# Load relevant data from messages
|
||||
used_repoids_dict = _get_used_repo_dict()
|
||||
@@ -103,10 +106,11 @@ def process():
|
||||
# installed packages that have mapping to prevent missing repositories that are disabled during the upgrade, but
|
||||
# can be used to upgrade installed packages.
|
||||
repoids_to_map = enabled_repoids.union(repoids_from_installed_packages_with_mapping)
|
||||
+ is_rhel = get_distro_id() == 'rhel'
|
||||
|
||||
# RHEL8.10 use a different repoid for client repository, but the repomapping mechanism cannot distinguish these
|
||||
# as it does not use minor versions. Therefore, we have to hardcode these changes.
|
||||
- if get_source_version() == '8.10':
|
||||
+ if is_rhel and get_source_version() == '8.10':
|
||||
for rhel88_rhui_client_repoid, rhel810_rhui_client_repoid in RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810.items():
|
||||
if rhel810_rhui_client_repoid in repoids_to_map:
|
||||
# Replace RHEL8.10 rhui client repoids with RHEL8.8 repoids,
|
||||
@@ -119,9 +123,9 @@ def process():
|
||||
default_channels = setuptargetrepos_repomap.get_default_repository_channels(repomap, repoids_to_map)
|
||||
repomap.set_default_channels(default_channels)
|
||||
|
||||
- # Get target RHEL repoids based on the repomap
|
||||
+ # Get target distro repoids based on the repomap
|
||||
expected_repos = repomap.get_expected_target_pesid_repos(repoids_to_map)
|
||||
- target_rhel_repoids = set()
|
||||
+ target_distro_repoids = set()
|
||||
for target_pesid, target_pesidrepo in expected_repos.items():
|
||||
if not target_pesidrepo:
|
||||
# NOTE this could happen only for enabled repositories part of the set,
|
||||
@@ -139,7 +143,7 @@ def process():
|
||||
if target_pesidrepo.repoid in excluded_repoids:
|
||||
api.current_logger().debug('Skipping the {} repo (excluded).'.format(target_pesidrepo.repoid))
|
||||
continue
|
||||
- target_rhel_repoids.add(target_pesidrepo.repoid)
|
||||
+ target_distro_repoids.add(target_pesidrepo.repoid)
|
||||
|
||||
# FIXME: this could possibly result into a try to enable multiple repositories
|
||||
# from the same family (pesid). But unless we have a bug in previous actors,
|
||||
@@ -151,7 +155,7 @@ def process():
|
||||
if repo in excluded_repoids:
|
||||
api.current_logger().debug('Skipping the {} repo from setup task (excluded).'.format(repo))
|
||||
continue
|
||||
- target_rhel_repoids.add(repo)
|
||||
+ target_distro_repoids.add(repo)
|
||||
|
||||
# On 8.10, some RHUI setups have different names than the one computed by repomapping.
|
||||
# Although such situation could be avoided (having another client repo when a single
|
||||
@@ -159,12 +163,16 @@ def process():
|
||||
# solution.
|
||||
if get_target_version() == '8.10':
|
||||
for pre_810_repoid, post_810_repoid in RHUI_CLIENT_REPOIDS_RHEL88_TO_RHEL810.items():
|
||||
- if pre_810_repoid in target_rhel_repoids:
|
||||
- target_rhel_repoids.remove(pre_810_repoid)
|
||||
- target_rhel_repoids.add(post_810_repoid)
|
||||
+ if pre_810_repoid in target_distro_repoids:
|
||||
+ target_distro_repoids.remove(pre_810_repoid)
|
||||
+ target_distro_repoids.add(post_810_repoid)
|
||||
|
||||
# create the final lists and sort them (for easier testing)
|
||||
- rhel_repos = [RHELTargetRepository(repoid=repoid) for repoid in sorted(target_rhel_repoids)]
|
||||
+ if is_rhel:
|
||||
+ rhel_repos = [RHELTargetRepository(repoid=repoid) for repoid in sorted(target_distro_repoids)]
|
||||
+ else:
|
||||
+ rhel_repos = []
|
||||
+ distro_repos = [DistroTargetRepository(repoid=repoid) for repoid in sorted(target_distro_repoids)]
|
||||
custom_repos = [repo for repo in custom_repos if repo.repoid not in excluded_repoids]
|
||||
custom_repos = sorted(custom_repos, key=lambda x: x.repoid)
|
||||
|
||||
@@ -179,5 +187,6 @@ def process():
|
||||
|
||||
api.produce(TargetRepositories(
|
||||
rhel_repos=rhel_repos,
|
||||
+ distro_repos=distro_repos,
|
||||
custom_repos=custom_repos,
|
||||
))
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
index 37be03f1..343ee2ea 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/libraries/setuptargetrepos_repomap.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-from leapp.libraries.common.config import get_target_product_channel
|
||||
+from leapp.libraries.common.config import get_distro_id, get_target_product_channel
|
||||
from leapp.libraries.common.config.version import get_source_major_version, get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
|
||||
@@ -44,7 +44,7 @@ class RepoMapDataHandler(object):
|
||||
# ideal for work, but there is not any significant impact..
|
||||
self.repositories = repo_map.repositories
|
||||
self.mapping = repo_map.mapping
|
||||
- self.distro = distro or api.current_actor().configuration.os_release.release_id
|
||||
+ self.distro = distro or get_distro_id()
|
||||
# FIXME(pstodulk): what about default_channel -> fallback_channel
|
||||
# hardcoded always as ga? instead of list of channels..
|
||||
# it'd be possibly confusing naming now...
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
index 1f898e8f..e4a30f7f 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
@@ -198,11 +198,23 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
setuptargetrepos.process()
|
||||
assert api.produce.called
|
||||
|
||||
+ distro_repos = api.produce.model_instances[0].distro_repos
|
||||
rhel_repos = api.produce.model_instances[0].rhel_repos
|
||||
- assert len(rhel_repos) == 3
|
||||
|
||||
+ assert len(distro_repos) == 3
|
||||
+
|
||||
+ produced_distro_repoids = {repo.repoid for repo in distro_repos}
|
||||
produced_rhel_repoids = {repo.repoid for repo in rhel_repos}
|
||||
- expected_rhel_repoids = {'{0}-8-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
- '{0}-8-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
- '{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id)}
|
||||
- assert produced_rhel_repoids == expected_rhel_repoids
|
||||
+
|
||||
+ expected_repoids = {
|
||||
+ "{0}-8-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
+ "{0}-8-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
+ "{0}-8-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
+ }
|
||||
+
|
||||
+ assert produced_distro_repoids == expected_repoids
|
||||
+ if distro_id == 'rhel':
|
||||
+ assert len(rhel_repos) == 3
|
||||
+ assert produced_rhel_repoids == expected_repoids
|
||||
+ else:
|
||||
+ assert len(rhel_repos) == 0
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 55877d05..407cb0b7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -17,6 +17,7 @@ from leapp.models import (
|
||||
CustomTargetRepositoryFile,
|
||||
PkgManagerInfo,
|
||||
RepositoriesFacts,
|
||||
+ RHELTargetRepository,
|
||||
RHSMInfo,
|
||||
RHUIInfo,
|
||||
StorageInfo,
|
||||
@@ -967,6 +968,7 @@ def _get_rh_available_repoids(context, indata):
|
||||
return rh_repoids
|
||||
|
||||
|
||||
+@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
def gather_target_repositories(context, indata):
|
||||
"""
|
||||
Get available required target repositories and inhibit or raise error if basic checks do not pass.
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 7853a7ad..f05e6bc2 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -1072,6 +1072,7 @@ def test_consume_data(monkeypatch, raised, no_rhsm, testdata):
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Currently not implemented in the actor. It's TODO.")
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories(monkeypatch):
|
||||
monkeypatch.setattr(userspacegen.api, 'current_actor', CurrentActorMocked())
|
||||
# The available RHSM repos
|
||||
@@ -1104,6 +1105,7 @@ def test_gather_target_repositories_none_available(monkeypatch):
|
||||
assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
|
||||
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories_rhui(monkeypatch):
|
||||
|
||||
indata = testInData(
|
||||
@@ -1122,6 +1124,10 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
rhel_repos=[
|
||||
models.RHELTargetRepository(repoid='rhui-1'),
|
||||
models.RHELTargetRepository(repoid='rhui-2')
|
||||
+ ],
|
||||
+ distro_repos=[
|
||||
+ models.DistroTargetRepository(repoid='rhui-1'),
|
||||
+ models.DistroTargetRepository(repoid='rhui-2')
|
||||
]
|
||||
)
|
||||
])
|
||||
@@ -1130,6 +1136,7 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
assert target_repoids == set(['rhui-1', 'rhui-2'])
|
||||
|
||||
|
||||
+@suppress_deprecation(models.RHELTargetRepository)
|
||||
def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
# If the repos that Leapp identifies as required for the upgrade (based on the repo mapping and PES data) are not
|
||||
# available, an exception shall be raised
|
||||
diff --git a/repos/system_upgrade/common/models/targetrepositories.py b/repos/system_upgrade/common/models/targetrepositories.py
|
||||
index 02c6c5e5..e1a0b646 100644
|
||||
--- a/repos/system_upgrade/common/models/targetrepositories.py
|
||||
+++ b/repos/system_upgrade/common/models/targetrepositories.py
|
||||
@@ -1,4 +1,5 @@
|
||||
from leapp.models import fields, Model
|
||||
+from leapp.reporting import deprecated
|
||||
from leapp.topics import TransactionTopic
|
||||
|
||||
|
||||
@@ -11,10 +12,18 @@ class UsedTargetRepository(TargetRepositoryBase):
|
||||
pass
|
||||
|
||||
|
||||
+@deprecated(
|
||||
+ since="2025-07-23",
|
||||
+ message="This model is deprecated, use DistroTargetRepository instead.",
|
||||
+)
|
||||
class RHELTargetRepository(TargetRepositoryBase):
|
||||
pass
|
||||
|
||||
|
||||
+class DistroTargetRepository(TargetRepositoryBase):
|
||||
+ pass
|
||||
+
|
||||
+
|
||||
class CustomTargetRepository(TargetRepositoryBase):
|
||||
name = fields.Nullable(fields.String())
|
||||
baseurl = fields.Nullable(fields.String())
|
||||
@@ -26,20 +35,39 @@ class TargetRepositories(Model):
|
||||
Repositories supposed to be used during the IPU process
|
||||
|
||||
The list of the actually used repositories could be just subset
|
||||
- of these repositoies. In case of `custom_repositories`, all such repositories
|
||||
+ of these repositories. In case of `custom_repositories`, all such repositories
|
||||
must be available otherwise the upgrade is inhibited. But in case of
|
||||
- `rhel_repos`, only BaseOS and Appstream repos are required now. If others
|
||||
+ `distro_repos`, only BaseOS and Appstream repos are required now. If others
|
||||
are missing, upgrade can still continue.
|
||||
+
|
||||
+ Note: `rhel_repos` are deprecated, use `distro_repos` instead.
|
||||
"""
|
||||
topic = TransactionTopic
|
||||
+
|
||||
+ # DEPRECATED: this has been superseded by distro_repos
|
||||
rhel_repos = fields.List(fields.Model(RHELTargetRepository))
|
||||
"""
|
||||
Expected target YUM RHEL repositories provided via RHSM
|
||||
|
||||
+ DEPRECATED - use distro_repos instead.
|
||||
+
|
||||
These repositories are stored inside /etc/yum.repos.d/redhat.repo and
|
||||
are expected to be used based on the provided repositories mapping.
|
||||
"""
|
||||
|
||||
+ distro_repos = fields.List(fields.Model(DistroTargetRepository))
|
||||
+ """
|
||||
+ Expected target DNF repositories provided by the distribution.
|
||||
+
|
||||
+ On RHEL these are the repositories provided via RHSM.
|
||||
+ These repositories are stored inside /etc/yum.repos.d/redhat.repo and
|
||||
+ are expected to be used based on the provided repositories mapping.
|
||||
+
|
||||
+ On other distributions, such as Centos Stream these are repositories
|
||||
+ in /etc/yum.repos.d/ that are provided by the distribution and are expected
|
||||
+ to be used based on the provided repositories mapping.
|
||||
+ """
|
||||
+
|
||||
custom_repos = fields.List(fields.Model(CustomTargetRepository), default=[])
|
||||
"""
|
||||
Custom YUM repositories required to be used for the IPU
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
65
SOURCES/0016-checktargetrepos-Skip-if-not-RHEL.patch
Normal file
65
SOURCES/0016-checktargetrepos-Skip-if-not-RHEL.patch
Normal file
@ -0,0 +1,65 @@
|
||||
From e61718d44e0175bcd28c8a5ee44dc46880d74482 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Tue, 5 Aug 2025 12:20:23 +0200
|
||||
Subject: [PATCH 16/55] checktargetrepos: Skip if not RHEL
|
||||
|
||||
Skip the target repos check on non-RHEL distros. On non-RHEL distros,
|
||||
there is no subscription-manager. The base repositories (BaseOS,
|
||||
AppStream, ...) should always be present.
|
||||
This is checked using the seatbelts in target userspace creator.
|
||||
---
|
||||
.../system_upgrade/common/actors/checktargetrepos/actor.py | 4 +++-
|
||||
.../actors/checktargetrepos/libraries/checktargetrepos.py | 7 ++++---
|
||||
.../actors/checktargetrepos/tests/test_checktargetrepos.py | 2 --
|
||||
3 files changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/actor.py b/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
index d61fb685..a5bdde10 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/actor.py
|
||||
@@ -6,7 +6,9 @@ from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
class Checktargetrepos(Actor):
|
||||
"""
|
||||
- Check whether target yum repositories are specified.
|
||||
+ Check whether target dnf repositories are specified on RHEL.
|
||||
+
|
||||
+ NOTE: this actor does nothing on distros other than RHEL.
|
||||
|
||||
RHSM | RHUI | ER | CTR | CTRF || result
|
||||
-----+------+----+-----+------++-------
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
index 141cf8e4..ea21e1de 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/libraries/checktargetrepos.py
|
||||
@@ -40,9 +40,10 @@ def process():
|
||||
|
||||
rhui_info = next(api.consume(RHUIInfo), None)
|
||||
|
||||
- if not rhsm.skip_rhsm() or rhui_info:
|
||||
- # getting RH repositories through RHSM or RHUI; resolved by seatbelts
|
||||
- # implemented in other actors
|
||||
+ if config.get_distro_id() != 'rhel' or (not rhsm.skip_rhsm() or rhui_info):
|
||||
+ # RHEL: getting RH repositories through RHSM or RHUI;
|
||||
+ # resolved by seatbelts in other actors
|
||||
+ # other: distro repos provided by the distro directly, seatbelts elsewhere
|
||||
return
|
||||
|
||||
# rhsm skipped; take your seatbelts please
|
||||
diff --git a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
index ea93ce7e..e055b3a6 100644
|
||||
--- a/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/checktargetrepos/tests/test_checktargetrepos.py
|
||||
@@ -65,9 +65,7 @@ _CUSTOM_TARGET_REPOFILE = CustomTargetRepositoryFile(file='/etc/leapp/files/leap
|
||||
def test_checktargetrepos_rhsm(monkeypatch):
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: False)
|
||||
- monkeypatch.setattr(api, 'consume', MockedConsume())
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
- monkeypatch.setattr(checktargetrepos, 'get_target_major_version', lambda: '8')
|
||||
checktargetrepos.process()
|
||||
assert reporting.create_report.called == 0
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,820 @@
|
||||
From 32d9c40ffc7ea8d08e2b85881579ede1fdaedb32 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 7 Aug 2025 13:40:33 +0200
|
||||
Subject: [PATCH 17/55] userspacegen: Add repo gathering for non-RHEL distros
|
||||
|
||||
The _get_rh_available_repoids() function is replaced by the
|
||||
new get_distro_repoids() function from the distro library. This function
|
||||
works with all the "supported" distros.
|
||||
The idea is the same as for RHEL, scan well-known distro-provided
|
||||
repofiles for repositories.
|
||||
For RHEL, at least for now, the existing
|
||||
rhsm.get_rhsm_available_repoids() function is still used.
|
||||
|
||||
These changes together enable the use of repomapping on distros other
|
||||
than RHEL, as before this change the --enablerepo option had to be used
|
||||
to specify target repos and they were treated as custom repos.
|
||||
|
||||
Also, the unused _get_rhui_available_repoids() function is removed.
|
||||
|
||||
Jira: RHEL-107212
|
||||
|
||||
Move get_distro_repoids() to the distro library
|
||||
---
|
||||
.../libraries/userspacegen.py | 228 ++++++++++--------
|
||||
.../tests/unit_test_targetuserspacecreator.py | 56 ++++-
|
||||
.../system_upgrade/common/libraries/distro.py | 192 +++++++++++++++
|
||||
.../common/libraries/tests/test_distro.py | 154 ++++++++++++
|
||||
4 files changed, 524 insertions(+), 106 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
index 407cb0b7..26fec2d9 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/libraries/userspacegen.py
|
||||
@@ -6,7 +6,7 @@ import shutil
|
||||
from leapp import reporting
|
||||
from leapp.exceptions import StopActorExecution, StopActorExecutionError
|
||||
from leapp.libraries.actor import constants
|
||||
-from leapp.libraries.common import dnfplugin, mounting, overlaygen, repofileutils, rhsm, utils
|
||||
+from leapp.libraries.common import distro, dnfplugin, mounting, overlaygen, repofileutils, rhsm, utils
|
||||
from leapp.libraries.common.config import get_distro_id, get_env, get_product_type
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.common.gpg import get_path_to_gpg_certs, is_nogpgcheck_set
|
||||
@@ -58,6 +58,7 @@ from leapp.utils.deprecation import suppress_deprecation
|
||||
PROD_CERTS_FOLDER = 'prod-certs'
|
||||
PERSISTENT_PACKAGE_CACHE_DIR = '/var/lib/leapp/persistent_package_cache'
|
||||
DEDICATED_LEAPP_PART_URL = 'https://access.redhat.com/solutions/7011704'
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
|
||||
|
||||
def _check_deprecated_rhsm_skip():
|
||||
@@ -778,7 +779,7 @@ def _inhibit_on_duplicate_repos(repofiles):
|
||||
list_separator_fmt = '\n - '
|
||||
api.current_logger().warning(
|
||||
'The following repoids are defined multiple times:{0}{1}'
|
||||
- .format(list_separator_fmt, list_separator_fmt.join(duplicates))
|
||||
+ .format(list_separator_fmt, list_separator_fmt.join(sorted(duplicates)))
|
||||
)
|
||||
|
||||
reporting.create_report([
|
||||
@@ -786,7 +787,7 @@ def _inhibit_on_duplicate_repos(repofiles):
|
||||
reporting.Summary(
|
||||
'The following repositories are defined multiple times inside the'
|
||||
' "upgrade" container:{0}{1}'
|
||||
- .format(list_separator_fmt, list_separator_fmt.join(duplicates))
|
||||
+ .format(list_separator_fmt, list_separator_fmt.join(sorted(duplicates)))
|
||||
),
|
||||
reporting.Severity(reporting.Severity.MEDIUM),
|
||||
reporting.Groups([reporting.Groups.REPOSITORY]),
|
||||
@@ -815,21 +816,19 @@ def _get_all_available_repoids(context):
|
||||
return set(repoids)
|
||||
|
||||
|
||||
-def _get_rhsm_available_repoids(context):
|
||||
- target_major_version = get_target_major_version()
|
||||
+def _inhibit_if_no_base_repos(distro_repoids):
|
||||
# FIXME: check that required repo IDs (baseos, appstream)
|
||||
# + or check that all required RHEL repo IDs are available.
|
||||
- if rhsm.skip_rhsm():
|
||||
- return set()
|
||||
- # Get the RHSM repos available in the target RHEL container
|
||||
- # TODO: very similar thing should happens for all other repofiles in container
|
||||
- #
|
||||
- repoids = rhsm.get_available_repo_ids(context)
|
||||
+
|
||||
+ target_major_version = get_target_major_version()
|
||||
# NOTE(ivasilev) For the moment at least AppStream and BaseOS repos are required. While we are still
|
||||
# contemplating on what can be a generic solution to checking this, let's introduce a minimal check for
|
||||
# at-least-one-appstream and at-least-one-baseos among present repoids
|
||||
- if not repoids or all("baseos" not in ri for ri in repoids) or all("appstream" not in ri for ri in repoids):
|
||||
+ no_baseos = all("baseos" not in ri for ri in distro_repoids)
|
||||
+ no_appstream = all("appstream" not in ri for ri in distro_repoids)
|
||||
+ if no_baseos or no_appstream:
|
||||
reporting.create_report([
|
||||
+ # TODO: Make the report distro agnostic
|
||||
reporting.Title('Cannot find required basic RHEL target repositories.'),
|
||||
reporting.Summary(
|
||||
'This can happen when a repository ID was entered incorrectly either while using the --enablerepo'
|
||||
@@ -861,21 +860,6 @@ def _get_rhsm_available_repoids(context):
|
||||
title='Preparing for the upgrade')
|
||||
])
|
||||
raise StopActorExecution()
|
||||
- return set(repoids)
|
||||
-
|
||||
-
|
||||
-def _get_rhui_available_repoids(context, cloud_repo):
|
||||
- repofiles = repofileutils.get_parsed_repofiles(context)
|
||||
-
|
||||
- # TODO: same refactoring as Issue #486?
|
||||
- _inhibit_on_duplicate_repos(repofiles)
|
||||
- repoids = []
|
||||
- for rfile in repofiles:
|
||||
- if rfile.file == cloud_repo and rfile.data:
|
||||
- repoids = [repo.repoid for repo in rfile.data]
|
||||
- repoids.sort()
|
||||
- break
|
||||
- return set(repoids)
|
||||
|
||||
|
||||
def get_copy_location_from_copy_in_task(context_basepath, copy_task):
|
||||
@@ -886,86 +870,106 @@ def get_copy_location_from_copy_in_task(context_basepath, copy_task):
|
||||
return copy_task.dst
|
||||
|
||||
|
||||
-def _get_rh_available_repoids(context, indata):
|
||||
+def _get_rhui_available_repoids(context, rhui_info):
|
||||
"""
|
||||
- RH repositories are provided either by RHSM or are stored in the expected repo file provided by
|
||||
- RHUI special packages (every cloud provider has itw own rpm).
|
||||
+ Get repoids provided by the RHUI target clients
|
||||
+
|
||||
+ :rtype: set[str]
|
||||
"""
|
||||
+ # If we are upgrading a RHUI system, check what repositories are provided by the (already installed) target clients
|
||||
+ setup_info = rhui_info.target_client_setup_info
|
||||
+ target_content_access_files = set()
|
||||
+ if setup_info.bootstrap_target_client:
|
||||
+ target_content_access_files = _query_rpm_for_pkg_files(context, rhui_info.target_client_pkg_names)
|
||||
|
||||
- rh_repoids = _get_rhsm_available_repoids(context)
|
||||
+ def is_repofile(path):
|
||||
+ return os.path.dirname(path) == '/etc/yum.repos.d' and os.path.basename(path).endswith('.repo')
|
||||
|
||||
- # If we are upgrading a RHUI system, check what repositories are provided by the (already installed) target clients
|
||||
- if indata and indata.rhui_info:
|
||||
- setup_info = indata.rhui_info.target_client_setup_info
|
||||
- target_content_access_files = set()
|
||||
- if setup_info.bootstrap_target_client:
|
||||
- target_content_access_files = _query_rpm_for_pkg_files(context, indata.rhui_info.target_client_pkg_names)
|
||||
+ def extract_repoid_from_line(line):
|
||||
+ return line.split(':', 1)[1].strip()
|
||||
|
||||
- def is_repofile(path):
|
||||
- return os.path.dirname(path) == '/etc/yum.repos.d' and os.path.basename(path).endswith('.repo')
|
||||
+ target_ver = api.current_actor().configuration.version.target
|
||||
+ setup_tasks = rhui_info.target_client_setup_info.preinstall_tasks.files_to_copy_into_overlay
|
||||
|
||||
- def extract_repoid_from_line(line):
|
||||
- return line.split(':', 1)[1].strip()
|
||||
+ yum_repos_d = context.full_path('/etc/yum.repos.d')
|
||||
+ all_repofiles = {os.path.join(yum_repos_d, path) for path in os.listdir(yum_repos_d) if path.endswith('.repo')}
|
||||
+ api.current_logger().debug('(RHUI Setup) All available repofiles: {0}'.format(' '.join(all_repofiles)))
|
||||
|
||||
- target_ver = api.current_actor().configuration.version.target
|
||||
- setup_tasks = indata.rhui_info.target_client_setup_info.preinstall_tasks.files_to_copy_into_overlay
|
||||
+ target_access_repofiles = {
|
||||
+ context.full_path(path) for path in target_content_access_files if is_repofile(path)
|
||||
+ }
|
||||
|
||||
- yum_repos_d = context.full_path('/etc/yum.repos.d')
|
||||
- all_repofiles = {os.path.join(yum_repos_d, path) for path in os.listdir(yum_repos_d) if path.endswith('.repo')}
|
||||
- api.current_logger().debug('(RHUI Setup) All available repofiles: {0}'.format(' '.join(all_repofiles)))
|
||||
+ # Exclude repofiles used to setup the target rhui access as on some platforms the repos provided by
|
||||
+ # the client are not sufficient to install the client into target userspace (GCP)
|
||||
+ rhui_setup_repofile_tasks = [task for task in setup_tasks if task.src.endswith('repo')]
|
||||
+ rhui_setup_repofiles = (
|
||||
+ get_copy_location_from_copy_in_task(context.base_dir, copy) for copy in rhui_setup_repofile_tasks
|
||||
+ )
|
||||
+ rhui_setup_repofiles = {context.full_path(repofile) for repofile in rhui_setup_repofiles}
|
||||
|
||||
- target_access_repofiles = {
|
||||
- context.full_path(path) for path in target_content_access_files if is_repofile(path)
|
||||
- }
|
||||
+ foreign_repofiles = all_repofiles - target_access_repofiles - rhui_setup_repofiles
|
||||
|
||||
- # Exclude repofiles used to setup the target rhui access as on some platforms the repos provided by
|
||||
- # the client are not sufficient to install the client into target userspace (GCP)
|
||||
- rhui_setup_repofile_tasks = [task for task in setup_tasks if task.src.endswith('repo')]
|
||||
- rhui_setup_repofiles = (
|
||||
- get_copy_location_from_copy_in_task(context.base_dir, copy) for copy in rhui_setup_repofile_tasks
|
||||
- )
|
||||
- rhui_setup_repofiles = {context.full_path(repofile) for repofile in rhui_setup_repofiles}
|
||||
+ api.current_logger().debug(
|
||||
+ 'The following repofiles are considered as unknown to'
|
||||
+ ' the target RHUI content setup and will be ignored: {0}'.format(' '.join(foreign_repofiles))
|
||||
+ )
|
||||
|
||||
- foreign_repofiles = all_repofiles - target_access_repofiles - rhui_setup_repofiles
|
||||
+ # Rename non-client repofiles so they will not be recognized when running dnf repolist
|
||||
+ for foreign_repofile in foreign_repofiles:
|
||||
+ os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile))
|
||||
|
||||
- api.current_logger().debug(
|
||||
- 'The following repofiles are considered as unknown to'
|
||||
- ' the target RHUI content setup and will be ignored: {0}'.format(' '.join(foreign_repofiles))
|
||||
+ rhui_repoids = set()
|
||||
+ try:
|
||||
+ dnf_cmd = [
|
||||
+ 'dnf', 'repolist',
|
||||
+ '--releasever', target_ver, '-v',
|
||||
+ '--enablerepo', '*',
|
||||
+ '--disablerepo', '*-source-*',
|
||||
+ '--disablerepo', '*-debug-*',
|
||||
+ ]
|
||||
+ repolist_result = context.call(dnf_cmd)['stdout']
|
||||
+ repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')]
|
||||
+ rhui_repoids.update({extract_repoid_from_line(line) for line in repoid_lines})
|
||||
+
|
||||
+ except CalledProcessError as err:
|
||||
+ details = {'err': err.stderr, 'details': str(err)}
|
||||
+ raise StopActorExecutionError(
|
||||
+ message='Failed to retrieve repoids provided by target RHUI clients.',
|
||||
+ details=details
|
||||
)
|
||||
|
||||
- # Rename non-client repofiles so they will not be recognized when running dnf repolist
|
||||
+ finally:
|
||||
+ # Revert the renaming of non-client repofiles
|
||||
for foreign_repofile in foreign_repofiles:
|
||||
- os.rename(foreign_repofile, '{0}.back'.format(foreign_repofile))
|
||||
+ os.rename('{0}.back'.format(foreign_repofile), foreign_repofile)
|
||||
|
||||
- try:
|
||||
- dnf_cmd = [
|
||||
- 'dnf', 'repolist',
|
||||
- '--releasever', target_ver, '-v',
|
||||
- '--enablerepo', '*',
|
||||
- '--disablerepo', '*-source-*',
|
||||
- '--disablerepo', '*-debug-*',
|
||||
- ]
|
||||
- repolist_result = context.call(dnf_cmd)['stdout']
|
||||
- repoid_lines = [line for line in repolist_result.split('\n') if line.startswith('Repo-id')]
|
||||
- rhui_repoids = {extract_repoid_from_line(line) for line in repoid_lines}
|
||||
- rh_repoids.update(rhui_repoids)
|
||||
-
|
||||
- except CalledProcessError as err:
|
||||
- details = {'err': err.stderr, 'details': str(err)}
|
||||
- raise StopActorExecutionError(
|
||||
- message='Failed to retrieve repoids provided by target RHUI clients.',
|
||||
- details=details
|
||||
- )
|
||||
+ return rhui_repoids
|
||||
|
||||
- finally:
|
||||
- # Revert the renaming of non-client repofiles
|
||||
- for foreign_repofile in foreign_repofiles:
|
||||
- os.rename('{0}.back'.format(foreign_repofile), foreign_repofile)
|
||||
|
||||
- api.current_logger().debug(
|
||||
- 'The following repofiles are considered as provided by RedHat: {0}'.format(' '.join(rh_repoids))
|
||||
- )
|
||||
- return rh_repoids
|
||||
+def _get_distro_available_repoids(context, indata):
|
||||
+ """
|
||||
+ Get repoids provided by the distribution
|
||||
+
|
||||
+ On RHEL: RH repositories are provided either by RHSM or are stored in the
|
||||
+ expected repo file provided by RHUI special packages (every cloud
|
||||
+ provider has itw own rpm).
|
||||
+ On other: Repositories are provided in specific repofiles (e.g. centos.repo
|
||||
+ and centos-addons.repo on CS)
|
||||
+
|
||||
+ :return: A set of repoids provided by distribution
|
||||
+ :rtype: set[str]
|
||||
+ """
|
||||
+ distro_repoids = distro.get_target_distro_repoids(context)
|
||||
+ distro_id = get_distro_id()
|
||||
+ rhel_and_rhsm = distro_id == 'rhel' and not rhsm.skip_rhsm()
|
||||
+ if distro_id != 'rhel' or rhel_and_rhsm:
|
||||
+ _inhibit_if_no_base_repos(distro_repoids)
|
||||
+
|
||||
+ if indata and indata.rhui_info:
|
||||
+ rhui_repoids = _get_rhui_available_repoids(context, indata.rhui_info)
|
||||
+ distro_repoids.extend(rhui_repoids)
|
||||
+
|
||||
+ return set(distro_repoids)
|
||||
|
||||
|
||||
@suppress_deprecation(RHELTargetRepository) # member of TargetRepositories
|
||||
@@ -986,17 +990,31 @@ def gather_target_repositories(context, indata):
|
||||
:param context: An instance of a mounting.IsolatedActions class
|
||||
:type context: mounting.IsolatedActions class
|
||||
:return: List of target system repoids
|
||||
- :rtype: List(string)
|
||||
+ :rtype: set[str]
|
||||
"""
|
||||
- rh_available_repoids = _get_rh_available_repoids(context, indata)
|
||||
- all_available_repoids = _get_all_available_repoids(context)
|
||||
|
||||
- target_repoids = []
|
||||
- missing_custom_repoids = []
|
||||
+ distro_repoids = _get_distro_available_repoids(context, indata)
|
||||
+ if distro_repoids:
|
||||
+ api.current_logger().info(
|
||||
+ "The following repoids are considered as provided by the '{}' distribution:{}{}".format(
|
||||
+ get_distro_id(),
|
||||
+ FMT_LIST_SEPARATOR,
|
||||
+ FMT_LIST_SEPARATOR.join(sorted(distro_repoids)),
|
||||
+ )
|
||||
+ )
|
||||
+ else:
|
||||
+ api.current_logger().warning(
|
||||
+ "No repoids provided by the {} distribution have been discovered".format(get_distro_id())
|
||||
+ )
|
||||
+
|
||||
+ all_repoids = _get_all_available_repoids(context)
|
||||
+
|
||||
+ target_repoids = set()
|
||||
+ missing_custom_repoids = set()
|
||||
for target_repo in api.consume(TargetRepositories):
|
||||
- for rhel_repo in target_repo.rhel_repos:
|
||||
- if rhel_repo.repoid in rh_available_repoids:
|
||||
- target_repoids.append(rhel_repo.repoid)
|
||||
+ for distro_repo in target_repo.distro_repos:
|
||||
+ if distro_repo.repoid in distro_repoids:
|
||||
+ target_repoids.add(distro_repo.repoid)
|
||||
else:
|
||||
# TODO: We shall report that the RHEL repos that we deem necessary for
|
||||
# the upgrade are not available; but currently it would just print bunch of
|
||||
@@ -1005,12 +1023,16 @@ def gather_target_repositories(context, indata):
|
||||
# of the upgrade. Let's skip it for now until it's clear how we will deal
|
||||
# with it.
|
||||
pass
|
||||
+
|
||||
for custom_repo in target_repo.custom_repos:
|
||||
- if custom_repo.repoid in all_available_repoids:
|
||||
- target_repoids.append(custom_repo.repoid)
|
||||
+ if custom_repo.repoid in all_repoids:
|
||||
+ target_repoids.add(custom_repo.repoid)
|
||||
else:
|
||||
- missing_custom_repoids.append(custom_repo.repoid)
|
||||
- api.current_logger().debug("Gathered target repositories: {}".format(', '.join(target_repoids)))
|
||||
+ missing_custom_repoids.add(custom_repo.repoid)
|
||||
+ api.current_logger().debug(
|
||||
+ "Gathered target repositories: {}".format(", ".join(sorted(target_repoids)))
|
||||
+ )
|
||||
+
|
||||
if not target_repoids:
|
||||
target_major_version = get_target_major_version()
|
||||
reporting.create_report([
|
||||
@@ -1056,7 +1078,7 @@ def gather_target_repositories(context, indata):
|
||||
' while using the --enablerepo option of leapp, or in a third party actor that produces a'
|
||||
' CustomTargetRepositoryMessage.\n'
|
||||
'The following repositories IDs could not be found in the target configuration:\n'
|
||||
- '- {}\n'.format('\n- '.join(missing_custom_repoids))
|
||||
+ '- {}\n'.format('\n- '.join(sorted(missing_custom_repoids)))
|
||||
),
|
||||
reporting.Groups([reporting.Groups.REPOSITORY]),
|
||||
reporting.Groups([reporting.Groups.INHIBITOR]),
|
||||
@@ -1073,7 +1095,7 @@ def gather_target_repositories(context, indata):
|
||||
))
|
||||
])
|
||||
raise StopActorExecution()
|
||||
- return set(target_repoids)
|
||||
+ return target_repoids
|
||||
|
||||
|
||||
def _install_custom_repofiles(context, custom_repofiles):
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index f05e6bc2..2ae194d7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -11,9 +11,9 @@ import pytest
|
||||
from leapp import models, reporting
|
||||
from leapp.exceptions import StopActorExecution, StopActorExecutionError
|
||||
from leapp.libraries.actor import userspacegen
|
||||
-from leapp.libraries.common import overlaygen, repofileutils, rhsm
|
||||
+from leapp.libraries.common import distro, overlaygen, repofileutils, rhsm
|
||||
from leapp.libraries.common.config import architecture
|
||||
-from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked, produce_mocked
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked, logger_mocked, produce_mocked
|
||||
from leapp.libraries.stdlib import api, CalledProcessError
|
||||
from leapp.utils.deprecation import suppress_deprecation
|
||||
|
||||
@@ -1115,7 +1115,9 @@ def test_gather_target_repositories_rhui(monkeypatch):
|
||||
monkeypatch.setattr(userspacegen.api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(userspacegen, '_get_all_available_repoids', lambda x: [])
|
||||
monkeypatch.setattr(
|
||||
- userspacegen, '_get_rh_available_repoids', lambda x, y: ['rhui-1', 'rhui-2', 'rhui-3']
|
||||
+ userspacegen,
|
||||
+ "_get_distro_available_repoids",
|
||||
+ lambda dummy_context, dummy_indata: {"rhui-1", "rhui-2", "rhui-3"},
|
||||
)
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
monkeypatch.setattr(
|
||||
@@ -1195,6 +1197,54 @@ def test_gather_target_repositories_baseos_appstream_not_available(monkeypatch):
|
||||
assert inhibitors[0].get('title', '') == 'Cannot find required basic RHEL target repositories.'
|
||||
|
||||
|
||||
+def test__get_distro_available_repoids_norhsm_norhui(monkeypatch):
|
||||
+ """
|
||||
+ Empty set should be returned when on rhel and skip_rhsm == True.
|
||||
+ """
|
||||
+ monkeypatch.setattr(
|
||||
+ userspacegen.api, "current_actor", CurrentActorMocked(release_id="rhel")
|
||||
+ )
|
||||
+ monkeypatch.setattr(userspacegen.api.current_actor(), 'produce', produce_mocked())
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_repoids', lambda ctx: [])
|
||||
+
|
||||
+ indata = testInData(_PACKAGES_MSGS, None, None, _XFS_MSG, _STORAGEINFO_MSG, None)
|
||||
+ # NOTE: context is not used without rhsm, for simplicity setting to None
|
||||
+ repoids = userspacegen._get_distro_available_repoids(None, indata)
|
||||
+ assert repoids == set()
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize(
|
||||
+ "distro_id,skip_rhsm", [("rhel", False), ("centos", True), ("almalinux", True)]
|
||||
+)
|
||||
+def test__get_distro_available_repoids_nobaserepos_inhibit(
|
||||
+ monkeypatch, distro_id, skip_rhsm
|
||||
+):
|
||||
+ """
|
||||
+ Test that get_distro_available repoids reports and raises if there are no base repos.
|
||||
+ """
|
||||
+ monkeypatch.setattr(
|
||||
+ userspacegen.api, "current_actor", CurrentActorMocked(release_id=distro_id)
|
||||
+ )
|
||||
+ monkeypatch.setattr(userspacegen.api.current_actor(), 'produce', produce_mocked())
|
||||
+ monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
+ monkeypatch.setattr(distro, 'get_target_distro_repoids', lambda ctx: [])
|
||||
+
|
||||
+ indata = testInData(_PACKAGES_MSGS, None, None, _XFS_MSG, _STORAGEINFO_MSG, None)
|
||||
+ with pytest.raises(StopActorExecution):
|
||||
+ # NOTE: context is not used without rhsm, for simplicity setting to None
|
||||
+ userspacegen._get_distro_available_repoids(None, indata)
|
||||
+
|
||||
+ # TODO adjust the asserts when the report is made distro agnostic
|
||||
+ assert reporting.create_report.called == 1
|
||||
+ report = reporting.create_report.reports[0]
|
||||
+ assert "Cannot find required basic RHEL target repositories" in report["title"]
|
||||
+ assert reporting.Groups.INHIBITOR in report["groups"]
|
||||
+
|
||||
+
|
||||
def mocked_consume_data():
|
||||
packages = {'dnf', 'dnf-command(config-manager)', 'pkgA', 'pkgB'}
|
||||
rhsm_info = _RHSMINFO_MSG
|
||||
diff --git a/repos/system_upgrade/common/libraries/distro.py b/repos/system_upgrade/common/libraries/distro.py
|
||||
index 2ed5eacd..d6a2381a 100644
|
||||
--- a/repos/system_upgrade/common/libraries/distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/distro.py
|
||||
@@ -2,6 +2,10 @@ import json
|
||||
import os
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
+from leapp.libraries.common import repofileutils, rhsm
|
||||
+from leapp.libraries.common.config import get_distro_id
|
||||
+from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_X86_64
|
||||
+from leapp.libraries.common.config.version import get_target_major_version
|
||||
from leapp.libraries.stdlib import api
|
||||
|
||||
|
||||
@@ -16,3 +20,191 @@ def get_distribution_data(distribution):
|
||||
raise StopActorExecutionError(
|
||||
'Cannot find distribution signature configuration.',
|
||||
details={'Problem': 'Distribution {} was not found in {}.'.format(distribution, distributions_path)})
|
||||
+
|
||||
+
|
||||
+# distro -> major_version -> repofile -> tuple of architectures where it's present
|
||||
+_DISTRO_REPOFILES_MAP = {
|
||||
+ 'rhel': {
|
||||
+ '8': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ '9': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ '10': {'/etc/yum.repos.d/redhat.repo': ARCH_ACCEPTED},
|
||||
+ },
|
||||
+ 'centos': {
|
||||
+ '8': {
|
||||
+ # TODO is this true on all archs?
|
||||
+ 'CentOS-Linux-AppStream.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-BaseOS.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-ContinuousRelease.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Debuginfo.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Devel.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Extras.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-FastTrack.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-HighAvailability.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Media.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Plus.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-PowerTools.repo': ARCH_ACCEPTED,
|
||||
+ 'CentOS-Linux-Sources.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '9': {
|
||||
+ '/etc/yum.repos.d/centos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/centos-addons.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '10': {
|
||||
+ '/etc/yum.repos.d/centos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/centos-addons.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ },
|
||||
+ 'almalinux': {
|
||||
+ '8': {
|
||||
+ # TODO is this true on all archs?
|
||||
+ '/etc/yum.repos.d/almalinux-ha.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-powertools.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-resilientstorage.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux.repo': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ '9': {
|
||||
+ '/etc/yum.repos.d/almalinux-appstream.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-baseos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-crb.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-extras.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-highavailability.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-resilientstorage.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ # RT and NFV are only on x86_64 on almalinux 9
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': (ARCH_X86_64,),
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': (ARCH_X86_64,),
|
||||
+ },
|
||||
+ '10': {
|
||||
+ # no resilientstorage on 10
|
||||
+ '/etc/yum.repos.d/almalinux-appstream.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-baseos.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-crb.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-extras.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-highavailability.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-plus.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-sap.repo': ARCH_ACCEPTED,
|
||||
+ '/etc/yum.repos.d/almalinux-saphana.repo': ARCH_ACCEPTED,
|
||||
+ # RT and NFV are only on x86_64 on almalinux 10
|
||||
+ '/etc/yum.repos.d/almalinux-nfv.repo': (ARCH_X86_64,),
|
||||
+ '/etc/yum.repos.d/almalinux-rt.repo': (ARCH_X86_64,),
|
||||
+ },
|
||||
+ },
|
||||
+}
|
||||
+
|
||||
+
|
||||
+def _get_distro_repofiles(distro, major_version, arch):
|
||||
+ """
|
||||
+ Get distribution provided repofiles.
|
||||
+
|
||||
+ Note that this does not perform any validation, the caller must check
|
||||
+ whether the files exist.
|
||||
+
|
||||
+ :param distro: The distribution to get repofiles for.
|
||||
+ :type distro: str
|
||||
+ :param major_version: The major version to get repofiles for.
|
||||
+ :type major_version: str
|
||||
+ :param arch: The architecture to get repofiles for.
|
||||
+ :type arch: str
|
||||
+ :return: A list of paths to repofiles provided by distribution
|
||||
+ :rtype: list[str] or None if no repofiles are mapped for the arguments
|
||||
+ """
|
||||
+
|
||||
+ distro_repofiles = _DISTRO_REPOFILES_MAP.get(distro)
|
||||
+ if not distro_repofiles:
|
||||
+ return None
|
||||
+
|
||||
+ version_repofiles = distro_repofiles.get(major_version, {})
|
||||
+ if not version_repofiles:
|
||||
+ return None
|
||||
+
|
||||
+ return [repofile for repofile, archs in version_repofiles.items() if arch in archs]
|
||||
+
|
||||
+
|
||||
+def get_target_distro_repoids(context):
|
||||
+ """
|
||||
+ Get repoids defined in distro provided repofiles
|
||||
+
|
||||
+ See the generic :func:`_get_distro_repoids` for more details.
|
||||
+
|
||||
+ :param context: An instance of mounting.IsolatedActions class
|
||||
+ :type context: mounting.IsolatedActions
|
||||
+ :return: Repoids of distribution provided repositories
|
||||
+ :type: list[str]
|
||||
+ """
|
||||
+
|
||||
+ return get_distro_repoids(
|
||||
+ context,
|
||||
+ get_distro_id(),
|
||||
+ get_target_major_version(),
|
||||
+ api.current_actor().configuration.architecture
|
||||
+ )
|
||||
+
|
||||
+
|
||||
+def get_distro_repoids(context, distro, major_version, arch):
|
||||
+ """
|
||||
+ Get repoids defined in distro provided repofiles
|
||||
+
|
||||
+ On RHEL with RHSM this delegates to rhsm.get_available_repo_ids.
|
||||
+
|
||||
+ Repofiles installed by RHUI client packages are not covered by this
|
||||
+ function.
|
||||
+
|
||||
+ :param context: An instance of mounting.IsolatedActions class
|
||||
+ :type context: mounting.IsolatedActions
|
||||
+ :param distro: The distro whose repoids to return
|
||||
+ :type distro: str
|
||||
+ :param major_version: The major version to get distro repoids for.
|
||||
+ :type major_version: str
|
||||
+ :param arch: The architecture to get distro repoids for.
|
||||
+ :type arch: str
|
||||
+ :return: Repoids of distribution provided repositories
|
||||
+ :type: list[str]
|
||||
+ """
|
||||
+
|
||||
+ if distro == 'rhel':
|
||||
+ if rhsm.skip_rhsm():
|
||||
+ return []
|
||||
+ # Kept this todo here from the original code from
|
||||
+ # userspacegen._get_rh_available_repoids:
|
||||
+ # Get the RHSM repos available in the target RHEL container
|
||||
+ # TODO: very similar thing should happens for all other repofiles in container
|
||||
+ return rhsm.get_available_repo_ids(context)
|
||||
+
|
||||
+ repofiles = repofileutils.get_parsed_repofiles(context)
|
||||
+ distro_repofiles = _get_distro_repofiles(distro, major_version, arch)
|
||||
+ if not distro_repofiles:
|
||||
+ # TODO: a different way of signaling an error would be preferred (e.g. returning None),
|
||||
+ # but since rhsm.get_available_repo_ids also raises StopActorExecutionError,
|
||||
+ # let's make it easier for the caller for now and use it too
|
||||
+ raise StopActorExecutionError(
|
||||
+ "No known distro provided repofiles mapped",
|
||||
+ details={
|
||||
+ "details": "distro: {}, major version: {}, architecture: {}".format(
|
||||
+ distro, major_version, arch
|
||||
+ )
|
||||
+ },
|
||||
+ )
|
||||
+
|
||||
+ distro_repoids = []
|
||||
+ for rfile in repofiles:
|
||||
+ if rfile.file in distro_repofiles:
|
||||
+
|
||||
+ if not os.path.exists(context.full_path(rfile.file)):
|
||||
+ api.current_logger().debug(
|
||||
+ "Expected distribution provided repofile does not exists: {}".format(
|
||||
+ rfile
|
||||
+ )
|
||||
+ )
|
||||
+ continue
|
||||
+
|
||||
+ if rfile.data:
|
||||
+ distro_repoids.extend([repo.repoid for repo in rfile.data])
|
||||
+
|
||||
+ return sorted(distro_repoids)
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
new file mode 100644
|
||||
index 00000000..3a8f174f
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -0,0 +1,154 @@
|
||||
+import os
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.actors import StopActorExecutionError
|
||||
+from leapp.libraries.common import distro, repofileutils, rhsm
|
||||
+from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_ARM64, ARCH_PPC64LE, ARCH_S390X, ARCH_X86_64
|
||||
+from leapp.libraries.common.distro import _get_distro_repofiles, get_distro_repoids
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import RepositoryData, RepositoryFile
|
||||
+
|
||||
+_RHEL_REPOFILES = ['/etc/yum.repos.d/redhat.repo']
|
||||
+_CENTOS_REPOFILES = [
|
||||
+ "/etc/yum.repos.d/centos.repo", "/etc/yum.repos.d/centos-addons.repo"
|
||||
+]
|
||||
+
|
||||
+
|
||||
+def test_get_distro_repofiles(monkeypatch):
|
||||
+ """
|
||||
+ Test the functionality, not the data.
|
||||
+ """
|
||||
+ test_map = {
|
||||
+ 'distro1': {
|
||||
+ '8': {
|
||||
+ 'repofile1': ARCH_ACCEPTED,
|
||||
+ 'repofile2': [ARCH_X86_64],
|
||||
+ },
|
||||
+ '9': {
|
||||
+ 'repofile3': ARCH_ACCEPTED,
|
||||
+ },
|
||||
+ },
|
||||
+ 'distro2': {
|
||||
+ '8': {},
|
||||
+ '9': {
|
||||
+ 'repofile2': [ARCH_X86_64],
|
||||
+ 'repofile3': [ARCH_ARM64, ARCH_S390X, ARCH_PPC64LE],
|
||||
+ },
|
||||
+ },
|
||||
+ }
|
||||
+ monkeypatch.setattr(distro, '_DISTRO_REPOFILES_MAP', test_map)
|
||||
+
|
||||
+ # mix of all and specific arch
|
||||
+ repofiles = _get_distro_repofiles('distro1', '8', ARCH_X86_64)
|
||||
+ assert repofiles == ['repofile1', 'repofile2']
|
||||
+
|
||||
+ # match all but not x86_64
|
||||
+ repofiles = _get_distro_repofiles('distro1', '8', ARCH_ARM64)
|
||||
+ assert repofiles == ['repofile1']
|
||||
+
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_X86_64)
|
||||
+ assert repofiles == ['repofile2']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_ARM64)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_S390X)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+ repofiles = _get_distro_repofiles('distro2', '9', ARCH_PPC64LE)
|
||||
+ assert repofiles == ['repofile3']
|
||||
+
|
||||
+ # version not mapped
|
||||
+ repofiles = _get_distro_repofiles('distro2', '8', ARCH_X86_64)
|
||||
+ assert repofiles is None
|
||||
+
|
||||
+ # distro not mapped
|
||||
+ repofiles = _get_distro_repofiles('distro42', '8', ARCH_X86_64)
|
||||
+ assert repofiles is None
|
||||
+
|
||||
+
|
||||
+def _make_repo(repoid):
|
||||
+ return RepositoryData(repoid=repoid, name='name {}'.format(repoid))
|
||||
+
|
||||
+
|
||||
+def _make_repofile(rfile, data=None):
|
||||
+ if data is None:
|
||||
+ data = [_make_repo("{}-{}".format(rfile.split("/")[-1], i)) for i in range(3)]
|
||||
+ return RepositoryFile(file=rfile, data=data)
|
||||
+
|
||||
+
|
||||
+def _make_repofiles(rfiles):
|
||||
+ return [_make_repofile(rfile) for rfile in rfiles]
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('other_rfiles', [
|
||||
+ [],
|
||||
+ [_make_repofile("foo")],
|
||||
+ _make_repofiles(["foo", "bar"]),
|
||||
+])
|
||||
+@pytest.mark.parametrize(
|
||||
+ "distro_id,skip_rhsm,distro_rfiles",
|
||||
+ [
|
||||
+ ("rhel", True, []),
|
||||
+ ("rhel", True, _make_repofiles(_RHEL_REPOFILES)),
|
||||
+ ("rhel", False, _make_repofiles(_RHEL_REPOFILES)),
|
||||
+ ("centos", True, []),
|
||||
+ ("centos", True, _make_repofiles(_CENTOS_REPOFILES)),
|
||||
+ ]
|
||||
+)
|
||||
+def test_get_distro_repoids(
|
||||
+ monkeypatch, distro_id, skip_rhsm, distro_rfiles, other_rfiles
|
||||
+):
|
||||
+ """
|
||||
+ Tests that the correct repoids are returned
|
||||
+
|
||||
+ This is a little ugly because on RHEL the get_distro_repoids function still
|
||||
+ delegates to rhsm.get_available_repo_ids and also has different behavior
|
||||
+ with skip_rhsm
|
||||
+ """
|
||||
+ current_actor = CurrentActorMocked(release_id=distro_id if distro_id else 'rhel')
|
||||
+ monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
+ monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
+
|
||||
+ repofiles = other_rfiles
|
||||
+ if distro_rfiles:
|
||||
+ repofiles.extend(distro_rfiles)
|
||||
+ monkeypatch.setattr(repofileutils, 'get_parsed_repofiles', lambda x: repofiles)
|
||||
+
|
||||
+ distro_repoids = []
|
||||
+ for rfile in distro_rfiles:
|
||||
+ distro_repoids.extend([repo.repoid for repo in rfile.data] if rfile else [])
|
||||
+ distro_repoids.sort()
|
||||
+
|
||||
+ monkeypatch.setattr(rhsm, 'get_available_repo_ids', lambda _: distro_repoids)
|
||||
+ monkeypatch.setattr(os.path, 'exists', lambda f: f in _CENTOS_REPOFILES)
|
||||
+
|
||||
+ class MockedContext:
|
||||
+ def full_path(self, path):
|
||||
+ return path
|
||||
+
|
||||
+ repoids = get_distro_repoids(MockedContext(), distro_id, '9', 'x86_64')
|
||||
+
|
||||
+ if distro_id == 'rhel' and skip_rhsm:
|
||||
+ assert repoids == []
|
||||
+ else:
|
||||
+ assert sorted(repoids) == distro_repoids
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('other_rfiles', [
|
||||
+ [],
|
||||
+ [_make_repofile("foo")],
|
||||
+ _make_repofiles(["foo", "bar"]),
|
||||
+])
|
||||
+def test_get_distro_repoids_no_distro_repofiles(monkeypatch, other_rfiles):
|
||||
+ """
|
||||
+ Test that exception is thrown when there are no known distro provided repofiles.
|
||||
+ """
|
||||
+
|
||||
+ def mocked_get_distro_repofiles(*args):
|
||||
+ return []
|
||||
+
|
||||
+ monkeypatch.setattr(distro, '_get_distro_repofiles', mocked_get_distro_repofiles)
|
||||
+ monkeypatch.setattr(repofileutils, "get_parsed_repofiles", lambda x: other_rfiles)
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError):
|
||||
+ get_distro_repoids(None, 'somedistro', '8', 'x86_64')
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
From ae9a953dc111c0b14a8b86b3f0aee26cea1f08b4 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 1 Sep 2025 23:43:53 +0200
|
||||
Subject: [PATCH 18/55] lib/distro: Add tests for existing
|
||||
get_distribution_data() function
|
||||
|
||||
---
|
||||
.../common/libraries/tests/test_distro.py | 47 ++++++++++++++++++-
|
||||
1 file changed, 46 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
index 3a8f174f..8e866455 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -1,3 +1,4 @@
|
||||
+import json
|
||||
import os
|
||||
|
||||
import pytest
|
||||
@@ -5,7 +6,7 @@ import pytest
|
||||
from leapp.actors import StopActorExecutionError
|
||||
from leapp.libraries.common import distro, repofileutils, rhsm
|
||||
from leapp.libraries.common.config.architecture import ARCH_ACCEPTED, ARCH_ARM64, ARCH_PPC64LE, ARCH_S390X, ARCH_X86_64
|
||||
-from leapp.libraries.common.distro import _get_distro_repofiles, get_distro_repoids
|
||||
+from leapp.libraries.common.distro import _get_distro_repofiles, get_distribution_data, get_distro_repoids
|
||||
from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import RepositoryData, RepositoryFile
|
||||
@@ -15,6 +16,50 @@ _CENTOS_REPOFILES = [
|
||||
"/etc/yum.repos.d/centos.repo", "/etc/yum.repos.d/centos-addons.repo"
|
||||
]
|
||||
|
||||
+_CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('distro', ['rhel', 'centos'])
|
||||
+def test_get_distribution_data(monkeypatch, distro):
|
||||
+ common_path = os.path.join(_CUR_DIR, "../../files/", 'distro')
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "get_common_folder_path",
|
||||
+ lambda folder: common_path
|
||||
+ )
|
||||
+ data_path = os.path.join(common_path, distro, "gpg-signatures.json")
|
||||
+
|
||||
+ def exists_mocked(path):
|
||||
+ assert path == data_path
|
||||
+ return True
|
||||
+
|
||||
+ monkeypatch.setattr(os.path, 'exists', exists_mocked)
|
||||
+ ret = get_distribution_data(distro)
|
||||
+
|
||||
+ with open(data_path) as fp:
|
||||
+ assert ret == json.load(fp)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('distro', ['rhel', 'centos'])
|
||||
+def test_get_distribution_data_not_exists(monkeypatch, distro):
|
||||
+ common_path = os.path.join(_CUR_DIR, "../../files/", 'distro')
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "get_common_folder_path",
|
||||
+ lambda folder: common_path
|
||||
+ )
|
||||
+ data_path = os.path.join(common_path, distro, "gpg-signatures.json")
|
||||
+
|
||||
+ def exists_mocked(path):
|
||||
+ assert path == data_path
|
||||
+ return False
|
||||
+
|
||||
+ monkeypatch.setattr(os.path, 'exists', exists_mocked)
|
||||
+
|
||||
+ with pytest.raises(StopActorExecutionError) as err:
|
||||
+ get_distribution_data(distro)
|
||||
+ assert 'Cannot find distribution signature configuration.' in err
|
||||
+
|
||||
|
||||
def test_get_distro_repofiles(monkeypatch):
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
152
SOURCES/0019-Disable-RHSM-tests.patch
Normal file
152
SOURCES/0019-Disable-RHSM-tests.patch
Normal file
@ -0,0 +1,152 @@
|
||||
From e749dbc430099ac0d0cb06fb9dff4ec458d359b3 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Diblik <ddiblik@redhat.com>
|
||||
Date: Fri, 10 Oct 2025 16:51:34 +0200
|
||||
Subject: [PATCH 19/55] Disable RHSM tests
|
||||
|
||||
Signed-off-by: Daniel Diblik <ddiblik@redhat.com>
|
||||
---
|
||||
.packit.yaml | 30 +++++++++++++++---------------
|
||||
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 607dff93..3d1cd7ff 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -155,7 +155,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -209,7 +209,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -232,7 +232,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -258,7 +258,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -284,7 +284,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -306,7 +306,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -332,7 +332,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -358,7 +358,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -434,7 +434,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:9to10 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -463,7 +463,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -489,7 +489,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -514,7 +514,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:9to10 & tag:tier0 & enabled:true'
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -543,7 +543,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
@@ -572,7 +572,7 @@ jobs:
|
||||
tf_extra_params:
|
||||
test:
|
||||
tmt:
|
||||
- plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
context:
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
462
SOURCES/0020-Update-packit-config.patch
Normal file
462
SOURCES/0020-Update-packit-config.patch
Normal file
@ -0,0 +1,462 @@
|
||||
From 6a38e8a3373bdc41a04538a090531ba0ccf8fa96 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 14 Oct 2025 15:11:02 +0200
|
||||
Subject: [PATCH 20/55] Update packit config
|
||||
|
||||
Introduce refactor of labels and introduce 8.10 -> 9.6 AWS tests.
|
||||
---
|
||||
.packit.yaml | 285 ++++++++++++++++++++++++++-------------------------
|
||||
1 file changed, 143 insertions(+), 142 deletions(-)
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 3d1cd7ff..720d07a7 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -104,6 +104,8 @@ jobs:
|
||||
# is the last RHEL 8 release and all new future tests will start from this
|
||||
# one release.
|
||||
|
||||
+# This job is never triggered - we define abstract anchor that are reused in jobs that 'inherit'
|
||||
+# and have actionable triggers
|
||||
- &sanity-abstract-8to9
|
||||
job: tests
|
||||
trigger: ignore
|
||||
@@ -116,6 +118,47 @@ jobs:
|
||||
epel-8-x86_64:
|
||||
distros: [RHEL-8.10.0-Nightly]
|
||||
identifier: sanity-abstract-8to9
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9'
|
||||
+ environments:
|
||||
+ - &tmt-env-settings-810to94
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to94
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.4"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to96
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to96
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.6"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to97
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to97
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.7"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-810to98
|
||||
+ tmt:
|
||||
+ context: &tmt-context-810to98
|
||||
+ distro: "rhel-8.10"
|
||||
+ distro_target: "rhel-9.8"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
- &sanity-abstract-8to9-aws
|
||||
<<: *sanity-abstract-8to9
|
||||
@@ -147,7 +190,10 @@ jobs:
|
||||
# ######################### Individual tests ########################### #
|
||||
# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.4
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.4 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
- &sanity-810to94
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -157,15 +203,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to94
|
||||
+ env: &env-810to94
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.4"
|
||||
LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
@@ -184,18 +223,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to94
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.4"
|
||||
- LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
+ <<: *env-810to94
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to94
|
||||
@@ -212,19 +242,19 @@ jobs:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.4"
|
||||
+ context: *tmt-context-810to94
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.4"
|
||||
- LEAPP_TARGET_PRODUCT_CHANNEL: "EUS"
|
||||
+ <<: *env-810to94
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.6 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.6
|
||||
- &sanity-810to96
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -234,15 +264,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to96
|
||||
+ env: &env-810to96
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.6"
|
||||
|
||||
@@ -260,17 +283,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to96
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.6"
|
||||
+ <<: *env-810to96
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to96
|
||||
@@ -285,20 +300,37 @@ jobs:
|
||||
test:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to96
|
||||
+ env:
|
||||
+ <<: *env-810to96
|
||||
+
|
||||
+- &sanity-810to96-aws
|
||||
+ <<: *sanity-abstract-8to9-aws
|
||||
+ trigger: pull_request
|
||||
+ targets:
|
||||
+ epel-8-x86_64:
|
||||
+ distros: [RHEL-8.10-rhui]
|
||||
+ identifier: sanity-8.10to9.6-aws
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:rhui-aws-tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.6"
|
||||
+ context: *tmt-context-810to96
|
||||
settings:
|
||||
provisioning:
|
||||
tags:
|
||||
BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.6"
|
||||
+ <<: *env-810to96
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.7 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 8.10 -> 9.7
|
||||
- &sanity-810to97
|
||||
<<: *sanity-abstract-8to9
|
||||
trigger: pull_request
|
||||
@@ -308,15 +340,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-810to97
|
||||
+ env: &env-810to97
|
||||
SOURCE_RELEASE: "8.10"
|
||||
TARGET_RELEASE: "9.7"
|
||||
|
||||
@@ -334,17 +359,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to97
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.7"
|
||||
+ <<: *env-810to97
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-810to97
|
||||
@@ -360,17 +377,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-8.10"
|
||||
- distro_target: "rhel-9.7"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-810to97
|
||||
env:
|
||||
- SOURCE_RELEASE: "8.10"
|
||||
- TARGET_RELEASE: "9.7"
|
||||
+ <<: *env-810to97
|
||||
|
||||
# ###################################################################### #
|
||||
# ############################## 9 TO 10 ################################ #
|
||||
@@ -392,6 +401,38 @@ jobs:
|
||||
epel-9-x86_64:
|
||||
distros: [RHEL-9.6.0-Nightly]
|
||||
identifier: sanity-abstract-9to10
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:9to10'
|
||||
+ environments:
|
||||
+ - &tmt-env-settings-96to100
|
||||
+ tmt:
|
||||
+ context: &tmt-context-96to100
|
||||
+ distro: "rhel-9.6"
|
||||
+ distro_target: "rhel-10.0"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-97to101
|
||||
+ tmt:
|
||||
+ context: &tmt-context-97to101
|
||||
+ distro: "rhel-9.7"
|
||||
+ distro_target: "rhel-10.1"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - &tmt-env-settings-98to102
|
||||
+ tmt:
|
||||
+ context: &tmt-context-98to102
|
||||
+ distro: "rhel-9.8"
|
||||
+ distro_target: "rhel-10.2"
|
||||
+ settings:
|
||||
+ provisioning:
|
||||
+ tags:
|
||||
+ BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
|
||||
- &sanity-abstract-9to10-aws
|
||||
<<: *sanity-abstract-9to10
|
||||
@@ -423,7 +464,10 @@ jobs:
|
||||
# ######################### Individual tests ########################### #
|
||||
# ###################################################################### #
|
||||
|
||||
-# Tests: 9.6 -> 10.0
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.6 > 10.0 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
- &sanity-96to100
|
||||
<<: *sanity-abstract-9to10
|
||||
trigger: pull_request
|
||||
@@ -436,15 +480,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-96to100
|
||||
+ env: &env-96to100
|
||||
SOURCE_RELEASE: "9.6"
|
||||
TARGET_RELEASE: "10.0"
|
||||
|
||||
@@ -465,17 +502,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-96to100
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.6"
|
||||
- TARGET_RELEASE: "10.0"
|
||||
+ <<: *env-96to100
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-96to100
|
||||
@@ -491,19 +520,14 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.6"
|
||||
- distro_target: "rhel-10.0"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-96to100
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.6"
|
||||
- TARGET_RELEASE: "10.0"
|
||||
+ <<: *env-96to100
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.7 > 10.1 ############################# #
|
||||
+# ###################################################################### #
|
||||
|
||||
-# Tests: 9.7 -> 10.1
|
||||
- &sanity-97to101
|
||||
<<: *sanity-abstract-9to10
|
||||
trigger: pull_request
|
||||
@@ -516,15 +540,8 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
- env:
|
||||
+ - *tmt-env-settings-97to101
|
||||
+ env: &env-97to101
|
||||
SOURCE_RELEASE: "9.7"
|
||||
TARGET_RELEASE: "10.1"
|
||||
|
||||
@@ -545,17 +562,9 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-97to101
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.7"
|
||||
- TARGET_RELEASE: "10.1"
|
||||
+ <<: *env-97to101
|
||||
|
||||
# On-demand kernel-rt tests
|
||||
- &kernel-rt-97to101
|
||||
@@ -574,14 +583,6 @@ jobs:
|
||||
tmt:
|
||||
plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
environments:
|
||||
- - tmt:
|
||||
- context:
|
||||
- distro: "rhel-9.7"
|
||||
- distro_target: "rhel-10.1"
|
||||
- settings:
|
||||
- provisioning:
|
||||
- tags:
|
||||
- BusinessUnit: sst_upgrades@leapp_upstream_test
|
||||
+ - *tmt-env-settings-97to101
|
||||
env:
|
||||
- SOURCE_RELEASE: "9.7"
|
||||
- TARGET_RELEASE: "10.1"
|
||||
+ <<: *env-97to101
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,880 @@
|
||||
From 06afa61c2508f18937244787440c709c5ee0a285 Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Tue, 14 Oct 2025 15:56:11 +0200
|
||||
Subject: [PATCH 21/55] Update upgrade paths: 8.10 -> 9.8 -> 10.2 with
|
||||
certificates
|
||||
|
||||
Jira: RHEL-108025
|
||||
---
|
||||
.packit.yaml | 119 ++++++++++++++++++
|
||||
.../common/files/prod-certs/10.2/279.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/362.pem | 36 ++++++
|
||||
.../common/files/prod-certs/10.2/363.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/419.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/433.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/479.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/486.pem | 35 ++++++
|
||||
.../common/files/prod-certs/10.2/72.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/279.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/362.pem | 36 ++++++
|
||||
.../common/files/prod-certs/9.8/363.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/419.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/433.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/479.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/486.pem | 35 ++++++
|
||||
.../common/files/prod-certs/9.8/72.pem | 35 ++++++
|
||||
.../common/files/upgrade_paths.json | 10 +-
|
||||
18 files changed, 687 insertions(+), 4 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
create mode 100644 repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
|
||||
diff --git a/.packit.yaml b/.packit.yaml
|
||||
index 720d07a7..0c3f682a 100644
|
||||
--- a/.packit.yaml
|
||||
+++ b/.packit.yaml
|
||||
@@ -381,6 +381,60 @@ jobs:
|
||||
env:
|
||||
<<: *env-810to97
|
||||
|
||||
+# ###################################################################### #
|
||||
+# ############################# 8.10 > 9.8 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+- &sanity-810to98
|
||||
+ <<: *sanity-abstract-8to9
|
||||
+ trigger: pull_request
|
||||
+ identifier: sanity-8.10to9.8
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:tier0 & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env: &env-810to98
|
||||
+ SOURCE_RELEASE: "8.10"
|
||||
+ TARGET_RELEASE: "9.8"
|
||||
+
|
||||
+# On-demand minimal beaker tests
|
||||
+- &beaker-minimal-810to98
|
||||
+ <<: *beaker-minimal-8to9-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - beaker-minimal
|
||||
+ - beaker-minimal-8.10to9.8
|
||||
+ - 8.10to9.8
|
||||
+ identifier: sanity-8.10to9.8-beaker-minimal-ondemand
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env:
|
||||
+ <<: *env-810to98
|
||||
+
|
||||
+# On-demand kernel-rt tests
|
||||
+- &kernel-rt-810to98
|
||||
+ <<: *kernel-rt-abstract-8to9-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - kernel-rt
|
||||
+ - kernel-rt-8.10to9.8
|
||||
+ - 8.10to9.8
|
||||
+ identifier: sanity-8.10to9.8-kernel-rt-ondemand
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-810to98
|
||||
+ env:
|
||||
+ <<: *env-810to98
|
||||
+
|
||||
# ###################################################################### #
|
||||
# ############################## 9 TO 10 ################################ #
|
||||
# ###################################################################### #
|
||||
@@ -586,3 +640,68 @@ jobs:
|
||||
- *tmt-env-settings-97to101
|
||||
env:
|
||||
<<: *env-97to101
|
||||
+
|
||||
+
|
||||
+# ###################################################################### #
|
||||
+# ############################# 9.8 > 10.2 ############################# #
|
||||
+# ###################################################################### #
|
||||
+
|
||||
+- &sanity-98to102
|
||||
+ <<: *sanity-abstract-9to10
|
||||
+ trigger: pull_request
|
||||
+ identifier: sanity-9.8to10.2
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8.0-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:9to10 & tag:tier0 & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env: &env-98to102
|
||||
+ SOURCE_RELEASE: "9.8"
|
||||
+ TARGET_RELEASE: "10.2"
|
||||
+
|
||||
+# On-demand minimal beaker tests
|
||||
+- &beaker-minimal-98to102
|
||||
+ <<: *beaker-minimal-9to10-abstract-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - beaker-minimal
|
||||
+ - beaker-minimal-9.8to10.2
|
||||
+ - 9.8to10.2
|
||||
+ identifier: sanity-9.8to10.2-beaker-minimal-ondemand
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:partitioning & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env:
|
||||
+ <<: *env-98to102
|
||||
+
|
||||
+# On-demand kernel-rt tests
|
||||
+- &kernel-rt-98to102
|
||||
+ <<: *kernel-rt-abstract-9to10-ondemand
|
||||
+ trigger: pull_request
|
||||
+ labels:
|
||||
+ - kernel-rt
|
||||
+ - kernel-rt-9.8to10.2
|
||||
+ - 9.8to10.2
|
||||
+ identifier: sanity-9.8to10.2-kernel-rt-ondemand
|
||||
+ targets:
|
||||
+ epel-9-x86_64:
|
||||
+ distros: [RHEL-9.8-Nightly]
|
||||
+ tf_extra_params:
|
||||
+ test:
|
||||
+ tmt:
|
||||
+ plan_filter: 'tag:8to9 & tag:kernel-rt & enabled:true & tag:-rhsm'
|
||||
+ environments:
|
||||
+ - *tmt-env-settings-98to102
|
||||
+ env:
|
||||
+ <<: *env-98to102
|
||||
+
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/279.pem b/repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
new file mode 100644
|
||||
index 00000000..76336f82
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/279.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKDCCBBCgAwIBAgIJALDxRLt/tVBkMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsyOWJlMDI0
|
||||
+My03NGU1LTRiNDctYjEwNy1iZjhkNjRjYmNjNDhdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsTCBrjAJBgNVHRMEAjAAMEMGDCsGAQQBkggJAYIXAQQzDDFSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuMBYGDCsG
|
||||
+AQQBkggJAYIXAgQGDAQxMC4yMBkGDCsGAQQBkggJAYIXAwQJDAdwcGM2NGxlMCkG
|
||||
+DCsGAQQBkggJAYIXBAQZDBdyaGVsLTEwLHJoZWwtMTAtcHBjNjRsZTANBgkqhkiG
|
||||
+9w0BAQsFAAOCAgEAGouNVN3DdCE2cqv3lKMNC3jit5mHi7QQt7fqN/KX4fQfArb6
|
||||
+IQ9M0GaGJM8W9rj+9s+Q9LOFjys24Pcdb9qbQWpfwvn9FY60uQw3TIXAerJaVb98
|
||||
+doxrFHjVptm0/VX2xnOa/dY97dmMT4Amwe5+y4RYlMEsYqY8dpJkVuKNdGtCg+Uf
|
||||
+f9hb6XjDqRevADgskHNprXrjF65Ib3a92qJRfttnVUfqqeDkTPntIPbau9hZwLeR
|
||||
+oMl8pn4kMIYLz1IolSAC8yBFe9sLxllGu8qIFqH4Efzx8BOtHkPUH/VqtgvUej+j
|
||||
+boJ0EEpwYjvYbz00mZmJHFNkUheW6cDUPWmMoTzYibPzRTrBcAIfvybpeuPjFGfl
|
||||
+gYZa/DpEG68hlEnSxB4TNpVCx9qfiqXvNcukmeX3Jr7DS1uC2ePBFDQKewx6WdAa
|
||||
+bAmuANmBUB+NX1WMuNTfxxIzxfIoShaChiFRVjsRTkLo1ZPuMkvXOXYfyfW1PKQN
|
||||
+PXHEdY9wprn8ZY2qhMwmE1sDdndNpSxB3boI9FQBUVDzbSG6KwbPfSdmrte+Wdrh
|
||||
+QCIGU+0x7ulF68yOkMkz1spPNgrTXt0efaCSWqUK0nqv1s1Gh2Q6iJaE0yETpSG7
|
||||
+hFeHpENftckpmuKcJM0v/uBBeIX7X8plrL7Fkm4ND/e61tEiDwvnhxGhtBE=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/362.pem b/repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
new file mode 100644
|
||||
index 00000000..ebeb065c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/362.pem
|
||||
@@ -0,0 +1,36 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGNzCCBB+gAwIBAgIJALDxRLt/tVBTMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFthMmU1N2Ix
|
||||
+MS03ZDBiLTRiNGYtOGE5ZC03MmRkNGM2NDA2NzJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBwDCBvTAJBgNVHRMEAjAAMEgGDCsGAQQBkggJAYJqAQQ4DDZSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuIEJldGEw
|
||||
+GwYMKwYBBAGSCAkBgmoCBAsMCTEwLjIgQmV0YTAZBgwrBgEEAZIICQGCagMECQwH
|
||||
+cHBjNjRsZTAuBgwrBgEEAZIICQGCagQEHgwccmhlbC0xMCxyaGVsLTEwLWJldGEt
|
||||
+cHBjNjRsZTANBgkqhkiG9w0BAQsFAAOCAgEAgQC6qqfeW79hSj2S+OfBT5ccNNZa
|
||||
+8blVYtVJU5iTfhX29VQTdGus/ROWGqfgDe8MMOCJyt0eNeqGO70KRJsT3pGeeKcM
|
||||
+UbDfdqzopgD7+/6IL1c1fw/8HijOorW+CMAzeOBdnjMwRjhZxcDlFSqxNCWtngnp
|
||||
+XlDMIlUR3m0rlBwzNfUMk7KYPUESmyEiBWMSKmqRDeiUg3BSP6Ci0x3Ufnf0xTBv
|
||||
+VPVKO/h3ta3+pAYzeFy/ageJ/sR9tLRZQZXzvxYvIY+8/EehafPJCHDHH3uCTpdZ
|
||||
+JAeXDLf2QcOBZnl8uONdev+KaE1JFRCRmqwhliUsARv/t24CY+UBoEzzaj/py2bR
|
||||
+RQqfE5WI1JSdj6HoQ6YHbtR6SF+UedfvMQoSF4zPiXAPNebiIiLkc1rtb/ycUi1f
|
||||
+bUjkRfgRqlDwUcgfHrKhSDp5/XhjgxVXiESNcDe2ltKvVr09qAaPBarLolWeIXkN
|
||||
+n2csdFxyiDZIhk6tFL8lUtpmXWpeEn/iBPwaiBIYoBnIbaqN4OZngwfi2QtTdl+s
|
||||
+9iCuYgbGQiEZnV3g7HLsYXrAagPuJxXs0FMYJZ8x6biREgUQATwTzZMQ8vWRMmYY
|
||||
+kteQBaOCDzNpb8OUgbPxgncl9kgr4NIBn+5oGeMitb+I1XvWqoCFsA7Uii6oygdk
|
||||
+iE+YZEA6e/4057M=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/363.pem b/repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
new file mode 100644
|
||||
index 00000000..865fbda6
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/363.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKTCCBBGgAwIBAgIJALDxRLt/tVBSMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0NjJhNDRj
|
||||
+ZC1jNWUzLTQzZGItYTExNy0zZjA5ZGU1ZDRmMzNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsjCBrzAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYJrAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NCBCZXRhMBsGDCsGAQQBkggJAYJr
|
||||
+AgQLDAkxMC4yIEJldGEwGQYMKwYBBAGSCAkBgmsDBAkMB2FhcmNoNjQwLgYMKwYB
|
||||
+BAGSCAkBgmsEBB4MHHJoZWwtMTAscmhlbC0xMC1iZXRhLWFhcmNoNjQwDQYJKoZI
|
||||
+hvcNAQELBQADggIBAC/KEEZ85rdWnL/CK9q3uT/d4reNZc1WD5oWYcpj+J31u4sw
|
||||
+pjAvmq/eA6DmzqGjhfEGhwu5MDbVg77OAPCcfm7qqGSDcnjqnO3ZogDjyzat1WS5
|
||||
+J2uuRcPbF6DIk/LkgIc/FgvSFG8Vc93hM+P56wTzTbnPYSRyJq3BBm8ZjSiFO5jq
|
||||
+V9WOganzxsVKzifTK8RoSdWLyB0JpvL/LZKa4G97ahUctYVilhJBHCgd+uT6/IVn
|
||||
+ppETnw4xo6SXg0+O+fC1P+90+GZrWWzeHeHnEgmZ8B+RTDQbx/KHQHU4UhqU5qnT
|
||||
+6VngqL1453IxmlxVxwKlkwzV4SYrQnmEZPvugMhlenbx0T9pJvwg/xvWYJJTGjUy
|
||||
+1l9p0LtyUHmFJxtbq50++oooUdDtQ6RDD5jtxnvWMF5PFLYGxf6gXFFCJVSgwonP
|
||||
+BtqoBH2PWp8/nwumAOquzks41m+bqzaMALhp0GUGTKKTITrM4gsLVHqKh2WTCOPs
|
||||
+s6mdXOyVma/o5Jri8Ec12/HGyIRlQQleb6vcC68PK3X088LZi/zENi2Bq31W5Hip
|
||||
+R03YxVzmjZA3kJsA8Vim4zaG7e6puLGuXmQLawN7oScBFlvVLvZD2ycZsYLOesCz
|
||||
+VSxJkmqDMb6To9RRbSmN0csPFKWNkdD8D5iBei4IaGWXyOB3GGJJ2ME/Qv65
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/419.pem b/repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
new file mode 100644
|
||||
index 00000000..42986ccc
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/419.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGjCCBAKgAwIBAgIJALDxRLt/tVBjMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0MjIwNzhj
|
||||
+OS1mY2MzLTQwMWQtOGM2Yi0yZGUwNWRmZGEyN2NdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBozCBoDAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYMjAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NDAWBgwrBgEEAZIICQGDIwIEBgwE
|
||||
+MTAuMjAZBgwrBgEEAZIICQGDIwMECQwHYWFyY2g2NDApBgwrBgEEAZIICQGDIwQE
|
||||
+GQwXcmhlbC0xMCxyaGVsLTEwLWFhcmNoNjQwDQYJKoZIhvcNAQELBQADggIBAAvn
|
||||
+gY6rJIku70uFkod9Xc45wNgPNMkim2p+dCOQXl5GG7rSLqBp/e6MhBOu+VfvXddF
|
||||
+zEndO84pb7Evc3PjjtnBietvvcmcoJjMTrGF2oKcJWJP+x/SKMzN2qPPoQu4QoZj
|
||||
+OTuaemuHLCkA9cnvRj2qxW9ZpINmr6H72jCHPoYGWD8Omupnctyt3/uu/MG7KT4y
|
||||
+8B5hXLmFeuF1vgOkKnoqjZRgZ86xsJ4dig/vLWkAKdsWPlRlV0SICwgVALqFmTge
|
||||
+Hgrz0A6F2BM7f0vYNFUTRv0qQwHR7EA/jEHCQByNc73cvDtHZFyODTqvEBoLFVOw
|
||||
+2fad9K5EID1GKj9U1NGYAlAvEpbrgs2Xd2ugFyN5mtbSLon+VeXm5q9fB/Ca0j7z
|
||||
+vvfdoKsd89R822m2Y+HB0eei63zGE6Ykr4aaTQNjQyTu5K8pUNG/y5UGWIpSM1IR
|
||||
+YqOsdJvCyavBlQ98K7OfL9yqOiZFXB9VkmXPPiT1ljNgpYzK63ZWidjXkpG2I7g1
|
||||
+YoCIT0JE5xX6x2U5Ia79OFug/g9SwQn6izVYrLCgqqNqeld0WokeFBPnyZkXSYt1
|
||||
+pzY4HAjXjaDGbF1O4SmoCTtagB2vNmi1wUPazizA5SESifVcYfPeaWRk10PJT9MR
|
||||
+p3EFR/BSg/hvmehuGSEfRNFV8g9Deo3EN1LHEhTY
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/433.pem b/repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
new file mode 100644
|
||||
index 00000000..932dbf7a
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/433.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGLDCCBBSgAwIBAgIJALDxRLt/tVBUMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsxNzhhMzJi
|
||||
+NC0xZWNjLTRmZDEtOTA2NS0wMGZkMjQzZDEzYzBdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBtTCBsjAJBgNVHRMEAjAAMEEGDCsGAQQBkggJAYMxAQQxDC9SZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIElCTSB6IFN5c3RlbXMgQmV0YTAbBgwrBgEE
|
||||
+AZIICQGDMQIECwwJMTAuMiBCZXRhMBcGDCsGAQQBkggJAYMxAwQHDAVzMzkweDAs
|
||||
+BgwrBgEEAZIICQGDMQQEHAwacmhlbC0xMCxyaGVsLTEwLWJldGEtczM5MHgwDQYJ
|
||||
+KoZIhvcNAQELBQADggIBAAUwQwSc0A1Q5SiC7N5xSS1ZegZQT1hER7SRDs5p6drK
|
||||
+Riayu5bER7kpQnJc/ww1/iTmHHH/H180pSP+EZEPqCLumqYmf1vW60SAR4BMklyh
|
||||
+QuYqVkJCxA7uloA59cLZcPnEu+xHLfnhSQdTIXhi1uLK960mEIiexCT8xMkQ5E5A
|
||||
+ZUajyEhdLp4ca8K+nUWzSzYQBpGYpkiQtniLZ/i4kzaYTfHpFGJNQQCrPlB2lMCa
|
||||
+vZKseaPlFzExXfq5MJ5IX1lc2RNqeaf22p49Bia6CgVLMagsFnAr909zZ9NAaZWV
|
||||
+kYqjLVMJ5EY25OJS21So0fI//lOsRVBxlfqOS7v9hYBnuLhPuiIiHEaNcQyNBI/7
|
||||
+DgT5xCmL8IDzvsBJLZ/AqolO1fo5lSVOZ5PCbwIZj7bBZJwf8gTSUu2cuhbN2Gxi
|
||||
+s7R2QFVco+AAPcuoWOISG4cKwX4wDUR+rHqQMCKJM6mQGlnB2OXBwZX1fYo7k82d
|
||||
+b7BygRhEML6INaweUe2Do7v8phz6TXM2lFJCQYnja2lO6GxSlaXgRNb4Rnc6ty79
|
||||
+O5S6K2g3uEc4Uc8F7echBFAudl9KQqu9il9cb3f0fI+kYX2j9ib4isdF8qIusZVp
|
||||
+F191fHyl1Y6pp4eWKA48uO8Op8uO320UIX8HQnNGi74eEOvCqvZtfKZE5+Za/YT+
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/479.pem b/repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
new file mode 100644
|
||||
index 00000000..2c4b8db2
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/479.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGDCCBACgAwIBAgIJALDxRLt/tVBmMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs5OTUxYjVm
|
||||
+NC0yZTE4LTQ1OGEtYTc4ZC05NGNkZDhkN2I1ZWVdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBoTCBnjAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYNfAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NDAWBgwrBgEEAZIICQGDXwIEBgwE
|
||||
+MTAuMjAYBgwrBgEEAZIICQGDXwMECAwGeDg2XzY0MCgGDCsGAQQBkggJAYNfBAQY
|
||||
+DBZyaGVsLTEwLHJoZWwtMTAteDg2XzY0MA0GCSqGSIb3DQEBCwUAA4ICAQDUoyHm
|
||||
+MM07NncLVGO9xO6qa3cxy8NyJO95LScKCAzlx3dHrgW+v1CcxZEzMsV6Rtpch0kH
|
||||
+De61DOCn50JgQ6s7e6Cxk6nMovcxYMi5q4JxYoIlCFTbeRRGdTQv8SmndmSd7rh2
|
||||
+6mDUWoDxbw1fpeNxiWAOq8IQXrcmrEnVIpOQP4Fc+yNw/Sdsqz23o9VBlP0yBJ4W
|
||||
+a6zGCwRzcisLsNOc+8mRtuirG11Zqm07V0xt2YVXlV13Wu/Dy0qKW49tPJD8WceO
|
||||
+hCC/alSRh1s4YV50gVlA0IRyyezAwU/0Al+lMKfMeqqedg81QGMBiy6qzDjXllcK
|
||||
+XfKYsWC2egkofpvxb5jVU0EXdl0kE+RGQfK3fVq09YwNim41n9qgJTlA1vIBrq8o
|
||||
+1NMwyrbQdfndyGZLSpzWxLHpYUCe2lJomgJTNvrA6+xTnlpfEPOn2zDUxJ7CSfoQ
|
||||
+ZkPhdO4UsrvJOPLt5oY5R5Q6tXLVR7xL24WeUw5FXtzFMibOaE3kT9ib0o8zluMS
|
||||
+ly290tfnl8Wq7fgjFT8mt0NIH/rXC4COBw87EjLbhxUCbEHnbJiOj+JT2QRxKjWg
|
||||
+9icCBbU5TEY0V8rC+vx54JCcx8NGaJDDKDmv6tgEOA0u9YEpGw44fk6RxqeNaysW
|
||||
+glkF2dUoSBDKWSqiroYrjEgaFWvdSaalOSJQuA==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/486.pem b/repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
new file mode 100644
|
||||
index 00000000..181b7a98
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/486.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJzCCBA+gAwIBAgIJALDxRLt/tVBVMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQzMVoXDTQ1MDcw
|
||||
+ODExMjQzMVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs2OWQ5ZGY5
|
||||
+Yy1mMGFmLTRjY2UtYTRhMi0zZDA4MDM1YjJmYjFdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsDCBrTAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYNmAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NCBCZXRhMBsGDCsGAQQBkggJAYNm
|
||||
+AgQLDAkxMC4yIEJldGEwGAYMKwYBBAGSCAkBg2YDBAgMBng4Nl82NDAtBgwrBgEE
|
||||
+AZIICQGDZgQEHQwbcmhlbC0xMCxyaGVsLTEwLWJldGEteDg2XzY0MA0GCSqGSIb3
|
||||
+DQEBCwUAA4ICAQA00Q5BALEU5y1CJwF7ru1xNujrtjZvwOdXeNl+esZIqlZQqITP
|
||||
+Rr6Xww0/mcMcvqEHu/PlJ2xyWC8VYrhZ+/LC6EtTbPEKSDEAHE914MU934pC02tP
|
||||
+QE+a7BKsHPGhh4SyvMrZ0vWoxnwcug5g8V5uXNOQYSgnOAHdNQxMeMh8LCHO76np
|
||||
+fjWL7en5dUMWHOB9W1kyZO87f2WBGhFrTyNnFTcg99G/MNMkMD5rLc+Qg8GhY1Zt
|
||||
+8+AN4c5HprFI1cUz8/4osj2ZBW1xxH+mcps2oy3L8UNFceiAdewVpTmwlBN0HEUk
|
||||
+3+NB64+QXLf13EowJnAunJrVms+bQbB1Y2zOL1ymiCLF6iQu4mIdEP2yqzk7lowa
|
||||
+RmuxEOI/S279n+YtilUuWKoeaLcGqPd0rPS5B01M049+KXW0Vv/6OOakA0rltB76
|
||||
++RBeE4UTnPCOIBfyVCHdoCTDFaI5GavVZGTr1bLQR9FdIRzQs+nx3VUYf6o2ZHOW
|
||||
+R1I794GHADaLwNfD5b5oo1XwIkuDxcvrF5kFlhnI3X9cVFDhk6uvMTzKEHPsdoYY
|
||||
+Oe2PdTNfyaiAZs5RzE7If+DAK1zCHrO3GHN4tRyQEwG5p/1F91iw2/Kj67zosH38
|
||||
+Wvm4FSL0ENRPIIUt+p0zT4FBPXOr4YwQGBn0PuaIob5mymAdbUI6Q3CHqA==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/10.2/72.pem b/repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
new file mode 100644
|
||||
index 00000000..3d15c146
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/10.2/72.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGGTCCBAGgAwIBAgIJALDxRLt/tVBlMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjQ0NloXDTQ1MDcw
|
||||
+ODExMjQ0NlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtmM2M4ZTQ0
|
||||
+OC1lYmY4LTQxN2MtOTI5My01ZmE5NjU2YTI4YjJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBojCBnzAJBgNVHRMEAjAAMDsGCysGAQQBkggJAUgBBCwMKlJlZCBIYXQg
|
||||
+RW50ZXJwcmlzZSBMaW51eCBmb3IgSUJNIHogU3lzdGVtczAVBgsrBgEEAZIICQFI
|
||||
+AgQGDAQxMC4yMBYGCysGAQQBkggJAUgDBAcMBXMzOTB4MCYGCysGAQQBkggJAUgE
|
||||
+BBcMFXJoZWwtMTAscmhlbC0xMC1zMzkweDANBgkqhkiG9w0BAQsFAAOCAgEAMT/B
|
||||
+VjMEkJIvwAShBe9XhWj1lNvd58VQNaet8eMebCOy2CN32v50zquH9QgQH4Sf/aBm
|
||||
+X8HfQWl23zAQApCjMr2Sawmjmy05Oj7UGghkbANDvwHV2VKg1nOIoy4oaRvQj86m
|
||||
+Hn7g0t4Iz1/kTCioZkRgj1PULeDKa7u/GKiYgpc1HVjxUUwJsC2JQwjZ1CwRsNPc
|
||||
+AV6sDLveJn0doggYrxbC/+9oGYSxxUrkvaPzMmuvHa5F50NHuwgcNTL47uVkglIV
|
||||
++GBQaBaOq9c/8yWbqLVVDbXu1JD6zgzGj6BYiziJEpU7cqYfCOF9qPIYTD9AnZLx
|
||||
+43LHz33E6dRRCD9yTuMQEHE3uUoFi/G+yQvf/paSddE5FBX2d35jPSKk5um/x30g
|
||||
+EiFhQKSuHqWIz/cfucwFBQJRHIPj/yN93RqE9u+uJQrSk8KorEg3fVTumBT6bTYh
|
||||
+QprOvJBrV6UZg7oHnUC9byiyHzHRHktHv2HOPGbywbIZd0TM5R0KWaEQEVg0OAJG
|
||||
+KgwEeuiEufQZGq29EZTEtyDpDIP9wNiC4pBHe9B1UpE6EdzfoZWlJb6wbUMRtTqw
|
||||
+RS1ijNAFzvYy2Yuz0/aRi163qek95YwoXeeZn2QbDN+YgFjJZq6pHjNxYTyDthos
|
||||
+uWfveDk3xJRFp+Ja5WbgEK9FxzdFz34OZKFlre4=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/279.pem b/repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
new file mode 100644
|
||||
index 00000000..8757b9b0
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/279.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJTCCBA2gAwIBAgIJALDxRLt/tVAaMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtkZDJiN2Jk
|
||||
+OS01NmJkLTQ3YzctOWQxOS1jNWYyNmE5YWQwZTJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrjCBqzAJBgNVHRMEAjAAMEMGDCsGAQQBkggJAYIXAQQzDDFSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuMBUGDCsG
|
||||
+AQQBkggJAYIXAgQFDAM5LjgwGQYMKwYBBAGSCAkBghcDBAkMB3BwYzY0bGUwJwYM
|
||||
+KwYBBAGSCAkBghcEBBcMFXJoZWwtOSxyaGVsLTktcHBjNjRsZTANBgkqhkiG9w0B
|
||||
+AQsFAAOCAgEAEzlRfJCOY32tUEuMY4Z/cBUoJjM3/IoKY+7tA1xjzNWzL0hPWXcP
|
||||
+Ifb2iYXG7rINxRkGk56PiFYReGjxlkhkUWRiciAZc6oHfbpw3IyeWnCgSHJXQqTc
|
||||
+kUEWcUG0CJOlE9OBegvqK+PSydRx2JYhaAFza3zMvIYrdtmOvqhP3/GvuN+nnI4G
|
||||
+F7GgJkOyalbaSTOWlH2+wxuXeAnlEtUTytRFBEsBywuyi6NIpBL6Oj+QoBFQdCOE
|
||||
+Ot2Q3v0N4Q5+aiu5UsYPHs97NV8DPkuA0I2qDZr9j/PgxwftbMt14QHG+G9LW3Cz
|
||||
+DSRIXeKfXGo0GbR7E4ZZBLpp/3LMmH5w/K13skoGtnfWC5x/yoHFRPGmSb1Rrzx2
|
||||
+kre8EMrXrFFZn4hXu/huQwLTxpg8Hn5pPzDphEksTKQxLeUF0lRj5b3NtqJbQ4he
|
||||
+NDBAA9cgpifdfaFO8Ax/zppiUeoEizAyst4FFGMDC5u4EFPNQJLjh6vc/2rvP1bk
|
||||
+KwH2FRxd/jyCcu6bEF4Fv/O/dpddkYtmSPQs3DLX9g9N30uOdOp9TM3W9lt/HFQE
|
||||
+VpqG7mXTu+f4hx5LFqJXR1pSLzCjVPl03sVi05rjD0Tjkt//pRybpzf/66wMQ1wE
|
||||
+LWoT869L+7EiL5aSPE3dX7D6IsNzqHvIPKuFAO8T2ZXdiwidAlpXlyA=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/362.pem b/repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
new file mode 100644
|
||||
index 00000000..cb1b7c00
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/362.pem
|
||||
@@ -0,0 +1,36 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGNDCCBBygAwIBAgIJALDxRLt/tVAGMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFswMGIwYzc0
|
||||
+MS0xMDQyLTRiZGUtOTYyYy1kZjRjOGVlMmNiNjBdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBvTCBujAJBgNVHRMEAjAAMEgGDCsGAQQBkggJAYJqAQQ4DDZSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIFBvd2VyLCBsaXR0bGUgZW5kaWFuIEJldGEw
|
||||
+GgYMKwYBBAGSCAkBgmoCBAoMCDkuOCBCZXRhMBkGDCsGAQQBkggJAYJqAwQJDAdw
|
||||
+cGM2NGxlMCwGDCsGAQQBkggJAYJqBAQcDBpyaGVsLTkscmhlbC05LWJldGEtcHBj
|
||||
+NjRsZTANBgkqhkiG9w0BAQsFAAOCAgEAvtSvgFTBFe30H/WQcgvDjJe2ucROmr6B
|
||||
+AW3OF3hvamcwciLMjzMgVyf4dwRDCsKL0q9cRmFXlMR0H36iNQnYkZU1p/sWfCIB
|
||||
+HtPDPlSr3miELB6FTvod/L4zn+CqbjgN2D3wJJKVfldbQzOTV3kEFed96yB8exTV
|
||||
+ObdCIzyadhtULog9mtUCe+8IxG8oDzpjAaaYfwkyq6tY3VzbvRS76292yFVQe6rG
|
||||
+wc9kxhwCfprnvzH7+dTlbMJlvk7PQB7xH1CvSmrIf7C5tfLf/BrsygFtqnq8KLTx
|
||||
+v644hMGkOvMBdEw5Ry3jMPAlmL+Eyc5751XkN3b5yujXA+T71t1/F0i99DM8XTO8
|
||||
+WovLAH4KjX+gvHugdsEQs0ujRpxPDgkv9/RFWs0kkBgzhUlFqOGBsi3HyGoqq770
|
||||
+/e4Fvnj/XxHzs4G3FgiyGnsKLOaKm7eFTwhePsscIckGr/6oq7U0VQF1xOc77I7n
|
||||
+uPFdSXso5TUUO2UVhqmeq71hhj000wpw4vKQ71rEfgTtMiC7Et93hpk4y4iwuk9w
|
||||
+mDGTksyr50QNgS9ZNWGLu2JejT3s9RcjROEJ6VOWJxorDWxEY/LXl683FtRXPEM2
|
||||
+UjHyhx8twhxbIlcD3a8S0R4BfcWCLvhtpdnmOtFGACYMaYd9TAdOG/AZoc/jBOpy
|
||||
+s2OKIQwKXPY=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/363.pem b/repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
new file mode 100644
|
||||
index 00000000..fa09ec7c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/363.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJjCCBA6gAwIBAgIJALDxRLt/tVAFMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs0MTFmZDc4
|
||||
+NC00ZTc4LTQ5YWQtOTNiOC0zNjc2OWY0ZDFlZTVdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrzCBrDAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYJrAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NCBCZXRhMBoGDCsGAQQBkggJAYJr
|
||||
+AgQKDAg5LjggQmV0YTAZBgwrBgEEAZIICQGCawMECQwHYWFyY2g2NDAsBgwrBgEE
|
||||
+AZIICQGCawQEHAwacmhlbC05LHJoZWwtOS1iZXRhLWFhcmNoNjQwDQYJKoZIhvcN
|
||||
+AQELBQADggIBAFzGv13LCdYf3XkOt3TjwVwY2ldFVMxf2Sx/uNjLFG4I1mhYwZZ9
|
||||
+0Pyz7J771yMxyhyKb8rc8XMAYxi8lOKfOpp1PpPRVC+NtKo2pdrbZhWy2qKomfyL
|
||||
+S6jN/hEgg7P6LHGEnvT1Bm9e+BoED3gmOVAmupL4xKv2eRxgXuwuPHrvE6oo63SB
|
||||
+xtrYIo/pmYgVFgl/d7X5vXqerF4pwLR2DwtK6O84DSyVRf35ghNET09GYm6G+URQ
|
||||
+eGWi1/h0YCpS9LCXOOOv/J4MM8zr+NLbDyJWxmaG83/zvAQhX65bzJ0bBtb0avJ0
|
||||
+cgos6LBCDxt+kmipnAMqz5Cb+HVifgdBz1ep3EcoxHwmwBDpHewq0zNtPgMyjzhi
|
||||
+uwB0inlcCk7JKdjdO36H7RdUYvrM7WEDUKAXtMgOXxr3o6h9v9jZKTfbk5Af91/D
|
||||
+epoMULy0sErnEuzHAq9sdh3HTmDTHsMNcUpxwC+93VGaCGGrbyM2yQtdLg7dhHQK
|
||||
+7d9Z9BJEzKReIy+R354M1jQsLGLQ3B8uY476dmP0G0Q01m86rsJ/gjxa8vrJpafO
|
||||
+t1Up9YexwbVtEtKG7koCz4fwxPv2cauGncuUTdyHJDoS5FpPLMlaWXAfwD0Udbiv
|
||||
+gZke/PD+39I+UPrxtM+XIXGoJPeZdM5Kv0+3/suvKHGqtkFa8YiK2EHA
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/419.pem b/repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
new file mode 100644
|
||||
index 00000000..9ad33fd1
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/419.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFzCCA/+gAwIBAgIJALDxRLt/tVAZMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtiOWY4OWYx
|
||||
+OC0xNjAzLTRlZDUtYTFmOS0xN2YyMmEwNDdlODNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBoDCBnTAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYMjAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIEFSTSA2NDAVBgwrBgEEAZIICQGDIwIEBQwD
|
||||
+OS44MBkGDCsGAQQBkggJAYMjAwQJDAdhYXJjaDY0MCcGDCsGAQQBkggJAYMjBAQX
|
||||
+DBVyaGVsLTkscmhlbC05LWFhcmNoNjQwDQYJKoZIhvcNAQELBQADggIBAFu1LxAU
|
||||
+wPUs7/e6mFAzT/JIzq1fQ6kMHxbrf9nS+g9pO0G0z7Imwj85Rk7qOpJpEjKaLVDy
|
||||
+OJ9fXV20TNidKDvjZuL+F209NLam64MEpy7q40LgOaDYsr9tvGfJJFAQRKRszbrC
|
||||
+/CGj7l/q09ym1FB3LXgpn4vHR8jD7LloGFEWq19UpRLe+L+1Frh16apy03WNYTnk
|
||||
+JLALo274I3+kgO69sEemXZF+WD/O+4ySugY/ImbrIlrY1SAeAWTd/kudLMLVLYnN
|
||||
+JlmB7OPUGE2ZAR0aOTvTeoDBZPz1EGItbJg2hlx4vrhrnGG9kKu+/cDOOAJ7+bgx
|
||||
+fgc64NOoLTSc+9QIgKKhDt5jShXHfFjpwWbJ08/U29bTZmntcRO0h6F0WBS3ptgW
|
||||
+hocfN2nDN7pPvivnrUUo+kRY7jKE57im3+mznHHw97em6YCREuvc/NwLIxi4LSiU
|
||||
+cJgOQ3ltljrFSMKlv4p6evMxlX/QOwgeE+hf/QYjCODoHe/66h5bnKkLGnFdPHxk
|
||||
+6btQfVePn8UpMUO64OgIcPuGyAEXu1m9N/PFL3S5JUVmfjF9COhmZQEW1x5HBF/u
|
||||
+mAfwI79++xKH1nmVsgDUjm5HMVZ3qj0y3miAKtC3Ses9Ym6JawpvPSld3xFGF5Mc
|
||||
+BiYQsv12swSrLy3IzdvJViXRFUFE3dWuVdG1
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/433.pem b/repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
new file mode 100644
|
||||
index 00000000..eaf93d90
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/433.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGKTCCBBGgAwIBAgIJALDxRLt/tVAHMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFsyYjk5MzMx
|
||||
+OC0xZjFiLTRlY2UtODJiMS0wODEzYmFjOGFkNGJdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBsjCBrzAJBgNVHRMEAjAAMEEGDCsGAQQBkggJAYMxAQQxDC9SZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIElCTSB6IFN5c3RlbXMgQmV0YTAaBgwrBgEE
|
||||
+AZIICQGDMQIECgwIOS44IEJldGEwFwYMKwYBBAGSCAkBgzEDBAcMBXMzOTB4MCoG
|
||||
+DCsGAQQBkggJAYMxBAQaDBhyaGVsLTkscmhlbC05LWJldGEtczM5MHgwDQYJKoZI
|
||||
+hvcNAQELBQADggIBACjKAgygB5V2mVD3S5snrHjFTpP2x1ODX1GdSgwrXFZ/ehom
|
||||
+hf1SI9zIsmm+s96ns/Gc5BDrqS2TSil083OqG5YZ98ap+NkQPI/XqIhMRSw2z+QK
|
||||
+p1i7e/Si6VZyiitnutCrbX/b1RzWCSOAfIU2m41iptvT7HATw0y/6CQpQNrhZ3wR
|
||||
+TubEIEypmxO5stJt4CO/bqkU3vX+U3FdQdSJWJn3qpvErJ4qNFdwl8zX9WGoaueh
|
||||
+gNbYrz2EWARVbvedp+ylB1VNdpYXQ+LUI/KwHI4Sxizgg16+IxcFoKJVCYNOH7Wh
|
||||
+IoMZc7eW91oAzm57yS36RF/Z50S1x8JHHg2hgev+2czDG9dgRTsLvvAXqsnrUHuD
|
||||
+lRPMDjgaSooUWJmKwIXQ7yJDAPHoxZAXWtMEc1kNLZGEPVDQbT73j4eDOxzZDZrr
|
||||
+agWGoWJ3kuY9AVvv/RTi6z5VWs7ySJER7RxQcGhH8TctysW7gIMjHfgnTGN2bW5U
|
||||
+mV5Ds+/i9AiA9/V+rWWsv8riz+MfEa23/J/EvOdBBCd5MuzsqkXn2gde8WP3cjes
|
||||
+sgqUKQzOy7Rqr5LHT1IQl5SkyYr1QV1InghJ8dh7BjRLvWUaw0uqPRvxX1c6K1l/
|
||||
+NFsCie9RwuhdE8OBwHuBjB28k3Zs9SPaVzYRe70qwi0epbCrhwcGOkTNfCcz
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/479.pem b/repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
new file mode 100644
|
||||
index 00000000..a0ff7061
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/479.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFTCCA/2gAwIBAgIJALDxRLt/tVAcMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFs4ZmM5YTM4
|
||||
+Ni0wYzkzLTQ0MjctYTlhOC1kMTdkMzAwZGJmZDZdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBnjCBmzAJBgNVHRMEAjAAMDUGDCsGAQQBkggJAYNfAQQlDCNSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NDAVBgwrBgEEAZIICQGDXwIEBQwD
|
||||
+OS44MBgGDCsGAQQBkggJAYNfAwQIDAZ4ODZfNjQwJgYMKwYBBAGSCAkBg18EBBYM
|
||||
+FHJoZWwtOSxyaGVsLTkteDg2XzY0MA0GCSqGSIb3DQEBCwUAA4ICAQC6vt8EEay9
|
||||
+CjdRGHmseXosuo03ub+bUt61uYVpf15IoVUV+7XT6ZHff8cPZbKBjoRbuWNILvR2
|
||||
+rCdl11bm3prCxfLNJh5u8hqNXv+iIB4k4qhCSrhPFQEf3HNJma2J67U/8Mt7oM4B
|
||||
+RqpZ1CCw9VTHQSB+iraKzE+BFr9kNlQfZu75Clsgv5dZaT1WK5hKiuQy8kc2CBKy
|
||||
+CuiL6i0PK2tzNtNH4ON/tMU3AM+edIiUFV6C376kewwO/omArY6FYmJVcPLKWh3h
|
||||
+TSUt81CmaHmyW+XKJ2pM3f2hfHdq1Lf7lInjgw5Rolyhm/Xqrrj8j19SrUSru/tw
|
||||
+WcmLMhhEyU2/jwfipbbzB9AC3tIXZjKv8539e4omsBmHwHQno1NAjq0+alGxr9pK
|
||||
+AZywsuMhiGyznbYdIANGZyMUN3sULIsG649UcEsmzM5q9g1TVyuJH9m+OJSK2PGk
|
||||
+UnorgDlGs1AiJhsqZuW8zxzy3nfQmniO/o/6wZbqlKiyLjQY7Fxa4Rb0hXbBJkZ7
|
||||
+TkHkjlAObUEkcjg0jUHb8sFRQ7hXx+Tk4tGk549crSZCCg951SITV5By9bAxm7fu
|
||||
+DHGXgY7tOwHII51sfBfryuvIKs+JmzF9Evzssf3kLBSXylyS6pr/8dKN6sF7Pw4M
|
||||
+Fe/gvJ3J/pARSVP41wR6tI0zYvqkO/ULQg==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/486.pem b/repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
new file mode 100644
|
||||
index 00000000..84461ed8
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/486.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGJDCCBAygAwIBAgIJALDxRLt/tVAIMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjIxOVoXDTQ1MDcw
|
||||
+ODExMjIxOVowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtkZjUwNWIw
|
||||
+ZS02Y2E4LTRkODQtOTY0Mi0wNGRlYTg5NjY0MzNdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBrTCBqjAJBgNVHRMEAjAAMDoGDCsGAQQBkggJAYNmAQQqDChSZWQgSGF0
|
||||
+IEVudGVycHJpc2UgTGludXggZm9yIHg4Nl82NCBCZXRhMBoGDCsGAQQBkggJAYNm
|
||||
+AgQKDAg5LjggQmV0YTAYBgwrBgEEAZIICQGDZgMECAwGeDg2XzY0MCsGDCsGAQQB
|
||||
+kggJAYNmBAQbDBlyaGVsLTkscmhlbC05LWJldGEteDg2XzY0MA0GCSqGSIb3DQEB
|
||||
+CwUAA4ICAQCNeDKnDjuvHBE0Fa0cMAFM96OWn3b3wTtAx7i9BCaCe4NsRTjEMJTw
|
||||
+jO4KwkfzCQWpOJuFHnOKmVZBXVZZ8aOLCfYTyQZ6nZ1UsiekL7l9sdIFCHrbgKkL
|
||||
+zBFe+8cVtUMwb9f7fORPp960ImtYpvt8ERihHf2LvIBUI+BGRz/D/3NW1ehVggGI
|
||||
+0VCe270sgLSl3y8lR5BrNXtKbigeI4mNMasndf/TDMFeCk5OH4FJ+DyiY0zma2IT
|
||||
+x0PwQmEeI4my1KTmQSUDgIOmHtKbq1tCR2wMIh/ju/HOrvVeOnzEsBgQTiTh92qJ
|
||||
+U7/++7Ayqw/6PfPCd+gOMqIPS1+Aef7w54I+zWyYeHQcXXCxcffPwO7sZV3zQJyh
|
||||
+clfLJv13Oe6G5mB7ZCH+tB4LdaVBURz9G0MkLwXGfTWfnU5N61Kne8hjOriSBWP4
|
||||
+2FZEP+2BQ/1Z7aIssbQKegdRvvMd/KqJjIeiFtrz9AVSodEUZgJlxiZ9KDSysG18
|
||||
+hmZcPuk2mc9nwWQ9gHZWzatGs+uONS92QqFvXxlY7TWMDIdlscubcjV/bbDHm69P
|
||||
++pqGilb3zJz8msBwFpdO+h4l8eUMMMsLzdUdH499q/enZrH3VSdmNtWtoVm9R7rp
|
||||
+khFJ4DdORE9/P5lfqAObt8KNO72BQ2/KcK0FZ1lLxKWG/4dZ5oAdGw==
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/prod-certs/9.8/72.pem b/repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
new file mode 100644
|
||||
index 00000000..724e0a62
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/files/prod-certs/9.8/72.pem
|
||||
@@ -0,0 +1,35 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIGFjCCA/6gAwIBAgIJALDxRLt/tVAbMA0GCSqGSIb3DQEBCwUAMIGuMQswCQYD
|
||||
+VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExFjAUBgNVBAoMDVJlZCBI
|
||||
+YXQsIEluYy4xGDAWBgNVBAsMD1JlZCBIYXQgTmV0d29yazEuMCwGA1UEAwwlUmVk
|
||||
+IEhhdCBFbnRpdGxlbWVudCBQcm9kdWN0IEF1dGhvcml0eTEkMCIGCSqGSIb3DQEJ
|
||||
+ARYVY2Etc3VwcG9ydEByZWRoYXQuY29tMB4XDTI1MDcwODExMjI0MloXDTQ1MDcw
|
||||
+ODExMjI0MlowRDFCMEAGA1UEAww5UmVkIEhhdCBQcm9kdWN0IElEIFtlYjMyYzY1
|
||||
+Ny00OGY0LTRiZjUtYmY3Yy1mYjMwNWU1YjgyMDFdMIICIjANBgkqhkiG9w0BAQEF
|
||||
+AAOCAg8AMIICCgKCAgEAxj9J04z+Ezdyx1U33kFftLv0ntNS1BSeuhoZLDhs18yk
|
||||
+sepG7hXXtHh2CMFfLZmTjAyL9i1XsxykQpVQdXTGpUF33C2qBQHB5glYs9+d781x
|
||||
+8p8m8zFxbPcW82TIJXbgW3ErVh8vk5qCbG1cCAAHb+DWMq0EAyy1bl/JgAghYNGB
|
||||
+RvKJObTdCrdpYh02KUqBLkSPZHvo6DUJFN37MXDpVeQq9VtqRjpKLLwuEfXb0Y7I
|
||||
+5xEOrR3kYbOaBAWVt3mYZ1t0L/KfY2jVOdU5WFyyB9PhbMdLi1xE801j+GJrwcLa
|
||||
+xmqvj4UaICRzcPATP86zVM1BBQa+lilkRQes5HyjZzZDiGYudnXhbqmLo/n0cuXo
|
||||
+QBVVjhzRTMx71Eiiahmiw+U1vGqkHhQNxb13HtN1lcAhUCDrxxeMvrAjYdWpYlpI
|
||||
+yW3NssPWt1YUHidMBSAJ4KctIf91dyE93aStlxwC/QnyFsZOmcEsBzVCnz9GmWMl
|
||||
+1/6XzBS1yDUqByklx0TLH+z/sK9A+O2rZAy1mByCYwVxvbOZhnqGxAuToIS+A81v
|
||||
+5hCjsCiOScVB+cil30YBu0cH85RZ0ILNkHdKdrLLWW4wjphK2nBn2g2i3+ztf+nQ
|
||||
+ED2pQqZ/rhuW79jcyCZl9kXqe1wOdF0Cwah4N6/3LzIXEEKyEJxNqQwtNc2IVE8C
|
||||
+AwEAAaOBnzCBnDAJBgNVHRMEAjAAMDsGCysGAQQBkggJAUgBBCwMKlJlZCBIYXQg
|
||||
+RW50ZXJwcmlzZSBMaW51eCBmb3IgSUJNIHogU3lzdGVtczAUBgsrBgEEAZIICQFI
|
||||
+AgQFDAM5LjgwFgYLKwYBBAGSCAkBSAMEBwwFczM5MHgwJAYLKwYBBAGSCAkBSAQE
|
||||
+FQwTcmhlbC05LHJoZWwtOS1zMzkweDANBgkqhkiG9w0BAQsFAAOCAgEADCKqieee
|
||||
+Hvj06J4U23K/Wr5zn+d6AtA2vfhpicAYh5jzYqLAJHmB9T5Ql6pFqJ9lMLI2EGSg
|
||||
+jhLD+lzDP9A2vk+rFWK0BEGnqlPrQtM5atTBeihRVRci1ymspPBrLwu+Zu3jromg
|
||||
+I14r86EZwSXpPZLaNUsOjOi4Euc50Q3wsUJGvXCpoU4SgnnAIER3lq9HSNFDZkmp
|
||||
+AjW+VHAhPIOTujm9PhCFIn5bB0jsygHHYyqV7KvQSmxoPTaLMxFpva+Xy0QNKlwg
|
||||
+NXKw/JYAHX1yaskeZviqwZzhKpnvycyEgWF9f7cBD6O8Adxx9qkqXqer7YsQ/wgR
|
||||
+cHjGCAKbV2OTIgyQEDie1gdPLdSUPzrbzJ9C1I85tSJH3ujdACiGG/aHPtspLb3Z
|
||||
+M6265fbXDbXOqjFuP/njDUqal3WgUgw34w4Xi2JLCcqLvHLQhTmZSKiD0SJbRDL1
|
||||
+smcle/yKhTc4+7zJqQV8faR9LVEAkaLzjG3ZRiTUDq4RASr9tN/A0AfXqggG9nGL
|
||||
+06m6QcXRxHM0OVgLHLksKsj3rG3VX0v3aQm353GW1sxxX0hqFnoOnGWA410GUG9S
|
||||
+rg897hshyti1pn045uhhFjbpxYRKu/JY9VNNyRW0KqL1hyz4TY7OQxJxGDAPX7uJ
|
||||
+7NGSWW9EsYMZNMxEee6br9lWVwGWnc8DWhA=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/repos/system_upgrade/common/files/upgrade_paths.json b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
index 22e0fd7d..61bb73c0 100644
|
||||
--- a/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
+++ b/repos/system_upgrade/common/files/upgrade_paths.json
|
||||
@@ -2,9 +2,10 @@
|
||||
"rhel": {
|
||||
"default": {
|
||||
"7.9": ["8.10"],
|
||||
- "8.10": ["9.4", "9.6", "9.7"],
|
||||
+ "8.10": ["9.4", "9.6", "9.7", "9.8"],
|
||||
"9.6": ["10.0"],
|
||||
"9.7": ["10.1"],
|
||||
+ "9.8": ["10.2"],
|
||||
"7": ["8.10"],
|
||||
"8": ["9.4", "9.6"],
|
||||
"9": ["10.0"]
|
||||
@@ -15,6 +16,7 @@
|
||||
"8.10": ["9.6", "9.4"],
|
||||
"8": ["9.6", "9.4"],
|
||||
"9.6": ["10.0"],
|
||||
+ "9.8": ["10.2"],
|
||||
"9": ["10.0"]
|
||||
}
|
||||
},
|
||||
@@ -25,13 +27,13 @@
|
||||
},
|
||||
"_virtual_versions": {
|
||||
"8": "8.10",
|
||||
- "9": "9.7",
|
||||
- "10": "10.1"
|
||||
+ "9": "9.8",
|
||||
+ "10": "10.2"
|
||||
}
|
||||
},
|
||||
"almalinux": {
|
||||
"default": {
|
||||
- "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7"],
|
||||
+ "8.10": ["9.0", "9.1", "9.2", "9.3", "9.4", "9.5", "9.6", "9.7","9.8"],
|
||||
"9.7": ["10.0", "10.1"]
|
||||
}
|
||||
}
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
48
SOURCES/0022-Add-kpatch-actor-to-el9toel10.patch
Normal file
48
SOURCES/0022-Add-kpatch-actor-to-el9toel10.patch
Normal file
@ -0,0 +1,48 @@
|
||||
From b41d5b386f3369cf714cff9f3277863f6f601bc1 Mon Sep 17 00:00:00 2001
|
||||
From: denli <denli@redhat.com>
|
||||
Date: Mon, 6 Oct 2025 12:25:07 -0400
|
||||
Subject: [PATCH 22/55] Add kpatch actor to el9toel10
|
||||
|
||||
---
|
||||
.../actors/kernel/checkkpatch/actor.py | 29 +++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..e7f6179c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
@@ -0,0 +1,29 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import CopyFile, DistributionSignedRPM, TargetUserSpacePreupgradeTasks
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+PLUGIN_PKGNAME = "kpatch-dnf"
|
||||
+CONFIG_PATH = "/etc/dnf/plugins/kpatch.conf"
|
||||
+
|
||||
+
|
||||
+class CheckKpatch(Actor):
|
||||
+ """
|
||||
+ Carry over kpatch-dnf and it's config into the container
|
||||
+
|
||||
+ Check is kpatch-dnf plugin is installed and if it is, install it and copy
|
||||
+ over the config file so that the plugin can make a decision on whether any
|
||||
+ kpatch-patch packages need to be installed during in-place upgrade.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_kpatch'
|
||||
+ consumes = (DistributionSignedRPM,)
|
||||
+ produces = (TargetUserSpacePreupgradeTasks,)
|
||||
+ tags = (IPUWorkflowTag, ChecksPhaseTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ if has_package(DistributionSignedRPM, PLUGIN_PKGNAME):
|
||||
+ api.produce(TargetUserSpacePreupgradeTasks(
|
||||
+ install_rpms=[PLUGIN_PKGNAME],
|
||||
+ copy_files=[CopyFile(src=CONFIG_PATH)]))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
54
SOURCES/0023-move-kpatch-actor-to-common-repo.patch
Normal file
54
SOURCES/0023-move-kpatch-actor-to-common-repo.patch
Normal file
@ -0,0 +1,54 @@
|
||||
From 0cf9d8adb12b40f4cdcd423e6c55c11e0fbacff5 Mon Sep 17 00:00:00 2001
|
||||
From: denli <denli@redhat.com>
|
||||
Date: Tue, 7 Oct 2025 08:09:58 -0400
|
||||
Subject: [PATCH 23/55] move kpatch actor to common repo
|
||||
|
||||
---
|
||||
.../actors/kernel/checkkpatch/actor.py | 0
|
||||
.../actors/kernel/checkkpatch/actor.py | 29 -------------------
|
||||
2 files changed, 29 deletions(-)
|
||||
rename repos/system_upgrade/{el8toel9 => common}/actors/kernel/checkkpatch/actor.py (100%)
|
||||
delete mode 100644 repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/common/actors/kernel/checkkpatch/actor.py
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/el8toel9/actors/kernel/checkkpatch/actor.py
|
||||
rename to repos/system_upgrade/common/actors/kernel/checkkpatch/actor.py
|
||||
diff --git a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py b/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
deleted file mode 100644
|
||||
index e7f6179c..00000000
|
||||
--- a/repos/system_upgrade/el9toel10/actors/kernel/checkkpatch/actor.py
|
||||
+++ /dev/null
|
||||
@@ -1,29 +0,0 @@
|
||||
-from leapp.actors import Actor
|
||||
-from leapp.libraries.common.rpms import has_package
|
||||
-from leapp.libraries.stdlib import api
|
||||
-from leapp.models import CopyFile, DistributionSignedRPM, TargetUserSpacePreupgradeTasks
|
||||
-from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
-
|
||||
-PLUGIN_PKGNAME = "kpatch-dnf"
|
||||
-CONFIG_PATH = "/etc/dnf/plugins/kpatch.conf"
|
||||
-
|
||||
-
|
||||
-class CheckKpatch(Actor):
|
||||
- """
|
||||
- Carry over kpatch-dnf and it's config into the container
|
||||
-
|
||||
- Check is kpatch-dnf plugin is installed and if it is, install it and copy
|
||||
- over the config file so that the plugin can make a decision on whether any
|
||||
- kpatch-patch packages need to be installed during in-place upgrade.
|
||||
- """
|
||||
-
|
||||
- name = 'check_kpatch'
|
||||
- consumes = (DistributionSignedRPM,)
|
||||
- produces = (TargetUserSpacePreupgradeTasks,)
|
||||
- tags = (IPUWorkflowTag, ChecksPhaseTag)
|
||||
-
|
||||
- def process(self):
|
||||
- if has_package(DistributionSignedRPM, PLUGIN_PKGNAME):
|
||||
- api.produce(TargetUserSpacePreupgradeTasks(
|
||||
- install_rpms=[PLUGIN_PKGNAME],
|
||||
- copy_files=[CopyFile(src=CONFIG_PATH)]))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
From 3128ca5df81b4c7591af189c9e2ae02f96c88fb4 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 09:00:20 +0200
|
||||
Subject: [PATCH 24/55] Makefile: Do not copy unnecessary files to test
|
||||
containers
|
||||
|
||||
In addition to tut/, docs/, packaging/, .git/ and all the __pycache__
|
||||
directories (and .pyc files) are excluded. This makes for a significant
|
||||
speedup in container setup (output with -v added to rsync) as a lot less
|
||||
needs to be copied:
|
||||
|
||||
Without this patch:
|
||||
sent 2,405,488 bytes received 19,754 bytes 194,019.36 bytes/sec
|
||||
total size is 165,333,162 speedup is 68.17
|
||||
|
||||
With this patch:
|
||||
sent 551,179 bytes received 4,067 bytes 100,953.82 bytes/sec
|
||||
total size is 23,280,513 speedup is 41.93
|
||||
|
||||
Some other small files and directories are still unnecessarily copied,
|
||||
but those don't really affect the copied size that much.
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 754c2c63..1bfbc3ac 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,7 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude "tut*" /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
python3.6) \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
From 7d9ae2c0adcef2eac7cb09fd9acf74f9a6011d64 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 09:08:02 +0200
|
||||
Subject: [PATCH 25/55] Makefile: Properly copy commands dir to test containers
|
||||
|
||||
During a containerized tests run, the commands/ directory is not used
|
||||
when running the commands tests. Instead, the commands are imported from
|
||||
tut/lib/python3.X/site-packages/leapp/cli/commands/ where python3.X is
|
||||
the python used in the tut/ virtualenv.
|
||||
|
||||
When there are changes breaking the commands tests, the test are still
|
||||
passing because the files are not being updated in the directory
|
||||
mentioned above. This can be currently fixed by rebuilding the container
|
||||
which takes a lot of time.
|
||||
|
||||
This patch adds copying of the commands/ dir to the
|
||||
tut/lib/python3.X/site-packages/leapp/cli/commands/.
|
||||
|
||||
This helped while working on #1438 because I caught the failing tests
|
||||
only after opening a the PR. The CI containerized tests are always
|
||||
created from scratch so it works there.
|
||||
---
|
||||
Makefile | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1bfbc3ac..9774a475 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,8 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' --exclude 'commands/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude '**/__pycache__/' /repo/commands/ /repocopy/tut/lib/$$_VENV/site-packages/leapp/cli/commands/ && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
python3.6) \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
From 1ba6d4301602c8a253ba92263fd829e385463182 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Stodulka <pstodulk@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 15:19:03 +0200
|
||||
Subject: [PATCH 26/55] livemode: update obsoleted log msg about config
|
||||
|
||||
The original livemode configuration was located in
|
||||
/etc/leapp/files/leapp-livemode.ini
|
||||
|
||||
However, this file has been replaced by new configuration for actors,
|
||||
represented by variable filename under /etc/leapp/actor_conf.d/
|
||||
|
||||
I decided to keep the info log, but dropped the information about the
|
||||
file path.
|
||||
---
|
||||
.../livemode_config_scanner/libraries/scan_livemode_config.py | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py b/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
index 26fd9d09..7d72204c 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/livemode_config_scanner/libraries/scan_livemode_config.py
|
||||
@@ -5,7 +5,6 @@ from leapp.libraries.common.rpms import has_package
|
||||
from leapp.libraries.stdlib import api
|
||||
from leapp.models import InstalledRPM, LiveModeConfig
|
||||
|
||||
-LIVEMODE_CONFIG_LOCATION = '/etc/leapp/files/devel-livemode.ini'
|
||||
DEFAULT_SQUASHFS_PATH = '/var/lib/leapp/live-upgrade.img'
|
||||
|
||||
|
||||
@@ -39,8 +38,7 @@ def scan_config_and_emit_message():
|
||||
if not should_scan_config():
|
||||
return
|
||||
|
||||
- api.current_logger().info('Loading livemode config from %s', LIVEMODE_CONFIG_LOCATION)
|
||||
-
|
||||
+ api.current_logger().info('Loading the livemode configuration.')
|
||||
config = api.current_actor().config[livemode_config_lib.LIVEMODE_CONFIG_SECTION]
|
||||
|
||||
# Mapping from model field names to configuration fields - because we might have
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,147 @@
|
||||
From 37409349656c12efd4033e0cb5a3c25d10e6630d Mon Sep 17 00:00:00 2001
|
||||
From: Mark Huth <mhuth@redhat.com>
|
||||
Date: Mon, 15 Sep 2025 16:29:02 +1000
|
||||
Subject: [PATCH 27/55] chore(RHINENG-19596): Rebrand Insights to Lightspeed
|
||||
|
||||
---
|
||||
commands/preupgrade/__init__.py | 2 +-
|
||||
commands/upgrade/__init__.py | 2 +-
|
||||
docs/source/configuring-ipu/envars.md | 2 +-
|
||||
.../common/actors/checkinsightsautoregister/actor.py | 2 +-
|
||||
.../libraries/checkinsightsautoregister.py | 5 +++--
|
||||
.../common/actors/insightsautoregister/actor.py | 2 +-
|
||||
.../insightsautoregister/libraries/insightsautoregister.py | 6 +++---
|
||||
.../insightsautoregister/tests/test_insightsautoregister.py | 2 +-
|
||||
8 files changed, 12 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/commands/preupgrade/__init__.py b/commands/preupgrade/__init__.py
|
||||
index 6443bd8a..f24e779a 100644
|
||||
--- a/commands/preupgrade/__init__.py
|
||||
+++ b/commands/preupgrade/__init__.py
|
||||
@@ -26,7 +26,7 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
help='Use only custom repositories and skip actions with Red Hat Subscription Manager.'
|
||||
' This only has effect on Red Hat Enterprise Linux systems.'
|
||||
)
|
||||
-@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Insights')
|
||||
+@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Lightspeed')
|
||||
@command_opt('no-rhsm-facts', is_flag=True, help='Do not store migration information using Red Hat '
|
||||
'Subscription Manager. Automatically implied by --no-rhsm.')
|
||||
@command_opt('enablerepo', action='append', metavar='<repoid>',
|
||||
diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py
|
||||
index 36be0719..c5900c0d 100644
|
||||
--- a/commands/upgrade/__init__.py
|
||||
+++ b/commands/upgrade/__init__.py
|
||||
@@ -32,7 +32,7 @@ from leapp.utils.output import beautify_actor_exception, report_errors, report_i
|
||||
help='Use only custom repositories and skip actions with Red Hat Subscription Manager.'
|
||||
' This only has effect on Red Hat Enterprise Linux systems.'
|
||||
)
|
||||
-@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Insights')
|
||||
+@command_opt('no-insights-register', is_flag=True, help='Do not register into Red Hat Lightspeed')
|
||||
@command_opt('no-rhsm-facts', is_flag=True, help='Do not store migration information using Red Hat '
|
||||
'Subscription Manager. Automatically implied by --no-rhsm.')
|
||||
@command_opt('enablerepo', action='append', metavar='<repoid>',
|
||||
diff --git a/docs/source/configuring-ipu/envars.md b/docs/source/configuring-ipu/envars.md
|
||||
index a042ba4a..09634df2 100644
|
||||
--- a/docs/source/configuring-ipu/envars.md
|
||||
+++ b/docs/source/configuring-ipu/envars.md
|
||||
@@ -21,7 +21,7 @@ Overrides the automatically detected storage device with GRUB core (e.g. /dev/sd
|
||||
Set to 1 to disable RPM GPG checks (same as yum/dnf –nogpgckeck option). It‘s equivalent to the --nogpgcheck leapp option.
|
||||
|
||||
#### LEAPP_NO_INSIGHTS_REGISTER
|
||||
-If set to `1`, Leapp does not register the system into Red Hat Insights automatically. It‘s equivalent to the --no-insights-register leapp option.
|
||||
+If set to `1`, Leapp does not register the system into Red Hat Lightspeed automatically. It‘s equivalent to the --no-insights-register leapp option.
|
||||
|
||||
#### LEAPP_NO_NETWORK_RENAMING
|
||||
If set to `1`, the actor responsible to handle NICs names ends without doing anything. The actor usually creates UDEV rules to preserve original NICs in case they are changed. However, in some cases it‘s not wanted and it leads in malfunction network configuration (e.g. in case the bonding is configured on the system). It‘s expected that NICs have to be handled manually if needed.
|
||||
diff --git a/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py b/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
index 70b3b670..52108566 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkinsightsautoregister/actor.py
|
||||
@@ -7,7 +7,7 @@ from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
|
||||
class CheckInsightsAutoregister(Actor):
|
||||
"""
|
||||
- Checks if system can be automatically registered into Red Hat Insights
|
||||
+ Checks if system can be automatically registered into Red Hat Lightspeed
|
||||
|
||||
The registration is skipped if NO_INSIGHTS_REGISTER=1 environment variable
|
||||
is set, the --no-insights-register command line argument present. if the
|
||||
diff --git a/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py b/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
index 762f3c08..8e26485b 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkinsightsautoregister/libraries/checkinsightsautoregister.py
|
||||
@@ -24,9 +24,9 @@ def _ensure_package(package):
|
||||
def _report_registration_info(installing_client):
|
||||
pkg_msg = " The '{}' package required for the registration will be installed during the upgrade."
|
||||
|
||||
- title = "Automatic registration into Red Hat Insights"
|
||||
+ title = "Automatic registration into Red Hat Lightspeed"
|
||||
summary = (
|
||||
- "After the upgrade, this system will be automatically registered into Red Hat Insights."
|
||||
+ "After the upgrade, this system will be automatically registered into Red Hat Lightspeed."
|
||||
"{}"
|
||||
" To skip the automatic registration, use the '--no-insights-register' command line option or"
|
||||
" set the LEAPP_NO_INSIGHTS_REGISTER environment variable."
|
||||
@@ -38,6 +38,7 @@ def _report_registration_info(installing_client):
|
||||
reporting.Summary(summary),
|
||||
reporting.Severity(reporting.Severity.INFO),
|
||||
reporting.Groups([reporting.Groups.SERVICES]),
|
||||
+ reporting.Key('693963253195f418526f045b6d630a1f4c7a193d'),
|
||||
]
|
||||
)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/actor.py b/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
index a81b434c..56615390 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/actor.py
|
||||
@@ -7,7 +7,7 @@ from leapp.tags import FirstBootPhaseTag, IPUWorkflowTag
|
||||
|
||||
class InsightsAutoregister(Actor):
|
||||
"""
|
||||
- Automatically registers system into Red Hat Insights
|
||||
+ Automatically registers system into Red Hat Lightspeed
|
||||
|
||||
The registration is skipped if NO_INSIGHTS_REGISTER=1 environment variable
|
||||
is set, the --no-insights-register command line argument present or the
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py b/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
index 2134a8bb..bd113a1f 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/libraries/insightsautoregister.py
|
||||
@@ -6,18 +6,18 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
def _insights_register():
|
||||
try:
|
||||
run(['insights-client', '--register'])
|
||||
- api.current_logger().info('Automatically registered into Red Hat Insights')
|
||||
+ api.current_logger().info('Automatically registered into Red Hat Lightspeed')
|
||||
except (CalledProcessError) as err:
|
||||
# TODO(mmatuska) produce post-upgrade report?
|
||||
api.current_logger().error(
|
||||
- 'Automatic registration into Red Hat Insights failed: {}'.format(err)
|
||||
+ 'Automatic registration into Red Hat Lightspeed failed: {}'.format(err)
|
||||
)
|
||||
|
||||
|
||||
def process():
|
||||
if rhsm.skip_rhsm() or get_env('LEAPP_NO_INSIGHTS_REGISTER', '0') == '1':
|
||||
api.current_logger().debug(
|
||||
- 'Skipping registration into Insights due to --no-insights-register'
|
||||
+ 'Skipping registration into Red Hat Lightspeed due to --no-insights-register'
|
||||
' or LEAPP_NO_INSIGHTS_REGISTER=1 set'
|
||||
)
|
||||
return
|
||||
diff --git a/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py b/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
index 0a039455..d5e6ba20 100644
|
||||
--- a/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
+++ b/repos/system_upgrade/common/actors/insightsautoregister/tests/test_insightsautoregister.py
|
||||
@@ -41,7 +41,7 @@ def test_insights_register_success_logged(monkeypatch):
|
||||
|
||||
def run_mocked(cmd, **kwargs):
|
||||
return {
|
||||
- 'stdout': 'Successfully registered into Insights',
|
||||
+ 'stdout': 'Successfully registered into Red Hat Lightspeed',
|
||||
'stderr': '',
|
||||
'exit_code': 0
|
||||
}
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
131
SOURCES/0028-ceph-luks-Fix-ceph-cephvolumescan-for-cephadm.patch
Normal file
131
SOURCES/0028-ceph-luks-Fix-ceph-cephvolumescan-for-cephadm.patch
Normal file
@ -0,0 +1,131 @@
|
||||
From ddefdee20a97d9b5e08502e4348d92212a702cc7 Mon Sep 17 00:00:00 2001
|
||||
From: Lukas Bezdicka <lbezdick@redhat.com>
|
||||
Date: Fri, 16 Feb 2024 14:58:02 +0100
|
||||
Subject: [PATCH 28/55] [ceph][luks] Fix ceph cephvolumescan for cephadm
|
||||
|
||||
For cephadm the containers are named ceph-<hash>-osd... while
|
||||
ceph-ansible still uses the ceph-osd-...
|
||||
|
||||
Other issue is that OSDs can have multiple volumes in them so filtering
|
||||
just for the first one is wrong and we need to check each volume for
|
||||
the encryption.
|
||||
|
||||
Resolves: rhbz#2264543
|
||||
Fixes: https://issues.redhat.com/browse/RHEL-25838
|
||||
---
|
||||
.../libraries/cephvolumescan.py | 5 +-
|
||||
.../tests/test_cephvolumescan.py | 50 +++++++++++++++++--
|
||||
2 files changed, 50 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py b/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
index b2364104..a9bff005 100644
|
||||
--- a/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
+++ b/repos/system_upgrade/common/actors/cephvolumescan/libraries/cephvolumescan.py
|
||||
@@ -8,7 +8,7 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import InstalledRPM
|
||||
|
||||
CEPH_CONF = "/etc/ceph/ceph.conf"
|
||||
-CONTAINER = "ceph-osd"
|
||||
+CONTAINER = "ceph-.*osd"
|
||||
|
||||
|
||||
def select_osd_container(engine):
|
||||
@@ -63,7 +63,8 @@ def encrypted_osds_list():
|
||||
output = get_ceph_lvm_list()
|
||||
if output is not None:
|
||||
try:
|
||||
- result = [output[key][0]['lv_uuid'] for key in output if output[key][0]['tags']['ceph.encrypted']]
|
||||
+ for key in output:
|
||||
+ result.extend([element['lv_uuid'] for element in output[key] if element['tags']['ceph.encrypted']])
|
||||
except KeyError:
|
||||
# TODO: possibly raise a report item with a medium risk factor
|
||||
# TODO: possibly create list of problematic osds, extend the cephinfo
|
||||
diff --git a/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py b/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
index f3811c45..168b8fc2 100644
|
||||
--- a/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
+++ b/repos/system_upgrade/common/actors/cephvolumescan/tests/test_cephvolumescan.py
|
||||
@@ -8,6 +8,8 @@ from leapp.reporting import Report
|
||||
CONT_PS_COMMAND_OUTPUT = {
|
||||
"stdout":
|
||||
"""CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
+ b5a3d8ef25b9 undercloud-0.ctlplane.redhat.local:8787/rh-osbs/rhceph:5 "-n osd.8 -f --set..." \
|
||||
+ 2 hours ago Up 2 hours ago ceph-bea1a933-0846-4aaa-8223-62cb8cb2873c-osd-8
|
||||
50d96fe72019 registry.redhat.io/rhceph/rhceph-4-rhel8:latest "/opt/ceph-contain..." \
|
||||
2 weeks ago Up 2 weeks ceph-osd-0
|
||||
f93c17b49c40 registry.redhat.io/rhceph/rhceph-4-rhel8:latest "/opt/ceph-contain..." \
|
||||
@@ -41,6 +43,32 @@ CEPH_VOLUME_OUTPUT = {
|
||||
"type":"block",
|
||||
"vg_name":"ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc"
|
||||
}
|
||||
+ ],
|
||||
+ "8":[
|
||||
+ {
|
||||
+ "devices": [
|
||||
+ "/dev/nvme0n1"
|
||||
+ ],
|
||||
+ "lv_name": "osd-db-b04857a0-a2a2-40c3-a490-cbe1f892a76c",
|
||||
+ "lv_uuid": "zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3",
|
||||
+ "tags":{
|
||||
+ "ceph.encrypted":"1"
|
||||
+ },
|
||||
+ "type": "db",
|
||||
+ "vg_name": "ceph-b78309b3-bd80-4399-87a3-ac647b216b63"
|
||||
+ },
|
||||
+ {
|
||||
+ "devices": [
|
||||
+ "/dev/sdb"
|
||||
+ ],
|
||||
+ "lv_name": "osd-block-477c303f-5eaf-4be8-b5cc-f6073eb345bf",
|
||||
+ "lv_uuid": "Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3",
|
||||
+ "tags":{
|
||||
+ "ceph.encrypted":"1"
|
||||
+ },
|
||||
+ "type": "block",
|
||||
+ "vg_name": "ceph-e3e0345b-8be1-40a7-955a-378ba967f954"
|
||||
+ }
|
||||
]
|
||||
}"""
|
||||
}
|
||||
@@ -51,7 +79,19 @@ CEPH_LVM_LIST = {
|
||||
'lv_uuid': 'Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn',
|
||||
'tags': {'ceph.encrypted': '1'},
|
||||
'type': 'block',
|
||||
- 'vg_name': 'ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc'}]
|
||||
+ 'vg_name': 'ceph-a696c40d-6b1d-448d-a40e-fadca22b64bc'}],
|
||||
+ '8': [{'devices': ['/dev/nvme0n1'],
|
||||
+ 'lv_name': 'osd-db-b04857a0-a2a2-40c3-a490-cbe1f892a76c',
|
||||
+ 'lv_uuid': 'zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3',
|
||||
+ 'tags': {'ceph.encrypted': '1'},
|
||||
+ 'type': 'db',
|
||||
+ 'vg_name': 'ceph-b78309b3-bd80-4399-87a3-ac647b216b63'},
|
||||
+ {'devices': ['/dev/sdb'],
|
||||
+ 'lv_name': 'osd-block-477c303f-5eaf-4be8-b5cc-f6073eb345bf',
|
||||
+ 'lv_uuid': 'Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3',
|
||||
+ 'tags': {'ceph.encrypted': '1'},
|
||||
+ 'type': 'block',
|
||||
+ 'vg_name': 'ceph-e3e0345b-8be1-40a7-955a-378ba967f954'}]
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +100,7 @@ def test_select_osd_container(m_run):
|
||||
|
||||
m_run.return_value = CONT_PS_COMMAND_OUTPUT
|
||||
|
||||
- assert cephvolumescan.select_osd_container('docker') == "ceph-osd-0"
|
||||
+ assert cephvolumescan.select_osd_container('docker') == "ceph-bea1a933-0846-4aaa-8223-62cb8cb2873c-osd-8"
|
||||
|
||||
|
||||
@patch('leapp.libraries.actor.cephvolumescan.has_package')
|
||||
@@ -82,4 +122,8 @@ def test_encrypted_osds_list(m_get_ceph_lvm_list, m_isfile):
|
||||
m_get_ceph_lvm_list.return_value = CEPH_LVM_LIST
|
||||
m_isfile.return_value = True
|
||||
|
||||
- assert cephvolumescan.encrypted_osds_list() == ['Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn']
|
||||
+ assert cephvolumescan.encrypted_osds_list() == [
|
||||
+ 'Tyc0TH-RDxr-ebAF-9mWF-Kh5R-YnvJ-cEcGVn',
|
||||
+ 'zcvGix-drzz-JwzP-6ktU-Od6W-N5jL-kxRFa3',
|
||||
+ 'Mz1dep-D715-Wxh1-zUuS-0cOA-mKXE-UxaEM3'
|
||||
+ ]
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
From bf1b5f5f537ff163470b29d8bb7ba452901368eb Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Wed, 22 Oct 2025 17:52:52 +0200
|
||||
Subject: [PATCH 29/55] Makefile: Do copy commands/ dir in containerized tests
|
||||
|
||||
In 7d9ae2c0 the commands dir copying was changed to copy the dir to
|
||||
tut/lib/$$_VENV/site-packages/leapp/cli/commands/ instead of the normal
|
||||
location in the container.
|
||||
|
||||
This fixed the problem that modifications on the host were not reflected
|
||||
in the testing containers. However a new problem was introduced -
|
||||
modifications to tests in the commands directory are not getting
|
||||
reflected in the testing containers.
|
||||
|
||||
This patch fixes that by copying the entire commands directory both to
|
||||
the normal location and the virtual env (path above).
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 9774a475..64115006 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -447,7 +447,7 @@ test_container:
|
||||
export _CONT_NAME="leapp-repo-tests-$(_TEST_CONTAINER)-cont"; \
|
||||
$(_CONTAINER_TOOL) ps -q -f name=$$_CONT_NAME && { $(_CONTAINER_TOOL) kill $$_CONT_NAME; $(_CONTAINER_TOOL) rm $$_CONT_NAME; }; \
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
- $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' --exclude 'commands/' /repo/ /repocopy && \
|
||||
+ $(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
$(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude '**/__pycache__/' /repo/commands/ /repocopy/tut/lib/$$_VENV/site-packages/leapp/cli/commands/ && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
From 87f584d8f9b957b9ae0138d6963077d87ccb2067 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 20 Oct 2025 11:40:04 +0200
|
||||
Subject: [PATCH 30/55] skip pre-generation of systemd fstab mount units during
|
||||
LiveMode upgrade
|
||||
|
||||
The new storage initialization solution interfered with LiveMode. Since
|
||||
LiveMode is a different upgrade approach, we now skip pre-generation of
|
||||
systemd fstab mount units (mount_unit_generator actor) when
|
||||
upgrading this way.
|
||||
---
|
||||
.../actors/initramfs/mount_units_generator/actor.py | 5 ++++-
|
||||
.../libraries/mount_unit_generator.py | 8 ++++++--
|
||||
2 files changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
index 5fe25515..dd667513 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -1,16 +1,19 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
|
||||
|
||||
class MountUnitGenerator(Actor):
|
||||
"""
|
||||
Sets up storage initialization using systemd's mount units in the upgrade container.
|
||||
+
|
||||
+ Note that this storage initialization is skipped when the LiveMode is enabled.
|
||||
"""
|
||||
|
||||
name = 'mount_unit_generator'
|
||||
consumes = (
|
||||
+ LiveModeConfig,
|
||||
TargetUserSpaceInfo,
|
||||
)
|
||||
produces = (
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
index e1060559..943bddd4 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -5,7 +5,7 @@ import tempfile
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
|
||||
|
||||
def run_systemd_fstab_generator(output_directory):
|
||||
@@ -295,8 +295,12 @@ def request_units_inclusion_in_initramfs(files_to_include):
|
||||
|
||||
|
||||
def setup_storage_initialization():
|
||||
- userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
+ livemode_config = next(api.consume(LiveModeConfig), None)
|
||||
+ if livemode_config and livemode_config.is_enabled:
|
||||
+ api.current_logger().debug('Pre-generation of systemd fstab mount units skipped: The LiveMode is enabled.')
|
||||
+ return
|
||||
|
||||
+ userspace_info = next(api.consume(TargetUserSpaceInfo), None)
|
||||
with mounting.NspawnActions(base_dir=userspace_info.path) as upgrade_container_ctx:
|
||||
with tempfile.TemporaryDirectory(dir='/var/lib/leapp/', prefix='tmp_systemd_fstab_') as workspace_path:
|
||||
run_systemd_fstab_generator(workspace_path)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
From 827e28de7b707f9fc458e1f5fdad9fffd7474abe Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Tue, 12 Aug 2025 16:59:01 +0200
|
||||
Subject: [PATCH 31/55] pylint: enable consider-using-set-comprehension
|
||||
|
||||
Fixed occurrences of list comprehensions wrapped in set() by using
|
||||
set comprehensions directly, removing disables for
|
||||
consider-using-set-comprehension added for Python 2 compatibility.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../checkconsumedassets/tests/test_asset_version_checking.py | 2 +-
|
||||
.../common/actors/selinux/selinuxapplycustom/actor.py | 4 +---
|
||||
3 files changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 5d75df40..e54d9a54 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -45,7 +45,6 @@ disable=
|
||||
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
# new for python3 version of pylint
|
||||
useless-object-inheritance,
|
||||
- consider-using-set-comprehension, # pylint3 force to use comprehension in place we don't want (py2 doesnt have these options, for inline skip)
|
||||
unnecessary-pass,
|
||||
invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
||||
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
diff --git a/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py b/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
index 9c324b44..f37dcea4 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkconsumedassets/tests/test_asset_version_checking.py
|
||||
@@ -44,4 +44,4 @@ def test_make_report_entries_with_unique_urls():
|
||||
docs_url_to_title_map = {'/path/to/asset1': ['asset1_title1', 'asset1_title2'],
|
||||
'/path/to/asset2': ['asset2_title']}
|
||||
report_urls = check_consumed_assets_lib.make_report_entries_with_unique_urls(docs_url_to_title_map)
|
||||
- assert set([ru.value['url'] for ru in report_urls]) == {'/path/to/asset1', '/path/to/asset2'}
|
||||
+ assert {ru.value['url'] for ru in report_urls} == {'/path/to/asset1', '/path/to/asset2'}
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
index 4856f36a..db8fe8ac 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/actor.py
|
||||
@@ -40,9 +40,7 @@ class SELinuxApplyCustom(Actor):
|
||||
return
|
||||
|
||||
# get list of policy modules after the upgrade
|
||||
- installed_modules = set(
|
||||
- [module[0] for module in selinuxapplycustom.list_selinux_modules()]
|
||||
- )
|
||||
+ installed_modules = {module[0] for module in selinuxapplycustom.list_selinux_modules()}
|
||||
|
||||
# import custom SElinux modules
|
||||
for semodules in self.consume(SELinuxModules):
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
165
SOURCES/0032-pylint-enable-consider-using-with.patch
Normal file
165
SOURCES/0032-pylint-enable-consider-using-with.patch
Normal file
@ -0,0 +1,165 @@
|
||||
From 006517ea2d69d3f0d9e3de2eb67bfb4d32f20551 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 10:46:10 +0200
|
||||
Subject: [PATCH 32/55] pylint: enable consider-using-with
|
||||
|
||||
Emitted when a resource-allocating assignment or call could be replaced
|
||||
by a 'with' block. Enabling this warning enforces using 'with' to ensure
|
||||
resources are properly released even if an exception occurs.
|
||||
|
||||
* ifcfgscanner: use StringIO in tests instead of mock_open for iteration support with 'with open'
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../ifcfgscanner/libraries/ifcfgscanner.py | 27 +++++++++----------
|
||||
.../tests/unit_test_ifcfgscanner.py | 8 +++---
|
||||
.../luksscanner/tests/test_luksdump_parser.py | 8 +++---
|
||||
.../scansaphana/tests/test_scansaphana.py | 6 ++---
|
||||
.../system_upgrade/common/libraries/guards.py | 2 +-
|
||||
6 files changed, 25 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index e54d9a54..fd770061 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -51,7 +51,6 @@ disable=
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
- consider-using-with, # on bunch spaces we cannot change that...
|
||||
duplicate-string-formatting-argument, # TMP: will be fixed in close future
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
use-dict-literal,
|
||||
diff --git a/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py b/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
index 683327b3..f0c8b847 100644
|
||||
--- a/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/ifcfgscanner/libraries/ifcfgscanner.py
|
||||
@@ -18,23 +18,22 @@ def process_ifcfg(filename, secrets=False):
|
||||
return None
|
||||
|
||||
properties = []
|
||||
- for line in open(filename).readlines():
|
||||
- try:
|
||||
- (name, value) = line.split("#")[0].strip().split("=")
|
||||
+ with open(filename) as f:
|
||||
+ for line in f:
|
||||
+ try:
|
||||
+ (name, value) = line.split("#")[0].strip().split("=")
|
||||
+ except ValueError:
|
||||
+ # We're not interested in lines that are not
|
||||
+ # simple assignments. Play it safe.
|
||||
+ continue
|
||||
+
|
||||
if secrets:
|
||||
value = None
|
||||
- except ValueError:
|
||||
- # We're not interested in lines that are not
|
||||
- # simple assignments. Play it safe.
|
||||
- continue
|
||||
-
|
||||
- # Deal with simple quoting. We don't expand anything, nor do
|
||||
- # multiline strings or anything of that sort.
|
||||
- if value is not None and len(value) > 1 and value[0] == value[-1]:
|
||||
- if value.startswith('"') or value.startswith("'"):
|
||||
+ elif len(value) > 1 and value[0] in ('"', "'") and value[0] == value[-1]:
|
||||
+ # Deal with simple quoting. We don't expand anything, nor do
|
||||
+ # multiline strings or anything of that sort.
|
||||
value = value[1:-1]
|
||||
-
|
||||
- properties.append(IfCfgProperty(name=name, value=value))
|
||||
+ properties.append(IfCfgProperty(name=name, value=value))
|
||||
return properties
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py b/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
index d3b4846f..d996de84 100644
|
||||
--- a/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/ifcfgscanner/tests/unit_test_ifcfgscanner.py
|
||||
@@ -1,5 +1,6 @@
|
||||
import errno
|
||||
import textwrap
|
||||
+from io import StringIO
|
||||
from os.path import basename
|
||||
|
||||
import mock
|
||||
@@ -63,8 +64,7 @@ def test_ifcfg1(monkeypatch):
|
||||
KEY_TYPE=key
|
||||
""")
|
||||
|
||||
- mock_config = mock.mock_open(read_data=ifcfg_file)
|
||||
- with mock.patch(_builtins_open, mock_config):
|
||||
+ with mock.patch(_builtins_open, return_value=StringIO(ifcfg_file)):
|
||||
monkeypatch.setattr(ifcfgscanner, "listdir", _listdir_ifcfg)
|
||||
monkeypatch.setattr(ifcfgscanner.path, "exists", _exists_ifcfg)
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
@@ -110,8 +110,8 @@ def test_ifcfg_key(monkeypatch):
|
||||
Report ifcfg secrets from keys- file.
|
||||
"""
|
||||
|
||||
- mock_config = mock.mock_open(read_data="KEY_PASSPHRASE1=Hell0")
|
||||
- with mock.patch(_builtins_open, mock_config):
|
||||
+ file_data = "KEY_PASSPHRASE1=Hell0"
|
||||
+ with mock.patch(_builtins_open, side_effect=lambda *a, **k: StringIO(file_data)):
|
||||
monkeypatch.setattr(ifcfgscanner, "listdir", _listdir_ifcfg)
|
||||
monkeypatch.setattr(ifcfgscanner.path, "exists", _exists_keys)
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py b/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
index 4b190149..f0482eef 100644
|
||||
--- a/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
+++ b/repos/system_upgrade/common/actors/luksscanner/tests/test_luksdump_parser.py
|
||||
@@ -7,8 +7,8 @@ CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def test_luksdump_parser_luks1(current_actor_context):
|
||||
- f = open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks1.txt'))
|
||||
- parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
+ with open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks1.txt')) as f:
|
||||
+ parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
|
||||
assert parsed_dict["Version"] == "1"
|
||||
assert parsed_dict["Cipher name"] == "aes"
|
||||
@@ -39,8 +39,8 @@ def test_luksdump_parser_luks1(current_actor_context):
|
||||
|
||||
|
||||
def test_luksdump_parser_luks2_tokens(current_actor_context):
|
||||
- f = open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks2_tokens.txt'))
|
||||
- parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
+ with open(os.path.join(CUR_DIR, 'files/luksDump_nvme0n1p3_luks2_tokens.txt')) as f:
|
||||
+ parsed_dict = LuksDumpParser.parse(f.readlines())
|
||||
|
||||
assert parsed_dict["Version"] == "2"
|
||||
assert parsed_dict["Epoch"] == "9"
|
||||
diff --git a/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py b/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
index 0b55c9fb..38a1cae7 100644
|
||||
--- a/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
+++ b/repos/system_upgrade/common/actors/scansaphana/tests/test_scansaphana.py
|
||||
@@ -77,9 +77,9 @@ class SubprocessCall(object):
|
||||
assert args[0][0:3] == ['sudo', '-u', self.admusername]
|
||||
cmd = args[0][3:]
|
||||
kwargs.pop('checked', None)
|
||||
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
- p.wait()
|
||||
- return {'exit_code': p.returncode, 'stdout': p.stdout.read()}
|
||||
+ with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
|
||||
+ stdout, stderr = p.communicate()
|
||||
+ return {'exit_code': p.returncode, 'stdout': stdout.decode('utf-8'), 'stderr': stderr.decode('utf-8')}
|
||||
|
||||
|
||||
def test_scansaphana_get_instance_status(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/libraries/guards.py b/repos/system_upgrade/common/libraries/guards.py
|
||||
index c8001817..ea2bf4dd 100644
|
||||
--- a/repos/system_upgrade/common/libraries/guards.py
|
||||
+++ b/repos/system_upgrade/common/libraries/guards.py
|
||||
@@ -34,7 +34,7 @@ def guarded_execution(*guards):
|
||||
def connection_guard(url='https://example.com'):
|
||||
def closure():
|
||||
try:
|
||||
- urlopen(url)
|
||||
+ urlopen(url) # pylint: disable=consider-using-with
|
||||
return None
|
||||
except URLError as e:
|
||||
cause = '''Failed to open url '{url}' with error: {error}'''.format(url=url, error=e)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
From 21bf23c218966040d4c3104d04ce0bcc39d0fb3d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 11:36:36 +0200
|
||||
Subject: [PATCH 33/55] pylint: duplicate-string-formatting-argument
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
repos/system_upgrade/common/libraries/fetch.py | 4 ++--
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index fd770061..aaa5d99e 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -51,7 +51,6 @@ disable=
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
- duplicate-string-formatting-argument, # TMP: will be fixed in close future
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
use-dict-literal,
|
||||
redundant-u-string-prefix, # still have py2 to support
|
||||
diff --git a/repos/system_upgrade/common/libraries/fetch.py b/repos/system_upgrade/common/libraries/fetch.py
|
||||
index 82bf4ff3..baf2c4eb 100644
|
||||
--- a/repos/system_upgrade/common/libraries/fetch.py
|
||||
+++ b/repos/system_upgrade/common/libraries/fetch.py
|
||||
@@ -56,8 +56,8 @@ def _request_data(service_path, cert, proxies, timeout=REQUEST_TIMEOUT):
|
||||
timeout = (timeout[0], timeout[1] + 10)
|
||||
if attempt > MAX_ATTEMPTS:
|
||||
logger.warning(
|
||||
- 'Attempt {} of {} to get {} failed: {}.'
|
||||
- .format(MAX_ATTEMPTS, MAX_ATTEMPTS, service_path, etype_msg)
|
||||
+ 'Attempt {max} of {max} to get {service} failed: {error}.'
|
||||
+ .format(max=MAX_ATTEMPTS, service=service_path, error=etype_msg)
|
||||
)
|
||||
raise
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
25
SOURCES/0034-pylint-enable-use-dict-literal.patch
Normal file
25
SOURCES/0034-pylint-enable-use-dict-literal.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 9cd95f0fb90a60b650ddc5bd05df6807f0e80a60 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:13:24 +0200
|
||||
Subject: [PATCH 34/55] pylint: enable use-dict-literal
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index aaa5d99e..bc051513 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,7 +52,6 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- use-dict-literal,
|
||||
redundant-u-string-prefix, # still have py2 to support
|
||||
logging-format-interpolation,
|
||||
logging-not-lazy,
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
43
SOURCES/0035-pylint-enable-redundant-u-string-prefix.patch
Normal file
43
SOURCES/0035-pylint-enable-redundant-u-string-prefix.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From d99c059cb0eae4d720a2d48fb39acf6e93bc0b0e Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:19:58 +0200
|
||||
Subject: [PATCH 35/55] pylint: enable redundant-u-string-prefix
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../common/actors/rootscanner/tests/test_rootscanner.py | 6 +++---
|
||||
2 files changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index bc051513..7d938715 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,7 +52,6 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- redundant-u-string-prefix, # still have py2 to support
|
||||
logging-format-interpolation,
|
||||
logging-not-lazy,
|
||||
use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
diff --git a/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py b/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
index 659a3017..07ce5da8 100644
|
||||
--- a/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/rootscanner/tests/test_rootscanner.py
|
||||
@@ -9,9 +9,9 @@ from leapp.libraries.actor.rootscanner import scan_dir
|
||||
|
||||
|
||||
@pytest.mark.parametrize("filename,symlink,count_invalid",
|
||||
- [(u'a_utf_file'.encode('utf-8'), u"utf8_symlink".encode('utf-8'), 0),
|
||||
- (u'простофайл'.encode('koi8-r'), u"этонеутф8".encode('koi8-r'), 2),
|
||||
- (u'a_utf_file'.encode('utf-8'), u"этонеутф8".encode('koi8-r'), 1)])
|
||||
+ [('a_utf_file'.encode('utf-8'), "utf8_symlink".encode('utf-8'), 0),
|
||||
+ ('простофайл'.encode('koi8-r'), "этонеутф8".encode('koi8-r'), 2),
|
||||
+ ('a_utf_file'.encode('utf-8'), "этонеутф8".encode('koi8-r'), 1)])
|
||||
def test_invalid_symlinks(filename, symlink, count_invalid):
|
||||
# Let's create a directory with both valid utf-8 and non-utf symlinks
|
||||
# NOTE(ivasilev) As this has to run for python2 as well can't use the nice tempfile.TemporaryDirectory way
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
110
SOURCES/0036-pylint-enable-logging-not-lazy.patch
Normal file
110
SOURCES/0036-pylint-enable-logging-not-lazy.patch
Normal file
@ -0,0 +1,110 @@
|
||||
From 078ba51a5851e388abe1357a552b981cba1acca9 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:43:04 +0200
|
||||
Subject: [PATCH 36/55] pylint: enable logging-not-lazy
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../rpmtransactionconfigtaskscollector.py | 5 +++--
|
||||
.../storagescanner/libraries/storagescanner.py | 8 ++++++--
|
||||
.../common/libraries/persistentnetnames.py | 2 +-
|
||||
.../libraries/multipathconfread.py | 14 +++++++++-----
|
||||
5 files changed, 19 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 7d938715..f7f4b25d 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -53,7 +53,6 @@ disable=
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
logging-format-interpolation,
|
||||
- logging-not-lazy,
|
||||
use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
|
||||
[FORMAT]
|
||||
diff --git a/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py b/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
index 43ac1fc4..84895f83 100644
|
||||
--- a/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
+++ b/repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/libraries/rpmtransactionconfigtaskscollector.py
|
||||
@@ -29,8 +29,9 @@ def load_tasks(base_dir, logger):
|
||||
filtered = set(to_install) - set(to_install_filtered)
|
||||
if filtered:
|
||||
api.current_logger().debug(
|
||||
- 'The following packages from "to_install" file will be ignored as they are already installed:'
|
||||
- '\n- ' + '\n- '.join(filtered))
|
||||
+ 'The following packages from "to_install" file will be ignored as they are already installed:\n- %s',
|
||||
+ '\n- '.join(filtered)
|
||||
+ )
|
||||
|
||||
return RpmTransactionTasks(
|
||||
to_install=to_install_filtered,
|
||||
diff --git a/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py b/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
index cae38731..e2d869da 100644
|
||||
--- a/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/storagescanner/libraries/storagescanner.py
|
||||
@@ -35,7 +35,7 @@ def _is_file_readable(path):
|
||||
def _get_cmd_output(cmd, delim, expected_len):
|
||||
""" Verify if command exists and return output """
|
||||
if not any(os.access(os.path.join(path, cmd[0]), os.X_OK) for path in os.environ['PATH'].split(os.pathsep)):
|
||||
- api.current_logger().warning("'%s': command not found" % cmd[0])
|
||||
+ api.current_logger().warning("'%s': command not found", cmd[0])
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -45,7 +45,11 @@ def _get_cmd_output(cmd, delim, expected_len):
|
||||
output = subprocess.check_output(cmd, env={'LVM_SUPPRESS_FD_WARNINGS': '1', 'PATH': os.environ['PATH']})
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
- api.current_logger().debug("Command '%s' return non-zero exit status: %s" % (" ".join(cmd), e.returncode))
|
||||
+ api.current_logger().debug(
|
||||
+ "Command '%s' returned non-zero exit status: %s",
|
||||
+ " ".join(cmd),
|
||||
+ e.returncode
|
||||
+ )
|
||||
return
|
||||
|
||||
if bytes is not str:
|
||||
diff --git a/repos/system_upgrade/common/libraries/persistentnetnames.py b/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
index 8769712c..7fdf7eaa 100644
|
||||
--- a/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
+++ b/repos/system_upgrade/common/libraries/persistentnetnames.py
|
||||
@@ -50,7 +50,7 @@ def interfaces():
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
# FIXME(msekleta): We should probably handle errors more granularly
|
||||
# Maybe we should inhibit upgrade process at this point
|
||||
- api.current_logger().warning('Failed to gather information about network interface: ' + str(e))
|
||||
+ api.current_logger().warning('Failed to gather information about network interface: %s', e)
|
||||
continue
|
||||
|
||||
yield Interface(**attrs)
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py b/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
index e5b3f06c..5b1cef50 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/multipathconfread/libraries/multipathconfread.py
|
||||
@@ -68,12 +68,16 @@ def _parse_config_dir(config_dir):
|
||||
res.append(conf)
|
||||
except OSError as e:
|
||||
if e.errno == errno.ENOENT:
|
||||
- api.current_logger().debug('Multipath conf directory ' +
|
||||
- '"{}" doesn\'t exist'.format(config_dir))
|
||||
+ api.current_logger().debug(
|
||||
+ 'Multipath conf directory "%s" doesn\'t exist',
|
||||
+ config_dir
|
||||
+ )
|
||||
else:
|
||||
- api.current_logger().warning('Failed to read multipath config ' +
|
||||
- 'directory ' +
|
||||
- '"{}": {}'.format(config_dir, e))
|
||||
+ api.current_logger().warning(
|
||||
+ 'Failed to read multipath config directory "%s": %s',
|
||||
+ config_dir,
|
||||
+ e
|
||||
+ )
|
||||
return res
|
||||
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
87
SOURCES/0037-pylint-enable-use-yield-from.patch
Normal file
87
SOURCES/0037-pylint-enable-use-yield-from.patch
Normal file
@ -0,0 +1,87 @@
|
||||
From 1104e25977b728a7059fc1ef4613ef55d1e0a9d7 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Wed, 13 Aug 2025 13:51:34 +0200
|
||||
Subject: [PATCH 37/55] pylint: enable use-yield-from
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 3 +--
|
||||
.../mount_units_generator/tests/test_mount_unit_generation.py | 3 +--
|
||||
.../actors/storagescanner/tests/unit_test_storagescanner.py | 3 +--
|
||||
.../tests/unit_test_targetuserspacecreator.py | 3 +--
|
||||
repos/system_upgrade/common/libraries/config/version.py | 3 +--
|
||||
5 files changed, 5 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index f7f4b25d..15a69461 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -52,8 +52,7 @@ disable=
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
- logging-format-interpolation,
|
||||
- use-yield-from # yield from cannot be used until we require python 3.3 or greater
|
||||
+ logging-format-interpolation
|
||||
|
||||
[FORMAT]
|
||||
# Maximum number of characters on a single line.
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index b814f6ce..9d75a31d 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -196,8 +196,7 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
('/source/dir', ['local-fs.target.requires'], ['unit1.mount', 'unit2.mount']),
|
||||
('/source/dir/local-fs.target.requires', [], ['unit1.mount', 'unit2.mount']),
|
||||
]
|
||||
- for i in tuples_to_yield:
|
||||
- yield i
|
||||
+ yield from tuples_to_yield
|
||||
|
||||
def mock_isdir(path):
|
||||
return 'local-fs.target.requires' in path
|
||||
diff --git a/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py b/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
index 456e40ec..3c7fcbd6 100644
|
||||
--- a/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/storagescanner/tests/unit_test_storagescanner.py
|
||||
@@ -268,8 +268,7 @@ def test_get_lsblk_info(monkeypatch):
|
||||
'crypt', '', '/dev/nvme0n1p1'],
|
||||
['/dev/nvme0n1p1', '259:1', '0', str(39 * bytes_per_gb), '0', 'part', '', '/dev/nvme0n1'],
|
||||
]
|
||||
- for output_line_parts in output_lines_split_on_whitespace:
|
||||
- yield output_line_parts
|
||||
+ yield from output_lines_split_on_whitespace
|
||||
elif len(cmd) == 5 and cmd[:4] == ['lsblk', '-nr', '--output', 'NAME,KNAME,SIZE']:
|
||||
# We cannot have the output in a list, since the command is called per device. Therefore, we have to map
|
||||
# each device path to its output.
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 2ae194d7..e78c3ac7 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -95,8 +95,7 @@ def traverse_structure(structure, root=Path('/')):
|
||||
filepath = root / filename
|
||||
|
||||
if isinstance(links_to, dict):
|
||||
- for pair in traverse_structure(links_to, filepath):
|
||||
- yield pair
|
||||
+ yield from traverse_structure(links_to, root=filepath)
|
||||
else:
|
||||
yield (filepath, links_to)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/version.py b/repos/system_upgrade/common/libraries/config/version.py
|
||||
index 00ce3ec8..5efa932d 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/version.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/version.py
|
||||
@@ -106,8 +106,7 @@ class _SupportedVersionsDict(dict):
|
||||
|
||||
def __iter__(self):
|
||||
self._feed_supported_versions()
|
||||
- for d in self.data:
|
||||
- yield d
|
||||
+ yield from self.data
|
||||
|
||||
def __repr__(self):
|
||||
self._feed_supported_versions()
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
1323
SOURCES/0038-pylint-enable-useless-object-inheritance.patch
Normal file
1323
SOURCES/0038-pylint-enable-useless-object-inheritance.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
||||
127
SOURCES/0039-pylint-enable-invalid-envvar-default.patch
Normal file
127
SOURCES/0039-pylint-enable-invalid-envvar-default.patch
Normal file
@ -0,0 +1,127 @@
|
||||
From e530472760f0df186531bf3d17323ee082c7fba8 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 13:12:24 +0200
|
||||
Subject: [PATCH 39/55] pylint: enable invalid-envvar-default
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../removeresumeservice/tests/test_removeresumeservice.py | 2 +-
|
||||
.../tests/test_scheduleselinuxrelabeling.py | 4 ++--
|
||||
.../tests/component_test_selinuxapplycustom.py | 2 +-
|
||||
.../tests/component_test_selinuxcontentscanner.py | 2 +-
|
||||
.../selinuxprepare/tests/component_test_selinuxprepare.py | 2 +-
|
||||
.../setpermissiveselinux/tests/test_setpermissiveselinux.py | 4 ++--
|
||||
7 files changed, 8 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index d98ab151..7a373e3d 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -45,7 +45,6 @@ disable=
|
||||
too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- invalid-envvar-default, # pylint3 warnings envvar returns str/none by default
|
||||
bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
diff --git a/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py b/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
index ea803856..d59ef346 100644
|
||||
--- a/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
+++ b/repos/system_upgrade/common/actors/removeresumeservice/tests/test_removeresumeservice.py
|
||||
@@ -11,7 +11,7 @@ import pytest
|
||||
'under the root user.',
|
||||
)
|
||||
# TODO make the test not destructive
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_remove_resume_service(current_actor_context):
|
||||
service_name = 'leapp_resume.service'
|
||||
diff --git a/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py b/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
index 595b9985..8603bd97 100644
|
||||
--- a/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
+++ b/repos/system_upgrade/common/actors/scheduleselinuxrelabeling/tests/test_scheduleselinuxrelabeling.py
|
||||
@@ -9,7 +9,7 @@ from leapp.snactor.fixture import current_actor_context
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system',
|
||||
)
|
||||
def test_schedule_no_relabel(current_actor_context):
|
||||
@@ -19,7 +19,7 @@ def test_schedule_no_relabel(current_actor_context):
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system',
|
||||
)
|
||||
def test_schedule_relabel(current_actor_context):
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
index 8a4665c1..aab18e58 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxapplycustom/tests/component_test_selinuxapplycustom.py
|
||||
@@ -72,7 +72,7 @@ def destructive_selinux_env():
|
||||
"Failed to remove SELinux customizations after testing")
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxApplyCustom(current_actor_context, destructive_selinux_teardown):
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
index faa2e1b0..802e038a 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxcontentscanner/tests/component_test_selinuxcontentscanner.py
|
||||
@@ -76,7 +76,7 @@ def find_semanage_rule(rules, rule):
|
||||
return next((r for r in rules if all(word in r for word in rule)), None)
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+@pytest.mark.skipif(os.getenv("DESTRUCTIVE_TESTING", "false") in ["False", "false", "0"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxContentScanner(current_actor_context, destructive_selinux_env):
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
index bad1baa2..d124675a 100644
|
||||
--- a/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
+++ b/repos/system_upgrade/common/actors/selinux/selinuxprepare/tests/component_test_selinuxprepare.py
|
||||
@@ -76,7 +76,7 @@ def destructive_selinux_env():
|
||||
_run_cmd(semodule_command)
|
||||
|
||||
|
||||
-@pytest.mark.skipif(os.getenv('DESTRUCTIVE_TESTING', False) in [False, '0'],
|
||||
+@pytest.mark.skipif(os.getenv('DESTRUCTIVE_TESTING', '0').lower() in ['false', '0'],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_SELinuxPrepare(current_actor_context, semodule_lfull_initial, semanage_export_initial,
|
||||
destructive_selinux_env):
|
||||
diff --git a/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py b/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
index efa4e550..9acdf39a 100644
|
||||
--- a/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
+++ b/repos/system_upgrade/common/actors/setpermissiveselinux/tests/test_setpermissiveselinux.py
|
||||
@@ -6,7 +6,7 @@ from leapp.models import SelinuxPermissiveDecision
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "0").lower() in ["0", "false"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def check_permissive_in_conf():
|
||||
""" Check if we have set permissive in SElinux conf file """
|
||||
@@ -19,7 +19,7 @@ def check_permissive_in_conf():
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
- os.getenv("DESTRUCTIVE_TESTING", False) in [False, "0"],
|
||||
+ os.getenv("DESTRUCTIVE_TESTING", "false").lower() in ["0", "false"],
|
||||
reason='Test disabled by default because it would modify the system')
|
||||
def test_set_selinux_permissive(current_actor_context):
|
||||
current_actor_context.feed(SelinuxPermissiveDecision(set_permissive=True))
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
613
SOURCES/0040-pylint-enable-bad-option-value.patch
Normal file
613
SOURCES/0040-pylint-enable-bad-option-value.patch
Normal file
@ -0,0 +1,613 @@
|
||||
From 81b24a657037ceffc3959abb4231a19352ca9a82 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 14:42:15 +0200
|
||||
Subject: [PATCH 40/55] pylint: enable bad-option-value
|
||||
|
||||
This pylint warning triggers when you try to disable a pylint check that is unknown or obsolete. Enabling this rule caused such warnings to appear, so the corresponding disables needed to be removed:
|
||||
* no-absolute-import -> Only relevant for Python 2. Python 3 uses absolute imports by default.
|
||||
* no-init -> Obsolete: __init__ method checks have changed, this option no longer exists.
|
||||
* bad-continuation -> Superseded by modern pylint formatting checks.
|
||||
* no-self-use -> Checks whether a method could be a function.
|
||||
* relative-import -> Python 3 discourages relative imports differently.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 8 +----
|
||||
commands/upgrade/breadcrumbs.py | 9 +++--
|
||||
.../checkmemory/libraries/checkmemory.py | 4 +--
|
||||
.../tests/test_enablerhsmtargetrepos.py | 3 +-
|
||||
.../tests/test_mount_unit_generation.py | 3 +-
|
||||
.../libraries/upgradeinitramfsgenerator.py | 2 +-
|
||||
.../unit_test_upgradeinitramfsgenerator.py | 2 +-
|
||||
.../tests/test_kernelcmdlineconfig.py | 4 +--
|
||||
.../opensshpermitrootlogincheck/actor.py | 6 ++--
|
||||
.../actors/persistentnetnamesdisable/actor.py | 6 ++--
|
||||
.../libraries/scankernel.py | 2 +-
|
||||
.../tests/unit_test_targetuserspacecreator.py | 3 +-
|
||||
.../tests/test_trustedgpgkeys.py | 2 +-
|
||||
.../common/files/rhel_upgrade.py | 9 +++--
|
||||
.../common/libraries/dnfplugin.py | 3 +-
|
||||
repos/system_upgrade/common/libraries/grub.py | 4 +--
|
||||
.../common/libraries/mounting.py | 3 +-
|
||||
.../common/libraries/overlaygen.py | 35 ++++++++++++-------
|
||||
.../common/libraries/tests/test_distro.py | 3 +-
|
||||
.../common/libraries/tests/test_grub.py | 2 +-
|
||||
.../common/libraries/tests/test_rhsm.py | 6 ++--
|
||||
.../common/libraries/testutils.py | 2 +-
|
||||
.../checkvdo/tests/unit_test_checkvdo.py | 6 ++--
|
||||
.../actors/nisscanner/libraries/nisscan.py | 6 ++--
|
||||
.../libraries/opensslconfigcheck.py | 3 +-
|
||||
25 files changed, 81 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 7a373e3d..0cba1129 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -9,23 +9,19 @@ disable=
|
||||
raising-bad-type,
|
||||
redundant-keyword-arg, # it's one or the other, this one is not so bad at all
|
||||
# "W" Warnings for stylistic problems or minor programming issues
|
||||
- no-absolute-import,
|
||||
arguments-differ,
|
||||
cell-var-from-loop,
|
||||
fixme,
|
||||
lost-exception,
|
||||
- no-init,
|
||||
pointless-string-statement,
|
||||
protected-access,
|
||||
redefined-outer-name,
|
||||
- relative-import,
|
||||
undefined-loop-variable,
|
||||
unsubscriptable-object,
|
||||
unused-argument,
|
||||
unused-import,
|
||||
unspecified-encoding,
|
||||
# "C" Coding convention violations
|
||||
- bad-continuation,
|
||||
missing-docstring,
|
||||
wrong-import-order,
|
||||
use-maxsplit-arg,
|
||||
@@ -33,7 +29,6 @@ disable=
|
||||
consider-using-enumerate,
|
||||
# "R" Refactor recommendations
|
||||
duplicate-code,
|
||||
- no-self-use,
|
||||
too-few-public-methods,
|
||||
too-many-branches,
|
||||
too-many-locals,
|
||||
@@ -42,10 +37,9 @@ disable=
|
||||
use-list-literal,
|
||||
use-dict-literal,
|
||||
too-many-lines, # we do not want to take care about that one
|
||||
- too-many-positional-arguments, # we cannot set yet max-possitional-arguments unfortunately
|
||||
+ too-many-positional-arguments,
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- bad-option-value, # python 2 doesn't have import-outside-toplevel, but in some case we need to import outside toplevel
|
||||
super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
diff --git a/commands/upgrade/breadcrumbs.py b/commands/upgrade/breadcrumbs.py
|
||||
index 1a90c143..95a551c3 100644
|
||||
--- a/commands/upgrade/breadcrumbs.py
|
||||
+++ b/commands/upgrade/breadcrumbs.py
|
||||
@@ -80,7 +80,8 @@ class _BreadCrumbs:
|
||||
# even though it shouldn't though, just ignore it
|
||||
pass
|
||||
|
||||
- def _commit_rhsm_facts(self):
|
||||
+ @staticmethod
|
||||
+ def _commit_rhsm_facts():
|
||||
if runs_in_container():
|
||||
return
|
||||
cmd = ['/usr/sbin/subscription-manager', 'facts', '--update']
|
||||
@@ -122,7 +123,8 @@ class _BreadCrumbs:
|
||||
except OSError:
|
||||
sys.stderr.write('WARNING: Could not write to /etc/migration-results\n')
|
||||
|
||||
- def _get_packages(self):
|
||||
+ @staticmethod
|
||||
+ def _get_packages():
|
||||
cmd = ['/bin/bash', '-c', 'rpm -qa --queryformat="%{nevra} %{SIGPGP:pgpsig}\n" | grep -Ee "leapp|snactor"']
|
||||
res = _call(cmd, lambda x, y: None, lambda x, y: None)
|
||||
if res.get('exit_code', None) == 0:
|
||||
@@ -131,7 +133,8 @@ class _BreadCrumbs:
|
||||
for t in [line.strip().split(' ', 1) for line in res['stdout'].split('\n') if line.strip()]]
|
||||
return []
|
||||
|
||||
- def _verify_leapp_pkgs(self):
|
||||
+ @staticmethod
|
||||
+ def _verify_leapp_pkgs():
|
||||
if not os.environ.get('LEAPP_IPU_IN_PROGRESS'):
|
||||
return []
|
||||
upg_path = os.environ.get('LEAPP_IPU_IN_PROGRESS').split('to')
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
index 808c9662..040b404b 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmemory/libraries/checkmemory.py
|
||||
@@ -34,8 +34,8 @@ def process():
|
||||
if minimum_req_error:
|
||||
title = 'Minimum memory requirements for RHEL {} are not met'.format(version.get_target_major_version())
|
||||
summary = 'Memory detected: {} MiB, required: {} MiB'.format(
|
||||
- int(minimum_req_error['detected'] / 1024), # noqa: W1619; pylint: disable=old-division
|
||||
- int(minimum_req_error['minimal_req'] / 1024), # noqa: W1619; pylint: disable=old-division
|
||||
+ int(minimum_req_error['detected'] / 1024),
|
||||
+ int(minimum_req_error['minimal_req'] / 1024),
|
||||
)
|
||||
reporting.create_report([
|
||||
reporting.Title(title),
|
||||
diff --git a/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py b/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
index f7b3f34a..dba38fff 100644
|
||||
--- a/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/enablerhsmtargetrepos/tests/test_enablerhsmtargetrepos.py
|
||||
@@ -17,7 +17,8 @@ def not_isolated_actions(raise_err=False):
|
||||
def __init__(self, base_dir=None):
|
||||
pass
|
||||
|
||||
- def call(self, cmd, **kwargs):
|
||||
+ @staticmethod
|
||||
+ def call(cmd, **kwargs):
|
||||
commands_called.append((cmd, kwargs))
|
||||
if raise_err:
|
||||
raise_call_error()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index 9d75a31d..8849ada9 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -249,7 +249,8 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
def __init__(self):
|
||||
self.base_dir = '/container'
|
||||
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return os.path.join('/container', path.lstrip('/'))
|
||||
|
||||
mock_container = MockedContainerContext()
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
index 3ad92167..f7e4a8af 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/libraries/upgradeinitramfsgenerator.py
|
||||
@@ -271,7 +271,7 @@ def _get_fspace(path, convert_to_mibs=False, coefficient=1):
|
||||
coefficient = min(coefficient, 1)
|
||||
fspace_bytes = int(stat.f_frsize * stat.f_bavail * coefficient)
|
||||
if convert_to_mibs:
|
||||
- return int(fspace_bytes / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(fspace_bytes / 1024 / 1024)
|
||||
return fspace_bytes
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
index 185cd4f0..b96bf79f 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/upgradeinitramfsgenerator/tests/unit_test_upgradeinitramfsgenerator.py
|
||||
@@ -257,7 +257,7 @@ class MockedGetFspace:
|
||||
def __call__(self, dummy_path, convert_to_mibs=False):
|
||||
if not convert_to_mibs:
|
||||
return self.space
|
||||
- return int(self.space / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(self.space / 1024 / 1024)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('input_msgs,dracut_modules,kernel_modules', [
|
||||
diff --git a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
index b7e51833..5b35bcd3 100644
|
||||
--- a/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/kernelcmdlineconfig/tests/test_kernelcmdlineconfig.py
|
||||
@@ -15,7 +15,7 @@ from leapp.models import InstalledTargetKernelInfo, KernelCmdlineArg, TargetKern
|
||||
|
||||
TARGET_KERNEL_NEVRA = 'kernel-core-1.2.3-4.x86_64.el8.x64_64'
|
||||
|
||||
-# pylint: disable=E501
|
||||
+# pylint: disable=line-too-long
|
||||
SAMPLE_KERNEL_ARGS = ('ro rootflags=subvol=root'
|
||||
' resume=/dev/mapper/luks-2c0df999-81ec-4a35-a1f9-b93afee8c6ad'
|
||||
' rd.luks.uuid=luks-90a6412f-c588-46ca-9118-5aca35943d25'
|
||||
@@ -31,7 +31,7 @@ title="Fedora Linux (6.5.13-100.fc37.x86_64) 37 (Thirty Seven)"
|
||||
id="a3018267cdd8451db7c77bb3e5b1403d-6.5.13-100.fc37.x86_64"
|
||||
""" # noqa: E501
|
||||
SAMPLE_GRUBBY_INFO_OUTPUT = TEMPLATE_GRUBBY_INFO_OUTPUT.format(SAMPLE_KERNEL_ARGS, SAMPLE_KERNEL_ROOT)
|
||||
-# pylint: enable=E501
|
||||
+# pylint: enable=line-too-long
|
||||
|
||||
|
||||
class MockedRun:
|
||||
diff --git a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
index 9c1a421c..98d329ab 100644
|
||||
--- a/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/opensshpermitrootlogincheck/actor.py
|
||||
@@ -55,7 +55,8 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
else:
|
||||
api.current_logger().warning('Unknown source major version: {}'.format(get_source_major_version()))
|
||||
|
||||
- def process7to8(self, config):
|
||||
+ @staticmethod
|
||||
+ def process7to8(config):
|
||||
# when the config was not modified, we can pass this check and let the
|
||||
# rpm handle the configuration file update
|
||||
if not config.modified:
|
||||
@@ -112,7 +113,8 @@ class OpenSshPermitRootLoginCheck(Actor):
|
||||
reporting.Groups([reporting.Groups.INHIBITOR])
|
||||
] + COMMON_RESOURCES)
|
||||
|
||||
- def process8to9(self, config):
|
||||
+ @staticmethod
|
||||
+ def process8to9(config):
|
||||
# RHEL8 default sshd configuration file is not modified: It will get replaced by rpm and
|
||||
# root will no longer be able to connect through ssh. This will probably result in many
|
||||
# false positives so it will have to be waived a lot
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
index 1add3588..b0182982 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesdisable/actor.py
|
||||
@@ -18,7 +18,8 @@ class PersistentNetNamesDisable(Actor):
|
||||
produces = (KernelCmdlineArg, Report)
|
||||
tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
|
||||
- def ethX_count(self, interfaces):
|
||||
+ @staticmethod
|
||||
+ def ethX_count(interfaces):
|
||||
ethX = re.compile('eth[0-9]+')
|
||||
count = 0
|
||||
|
||||
@@ -27,7 +28,8 @@ class PersistentNetNamesDisable(Actor):
|
||||
count = count + 1
|
||||
return count
|
||||
|
||||
- def single_eth0(self, interfaces):
|
||||
+ @staticmethod
|
||||
+ def single_eth0(interfaces):
|
||||
return len(interfaces) == 1 and interfaces[0].name == 'eth0'
|
||||
|
||||
def disable_persistent_naming(self):
|
||||
diff --git a/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py b/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
index c1cc69ee..35683cca 100644
|
||||
--- a/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
+++ b/repos/system_upgrade/common/actors/scaninstalledtargetkernelversion/libraries/scankernel.py
|
||||
@@ -70,7 +70,7 @@ def get_boot_files_provided_by_kernel_pkg(kernel_nevra):
|
||||
|
||||
@suppress_deprecation(InstalledTargetKernelVersion)
|
||||
def process():
|
||||
- # pylint: disable=no-else-return - false positive
|
||||
+ # pylint: disable=no-else-return # false positive
|
||||
# TODO: should we take care about stuff of kernel-rt and kernel in the same
|
||||
# time when both are present? or just one? currently, handle only one
|
||||
# of these during the upgrade. kernel-rt has higher prio when original sys
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index 1e5b87b0..bb17d89a 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -50,7 +50,8 @@ class MockedMountingBase:
|
||||
def __call__(self, **dummy_kwarg):
|
||||
yield self
|
||||
|
||||
- def call(self, *args, **kwargs):
|
||||
+ @staticmethod
|
||||
+ def call(*args, **kwargs):
|
||||
return {'stdout': ''}
|
||||
|
||||
def nspawn(self):
|
||||
diff --git a/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py b/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
index 7497c2a9..b8229d00 100644
|
||||
--- a/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
+++ b/repos/system_upgrade/common/actors/trustedgpgkeysscanner/tests/test_trustedgpgkeys.py
|
||||
@@ -40,7 +40,7 @@ class MockedGetGpgFromFile:
|
||||
self._data[fname] = fps
|
||||
|
||||
def get_files(self):
|
||||
- return self._data.keys() # noqa: W1655; pylint: disable=dict-keys-not-iterating
|
||||
+ return self._data.keys()
|
||||
|
||||
def __call__(self, fname):
|
||||
return self._data.get(fname, [])
|
||||
diff --git a/repos/system_upgrade/common/files/rhel_upgrade.py b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
index 4f76a61d..a5d7045b 100644
|
||||
--- a/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
+++ b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
@@ -49,7 +49,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
metavar="[%s]" % "|".join(CMDS))
|
||||
parser.add_argument('filename')
|
||||
|
||||
- def _process_entities(self, entities, op, entity_name):
|
||||
+ @staticmethod
|
||||
+ def _process_entities(entities, op, entity_name):
|
||||
"""
|
||||
Adds list of packages for given operation to the transaction
|
||||
"""
|
||||
@@ -73,7 +74,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
with open(self.opts.filename, 'w+') as fo:
|
||||
json.dump(self.plugin_data, fo, sort_keys=True, indent=2)
|
||||
|
||||
- def _read_aws_region(self, repo):
|
||||
+ @staticmethod
|
||||
+ def _read_aws_region(repo):
|
||||
region = None
|
||||
if repo.baseurl:
|
||||
# baseurl is tuple (changed by Amazon-id plugin)
|
||||
@@ -86,7 +88,8 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
sys.exit(1)
|
||||
return region
|
||||
|
||||
- def _fix_rhui_url(self, repo, region):
|
||||
+ @staticmethod
|
||||
+ def _fix_rhui_url(repo, region):
|
||||
if repo.baseurl:
|
||||
repo.baseurl = tuple(
|
||||
url.replace('REGION', region, 1) for url in repo.baseurl
|
||||
diff --git a/repos/system_upgrade/common/libraries/dnfplugin.py b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
index 4f0c3a99..1af52dc5 100644
|
||||
--- a/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
+++ b/repos/system_upgrade/common/libraries/dnfplugin.py
|
||||
@@ -461,9 +461,10 @@ def perform_transaction_install(target_userspace_info, storage_info, used_repos,
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _prepare_perform(used_repos, target_userspace_info, xfs_info, storage_info, target_iso=None):
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
+ # noqa: W0135
|
||||
reserve_space = overlaygen.get_recommended_leapp_free_space(target_userspace_info.path)
|
||||
with _prepare_transaction(used_repos=used_repos,
|
||||
target_userspace_info=target_userspace_info
|
||||
diff --git a/repos/system_upgrade/common/libraries/grub.py b/repos/system_upgrade/common/libraries/grub.py
|
||||
index 71432371..77679d01 100644
|
||||
--- a/repos/system_upgrade/common/libraries/grub.py
|
||||
+++ b/repos/system_upgrade/common/libraries/grub.py
|
||||
@@ -34,7 +34,6 @@ class EFIBootLoaderEntry:
|
||||
"""
|
||||
Representation of an UEFI boot loader entry.
|
||||
"""
|
||||
- # pylint: disable=eq-without-hash
|
||||
|
||||
def __init__(self, boot_number, label, active, efi_bin_source):
|
||||
self.boot_number = boot_number
|
||||
@@ -163,7 +162,8 @@ class EFIBootInfo:
|
||||
# it's not expected that no entry exists
|
||||
raise StopActorExecution('UEFI: Unable to detect any UEFI bootloader entry.')
|
||||
|
||||
- def _parse_key_value(self, bootmgr_output, key):
|
||||
+ @staticmethod
|
||||
+ def _parse_key_value(bootmgr_output, key):
|
||||
# e.g.: <key>: <value>
|
||||
for line in bootmgr_output.splitlines():
|
||||
if line.startswith(key + ':'):
|
||||
diff --git a/repos/system_upgrade/common/libraries/mounting.py b/repos/system_upgrade/common/libraries/mounting.py
|
||||
index 4e99e31e..ae3885cf 100644
|
||||
--- a/repos/system_upgrade/common/libraries/mounting.py
|
||||
+++ b/repos/system_upgrade/common/libraries/mounting.py
|
||||
@@ -66,7 +66,8 @@ class IsolationType:
|
||||
""" Release the isolation context """
|
||||
pass
|
||||
|
||||
- def make_command(self, cmd):
|
||||
+ @staticmethod
|
||||
+ def make_command(cmd):
|
||||
""" Transform the given command to the isolated environment """
|
||||
return cmd
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
index a048af2b..83dc33b8 100644
|
||||
--- a/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
|
||||
@@ -185,7 +185,7 @@ def _get_fspace(path, convert_to_mibs=False, coefficient=1):
|
||||
coefficient = min(coefficient, 1)
|
||||
fspace_bytes = int(stat.f_frsize * stat.f_bavail * coefficient)
|
||||
if convert_to_mibs:
|
||||
- return int(fspace_bytes / 1024 / 1024) # noqa: W1619; pylint: disable=old-division
|
||||
+ return int(fspace_bytes / 1024 / 1024)
|
||||
return fspace_bytes
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ def _prepare_required_mounts(scratch_dir, mounts_dir, storage_info, scratch_rese
|
||||
|
||||
@contextlib.contextmanager
|
||||
def _build_overlay_mount(root_mount, mounts):
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
if not root_mount:
|
||||
@@ -480,8 +480,8 @@ def _create_mount_disk_image(disk_images_directory, path, disk_size):
|
||||
# NOTE(pstodulk): In case the formatting params are modified,
|
||||
# the minimal required size could be different
|
||||
api.current_logger().warning(
|
||||
- 'The apparent size for the disk image representing {path}'
|
||||
- ' is too small ({disk_size} MiBs) for a formatting. Setting 130 MiBs instead.'
|
||||
+ 'The apparent size for the disk image representing {path} '
|
||||
+ 'is too small ({disk_size} MiBs) for a formatting. Setting 130 MiBs instead.'
|
||||
.format(path=path, disk_size=disk_size)
|
||||
)
|
||||
disk_size = 130
|
||||
@@ -489,12 +489,11 @@ def _create_mount_disk_image(disk_images_directory, path, disk_size):
|
||||
cmd = [
|
||||
'/bin/dd',
|
||||
'if=/dev/zero', 'of={}'.format(diskimage_path),
|
||||
- 'bs=1M', 'count=0', 'seek={}'.format(disk_size)
|
||||
+ 'bs=1M', 'count=0', 'seek={}'.format(disk_size),
|
||||
]
|
||||
hint = (
|
||||
'Please ensure that there is enough diskspace on the partition hosting'
|
||||
- 'the {} directory.'
|
||||
- .format(disk_images_directory)
|
||||
+ 'the {} directory.'.format(disk_images_directory)
|
||||
)
|
||||
|
||||
api.current_logger().debug('Attempting to create disk image at %s', diskimage_path)
|
||||
@@ -540,7 +539,9 @@ def _create_mounts_dir(scratch_dir, mounts_dir):
|
||||
utils.makedirs(mounts_dir)
|
||||
api.current_logger().debug('Done creating mount directories.')
|
||||
except OSError:
|
||||
- api.current_logger().error('Failed to create mounting directories %s', mounts_dir, exc_info=True)
|
||||
+ api.current_logger().error(
|
||||
+ 'Failed to create mounting directories %s', mounts_dir, exc_info=True
|
||||
+ )
|
||||
|
||||
# This is an attempt for giving the user a chance to resolve it on their own
|
||||
raise StopActorExecutionError(
|
||||
@@ -556,17 +557,25 @@ def _mount_dnf_cache(overlay_target):
|
||||
"""
|
||||
Convenience context manager to ensure bind mounted /var/cache/dnf and removal of the mount.
|
||||
"""
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
with mounting.BindMount(
|
||||
- source='/var/cache/dnf',
|
||||
- target=os.path.join(overlay_target, 'var', 'cache', 'dnf')) as cache_mount:
|
||||
+ source='/var/cache/dnf',
|
||||
+ target=os.path.join(overlay_target, 'var', 'cache', 'dnf'),
|
||||
+ ) as cache_mount:
|
||||
yield cache_mount
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
-def create_source_overlay(mounts_dir, scratch_dir, xfs_info, storage_info, mount_target=None, scratch_reserve=0):
|
||||
+def create_source_overlay(
|
||||
+ mounts_dir,
|
||||
+ scratch_dir,
|
||||
+ xfs_info,
|
||||
+ storage_info,
|
||||
+ mount_target=None,
|
||||
+ scratch_reserve=0,
|
||||
+):
|
||||
"""
|
||||
Context manager that prepares the source system overlay and yields the mount.
|
||||
|
||||
@@ -610,7 +619,7 @@ def create_source_overlay(mounts_dir, scratch_dir, xfs_info, storage_info, mount
|
||||
:type scratch_reserve: Optional[int]
|
||||
:rtype: mounting.BindMount or mounting.NullMount
|
||||
"""
|
||||
- # noqa: W0135; pylint: disable=contextmanager-generator-missing-cleanup
|
||||
+ # noqa: W0135; pylint: disable=bad-option-value,contextmanager-generator-missing-cleanup
|
||||
# NOTE(pstodulk): the pylint check is not valid in this case - finally is covered
|
||||
# implicitly
|
||||
api.current_logger().debug('Creating source overlay in {scratch_dir} with mounts in {mounts_dir}'.format(
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_distro.py b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
index 8e866455..13e782e6 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_distro.py
|
||||
@@ -168,7 +168,8 @@ def test_get_distro_repoids(
|
||||
monkeypatch.setattr(os.path, 'exists', lambda f: f in _CENTOS_REPOFILES)
|
||||
|
||||
class MockedContext:
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return path
|
||||
|
||||
repoids = get_distro_repoids(MockedContext(), distro_id, '9', 'x86_64')
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_grub.py b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
index d6f428bb..08dc6895 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_grub.py
|
||||
@@ -23,7 +23,7 @@ INVALID_DD = b'Nothing to see here!'
|
||||
|
||||
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
-# pylint: disable=E501
|
||||
+# pylint: disable=line-too-long
|
||||
# flake8: noqa: E501
|
||||
EFIBOOTMGR_OUTPUT = r"""
|
||||
BootCurrent: 0006
|
||||
diff --git a/repos/system_upgrade/common/libraries/tests/test_rhsm.py b/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
index 84a1bd5e..b118da29 100644
|
||||
--- a/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
+++ b/repos/system_upgrade/common/libraries/tests/test_rhsm.py
|
||||
@@ -73,7 +73,8 @@ class IsolatedActionsMocked:
|
||||
# A map from called commands to their mocked output
|
||||
self.mocked_command_call_outputs = dict()
|
||||
|
||||
- def is_isolated(self):
|
||||
+ @staticmethod
|
||||
+ def is_isolated():
|
||||
return True
|
||||
|
||||
def call(self, cmd, *args, **dummy_kwargs):
|
||||
@@ -93,7 +94,8 @@ class IsolatedActionsMocked:
|
||||
'exit_code': exit_code
|
||||
}
|
||||
|
||||
- def full_path(self, path):
|
||||
+ @staticmethod
|
||||
+ def full_path(path):
|
||||
return path
|
||||
|
||||
def remove(self, path):
|
||||
diff --git a/repos/system_upgrade/common/libraries/testutils.py b/repos/system_upgrade/common/libraries/testutils.py
|
||||
index 328a7ede..e84cc03a 100644
|
||||
--- a/repos/system_upgrade/common/libraries/testutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/testutils.py
|
||||
@@ -120,7 +120,7 @@ class CurrentActorMocked: # pylint:disable=R0904
|
||||
return os.path.join(self._common_tools_folder, name)
|
||||
|
||||
def consume(self, model):
|
||||
- return iter(filter( # pylint:disable=W0110,W1639
|
||||
+ return iter(filter(
|
||||
lambda msg: isinstance(msg, model), self._msgs
|
||||
))
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py b/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
index 865e036f..d7cfb4fb 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/checkvdo/tests/unit_test_checkvdo.py
|
||||
@@ -15,13 +15,15 @@ from leapp.utils.report import is_inhibitor
|
||||
|
||||
# Mock actor base for CheckVdo tests.
|
||||
class MockedActorCheckVdo(CurrentActorMocked):
|
||||
- def get_vdo_answer(self):
|
||||
+ @staticmethod
|
||||
+ def get_vdo_answer():
|
||||
return False
|
||||
|
||||
|
||||
# Mock actor for all_vdo_converted dialog response.
|
||||
class MockedActorAllVdoConvertedTrue(MockedActorCheckVdo):
|
||||
- def get_vdo_answer(self):
|
||||
+ @staticmethod
|
||||
+ def get_vdo_answer():
|
||||
return True
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py b/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
index 9910f748..ae51c69d 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/nisscanner/libraries/nisscan.py
|
||||
@@ -14,7 +14,8 @@ class NISScanLibrary:
|
||||
Helper library for NISScan actor.
|
||||
"""
|
||||
|
||||
- def client_has_non_default_configuration(self):
|
||||
+ @staticmethod
|
||||
+ def client_has_non_default_configuration():
|
||||
"""
|
||||
Check for any significant ypbind configuration lines in .conf file.
|
||||
"""
|
||||
@@ -31,7 +32,8 @@ class NISScanLibrary:
|
||||
return True
|
||||
return False
|
||||
|
||||
- def server_has_non_default_configuration(self):
|
||||
+ @staticmethod
|
||||
+ def server_has_non_default_configuration():
|
||||
"""
|
||||
Check for any additional (not default) files in ypserv DIR.
|
||||
"""
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
index f36a62e1..07c1b22f 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/opensslconfigcheck/libraries/opensslconfigcheck.py
|
||||
@@ -115,7 +115,8 @@ def _openssl_reachable_key(config, key, value=None):
|
||||
return False
|
||||
|
||||
|
||||
-# pylint: disable=too-many-return-statements -- could not simplify more
|
||||
+# pylint: disable=too-many-return-statements
|
||||
+# could not simplify more
|
||||
def _openssl_reachable_path(config, path, value=None):
|
||||
"""
|
||||
Check if the given path is reachable in OpenSSL configuration
|
||||
--
|
||||
2.51.1
|
||||
|
||||
182
SOURCES/0041-pylint-enable-super-with-arguments.patch
Normal file
182
SOURCES/0041-pylint-enable-super-with-arguments.patch
Normal file
@ -0,0 +1,182 @@
|
||||
From 2abc41bb019a0ebef73e48f2a50990d8e5038e51 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 18 Aug 2025 15:16:36 +0200
|
||||
Subject: [PATCH 41/55] pylint: enable super-with-arguments
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../unit_test_applytransactionworkarounds.py | 2 +-
|
||||
.../common/files/rhel_upgrade.py | 4 +--
|
||||
.../common/libraries/mounting.py | 28 +++++++++++--------
|
||||
.../common/libraries/repofileutils.py | 2 +-
|
||||
5 files changed, 20 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 0cba1129..4cfc49e0 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -40,7 +40,6 @@ disable=
|
||||
too-many-positional-arguments,
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
- super-with-arguments, # required in python 2
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
diff --git a/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py b/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
index 369514fc..96b8094f 100644
|
||||
--- a/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
+++ b/repos/system_upgrade/common/actors/applytransactionworkarounds/tests/unit_test_applytransactionworkarounds.py
|
||||
@@ -7,7 +7,7 @@ from leapp.models import DNFWorkaround
|
||||
|
||||
class ShowMessageCurrentActorMocked(CurrentActorMocked):
|
||||
def __init__(self, *args, **kwargs):
|
||||
- super(ShowMessageCurrentActorMocked, self).__init__(*args, **kwargs)
|
||||
+ super().__init__(*args, **kwargs)
|
||||
self._show_messages = []
|
||||
|
||||
@property
|
||||
diff --git a/repos/system_upgrade/common/files/rhel_upgrade.py b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
index a5d7045b..63910fe0 100644
|
||||
--- a/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
+++ b/repos/system_upgrade/common/files/rhel_upgrade.py
|
||||
@@ -40,7 +40,7 @@ class RhelUpgradeCommand(dnf.cli.Command):
|
||||
summary = 'Plugin for upgrading to the next RHEL major release'
|
||||
|
||||
def __init__(self, cli):
|
||||
- super(RhelUpgradeCommand, self).__init__(cli)
|
||||
+ super().__init__(cli)
|
||||
self.plugin_data = {}
|
||||
|
||||
@staticmethod
|
||||
@@ -225,6 +225,6 @@ class RhelUpgradePlugin(dnf.Plugin):
|
||||
name = 'rhel-upgrade'
|
||||
|
||||
def __init__(self, base, cli):
|
||||
- super(RhelUpgradePlugin, self).__init__(base, cli)
|
||||
+ super().__init__(base, cli)
|
||||
if cli:
|
||||
cli.register_command(RhelUpgradeCommand)
|
||||
diff --git a/repos/system_upgrade/common/libraries/mounting.py b/repos/system_upgrade/common/libraries/mounting.py
|
||||
index ae3885cf..279d31dc 100644
|
||||
--- a/repos/system_upgrade/common/libraries/mounting.py
|
||||
+++ b/repos/system_upgrade/common/libraries/mounting.py
|
||||
@@ -46,7 +46,7 @@ class MountError(Exception):
|
||||
""" Exception that is thrown when a mount related operation failed """
|
||||
|
||||
def __init__(self, message, details):
|
||||
- super(MountError, self).__init__(message)
|
||||
+ super().__init__(message)
|
||||
self.details = details
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class IsolationType:
|
||||
""" systemd-nspawn implementation """
|
||||
|
||||
def __init__(self, target, binds=(), env_vars=None):
|
||||
- super(IsolationType.NSPAWN, self).__init__(target=target)
|
||||
+ super().__init__(target=target)
|
||||
self.binds = list(binds) + ALWAYS_BIND
|
||||
self.env_vars = env_vars or get_all_envs()
|
||||
|
||||
@@ -98,7 +98,7 @@ class IsolationType:
|
||||
""" chroot implementation """
|
||||
|
||||
def __init__(self, target):
|
||||
- super(IsolationType.CHROOT, self).__init__(target)
|
||||
+ super().__init__(target)
|
||||
self.context = None
|
||||
|
||||
def create(self):
|
||||
@@ -262,14 +262,14 @@ class ChrootActions(IsolatedActions):
|
||||
""" Isolation with chroot """
|
||||
|
||||
def __init__(self, base_dir):
|
||||
- super(ChrootActions, self).__init__(base_dir=base_dir, implementation=IsolationType.CHROOT)
|
||||
+ super().__init__(base_dir=base_dir, implementation=IsolationType.CHROOT)
|
||||
|
||||
|
||||
class NspawnActions(IsolatedActions):
|
||||
""" Isolation with systemd-nspawn """
|
||||
|
||||
def __init__(self, base_dir, binds=(), env_vars=None):
|
||||
- super(NspawnActions, self).__init__(
|
||||
+ super().__init__(
|
||||
base_dir=base_dir, implementation=IsolationType.NSPAWN, binds=binds, env_vars=env_vars)
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ class NotIsolatedActions(IsolatedActions):
|
||||
_isolated = False
|
||||
|
||||
def __init__(self, base_dir):
|
||||
- super(NotIsolatedActions, self).__init__(base_dir=base_dir, implementation=IsolationType.NONE)
|
||||
+ super().__init__(base_dir=base_dir, implementation=IsolationType.NONE)
|
||||
|
||||
|
||||
class MountConfig:
|
||||
@@ -375,7 +375,7 @@ class NullMount(MountingBase):
|
||||
""" This is basically a NoOp for compatibility with other mount operations, in case a mount is optional """
|
||||
|
||||
def __init__(self, target, config=MountConfig.AttachOnly):
|
||||
- super(NullMount, self).__init__(source=target, target=target, mode=MountingMode.NONE, config=config)
|
||||
+ super().__init__(source=target, target=target, mode=MountingMode.NONE, config=config)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
@@ -388,21 +388,21 @@ class LoopMount(MountingBase):
|
||||
""" Performs loop mounts """
|
||||
|
||||
def __init__(self, source, target, config=MountConfig.Mount):
|
||||
- super(LoopMount, self).__init__(source=source, target=target, mode=MountingMode.LOOP, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.LOOP, config=config)
|
||||
|
||||
|
||||
class BindMount(MountingBase):
|
||||
""" Performs bind mounts """
|
||||
|
||||
def __init__(self, source, target, config=MountConfig.Mount):
|
||||
- super(BindMount, self).__init__(source=source, target=target, mode=MountingMode.BIND, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.BIND, config=config)
|
||||
|
||||
|
||||
class TypedMount(MountingBase):
|
||||
""" Performs a typed mounts """
|
||||
|
||||
def __init__(self, fstype, source, target, config=MountConfig.Mount):
|
||||
- super(TypedMount, self).__init__(source=source, target=target, mode=MountingMode.FSTYPE, config=config)
|
||||
+ super().__init__(source=source, target=target, mode=MountingMode.FSTYPE, config=config)
|
||||
self.fstype = fstype
|
||||
|
||||
def _mount_options(self):
|
||||
@@ -416,8 +416,12 @@ class OverlayMount(MountingBase):
|
||||
""" Performs an overlayfs mount """
|
||||
|
||||
def __init__(self, name, source, workdir, config=MountConfig.Mount):
|
||||
- super(OverlayMount, self).__init__(source=source, target=os.path.join(workdir, name),
|
||||
- mode=MountingMode.OVERLAY, config=config)
|
||||
+ super().__init__(
|
||||
+ source=source,
|
||||
+ target=os.path.join(workdir, name),
|
||||
+ mode=MountingMode.OVERLAY,
|
||||
+ config=config
|
||||
+ )
|
||||
self._upper_dir = os.path.join(workdir, 'upper')
|
||||
self._work_dir = os.path.join(workdir, 'work')
|
||||
self.additional_directories = (self._upper_dir, self._work_dir)
|
||||
diff --git a/repos/system_upgrade/common/libraries/repofileutils.py b/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
index cab3c42b..376473a4 100644
|
||||
--- a/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/repofileutils.py
|
||||
@@ -16,7 +16,7 @@ class InvalidRepoDefinition(Exception):
|
||||
def __init__(self, msg, repofile, repoid):
|
||||
message = 'Invalid repository definition: {repoid} in: {repofile}: {msg}'.format(
|
||||
repoid=repoid, repofile=repofile, msg=msg)
|
||||
- super(InvalidRepoDefinition, self).__init__(message)
|
||||
+ super().__init__(message)
|
||||
self.repofile = repofile
|
||||
self.repoid = repoid
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
|
||||
|
||||
203
SOURCES/0042-pylint-enable-use-a-generator.patch
Normal file
203
SOURCES/0042-pylint-enable-use-a-generator.patch
Normal file
@ -0,0 +1,203 @@
|
||||
From 215f307eeb1362e420ac08f528f9f11d6c1c974d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Fratrik <tfratrik@redhat.com>
|
||||
Date: Mon, 8 Sep 2025 08:10:13 +0200
|
||||
Subject: [PATCH 42/55] pylint: enable use-a-generator
|
||||
|
||||
Comprehensions inside functions like any(), all(), max(), min(), or sum()
|
||||
are unnecessary. Enabling this warning enforces using generator expressions
|
||||
instead of full list/set comprehensions in these cases.
|
||||
|
||||
Jira: RHELMISC-16038
|
||||
---
|
||||
.pylintrc | 1 -
|
||||
.../common/actors/checkluks/libraries/checkluks.py | 2 +-
|
||||
.../actors/checksaphana/tests/test_checksaphana.py | 7 +++++--
|
||||
.../tests/test_ddddload.py | 2 +-
|
||||
.../tests/test_persistentnetnamesconfig.py | 2 +-
|
||||
.../libraries/scandynamiclinkerconfiguration.py | 2 +-
|
||||
.../tests/test_checksystemdbrokensymlinks.py | 4 ++--
|
||||
.../tests/test_transitionsystemdservicesstates.py | 6 ++----
|
||||
.../tests/unit_test_targetuserspacecreator.py | 4 ++--
|
||||
.../actors/rocecheck/tests/unit_test_rocecheck.py | 10 ++++++++--
|
||||
10 files changed, 23 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/.pylintrc b/.pylintrc
|
||||
index 4cfc49e0..a82f8818 100644
|
||||
--- a/.pylintrc
|
||||
+++ b/.pylintrc
|
||||
@@ -41,7 +41,6 @@ disable=
|
||||
# new for python3 version of pylint
|
||||
unnecessary-pass,
|
||||
raise-missing-from, # no 'raise from' in python 2
|
||||
- use-a-generator, # cannot be modified because of Python2 support
|
||||
consider-using-f-string, # sorry, not gonna happen, still have to support py2
|
||||
logging-format-interpolation
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
index d52b9e73..84e8e61f 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkluks/libraries/checkluks.py
|
||||
@@ -27,7 +27,7 @@ def _formatted_list_output(input_list, sep=FMT_LIST_SEPARATOR):
|
||||
|
||||
|
||||
def _at_least_one_tpm_token(luks_dump):
|
||||
- return any([token.token_type == "clevis-tpm2" for token in luks_dump.tokens])
|
||||
+ return any(token.token_type == "clevis-tpm2" for token in luks_dump.tokens)
|
||||
|
||||
|
||||
def _get_ceph_volumes():
|
||||
diff --git a/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py b/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
index 29e9c930..8ec8d17f 100644
|
||||
--- a/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
+++ b/repos/system_upgrade/common/actors/checksaphana/tests/test_checksaphana.py
|
||||
@@ -284,7 +284,7 @@ def test_checksaphana_perform_check(monkeypatch):
|
||||
# Expected 3 reports due to v1names + v2lownames + running
|
||||
assert len(reports) == 3
|
||||
# Verifies that all expected title patterns are within the reports and not just coincidentally 3
|
||||
- assert all([any([pattern(report) for report in reports]) for pattern in EXPECTED_TITLE_PATTERNS.values()])
|
||||
+ assert all(any(pattern(report) for report in reports) for pattern in EXPECTED_TITLE_PATTERNS.values())
|
||||
|
||||
list_clear(reports)
|
||||
monkeypatch.setattr(checksaphana.api, 'consume', _consume_mock_sap_hana_info(
|
||||
@@ -294,4 +294,7 @@ def test_checksaphana_perform_check(monkeypatch):
|
||||
# Expected 2 reports due to v1names + v2lownames
|
||||
assert len(reports) == 2
|
||||
# Verifies that all expected title patterns are within the reports and not just coincidentally 2
|
||||
- assert all([any([EXPECTED_TITLE_PATTERNS[pattern](report) for report in reports]) for pattern in ['v1', 'low']])
|
||||
+ assert all(
|
||||
+ any(EXPECTED_TITLE_PATTERNS[pattern](report) for report in reports)
|
||||
+ for pattern in ['v1', 'low']
|
||||
+ )
|
||||
diff --git a/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py b/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
index c3386745..1f3473b6 100644
|
||||
--- a/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
+++ b/repos/system_upgrade/common/actors/loaddevicedriverdeprecationdata/tests/test_ddddload.py
|
||||
@@ -60,7 +60,7 @@ def test_filtered_load(monkeypatch):
|
||||
|
||||
assert produced
|
||||
assert len(produced[0].entries) == 3
|
||||
- assert not any([e.device_type == 'unsupported' for e in produced[0].entries])
|
||||
+ assert not any(e.device_type == 'unsupported' for e in produced[0].entries)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('data', (
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
index 5ad52c43..ee199ae4 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
@@ -177,7 +177,7 @@ def test_bz_1899455_crash_iface(monkeypatch, adjust_cwd):
|
||||
|
||||
for prod_models in [RenamedInterfaces, InitrdIncludes, TargetInitramfsTasks]:
|
||||
any(isinstance(i, prod_models) for i in persistentnetnamesconfig.api.produce.model_instances)
|
||||
- assert any(['Some network devices' in x for x in persistentnetnamesconfig.api.current_logger.warnmsg])
|
||||
+ assert any('Some network devices' in x for x in persistentnetnamesconfig.api.current_logger.warnmsg)
|
||||
|
||||
|
||||
def test_no_network_renaming(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py b/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
index 8d3b473e..73b0c84e 100644
|
||||
--- a/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
+++ b/repos/system_upgrade/common/actors/scandynamiclinkerconfiguration/libraries/scandynamiclinkerconfiguration.py
|
||||
@@ -113,5 +113,5 @@ def scan_dynamic_linker_configuration():
|
||||
included_configs=included_config_files,
|
||||
used_variables=used_variables)
|
||||
|
||||
- if other_lines or any([config.modified for config in included_config_files]) or used_variables:
|
||||
+ if other_lines or any(config.modified for config in included_config_files) or used_variables:
|
||||
api.produce(configuration)
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py b/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
index bcc33f13..a4c0a657 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/checksystemdbrokensymlinks/tests/test_checksystemdbrokensymlinks.py
|
||||
@@ -20,7 +20,7 @@ def test_report_broken_symlinks(monkeypatch):
|
||||
checksystemdbrokensymlinks._report_broken_symlinks(symlinks)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields['summary'] for s in symlinks])
|
||||
+ assert all(s in created_reports.report_fields['summary'] for s in symlinks)
|
||||
|
||||
|
||||
def test_report_enabled_services_broken_symlinks(monkeypatch):
|
||||
@@ -35,7 +35,7 @@ def test_report_enabled_services_broken_symlinks(monkeypatch):
|
||||
checksystemdbrokensymlinks._report_enabled_services_broken_symlinks(symlinks)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields['summary'] for s in symlinks])
|
||||
+ assert all(s in created_reports.report_fields['summary'] for s in symlinks)
|
||||
|
||||
|
||||
class ReportBrokenSymlinks:
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py b/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
index 6964a65b..488b37d4 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/transitionsystemdservicesstates/tests/test_transitionsystemdservicesstates.py
|
||||
@@ -205,9 +205,7 @@ def test_report_kept_enabled(monkeypatch, tasks, expect_extended_summary):
|
||||
assert created_reports.called
|
||||
if expect_extended_summary:
|
||||
assert extended_summary_str in created_reports.report_fields["summary"]
|
||||
- assert all(
|
||||
- [s in created_reports.report_fields["summary"] for s in tasks.to_enable]
|
||||
- )
|
||||
+ all(s in created_reports.report_fields['summary'] for s in tasks.to_enable)
|
||||
else:
|
||||
assert extended_summary_str not in created_reports.report_fields["summary"]
|
||||
|
||||
@@ -238,7 +236,7 @@ def test_report_newly_enabled(monkeypatch):
|
||||
transitionsystemdservicesstates._report_newly_enabled(newly_enabled)
|
||||
|
||||
assert created_reports.called
|
||||
- assert all([s in created_reports.report_fields["summary"] for s in newly_enabled])
|
||||
+ assert all(s in created_reports.report_fields["summary"] for s in newly_enabled)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
diff --git a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
index bb17d89a..0bb64f6f 100644
|
||||
--- a/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
+++ b/repos/system_upgrade/common/actors/targetuserspacecreator/tests/unit_test_targetuserspacecreator.py
|
||||
@@ -1068,7 +1068,7 @@ def test_consume_data(monkeypatch, raised, no_rhsm, testdata):
|
||||
assert raised[1] in err.value.message
|
||||
else:
|
||||
assert userspacegen.api.current_logger.warnmsg
|
||||
- assert any([raised[1] in x for x in userspacegen.api.current_logger.warnmsg])
|
||||
+ assert any(raised[1] in x for x in userspacegen.api.current_logger.warnmsg)
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Currently not implemented in the actor. It's TODO.")
|
||||
@@ -1390,7 +1390,7 @@ def test__get_files_owned_by_rpms_recursive(monkeypatch):
|
||||
assert sorted(owned[0:4]) == sorted(out)
|
||||
|
||||
def has_dbgmsg(substr):
|
||||
- return any([substr in log for log in logger.dbgmsg])
|
||||
+ return any(substr in log for log in logger.dbgmsg)
|
||||
|
||||
# test a few
|
||||
assert has_dbgmsg(
|
||||
diff --git a/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py b/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
index a36cc8ed..b5511d17 100644
|
||||
--- a/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
+++ b/repos/system_upgrade/el8toel9/actors/rocecheck/tests/unit_test_rocecheck.py
|
||||
@@ -91,7 +91,10 @@ def test_roce_old_rhel(monkeypatch, msgs, version):
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
rocecheck.process()
|
||||
assert reporting.create_report.called
|
||||
- assert any(['version of RHEL' in report['title'] for report in reporting.create_report.reports])
|
||||
+ assert any(
|
||||
+ 'version of RHEL' in report['title']
|
||||
+ for report in reporting.create_report.reports
|
||||
+ )
|
||||
|
||||
|
||||
# NOTE: what about the situation when net.naming-scheme is configured multiple times???
|
||||
@@ -113,4 +116,7 @@ def test_roce_wrong_configuration(monkeypatch, msgs, version):
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
rocecheck.process()
|
||||
assert reporting.create_report.called
|
||||
- assert any(['RoCE configuration' in report['title'] for report in reporting.create_report.reports])
|
||||
+ assert any(
|
||||
+ 'RoCE configuration' in report['title']
|
||||
+ for report in reporting.create_report.reports
|
||||
+ )
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,484 @@
|
||||
From adac307afff48ebbf4255edbd620ed29cbc9429e Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 13:12:19 +0200
|
||||
Subject: [PATCH 43/55] Set CurrentActorMocked src/dst version to 8->9 values
|
||||
|
||||
Currently, the default upgrade path is 7.8->8.1 which has been dropped
|
||||
from the repo. Several tests make assumptions about these defaults and in
|
||||
some cases this means that code path for other general upgrade paths
|
||||
(8->9, 9->10) are left untested e.g. modify_userspace_for_livemode.
|
||||
|
||||
This patch changes the default path to 8.10->9.6.
|
||||
|
||||
Updated tests:
|
||||
- checkrhui: assume 8->9 upgrade path
|
||||
- setuptargetrepos: Update tests to assume 8->9 upg path.
|
||||
- repairsystemdsymlinks: use 8->9 upgrade path instead of 7->8:
|
||||
We need to mock some "installation changed" service as there is
|
||||
*currently* none.
|
||||
- checkmemory: assume 8->9 upgrade path
|
||||
- peseventsscanner: assume 8->9 upgrade path
|
||||
- lib/config: assume correct upgrade path
|
||||
- persistentnetnamesconfig: use 8->9 upgrade path instead of 7->8
|
||||
|
||||
Jira: RHELMISC-16538
|
||||
---
|
||||
.../checkmemory/tests/test_checkmemory.py | 2 +-
|
||||
.../tests/component_test_checkrhui.py | 20 +++---
|
||||
.../libraries/persistentnetnamesconfig.py | 24 +++----
|
||||
.../tests/test_persistentnetnamesconfig.py | 16 ++++-
|
||||
.../tests/test_pes_event_scanner.py | 14 ++--
|
||||
.../tests/test_setuptargetrepos.py | 68 +++++++++----------
|
||||
.../libraries/repairsystemdsymlinks.py | 1 -
|
||||
.../tests/test_repairsystemdsymlinks.py | 29 +++++---
|
||||
.../libraries/config/tests/test_version.py | 2 +-
|
||||
.../common/libraries/testutils.py | 2 +-
|
||||
10 files changed, 98 insertions(+), 80 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py b/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
index a0bac0a9..79158dc6 100644
|
||||
--- a/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
+++ b/repos/system_upgrade/common/actors/checkmemory/tests/test_checkmemory.py
|
||||
@@ -21,7 +21,7 @@ def test_check_memory_high(monkeypatch):
|
||||
|
||||
|
||||
def test_report(monkeypatch):
|
||||
- title_msg = 'Minimum memory requirements for RHEL 8 are not met'
|
||||
+ title_msg = 'Minimum memory requirements for RHEL 9 are not met'
|
||||
monkeypatch.setattr(api, 'current_actor', CurrentActorMocked())
|
||||
monkeypatch.setattr(api, 'consume', lambda x: iter([MemoryInfo(mem_total=129)]))
|
||||
monkeypatch.setattr(reporting, "create_report", create_report_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
index 02ca352e..2e6f279e 100644
|
||||
--- a/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
+++ b/repos/system_upgrade/common/actors/cloud/checkrhui/tests/component_test_checkrhui.py
|
||||
@@ -279,10 +279,14 @@ class ExpectedAction(Enum):
|
||||
)
|
||||
def test_process(monkeypatch, extra_installed_pkgs, skip_rhsm, expected_action):
|
||||
known_setups = {
|
||||
- RHUIFamily('rhui-variant'): [
|
||||
- mk_rhui_setup(clients={'src_pkg'}, os_version='7'),
|
||||
- mk_rhui_setup(clients={'target_pkg'}, os_version='8', leapp_pkg='leapp_pkg',
|
||||
- mandatory_files=[('file1', '/etc'), ('file2', '/var')]),
|
||||
+ RHUIFamily("rhui-variant"): [
|
||||
+ mk_rhui_setup(clients={"src_pkg"}, os_version="8"),
|
||||
+ mk_rhui_setup(
|
||||
+ clients={"target_pkg"},
|
||||
+ os_version="9",
|
||||
+ leapp_pkg="leapp_pkg",
|
||||
+ mandatory_files=[("file1", "/etc"), ("file2", "/var")],
|
||||
+ ),
|
||||
]
|
||||
}
|
||||
|
||||
@@ -291,7 +295,7 @@ def test_process(monkeypatch, extra_installed_pkgs, skip_rhsm, expected_action):
|
||||
installed_rpms = InstalledRPM(items=installed_pkgs)
|
||||
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- actor = CurrentActorMocked(src_ver='7.9', msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
+ actor = CurrentActorMocked(msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
monkeypatch.setattr(api, 'current_actor', actor)
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: skip_rhsm)
|
||||
@@ -318,12 +322,12 @@ def test_unknown_target_rhui_setup(monkeypatch, is_target_setup_known):
|
||||
rhui_family = RHUIFamily('rhui-variant')
|
||||
known_setups = {
|
||||
rhui_family: [
|
||||
- mk_rhui_setup(clients={'src_pkg'}, os_version='7'),
|
||||
+ mk_rhui_setup(clients={'src_pkg'}, os_version='8'),
|
||||
]
|
||||
}
|
||||
|
||||
if is_target_setup_known:
|
||||
- target_setup = mk_rhui_setup(clients={'target_pkg'}, os_version='8', leapp_pkg='leapp_pkg')
|
||||
+ target_setup = mk_rhui_setup(clients={'target_pkg'}, os_version='9', leapp_pkg='leapp_pkg')
|
||||
known_setups[rhui_family].append(target_setup)
|
||||
|
||||
installed_pkgs = {'zip', 'kernel-core', 'python', 'src_pkg', 'leapp_pkg'}
|
||||
@@ -331,7 +335,7 @@ def test_unknown_target_rhui_setup(monkeypatch, is_target_setup_known):
|
||||
installed_rpms = InstalledRPM(items=installed_pkgs)
|
||||
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- actor = CurrentActorMocked(src_ver='7.9', msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
+ actor = CurrentActorMocked(msgs=[installed_rpms], config=_make_default_config(all_rhui_cfg))
|
||||
monkeypatch.setattr(api, 'current_actor', actor)
|
||||
monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
monkeypatch.setattr(rhsm, 'skip_rhsm', lambda: True)
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
index c90d13f2..189cd4d0 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/libraries/persistentnetnamesconfig.py
|
||||
@@ -55,21 +55,21 @@ def process():
|
||||
)
|
||||
return
|
||||
|
||||
- rhel7_ifaces = next(api.consume(PersistentNetNamesFacts)).interfaces
|
||||
- rhel8_ifaces = next(api.consume(PersistentNetNamesFactsInitramfs)).interfaces
|
||||
+ source_ifaces = next(api.consume(PersistentNetNamesFacts)).interfaces
|
||||
+ target_ifaces = next(api.consume(PersistentNetNamesFactsInitramfs)).interfaces
|
||||
|
||||
- rhel7_ifaces_map = {iface.mac: iface for iface in rhel7_ifaces}
|
||||
- rhel8_ifaces_map = {iface.mac: iface for iface in rhel8_ifaces}
|
||||
+ source_ifaces_map = {iface.mac: iface for iface in source_ifaces}
|
||||
+ target_ifaces_map = {iface.mac: iface for iface in target_ifaces}
|
||||
|
||||
initrd_files = []
|
||||
missing_ifaces = []
|
||||
renamed_interfaces = []
|
||||
|
||||
- if rhel7_ifaces != rhel8_ifaces:
|
||||
- for iface in rhel7_ifaces:
|
||||
- rhel7_name = rhel7_ifaces_map[iface.mac].name
|
||||
+ if source_ifaces != target_ifaces:
|
||||
+ for iface in source_ifaces:
|
||||
+ source_name = source_ifaces_map[iface.mac].name
|
||||
try:
|
||||
- rhel8_name = rhel8_ifaces_map[iface.mac].name
|
||||
+ target_name = target_ifaces_map[iface.mac].name
|
||||
except KeyError:
|
||||
missing_ifaces.append(iface)
|
||||
api.current_logger().warning(
|
||||
@@ -80,13 +80,13 @@ def process():
|
||||
)
|
||||
continue
|
||||
|
||||
- if rhel7_name != rhel8_name and get_env('LEAPP_NO_NETWORK_RENAMING', '0') != '1':
|
||||
- api.current_logger().warning('Detected interface rename {} -> {}.'.format(rhel7_name, rhel8_name))
|
||||
+ if source_name != target_name and get_env('LEAPP_NO_NETWORK_RENAMING', '0') != '1':
|
||||
+ api.current_logger().warning('Detected interface rename {} -> {}.'.format(source_name, target_name))
|
||||
|
||||
if re.search('eth[0-9]+', iface.name) is not None:
|
||||
api.current_logger().warning('Interface named using eth prefix, refusing to generate link file')
|
||||
- renamed_interfaces.append(RenamedInterface(**{'rhel7_name': rhel7_name,
|
||||
- 'rhel8_name': rhel8_name}))
|
||||
+ renamed_interfaces.append(RenamedInterface(**{'rhel7_name': source_name,
|
||||
+ 'rhel8_name': target_name}))
|
||||
continue
|
||||
|
||||
initrd_files.append(generate_link_file(iface))
|
||||
diff --git a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
index ee199ae4..c584c7ea 100644
|
||||
--- a/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
+++ b/repos/system_upgrade/common/actors/persistentnetnamesconfig/tests/test_persistentnetnamesconfig.py
|
||||
@@ -12,7 +12,6 @@ from leapp.models import (
|
||||
PCIAddress,
|
||||
PersistentNetNamesFacts,
|
||||
PersistentNetNamesFactsInitramfs,
|
||||
- RenamedInterface,
|
||||
RenamedInterfaces,
|
||||
TargetInitramfsTasks
|
||||
)
|
||||
@@ -170,7 +169,12 @@ def test_bz_1899455_crash_iface(monkeypatch, adjust_cwd):
|
||||
PersistentNetNamesFactsInitramfs.create(json_msgs["PersistentNetNamesFactsInitramfs"]),
|
||||
]
|
||||
monkeypatch.setattr(persistentnetnamesconfig, 'generate_link_file', generate_link_file_mocked)
|
||||
- monkeypatch.setattr(persistentnetnamesconfig.api, 'current_actor', CurrentActorMocked(msgs=msgs))
|
||||
+ monkeypatch.setattr(
|
||||
+ persistentnetnamesconfig.api,
|
||||
+ "current_actor",
|
||||
+ # without this the actor exits early
|
||||
+ CurrentActorMocked(msgs=msgs, envars={"LEAPP_DISABLE_NET_NAMING_SCHEMES": "1"}),
|
||||
+ )
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_logger', logger_mocked())
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'produce', produce_mocked())
|
||||
persistentnetnamesconfig.process()
|
||||
@@ -194,7 +198,13 @@ def test_no_network_renaming(monkeypatch):
|
||||
msgs = [PersistentNetNamesFacts(interfaces=interfaces)]
|
||||
interfaces[0].name = 'changedinterfacename0'
|
||||
msgs.append(PersistentNetNamesFactsInitramfs(interfaces=interfaces))
|
||||
- mocked_actor = CurrentActorMocked(msgs=msgs, envars={'LEAPP_NO_NETWORK_RENAMING': '1'})
|
||||
+ mocked_actor = CurrentActorMocked(
|
||||
+ msgs=msgs,
|
||||
+ envars={
|
||||
+ "LEAPP_DISABLE_NET_NAMING_SCHEMES": "1",
|
||||
+ "LEAPP_NO_NETWORK_RENAMING": "1",
|
||||
+ },
|
||||
+ )
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_actor', mocked_actor)
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'current_logger', logger_mocked())
|
||||
monkeypatch.setattr(persistentnetnamesconfig.api, 'produce', produce_mocked())
|
||||
diff --git a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
index 09a1e82d..f67f3840 100644
|
||||
--- a/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
+++ b/repos/system_upgrade/common/actors/peseventsscanner/tests/test_pes_event_scanner.py
|
||||
@@ -325,18 +325,18 @@ def test_blacklisted_repoid_is_not_produced(monkeypatch):
|
||||
Test that upgrade with a package that would be from a blacklisted repository on the target system does not remove
|
||||
the package as it was already installed, however, the blacklisted repoid should not be produced.
|
||||
"""
|
||||
- installed_pkgs = {Package('pkg-a', 'blacklisted-rhel7', None), Package('pkg-b', 'repoid-rhel7', None)}
|
||||
+ installed_pkgs = {Package('pkg-a', 'blacklisted-rhel8', None), Package('pkg-b', 'repoid-rhel8', None)}
|
||||
events = [
|
||||
- Event(1, Action.MOVED, {Package('pkg-b', 'repoid-rhel7', None)}, {Package('pkg-b', 'repoid-rhel8', None)},
|
||||
- (8, 0), (8, 1), []),
|
||||
- Event(2, Action.MOVED, {Package('pkg-a', 'repoid-rhel7', None)}, {Package('pkg-a', 'blacklisted-rhel8', None)},
|
||||
- (8, 0), (8, 1), []),
|
||||
+ Event(1, Action.MOVED, {Package('pkg-b', 'repoid-rhel8', None)}, {Package('pkg-b', 'repoid-rhel9', None)},
|
||||
+ (9, 0), (9, 1), []),
|
||||
+ Event(2, Action.MOVED, {Package('pkg-a', 'repoid-rhel8', None)}, {Package('pkg-a', 'blacklisted-rhel9', None)},
|
||||
+ (9, 0), (9, 1), []),
|
||||
]
|
||||
|
||||
monkeypatch.setattr(pes_events_scanner, 'get_installed_pkgs', lambda: installed_pkgs)
|
||||
monkeypatch.setattr(pes_events_scanner, 'get_pes_events', lambda folder, filename: events)
|
||||
monkeypatch.setattr(pes_events_scanner, 'apply_transaction_configuration', lambda pkgs, transaction_cfg: pkgs)
|
||||
- monkeypatch.setattr(pes_events_scanner, 'get_blacklisted_repoids', lambda: {'blacklisted-rhel8'})
|
||||
+ monkeypatch.setattr(pes_events_scanner, 'get_blacklisted_repoids', lambda: {'blacklisted-rhel9'})
|
||||
monkeypatch.setattr(pes_events_scanner, 'replace_pesids_with_repoids_in_packages',
|
||||
lambda pkgs, src_pkgs_repoids: pkgs)
|
||||
|
||||
@@ -357,7 +357,7 @@ def test_blacklisted_repoid_is_not_produced(monkeypatch):
|
||||
|
||||
repo_setup_tasks = [msg for msg in api.produce.model_instances if isinstance(msg, RepositoriesSetupTasks)]
|
||||
assert len(repo_setup_tasks) == 1
|
||||
- assert repo_setup_tasks[0].to_enable == ['repoid-rhel8']
|
||||
+ assert repo_setup_tasks[0].to_enable == ['repoid-rhel9']
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
diff --git a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
index e4a30f7f..ce7f01c0 100644
|
||||
--- a/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
+++ b/repos/system_upgrade/common/actors/setuptargetrepos/tests/test_setuptargetrepos.py
|
||||
@@ -1,6 +1,5 @@
|
||||
import pytest
|
||||
|
||||
-from leapp.libraries import stdlib
|
||||
from leapp.libraries.actor import setuptargetrepos
|
||||
from leapp.libraries.common.testutils import CurrentActorMocked, produce_mocked
|
||||
from leapp.libraries.stdlib import api
|
||||
@@ -15,8 +14,7 @@ from leapp.models import (
|
||||
RepositoriesSetupTasks,
|
||||
RepositoryData,
|
||||
RepositoryFile,
|
||||
- RPM,
|
||||
- TargetRepositories
|
||||
+ RPM
|
||||
)
|
||||
|
||||
RH_PACKAGER = 'Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>'
|
||||
@@ -108,27 +106,27 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
the RepositoriesMapping information for a specific distro.
|
||||
"""
|
||||
repos_data = [
|
||||
- RepositoryData(repoid='{}-7-server-rpms'.format(distro_id), name='{} 7 Server'.format(distro_id)),
|
||||
- RepositoryData(repoid='{}-7-blacklisted-rpms'.format(distro_id), name='{} 7 Blacklisted'.format(distro_id))]
|
||||
+ RepositoryData(repoid='{}-8-server-rpms'.format(distro_id), name='{} 8 Server'.format(distro_id)),
|
||||
+ RepositoryData(repoid='{}-8-blacklisted-rpms'.format(distro_id), name='{} 8 Blacklisted'.format(distro_id))]
|
||||
|
||||
repos_files = [RepositoryFile(file='/etc/yum.repos.d/redhat.repo', data=repos_data)]
|
||||
facts = RepositoriesFacts(repositories=repos_files)
|
||||
installed_rpms = InstalledRPM(
|
||||
- items=[mock_package('foreman', '{}-7-for-x86_64-satellite-extras-rpms'.format(distro_id)),
|
||||
- mock_package('foreman-proxy', 'nosuch-{}-7-for-x86_64-satellite-extras-rpms'.format(distro_id))])
|
||||
+ items=[mock_package('foreman', '{}-8-for-x86_64-satellite-extras-rpms'.format(distro_id)),
|
||||
+ mock_package('foreman-proxy', 'nosuch-{}-8-for-x86_64-satellite-extras-rpms'.format(distro_id))])
|
||||
|
||||
repomap = RepositoriesMapping(
|
||||
- mapping=[RepoMapEntry(source='{0}7-base'.format(distro_id),
|
||||
- target=['{0}8-baseos'.format(distro_id),
|
||||
- '{0}8-appstream'.format(distro_id),
|
||||
- '{0}8-blacklist'.format(distro_id)]),
|
||||
- RepoMapEntry(source='{0}7-satellite-extras'.format(distro_id),
|
||||
- target=['{0}8-satellite-extras'.format(distro_id)])],
|
||||
+ mapping=[RepoMapEntry(source='{0}8-base'.format(distro_id),
|
||||
+ target=['{0}9-baseos'.format(distro_id),
|
||||
+ '{0}9-appstream'.format(distro_id),
|
||||
+ '{0}9-blacklist'.format(distro_id)]),
|
||||
+ RepoMapEntry(source='{0}8-satellite-extras'.format(distro_id),
|
||||
+ target=['{0}9-satellite-extras'.format(distro_id)])],
|
||||
repositories=[
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}7-base'.format(distro_id),
|
||||
- repoid='{0}-7-server-rpms'.format(distro_id),
|
||||
- major_version='7',
|
||||
+ pesid='{0}8-base'.format(distro_id),
|
||||
+ repoid='{0}-8-server-rpms'.format(distro_id),
|
||||
+ major_version='8',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -136,9 +134,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-baseos'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-baseos'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-baseos-htb-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -146,9 +144,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-appstream'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-appstream'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-appstream-htb-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -156,9 +154,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-blacklist'.format(distro_id),
|
||||
- repoid='{0}-8-blacklisted-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-blacklist'.format(distro_id),
|
||||
+ repoid='{0}-9-blacklisted-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -166,9 +164,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}7-satellite-extras'.format(distro_id),
|
||||
- repoid='{0}-7-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
- major_version='7',
|
||||
+ pesid='{0}8-satellite-extras'.format(distro_id),
|
||||
+ repoid='{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
+ major_version='8',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -176,9 +174,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
distro=distro_id,
|
||||
),
|
||||
PESIDRepositoryEntry(
|
||||
- pesid='{0}8-satellite-extras'.format(distro_id),
|
||||
- repoid='{0}-8-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
- major_version='8',
|
||||
+ pesid='{0}9-satellite-extras'.format(distro_id),
|
||||
+ repoid='{0}-9-for-x86_64-satellite-extras-rpms'.format(distro_id),
|
||||
+ major_version='9',
|
||||
arch='x86_64',
|
||||
repo_type='rpm',
|
||||
channel='ga',
|
||||
@@ -188,7 +186,7 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
]
|
||||
)
|
||||
|
||||
- repos_blacklisted = RepositoriesBlacklisted(repoids=['{}-8-blacklisted-rpms'.format(distro_id)])
|
||||
+ repos_blacklisted = RepositoriesBlacklisted(repoids=['{}-9-blacklisted-rpms'.format(distro_id)])
|
||||
|
||||
msgs = [facts, repomap, repos_blacklisted, installed_rpms]
|
||||
|
||||
@@ -207,9 +205,9 @@ def test_repos_mapping_for_distro(monkeypatch, distro_id):
|
||||
produced_rhel_repoids = {repo.repoid for repo in rhel_repos}
|
||||
|
||||
expected_repoids = {
|
||||
- "{0}-8-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
- "{0}-8-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
- "{0}-8-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-baseos-htb-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-appstream-htb-rpms".format(distro_id),
|
||||
+ "{0}-9-for-x86_64-satellite-extras-rpms".format(distro_id),
|
||||
}
|
||||
|
||||
assert produced_distro_repoids == expected_repoids
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
index 3fcf4aa6..a8e801b9 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/libraries/repairsystemdsymlinks.py
|
||||
@@ -7,7 +7,6 @@ from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import SystemdBrokenSymlinksSource, SystemdBrokenSymlinksTarget, SystemdServicesInfoSource
|
||||
|
||||
_INSTALLATION_CHANGED = {
|
||||
- '8': ['rngd.service', 'sysstat.service'],
|
||||
'9': [],
|
||||
'10': [],
|
||||
}
|
||||
diff --git a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
index 5771fc6c..d52abdfa 100644
|
||||
--- a/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
+++ b/repos/system_upgrade/common/actors/systemd/repairsystemdsymlinks/tests/test_repairsystemdsymlinks.py
|
||||
@@ -1,13 +1,8 @@
|
||||
from leapp.libraries.actor import repairsystemdsymlinks
|
||||
from leapp.libraries.common import systemd
|
||||
-from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked
|
||||
-from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import (
|
||||
- SystemdBrokenSymlinksSource,
|
||||
- SystemdBrokenSymlinksTarget,
|
||||
- SystemdServiceFile,
|
||||
- SystemdServicesInfoSource
|
||||
-)
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import SystemdServiceFile, SystemdServicesInfoSource
|
||||
|
||||
|
||||
class MockedSystemdCmd:
|
||||
@@ -20,8 +15,16 @@ class MockedSystemdCmd:
|
||||
|
||||
|
||||
def test_bad_symslinks(monkeypatch):
|
||||
+ # there is no _INSTALLATION_CHANGED service on RHEL 8 and RHEL 9, but it's
|
||||
+ # possible such service will be discovered and added in the future as it
|
||||
+ # was on RHEL 7, so let's add such case
|
||||
+ monkeypatch.setitem(
|
||||
+ repairsystemdsymlinks._INSTALLATION_CHANGED,
|
||||
+ "9", ["some.service"],
|
||||
+ )
|
||||
+
|
||||
service_files = [
|
||||
- SystemdServiceFile(name='rngd.service', state='enabled'),
|
||||
+ SystemdServiceFile(name='some.service', state='enabled'),
|
||||
SystemdServiceFile(name='sysstat.service', state='disabled'),
|
||||
SystemdServiceFile(name='hello.service', state='enabled'),
|
||||
SystemdServiceFile(name='world.service', state='disabled'),
|
||||
@@ -36,11 +39,15 @@ def test_bad_symslinks(monkeypatch):
|
||||
monkeypatch.setattr(systemd, 'reenable_unit', reenable_mocked)
|
||||
|
||||
service_info = SystemdServicesInfoSource(service_files=service_files)
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[service_info]))
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "current_actor",
|
||||
+ CurrentActorMocked(src_ver="8.10", dst_ver="9.6", msgs=[service_info]),
|
||||
+ )
|
||||
|
||||
repairsystemdsymlinks._handle_bad_symlinks(service_info.service_files)
|
||||
|
||||
- assert reenable_mocked.units == ['rngd.service']
|
||||
+ assert reenable_mocked.units == ['some.service']
|
||||
|
||||
|
||||
def test_handle_newly_broken_symlink(monkeypatch):
|
||||
diff --git a/repos/system_upgrade/common/libraries/config/tests/test_version.py b/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
index d51f8098..f36dbc5f 100644
|
||||
--- a/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
+++ b/repos/system_upgrade/common/libraries/config/tests/test_version.py
|
||||
@@ -94,7 +94,7 @@ def test_matches_source_version(monkeypatch, result, version_list):
|
||||
(False, ['8.2', '8.0']),
|
||||
])
|
||||
def test_matches_target_version(monkeypatch, result, version_list):
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(src_ver='7.6'))
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(src_ver='7.6', dst_ver='8.1'))
|
||||
assert version.matches_target_version(*version_list) == result
|
||||
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/testutils.py b/repos/system_upgrade/common/libraries/testutils.py
|
||||
index e84cc03a..107ad8a7 100644
|
||||
--- a/repos/system_upgrade/common/libraries/testutils.py
|
||||
+++ b/repos/system_upgrade/common/libraries/testutils.py
|
||||
@@ -80,7 +80,7 @@ def _make_default_config(actor_config_schema):
|
||||
class CurrentActorMocked: # pylint:disable=R0904
|
||||
def __init__(self, arch=architecture.ARCH_X86_64, envars=None, # pylint:disable=R0913
|
||||
kernel='3.10.0-957.43.1.el7.x86_64',
|
||||
- release_id='rhel', src_ver='7.8', dst_ver='8.1', msgs=None, flavour='default', config=None,
|
||||
+ release_id='rhel', src_ver='8.10', dst_ver='9.6', msgs=None, flavour='default', config=None,
|
||||
virtual_source_version=None, virtual_target_version=None,
|
||||
supported_upgrade_paths=None):
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -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
@ -0,0 +1,303 @@
|
||||
From ad9b2ae552b6c36d78a445dbbcfcc179afd1d839 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:23:55 +0200
|
||||
Subject: [PATCH 44/55] scancpu: Remove non-JSON ("txt") lscpu output support
|
||||
|
||||
This was only used on RHEL 7.
|
||||
|
||||
- Remove txt test files
|
||||
- Remove empty_field test - IIRC it's not possible to have and empty
|
||||
field in JSON lscpu output, there would be null
|
||||
---
|
||||
.../actors/scancpu/libraries/scancpu.py | 11 ++---
|
||||
.../scancpu/tests/files/{json => }/invalid | 0
|
||||
.../tests/files/{json => }/lscpu_aarch64 | 0
|
||||
.../tests/files/{json => }/lscpu_ppc64le | 0
|
||||
.../tests/files/{json => }/lscpu_s390x | 0
|
||||
.../tests/files/{json => }/lscpu_x86_64 | 0
|
||||
.../scancpu/tests/files/txt/lscpu_aarch64 | 25 -----------
|
||||
.../scancpu/tests/files/txt/lscpu_empty_field | 4 --
|
||||
.../scancpu/tests/files/txt/lscpu_ppc64le | 15 -------
|
||||
.../scancpu/tests/files/txt/lscpu_s390x | 26 ------------
|
||||
.../scancpu/tests/files/txt/lscpu_x86_64 | 36 ----------------
|
||||
.../actors/scancpu/tests/test_scancpu.py | 42 ++-----------------
|
||||
12 files changed, 7 insertions(+), 152 deletions(-)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/invalid (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_aarch64 (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_ppc64le (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_s390x (100%)
|
||||
rename repos/system_upgrade/common/actors/scancpu/tests/files/{json => }/lscpu_x86_64 (100%)
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
delete mode 100644 repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
index db3f92d4..ecc23349 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/libraries/scancpu.py
|
||||
@@ -2,17 +2,15 @@ import json
|
||||
import re
|
||||
|
||||
from leapp.libraries.common.config import architecture
|
||||
-from leapp.libraries.common.config.version import get_source_major_version
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
from leapp.models import CPUInfo, DetectedDeviceOrDriver, DeviceDriverDeprecationData
|
||||
|
||||
-LSCPU_NAME_VALUE = re.compile(r'^(?P<name>[^:]+):[^\S\n]+(?P<value>.+)\n?', flags=re.MULTILINE)
|
||||
PPC64LE_MODEL = re.compile(r'\d+\.\d+ \(pvr (?P<family>[0-9a-fA-F]+) 0*[0-9a-fA-F]+\)')
|
||||
|
||||
|
||||
-def _get_lscpu_output(output_json=False):
|
||||
+def _get_lscpu_output():
|
||||
try:
|
||||
- result = run(['lscpu'] + (['-J'] if output_json else []))
|
||||
+ result = run(['lscpu', '-J'])
|
||||
return result.get('stdout', '')
|
||||
except (OSError, CalledProcessError):
|
||||
api.current_logger().debug('Executing `lscpu` failed', exc_info=True)
|
||||
@@ -20,10 +18,7 @@ def _get_lscpu_output(output_json=False):
|
||||
|
||||
|
||||
def _parse_lscpu_output():
|
||||
- if get_source_major_version() == '7':
|
||||
- return dict(LSCPU_NAME_VALUE.findall(_get_lscpu_output()))
|
||||
-
|
||||
- lscpu = _get_lscpu_output(output_json=True)
|
||||
+ lscpu = _get_lscpu_output()
|
||||
try:
|
||||
parsed_json = json.loads(lscpu)
|
||||
# The json contains one entry "lscpu" which is a list of dictionaries
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid b/repos/system_upgrade/common/actors/scancpu/tests/files/invalid
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/invalid
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/invalid
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_aarch64
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_aarch64
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_ppc64le
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_ppc64le
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_s390x
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_s390x
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64 b/repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_x86_64
|
||||
similarity index 100%
|
||||
rename from repos/system_upgrade/common/actors/scancpu/tests/files/json/lscpu_x86_64
|
||||
rename to repos/system_upgrade/common/actors/scancpu/tests/files/lscpu_x86_64
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64 b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
deleted file mode 100644
|
||||
index 3b9619ef..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_aarch64
|
||||
+++ /dev/null
|
||||
@@ -1,25 +0,0 @@
|
||||
-Architecture: aarch64
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 160
|
||||
-On-line CPU(s) list: 0-159
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 80
|
||||
-Socket(s): 2
|
||||
-NUMA node(s): 4
|
||||
-Vendor ID: ARM
|
||||
-BIOS Vendor ID: Ampere(R)
|
||||
-Model: 1
|
||||
-Model name: Neoverse-N1
|
||||
-BIOS Model name: Ampere(R) Altra(R) Processor
|
||||
-Stepping: r3p1
|
||||
-CPU max MHz: 3000.0000
|
||||
-CPU min MHz: 1000.0000
|
||||
-BogoMIPS: 50.00
|
||||
-L1d cache: 64K
|
||||
-L1i cache: 64K
|
||||
-L2 cache: 1024K
|
||||
-NUMA node0 CPU(s): 0-79
|
||||
-NUMA node1 CPU(s): 80-159
|
||||
-NUMA node2 CPU(s):
|
||||
-NUMA node3 CPU(s):
|
||||
-Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
deleted file mode 100644
|
||||
index f830b7fe..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_empty_field
|
||||
+++ /dev/null
|
||||
@@ -1,4 +0,0 @@
|
||||
-Empyt 1:
|
||||
-Empyt 2:
|
||||
-Empyt 3:
|
||||
-Flags: flag
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
deleted file mode 100644
|
||||
index 07d2ed65..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_ppc64le
|
||||
+++ /dev/null
|
||||
@@ -1,15 +0,0 @@
|
||||
-Architecture: ppc64le
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 8
|
||||
-On-line CPU(s) list: 0-7
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 1
|
||||
-Socket(s): 8
|
||||
-NUMA node(s): 1
|
||||
-Model: 2.1 (pvr 004b 0201)
|
||||
-Model name: POWER8E (raw), altivec supported
|
||||
-Hypervisor vendor: KVM
|
||||
-Virtualization type: para
|
||||
-L1d cache: 64K
|
||||
-L1i cache: 32K
|
||||
-NUMA node0 CPU(s): 0-7
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
deleted file mode 100644
|
||||
index 2c0de9f9..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_s390x
|
||||
+++ /dev/null
|
||||
@@ -1,26 +0,0 @@
|
||||
-Architecture: s390x
|
||||
-CPU op-mode(s): 32-bit, 64-bit
|
||||
-Byte Order: Big Endian
|
||||
-CPU(s): 4
|
||||
-On-line CPU(s) list: 0-3
|
||||
-Thread(s) per core: 1
|
||||
-Core(s) per socket: 1
|
||||
-Socket(s) per book: 1
|
||||
-Book(s) per drawer: 1
|
||||
-Drawer(s): 4
|
||||
-NUMA node(s): 1
|
||||
-Vendor ID: IBM/S390
|
||||
-Machine type: 3931
|
||||
-CPU dynamic MHz: 5200
|
||||
-CPU static MHz: 5200
|
||||
-BogoMIPS: 3331.00
|
||||
-Hypervisor: KVM/Linux
|
||||
-Hypervisor vendor: KVM
|
||||
-Virtualization type: full
|
||||
-Dispatching mode: horizontal
|
||||
-L1d cache: 128K
|
||||
-L1i cache: 128K
|
||||
-L2 cache: 32768K
|
||||
-L3 cache: 262144K
|
||||
-NUMA node0 CPU(s): 0-3
|
||||
-Flags: esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt vxp2 nnpa sie
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64 b/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
deleted file mode 100644
|
||||
index a1dc1035..00000000
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/files/txt/lscpu_x86_64
|
||||
+++ /dev/null
|
||||
@@ -1,36 +0,0 @@
|
||||
-Architecture: x86_64
|
||||
-CPU op-mode(s): 32-bit, 64-bit
|
||||
-Address sizes: 46 bits physical, 48 bits virtual
|
||||
-Byte Order: Little Endian
|
||||
-CPU(s): 48
|
||||
-On-line CPU(s) list: 0-47
|
||||
-Vendor ID: GenuineIntel
|
||||
-Model name: Intel(R) Xeon(R) CPU E5-2670 v3 @ 2.30GHz
|
||||
-CPU family: 6
|
||||
-Model: 63
|
||||
-Thread(s) per core: 2
|
||||
-Core(s) per socket: 12
|
||||
-Socket(s): 2
|
||||
-Stepping: 2
|
||||
-CPU(s) scaling MHz: 44%
|
||||
-CPU max MHz: 3100.0000
|
||||
-CPU min MHz: 1200.0000
|
||||
-BogoMIPS: 4599.83
|
||||
-Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d
|
||||
-Virtualization: VT-x
|
||||
-L1d cache: 768 KiB (24 instances)
|
||||
-L1i cache: 768 KiB (24 instances)
|
||||
-L2 cache: 6 MiB (24 instances)
|
||||
-L3 cache: 60 MiB (2 instances)
|
||||
-NUMA node(s): 2
|
||||
-NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46
|
||||
-NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47
|
||||
-Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
|
||||
-Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
|
||||
-Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable
|
||||
-Vulnerability Meltdown: Mitigation; PTI
|
||||
-Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
|
||||
-Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
|
||||
-Vulnerability Spectre v2: Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
|
||||
-Vulnerability Srbds: Not affected
|
||||
-Vulnerability Tsx async abort: Not affected
|
||||
diff --git a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
index be0802ba..3605ebe7 100644
|
||||
--- a/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
+++ b/repos/system_upgrade/common/actors/scancpu/tests/test_scancpu.py
|
||||
@@ -61,29 +61,20 @@ class mocked_get_cpuinfo:
|
||||
def __init__(self, filename):
|
||||
self.filename = filename
|
||||
|
||||
- def __call__(self, output_json=False):
|
||||
+ def __call__(self):
|
||||
"""
|
||||
Return lines of the self.filename test file located in the files directory.
|
||||
|
||||
Those files contain /proc/cpuinfo content from several machines.
|
||||
"""
|
||||
-
|
||||
- filename = self.filename
|
||||
- if output_json:
|
||||
- filename = os.path.join('json', filename)
|
||||
- else:
|
||||
- filename = os.path.join('txt', filename)
|
||||
- filename = os.path.join(CUR_DIR, 'files', filename)
|
||||
+ filename = os.path.join(CUR_DIR, 'files', self.filename)
|
||||
|
||||
with open(filename, 'r') as fp:
|
||||
return '\n'.join(fp.read().splitlines())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("arch", ARCH_SUPPORTED)
|
||||
-@pytest.mark.parametrize("version", ['7', '8'])
|
||||
-def test_scancpu(monkeypatch, arch, version):
|
||||
-
|
||||
- monkeypatch.setattr('leapp.libraries.actor.scancpu.get_source_major_version', lambda: version)
|
||||
+def test_scancpu(monkeypatch, arch):
|
||||
|
||||
mocked_cpuinfo = mocked_get_cpuinfo('lscpu_' + arch)
|
||||
monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
@@ -106,34 +97,9 @@ def test_scancpu(monkeypatch, arch, version):
|
||||
assert expected == produced
|
||||
|
||||
|
||||
-def test_lscpu_with_empty_field(monkeypatch):
|
||||
-
|
||||
- def mocked_cpuinfo(*args, **kwargs):
|
||||
- return mocked_get_cpuinfo('lscpu_empty_field')(output_json=False)
|
||||
-
|
||||
- monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
- monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
- current_actor = CurrentActorMocked()
|
||||
- monkeypatch.setattr(api, 'current_actor', current_actor)
|
||||
-
|
||||
- scancpu.process()
|
||||
-
|
||||
- expected = CPUInfo(machine_type=None, flags=['flag'])
|
||||
- produced = api.produce.model_instances[0]
|
||||
-
|
||||
- assert api.produce.called == 1
|
||||
-
|
||||
- assert expected.machine_type == produced.machine_type
|
||||
- assert sorted(expected.flags) == sorted(produced.flags)
|
||||
-
|
||||
-
|
||||
def test_parse_invalid_json(monkeypatch):
|
||||
|
||||
- monkeypatch.setattr('leapp.libraries.actor.scancpu.get_source_major_version', lambda: '8')
|
||||
-
|
||||
- def mocked_cpuinfo(*args, **kwargs):
|
||||
- return mocked_get_cpuinfo('invalid')(output_json=True)
|
||||
-
|
||||
+ mocked_cpuinfo = mocked_get_cpuinfo('invalid')
|
||||
monkeypatch.setattr(scancpu, '_get_lscpu_output', mocked_cpuinfo)
|
||||
monkeypatch.setattr(api, 'produce', produce_mocked())
|
||||
monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
From 44c6b10a1813bfa019fb8ee2ec08a619e325ba08 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:34:37 +0200
|
||||
Subject: [PATCH 45/55] modify_userspace_for_livemode: Remove RHEL7
|
||||
crypto-policies workaround
|
||||
|
||||
---
|
||||
.../libraries/prepareliveimage.py | 13 -------------
|
||||
.../tests/test_livemode_userspace_modifications.py | 2 --
|
||||
2 files changed, 15 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
index 686c4cd6..116c463d 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
@@ -381,19 +381,6 @@ def setup_sshd(context, authorized_keys):
|
||||
error
|
||||
)
|
||||
|
||||
- # @Todo(mhecko): This is hazardous. I guess we are setting this so that we can use weaker SSH keys from RHEL7,
|
||||
- # # but this way we change crypto settings system-wise (could be a problem for FIPS). Instead, we
|
||||
- # # should check whether the keys will be OK on RHEL8, and inform the user otherwise.
|
||||
- if get_target_major_version() == '8': # set to LEGACY for 7>8 only
|
||||
- try:
|
||||
- with context.open('/etc/crypto-policies/config', 'w+') as f:
|
||||
- f.write('LEGACY\n')
|
||||
- except OSError as error:
|
||||
- api.current_logger().warning('Cannot set crypto policy to LEGACY')
|
||||
- details = {'details': 'Failed to set crypto-policies to LEGACY due to the error: {0}'.format(error)}
|
||||
- raise StopActorExecutionError('Failed to set up livemode SSHD', details=details)
|
||||
-
|
||||
-
|
||||
# stolen from upgradeinitramfsgenerator.py
|
||||
def _get_target_kernel_version(context):
|
||||
"""
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
index e890f45a..b046d8c7 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/tests/test_livemode_userspace_modifications.py
|
||||
@@ -296,8 +296,6 @@ def test_setup_sshd(monkeypatch):
|
||||
Action(type_=ActionType.SYMLINK,
|
||||
args=('/usr/lib/systemd/system/sshd.service',
|
||||
'/USERSPACE/etc/systemd/system/multi-user.target.wants/sshd.service')),
|
||||
- Action(type_=ActionType.OPEN, args=('/USERSPACE/etc/crypto-policies/config',)),
|
||||
- Action(type_=ActionType.WRITE, args=('LEGACY\n',)),
|
||||
]
|
||||
|
||||
error = assert_execution_trace_subsumes_other(actual_trace, expected_trace)
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
From 4bede4b415f3e561399bf5c4ebed659c1aa4948d Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 14:37:41 +0200
|
||||
Subject: [PATCH 46/55] modify_userspace_for_livemode: Remove unused code in
|
||||
modify_userspace_for_livemode
|
||||
|
||||
---
|
||||
.../libraries/prepareliveimage.py | 30 +------------------
|
||||
1 file changed, 1 insertion(+), 29 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
index 116c463d..2587bf89 100644
|
||||
--- a/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
+++ b/repos/system_upgrade/common/actors/livemode/modify_userspace_for_livemode/libraries/prepareliveimage.py
|
||||
@@ -6,7 +6,7 @@ import os.path
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.common.config.version import get_target_major_version
|
||||
-from leapp.libraries.stdlib import api, CalledProcessError
|
||||
+from leapp.libraries.stdlib import api
|
||||
from leapp.models import LiveImagePreparationInfo
|
||||
|
||||
LEAPP_UPGRADE_SERVICE_FILE = 'upgrade.service'
|
||||
@@ -381,34 +381,6 @@ def setup_sshd(context, authorized_keys):
|
||||
error
|
||||
)
|
||||
|
||||
-# stolen from upgradeinitramfsgenerator.py
|
||||
-def _get_target_kernel_version(context):
|
||||
- """
|
||||
- Get the version of the most recent kernel version within the container.
|
||||
- """
|
||||
- try:
|
||||
- results = context.call(['rpm', '-qa', 'kernel-core'], split=True)['stdout']
|
||||
-
|
||||
- except CalledProcessError as error:
|
||||
- problem = 'Could not query the target userspace kernel version through rpm. Full error: {0}'.format(error)
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot get the version of the installed kernel.',
|
||||
- details={'Problem': problem})
|
||||
-
|
||||
- if len(results) > 1:
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot detect the version of the target userspace kernel.',
|
||||
- details={'Problem': 'Detected unexpectedly multiple kernels inside target userspace container.'})
|
||||
- if not results:
|
||||
- raise StopActorExecutionError(
|
||||
- 'Cannot detect the version of the target userspace kernel.',
|
||||
- details={'Problem': 'An rpm query for the available kernels did not produce any results.'})
|
||||
-
|
||||
- kernel_version = '-'.join(results[0].rsplit("-", 2)[-2:])
|
||||
- api.current_logger().debug('Detected kernel version inside container: {}.'.format(kernel_version))
|
||||
-
|
||||
- return kernel_version
|
||||
-
|
||||
|
||||
def fakerootfs():
|
||||
"""
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,170 @@
|
||||
From 000c5f6558e788842fbf95d2fdb0014d18285c15 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Thu, 21 Aug 2025 15:10:58 +0200
|
||||
Subject: [PATCH 47/55] repositoriesblacklist: Remove the rhel7-optional
|
||||
unsupported PESID
|
||||
|
||||
Update tests to assume 8->9 upgrade path.
|
||||
---
|
||||
.../libraries/repositoriesblacklist.py | 4 +-
|
||||
.../tests/test_repositoriesblacklist.py | 48 ++++++++++---------
|
||||
2 files changed, 27 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py b/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
index e22fbee0..5059f619 100644
|
||||
--- a/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
+++ b/repos/system_upgrade/common/actors/repositoriesblacklist/libraries/repositoriesblacklist.py
|
||||
@@ -6,7 +6,6 @@ from leapp.models import CustomTargetRepository, RepositoriesBlacklisted, Reposi
|
||||
|
||||
# {OS_MAJOR_VERSION: PESID}
|
||||
UNSUPPORTED_PESIDS = {
|
||||
- "7": "rhel7-optional",
|
||||
"8": "rhel8-CRB",
|
||||
"9": "rhel9-CRB",
|
||||
"10": "rhel10-CRB"
|
||||
@@ -28,9 +27,8 @@ def _report_using_unsupported_repos(repos):
|
||||
|
||||
|
||||
def _report_excluded_repos(repos):
|
||||
- optional_repository_name = 'optional' if get_source_major_version() == '7' else 'CRB'
|
||||
api.current_logger().info(
|
||||
- "The {0} repository is not enabled. Excluding {1} from the upgrade".format(optional_repository_name, repos)
|
||||
+ "The CRB repository is not enabled. Excluding {} from the upgrade".format(repos)
|
||||
)
|
||||
|
||||
report = [
|
||||
diff --git a/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py b/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
index c4f9a36e..945007c6 100644
|
||||
--- a/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
+++ b/repos/system_upgrade/common/actors/repositoriesblacklist/tests/test_repositoriesblacklist.py
|
||||
@@ -20,8 +20,8 @@ from leapp.models import (
|
||||
def repofacts_opts_disabled():
|
||||
repos_data = [
|
||||
RepositoryData(
|
||||
- repoid="rhel-7-server-optional-rpms",
|
||||
- name="RHEL 7 Server",
|
||||
+ repoid="codeready-builder-for-rhel-8-x86_64-rpms",
|
||||
+ name="RHEL 8 CRB",
|
||||
enabled=False,
|
||||
)
|
||||
]
|
||||
@@ -32,11 +32,11 @@ def repofacts_opts_disabled():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def rhel7_optional_pesidrepo():
|
||||
+def rhel8_crb_pesidrepo():
|
||||
return PESIDRepositoryEntry(
|
||||
- pesid='rhel7-optional',
|
||||
- major_version='7',
|
||||
- repoid='rhel-7-server-optional-rpms',
|
||||
+ pesid='rhel8-CRB',
|
||||
+ major_version='8',
|
||||
+ repoid='codeready-builder-for-rhel-8-x86_64-rpms',
|
||||
rhui='',
|
||||
arch='x86_64',
|
||||
channel='ga',
|
||||
@@ -46,11 +46,11 @@ def rhel7_optional_pesidrepo():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def rhel8_crb_pesidrepo():
|
||||
+def rhel9_crb_pesidrepo():
|
||||
return PESIDRepositoryEntry(
|
||||
- pesid='rhel8-CRB',
|
||||
- major_version='8',
|
||||
- repoid='codeready-builder-for-rhel-8-x86_64-rpms',
|
||||
+ pesid='rhel9-CRB',
|
||||
+ major_version='9',
|
||||
+ repoid='codeready-builder-for-rhel-9-x86_64-rpms',
|
||||
rhui='',
|
||||
arch='x86_64',
|
||||
channel='ga',
|
||||
@@ -60,10 +60,10 @@ def rhel8_crb_pesidrepo():
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
-def repomap_opts_only(rhel7_optional_pesidrepo, rhel8_crb_pesidrepo):
|
||||
+def repomap_opts_only(rhel8_crb_pesidrepo, rhel9_crb_pesidrepo):
|
||||
return RepositoriesMapping(
|
||||
- mapping=[RepoMapEntry(source='rhel7-optional', target=['rhel8-CRB'])],
|
||||
- repositories=[rhel7_optional_pesidrepo, rhel8_crb_pesidrepo]
|
||||
+ mapping=[RepoMapEntry(source='rhel8-CRB', target=['rhel9-CRB'])],
|
||||
+ repositories=[rhel8_crb_pesidrepo, rhel9_crb_pesidrepo]
|
||||
)
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ def test_all_target_optionals_blacklisted_when_no_optional_on_source(monkeypatch
|
||||
|
||||
repos_data = [
|
||||
RepositoryData(
|
||||
- repoid="rhel-7-server-rpms",
|
||||
- name="RHEL 7 Server",
|
||||
+ repoid="rhel-8-server-rpms",
|
||||
+ name="RHEL 8 Server",
|
||||
enabled=True,
|
||||
)
|
||||
]
|
||||
@@ -92,7 +92,7 @@ def test_all_target_optionals_blacklisted_when_no_optional_on_source(monkeypatch
|
||||
repositoriesblacklist.process()
|
||||
|
||||
assert api.produce.called
|
||||
- assert 'codeready-builder-for-rhel-8-x86_64-rpms' in api.produce.model_instances[0].repoids
|
||||
+ assert 'codeready-builder-for-rhel-9-x86_64-rpms' in api.produce.model_instances[0].repoids
|
||||
|
||||
|
||||
def test_with_no_mapping_for_optional_repos(monkeypatch, repomap_opts_only, repofacts_opts_disabled):
|
||||
@@ -115,7 +115,11 @@ def test_blacklist_produced_when_optional_repo_disabled(monkeypatch, repofacts_o
|
||||
Tests whether a correct blacklist is generated when there is disabled optional repo on the system.
|
||||
"""
|
||||
|
||||
- monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[repofacts_opts_disabled, repomap_opts_only]))
|
||||
+ monkeypatch.setattr(
|
||||
+ api,
|
||||
+ "current_actor",
|
||||
+ CurrentActorMocked(msgs=[repofacts_opts_disabled, repomap_opts_only]),
|
||||
+ )
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
monkeypatch.setattr(reporting, "create_report", produce_mocked())
|
||||
|
||||
@@ -123,7 +127,7 @@ def test_blacklist_produced_when_optional_repo_disabled(monkeypatch, repofacts_o
|
||||
|
||||
assert api.produce.model_instances, 'A blacklist should get generated.'
|
||||
|
||||
- expected_blacklisted_repoid = 'codeready-builder-for-rhel-8-x86_64-rpms'
|
||||
+ expected_blacklisted_repoid = 'codeready-builder-for-rhel-9-x86_64-rpms'
|
||||
err_msg = 'Blacklist does not contain expected repoid.'
|
||||
assert expected_blacklisted_repoid in api.produce.model_instances[0].repoids, err_msg
|
||||
|
||||
@@ -166,8 +170,8 @@ def test_repositoriesblacklist_not_empty(monkeypatch, repofacts_opts_disabled, r
|
||||
|
||||
def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repomap_opts_only):
|
||||
"""
|
||||
- Tests whether nothing is produced if there are some disabled optional repos, but an empty blacklist is determined
|
||||
- from the repo mapping data.
|
||||
+ Tests whether nothing is produced if there are some disabled optional
|
||||
+ repos, but an empty blacklist is determined from the repo mapping data.
|
||||
"""
|
||||
|
||||
msgs_to_feed = [repofacts_opts_disabled, repomap_opts_only]
|
||||
@@ -177,7 +181,7 @@ def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repom
|
||||
repositoriesblacklist,
|
||||
"_get_repoids_to_exclude",
|
||||
lambda dummy_mapping: set()
|
||||
- ) # pylint:disable=W0108
|
||||
+ )
|
||||
monkeypatch.setattr(api, "produce", produce_mocked())
|
||||
|
||||
repositoriesblacklist.process()
|
||||
@@ -187,7 +191,7 @@ def test_repositoriesblacklist_empty(monkeypatch, repofacts_opts_disabled, repom
|
||||
@pytest.mark.parametrize(
|
||||
("enabled_repo", "exp_report_title", "message_produced"),
|
||||
[
|
||||
- ("codeready-builder-for-rhel-8-x86_64-rpms", "Using repository not supported by Red Hat", False),
|
||||
+ ("codeready-builder-for-rhel-9-x86_64-rpms", "Using repository not supported by Red Hat", False),
|
||||
("some_other_enabled_repo", "Excluded target system repositories", True),
|
||||
(None, "Excluded target system repositories", True),
|
||||
],
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,209 @@
|
||||
From 0a203330cee4fba6a28c65f1c6e0e450cc45771e Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Thu, 30 Oct 2025 11:52:39 +0100
|
||||
Subject: [PATCH 48/55] mount_unit_gen: bind mount /sysroot/boot to /boot
|
||||
|
||||
Our changes towards using systemd-fstab-generator in the upgrade
|
||||
initramfs caused that we are mounting almost all partitions, including
|
||||
/boot (the actual mount target is /sysroot/boot) early in the boot
|
||||
process. When upgrading with FIPS, the dracut fips module tries to mount
|
||||
the device where the boot partition resides to check the integrity of
|
||||
the kernel, however, it fails as the boot block device is already
|
||||
mounted by us. This patch therefore introduces a static unit that
|
||||
bind-mounts What=/sysroot/boot to Where=/boot, making the contents of
|
||||
/boot available to the fips module. The bind-mounting service is
|
||||
introduced only if the source system has /boot on a separate partition.
|
||||
This is determined by checking whether anything shuld be mounted at
|
||||
/boot according to fstab.
|
||||
|
||||
Jira-ref: RHEL-123886
|
||||
---
|
||||
.../initramfs/mount_units_generator/actor.py | 3 +-
|
||||
.../files/bundled_units/boot.mount | 11 ++++
|
||||
.../libraries/mount_unit_generator.py | 38 ++++++++++-
|
||||
.../tests/test_mount_unit_generation.py | 63 ++++++++++++++++++-
|
||||
4 files changed, 111 insertions(+), 4 deletions(-)
|
||||
create mode 100644 repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
index dd667513..23c618b6 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/actor.py
|
||||
@@ -1,6 +1,6 @@
|
||||
from leapp.actors import Actor
|
||||
from leapp.libraries.actor import mount_unit_generator as mount_unit_generator_lib
|
||||
-from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
from leapp.tags import InterimPreparationPhaseTag, IPUWorkflowTag
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ class MountUnitGenerator(Actor):
|
||||
consumes = (
|
||||
LiveModeConfig,
|
||||
TargetUserSpaceInfo,
|
||||
+ StorageInfo,
|
||||
)
|
||||
produces = (
|
||||
UpgradeInitramfsTasks,
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
new file mode 100644
|
||||
index 00000000..869c5e4c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/files/bundled_units/boot.mount
|
||||
@@ -0,0 +1,11 @@
|
||||
+[Unit]
|
||||
+DefaultDependencies=no
|
||||
+Before=local-fs.target
|
||||
+After=sysroot-boot.target
|
||||
+Requires=sysroot-boot.target
|
||||
+
|
||||
+[Mount]
|
||||
+What=/sysroot/boot
|
||||
+Where=/boot
|
||||
+Type=none
|
||||
+Options=bind
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
index 943bddd4..e3070986 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/libraries/mount_unit_generator.py
|
||||
@@ -5,7 +5,9 @@ import tempfile
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.common import mounting
|
||||
from leapp.libraries.stdlib import api, CalledProcessError, run
|
||||
-from leapp.models import LiveModeConfig, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import LiveModeConfig, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+
|
||||
+BIND_MOUNT_SYSROOT_BOOT_UNIT = 'boot.mount'
|
||||
|
||||
|
||||
def run_systemd_fstab_generator(output_directory):
|
||||
@@ -294,6 +296,39 @@ def request_units_inclusion_in_initramfs(files_to_include):
|
||||
api.produce(tasks)
|
||||
|
||||
|
||||
+def does_system_have_separate_boot_partition():
|
||||
+ storage_info = next(api.consume(StorageInfo), None)
|
||||
+ if not storage_info:
|
||||
+ err_msg = 'Actor did not receive required information about system storage (StorageInfo)'
|
||||
+ raise StopActorExecutionError(err_msg)
|
||||
+
|
||||
+ for fstab_entry in storage_info.fstab:
|
||||
+ if fstab_entry.fs_file == '/boot':
|
||||
+ return True
|
||||
+
|
||||
+ return False
|
||||
+
|
||||
+
|
||||
+def inject_bundled_units(workspace):
|
||||
+ """
|
||||
+ Copy static units that are bundled within this actor into the workspace.
|
||||
+ """
|
||||
+ bundled_units_dir = api.get_actor_folder_path('bundled_units')
|
||||
+ for unit in os.listdir(bundled_units_dir):
|
||||
+ if unit == BIND_MOUNT_SYSROOT_BOOT_UNIT:
|
||||
+ has_separate_boot = does_system_have_separate_boot_partition()
|
||||
+ if not has_separate_boot:
|
||||
+ # We perform bind-mounting because of dracut's fips module.
|
||||
+ # When /boot is not a separate partition, we don't need to bind mount it --
|
||||
+ # the fips module itself will create a symlink.
|
||||
+ continue
|
||||
+
|
||||
+ unit_path = os.path.join(bundled_units_dir, unit)
|
||||
+ unit_dst = os.path.join(workspace, unit)
|
||||
+ api.current_logger().debug('Copying static unit bundled within leapp {} to {}'.format(unit, unit_dst))
|
||||
+ shutil.copyfile(unit_path, unit_dst)
|
||||
+
|
||||
+
|
||||
def setup_storage_initialization():
|
||||
livemode_config = next(api.consume(LiveModeConfig), None)
|
||||
if livemode_config and livemode_config.is_enabled:
|
||||
@@ -306,6 +341,7 @@ def setup_storage_initialization():
|
||||
run_systemd_fstab_generator(workspace_path)
|
||||
remove_units_for_targets_that_are_already_mounted_by_dracut(workspace_path)
|
||||
prefix_all_mount_units_with_sysroot(workspace_path)
|
||||
+ inject_bundled_units(workspace_path)
|
||||
fix_symlinks_in_targets(workspace_path)
|
||||
mount_unit_files = copy_units_into_system_location(upgrade_container_ctx, workspace_path)
|
||||
request_units_inclusion_in_initramfs(mount_unit_files)
|
||||
diff --git a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
index 8849ada9..eb90a75d 100644
|
||||
--- a/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
+++ b/repos/system_upgrade/common/actors/initramfs/mount_units_generator/tests/test_mount_unit_generation.py
|
||||
@@ -5,9 +5,9 @@ import pytest
|
||||
|
||||
from leapp.exceptions import StopActorExecutionError
|
||||
from leapp.libraries.actor import mount_unit_generator
|
||||
-from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.common.testutils import CurrentActorMocked, logger_mocked
|
||||
from leapp.libraries.stdlib import api, CalledProcessError
|
||||
-from leapp.models import TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
+from leapp.models import FstabEntry, StorageInfo, TargetUserSpaceInfo, UpgradeInitramfsTasks
|
||||
|
||||
|
||||
def test_run_systemd_fstab_generator_successful_generation(monkeypatch):
|
||||
@@ -267,3 +267,62 @@ def test_copy_units_mixed_content(monkeypatch):
|
||||
]
|
||||
assert sorted(files) == sorted(expected_files)
|
||||
assert mount_unit_generator._delete_file.removal_called
|
||||
+
|
||||
+
|
||||
+class CurrentActorMockedWithActorFolder(CurrentActorMocked):
|
||||
+ def __init__(self, actor_folder_path, *args, **kwargs):
|
||||
+ self.actor_folder_path = actor_folder_path
|
||||
+ super().__init__(*args, **kwargs)
|
||||
+
|
||||
+ def get_actor_folder_path(self, subfolder):
|
||||
+ return os.path.join(self.actor_folder_path, subfolder)
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('has_separate_boot', (True, False))
|
||||
+def test_injection_of_sysroot_boot_bindmount_unit(monkeypatch, has_separate_boot):
|
||||
+ fstab_entries = [
|
||||
+ FstabEntry(fs_spec='UUID=123', fs_file='/root', fs_vfstype='xfs',
|
||||
+ fs_mntops='defaults', fs_freq='0', fs_passno='0')
|
||||
+ ]
|
||||
+
|
||||
+ if has_separate_boot:
|
||||
+ boot_fstab_entry = FstabEntry(fs_spec='UUID=123', fs_file='/root', fs_vfstype='xfs',
|
||||
+ fs_mntops='defaults', fs_freq='0', fs_passno='0')
|
||||
+ fstab_entries.append(boot_fstab_entry)
|
||||
+
|
||||
+ storage_info = StorageInfo(fstab=fstab_entries)
|
||||
+
|
||||
+ actor_mock = CurrentActorMockedWithActorFolder(actor_folder_path='/actor', msgs=[storage_info])
|
||||
+ monkeypatch.setattr(api, 'current_actor', actor_mock)
|
||||
+
|
||||
+ workspace_path = '/workspace'
|
||||
+ was_copyfile_for_sysroot_boot_called = False
|
||||
+
|
||||
+ def copyfile_mocked(source, dest, *args, **kwargs):
|
||||
+ if not os.path.basename(source) == mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT:
|
||||
+ return
|
||||
+
|
||||
+ assert has_separate_boot
|
||||
+ assert dest == os.path.join(workspace_path, mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT)
|
||||
+
|
||||
+ nonlocal was_copyfile_for_sysroot_boot_called
|
||||
+ was_copyfile_for_sysroot_boot_called = True
|
||||
+
|
||||
+ monkeypatch.setattr(shutil, 'copyfile', copyfile_mocked)
|
||||
+
|
||||
+ def listdir_mocked(path):
|
||||
+ assert path == actor_mock.get_actor_folder_path('bundled_units')
|
||||
+ return [
|
||||
+ mount_unit_generator.BIND_MOUNT_SYSROOT_BOOT_UNIT,
|
||||
+ 'other.mount'
|
||||
+ ]
|
||||
+
|
||||
+ monkeypatch.setattr(os, 'listdir', listdir_mocked)
|
||||
+ monkeypatch.setattr(mount_unit_generator,
|
||||
+ 'does_system_have_separate_boot_partition',
|
||||
+ lambda: has_separate_boot)
|
||||
+
|
||||
+ mount_unit_generator.inject_bundled_units(workspace_path)
|
||||
+
|
||||
+ if has_separate_boot:
|
||||
+ assert was_copyfile_for_sysroot_boot_called
|
||||
--
|
||||
2.51.1
|
||||
|
||||
40
SOURCES/0049-fix-parsing-of-dnf-config-dump.patch
Normal file
40
SOURCES/0049-fix-parsing-of-dnf-config-dump.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From 9b06998b2077d0007da818059d5c6e244ac55948 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Mocary <pmocary@redhat.com>
|
||||
Date: Mon, 10 Nov 2025 19:31:25 +0100
|
||||
Subject: [PATCH 49/55] fix parsing of dnf config dump
|
||||
|
||||
This patch fixes handling of empty lines during parsing of output from
|
||||
`dnf config-manager --dump` command.
|
||||
|
||||
Jira: RHEL-120328
|
||||
---
|
||||
repos/system_upgrade/common/libraries/dnfconfig.py | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/repos/system_upgrade/common/libraries/dnfconfig.py b/repos/system_upgrade/common/libraries/dnfconfig.py
|
||||
index 4b5afeb5..9f1902b6 100644
|
||||
--- a/repos/system_upgrade/common/libraries/dnfconfig.py
|
||||
+++ b/repos/system_upgrade/common/libraries/dnfconfig.py
|
||||
@@ -43,8 +43,11 @@ def _get_main_dump(context, disable_plugins):
|
||||
|
||||
output_data = {}
|
||||
for line in data[main_start:]:
|
||||
+ if not line.strip():
|
||||
+ continue
|
||||
try:
|
||||
key, val = _strip_split(line, '=', 1)
|
||||
+ output_data[key] = val
|
||||
except ValueError:
|
||||
# This is not expected to happen, but call it a seatbelt in case
|
||||
# the dnf dump implementation will change and we will miss it
|
||||
@@ -54,7 +57,6 @@ def _get_main_dump(context, disable_plugins):
|
||||
api.current_logger().warning(
|
||||
'Cannot parse the dnf dump correctly, line: {}'.format(line))
|
||||
pass
|
||||
- output_data[key] = val
|
||||
|
||||
return output_data
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,609 @@
|
||||
From 428c46051619a570b08189677bb27eedf69c2a9e Mon Sep 17 00:00:00 2001
|
||||
From: karolinku <kkula@redhat.com>
|
||||
Date: Fri, 17 Oct 2025 16:06:15 +0200
|
||||
Subject: [PATCH 50/55] Add detection for third-party target Python modules
|
||||
|
||||
Introduce actors to detect presence of third-party
|
||||
Python modules installed for target Python. Those modules could
|
||||
interfere with the upgrade process or cause issues after rebooting
|
||||
into the target system.
|
||||
|
||||
Scanner (scanthirdpartytargetpythonmodules):
|
||||
- Identifies the target Python interpreter
|
||||
- Queries the target Python's sys.path to determine where it searches
|
||||
for modules
|
||||
- Recursively scans these directories for Python files (.py, .so, .pyc)
|
||||
- Cross-references found files against the RPM database to determine
|
||||
ownership and categorize them
|
||||
|
||||
Checker (checkthirdpartytargetpythonmodules) creates a high severity
|
||||
report to inform users about findings and presents full list of them
|
||||
in logs and short version in report.
|
||||
|
||||
Jira: RHEL-71882
|
||||
---
|
||||
.../actor.py | 21 ++
|
||||
.../checkthirdpartytargetpythonmodules.py | 74 +++++++
|
||||
...check_third_party_target_python_modules.py | 46 +++++
|
||||
.../actor.py | 19 ++
|
||||
.../scanthirdpartytargetpythonmodules.py | 193 ++++++++++++++++++
|
||||
..._scan_third_party_target_python_modules.py | 136 ++++++++++++
|
||||
.../models/thirdpartytagetpythonmodules.py | 25 +++
|
||||
requirements.txt | 1 +
|
||||
8 files changed, 515 insertions(+)
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/libraries/checkthirdpartytargetpythonmodules.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/tests/test_check_third_party_target_python_modules.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/actor.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/libraries/scanthirdpartytargetpythonmodules.py
|
||||
create mode 100644 repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/tests/test_scan_third_party_target_python_modules.py
|
||||
create mode 100644 repos/system_upgrade/common/models/thirdpartytagetpythonmodules.py
|
||||
|
||||
diff --git a/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/actor.py b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..e1868819
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/actor.py
|
||||
@@ -0,0 +1,21 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor.checkthirdpartytargetpythonmodules import perform_check
|
||||
+from leapp.models import ThirdPartyTargetPythonModules
|
||||
+from leapp.reporting import Report
|
||||
+from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class CheckThirdPartyTargetPythonModules(Actor):
|
||||
+ """
|
||||
+ Produces a report if any third-party target Python modules are detected on the source system.
|
||||
+
|
||||
+ If such modules are detected, a high risk report is produced.
|
||||
+ """
|
||||
+
|
||||
+ name = 'check_third_party_target_python_modules'
|
||||
+ consumes = (ThirdPartyTargetPythonModules,)
|
||||
+ produces = (Report,)
|
||||
+ tags = (ChecksPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ perform_check()
|
||||
diff --git a/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/libraries/checkthirdpartytargetpythonmodules.py b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/libraries/checkthirdpartytargetpythonmodules.py
|
||||
new file mode 100644
|
||||
index 00000000..7ed34738
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/libraries/checkthirdpartytargetpythonmodules.py
|
||||
@@ -0,0 +1,74 @@
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import ThirdPartyTargetPythonModules
|
||||
+
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
+MAX_REPORTED_ITEMS = 30
|
||||
+
|
||||
+
|
||||
+def _formatted_list_output_with_max_items(input_list, sep=FMT_LIST_SEPARATOR, max_items=MAX_REPORTED_ITEMS):
|
||||
+ if not input_list:
|
||||
+ return ''
|
||||
+
|
||||
+ total_count = len(input_list)
|
||||
+ items_to_show = input_list[:max_items]
|
||||
+ formatted = ['{}{}'.format(sep, item) for item in items_to_show]
|
||||
+
|
||||
+ if total_count > max_items:
|
||||
+ formatted.append('{}... and {} more'.format(sep, total_count - max_items))
|
||||
+
|
||||
+ return ''.join(formatted)
|
||||
+
|
||||
+
|
||||
+def check_third_party_target_python_modules(third_party_target_python_modules):
|
||||
+ """Create an inhibitor when third-party Python modules are detected."""
|
||||
+ target_python_version = third_party_target_python_modules.target_python.split('python')[1]
|
||||
+ third_party_rpms = third_party_target_python_modules.third_party_rpm_names
|
||||
+ third_party_modules = third_party_target_python_modules.third_party_modules
|
||||
+
|
||||
+ summary = (
|
||||
+ 'Third-party target Python modules may interfere with '
|
||||
+ 'the upgrade process or cause unexpected behavior after the upgrade.'
|
||||
+ )
|
||||
+
|
||||
+ if third_party_rpms:
|
||||
+ summary = (
|
||||
+ '{pre}\n\nNon-distribution RPM packages detected:{rpmlist}'
|
||||
+ .format(
|
||||
+ pre=summary,
|
||||
+ rpmlist=_formatted_list_output_with_max_items(third_party_rpms))
|
||||
+ )
|
||||
+
|
||||
+ if third_party_modules:
|
||||
+ summary = (
|
||||
+ '{pre}\n\nNon-distribution modules detected (list can be incomplete):{modulelist}'
|
||||
+ .format(
|
||||
+ pre=summary,
|
||||
+ modulelist=_formatted_list_output_with_max_items(third_party_modules))
|
||||
+ )
|
||||
+
|
||||
+ reporting.create_report([
|
||||
+ reporting.Title('Detected third-party Python modules for the target Python version'),
|
||||
+ reporting.Summary(summary),
|
||||
+ reporting.Remediation(
|
||||
+ hint='Remove third-party target Python {} packages before attempting the upgrade or ensure '
|
||||
+ 'that those modules are not interfering with distribution-provided modules.'
|
||||
+ .format(target_python_version),
|
||||
+ ),
|
||||
+ reporting.Severity(reporting.Severity.HIGH)
|
||||
+ ])
|
||||
+
|
||||
+
|
||||
+def perform_check():
|
||||
+ """Perform the check for third-party Python modules."""
|
||||
+ third_party_target_python_modules_msg = next(api.consume(
|
||||
+ ThirdPartyTargetPythonModules),
|
||||
+ None,
|
||||
+ )
|
||||
+
|
||||
+ if not third_party_target_python_modules_msg:
|
||||
+ return
|
||||
+
|
||||
+ if (third_party_target_python_modules_msg.third_party_rpm_names or
|
||||
+ third_party_target_python_modules_msg.third_party_modules):
|
||||
+ check_third_party_target_python_modules(third_party_target_python_modules_msg)
|
||||
diff --git a/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/tests/test_check_third_party_target_python_modules.py b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/tests/test_check_third_party_target_python_modules.py
|
||||
new file mode 100644
|
||||
index 00000000..2a87d195
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/checkthirdpartytargetpythonmodules/tests/test_check_third_party_target_python_modules.py
|
||||
@@ -0,0 +1,46 @@
|
||||
+import pytest
|
||||
+
|
||||
+from leapp import reporting
|
||||
+from leapp.libraries.actor import checkthirdpartytargetpythonmodules
|
||||
+from leapp.libraries.common.testutils import create_report_mocked, CurrentActorMocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import ThirdPartyTargetPythonModules
|
||||
+
|
||||
+
|
||||
+def test_perform_check_no_message_available(monkeypatch):
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ checkthirdpartytargetpythonmodules.perform_check()
|
||||
+
|
||||
+ assert not reporting.create_report.called
|
||||
+
|
||||
+
|
||||
+def test_perform_check_empty_lists(monkeypatch):
|
||||
+ msg = ThirdPartyTargetPythonModules(
|
||||
+ target_python='python3.9',
|
||||
+ third_party_modules=[],
|
||||
+ third_party_rpm_names=[]
|
||||
+ )
|
||||
+
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[msg]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ checkthirdpartytargetpythonmodules.perform_check()
|
||||
+
|
||||
+ assert not reporting.create_report.called
|
||||
+
|
||||
+
|
||||
+def test_perform_check_with_third_party_modules(monkeypatch):
|
||||
+ msg = ThirdPartyTargetPythonModules(
|
||||
+ target_python='python3.9',
|
||||
+ third_party_modules=['third_party_module'],
|
||||
+ third_party_rpm_names=['third_party_rpm']
|
||||
+ )
|
||||
+
|
||||
+ monkeypatch.setattr(api, 'current_actor', CurrentActorMocked(msgs=[msg]))
|
||||
+ monkeypatch.setattr(reporting, 'create_report', create_report_mocked())
|
||||
+
|
||||
+ checkthirdpartytargetpythonmodules.perform_check()
|
||||
+
|
||||
+ assert reporting.create_report.called
|
||||
diff --git a/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/actor.py b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/actor.py
|
||||
new file mode 100644
|
||||
index 00000000..2c0d1973
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/actor.py
|
||||
@@ -0,0 +1,19 @@
|
||||
+from leapp.actors import Actor
|
||||
+from leapp.libraries.actor import scanthirdpartytargetpythonmodules
|
||||
+from leapp.models import DistributionSignedRPM, ThirdPartyTargetPythonModules
|
||||
+from leapp.tags import FactsPhaseTag, IPUWorkflowTag
|
||||
+
|
||||
+
|
||||
+class ScanThirdPartyTargetPythonModules(Actor):
|
||||
+ """
|
||||
+ Detect third-party target Python modules and RPMs on the source system.
|
||||
+
|
||||
+ """
|
||||
+
|
||||
+ name = 'scan_third_party_target_python_modules'
|
||||
+ consumes = (DistributionSignedRPM,)
|
||||
+ produces = (ThirdPartyTargetPythonModules,)
|
||||
+ tags = (FactsPhaseTag, IPUWorkflowTag)
|
||||
+
|
||||
+ def process(self):
|
||||
+ scanthirdpartytargetpythonmodules.process()
|
||||
diff --git a/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/libraries/scanthirdpartytargetpythonmodules.py b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/libraries/scanthirdpartytargetpythonmodules.py
|
||||
new file mode 100644
|
||||
index 00000000..1329c50f
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/libraries/scanthirdpartytargetpythonmodules.py
|
||||
@@ -0,0 +1,193 @@
|
||||
+import json
|
||||
+import os
|
||||
+from collections import defaultdict
|
||||
+from pathlib import Path
|
||||
+
|
||||
+import rpm
|
||||
+
|
||||
+from leapp.libraries.common.config.version import get_target_major_version
|
||||
+from leapp.libraries.common.rpms import has_package
|
||||
+from leapp.libraries.stdlib import api, run
|
||||
+from leapp.models import DistributionSignedRPM, ThirdPartyTargetPythonModules
|
||||
+
|
||||
+PYTHON_EXTENSIONS = (".py", ".so", ".pyc")
|
||||
+FMT_LIST_SEPARATOR = '\n - '
|
||||
+
|
||||
+
|
||||
+def _formatted_list_output(input_list, sep=FMT_LIST_SEPARATOR):
|
||||
+ return ['{}{}'.format(sep, item) for item in input_list]
|
||||
+
|
||||
+
|
||||
+def get_python_sys_paths(python_interpreter):
|
||||
+ """Get sys.path from the specified Python interpreter."""
|
||||
+
|
||||
+ result = run([python_interpreter, '-c', 'import sys, json; print(json.dumps(sys.path))'])['stdout']
|
||||
+ raw_paths = json.loads(result)
|
||||
+ paths = [Path(raw_path).resolve() for raw_path in raw_paths]
|
||||
+ return paths
|
||||
+
|
||||
+
|
||||
+def get_python_binary_for_rhel(rhel_version):
|
||||
+ """
|
||||
+ Maps RHEL major version to the appropriate Python binary.
|
||||
+ """
|
||||
+
|
||||
+ version_map = {
|
||||
+ '9': 'python3.9',
|
||||
+ '10': 'python3.12',
|
||||
+ }
|
||||
+ return version_map.get(rhel_version)
|
||||
+
|
||||
+
|
||||
+def is_target_python_present(target_python):
|
||||
+ """
|
||||
+ Checks if the target Python interpreter is available on the system.
|
||||
+ """
|
||||
+
|
||||
+ result = run(['command', '-v', target_python], checked=False)
|
||||
+ return not result['exit_code']
|
||||
+
|
||||
+
|
||||
+def identify_files_of_pypackages(syspaths):
|
||||
+ ts = rpm.TransactionSet()
|
||||
+ # add a trailing slash by calling os.path.join(..., '')
|
||||
+ roots = tuple(os.path.join(str(path), "") for path in syspaths)
|
||||
+ file_to_pkg = {}
|
||||
+
|
||||
+ # Iterate over all installed packages
|
||||
+ for header in ts.dbMatch():
|
||||
+ pkg = header['name']
|
||||
+ files = header['filenames']
|
||||
+ for filename in files:
|
||||
+ if filename and filename.endswith(PYTHON_EXTENSIONS) and filename.startswith(roots):
|
||||
+ file_to_pkg[filename] = pkg
|
||||
+ return file_to_pkg
|
||||
+
|
||||
+
|
||||
+def find_python_related(root):
|
||||
+ # recursively search for all files matching the given extension
|
||||
+ for pattern in PYTHON_EXTENSIONS:
|
||||
+ yield from root.rglob("*" + pattern)
|
||||
+
|
||||
+
|
||||
+def _should_skip_file(file):
|
||||
+ # pyc files are importable, but not if they are in __pycache__
|
||||
+ return file.name.endswith(".pyc") and file.parent.name == "__pycache__"
|
||||
+
|
||||
+
|
||||
+def scan_python_files(system_paths, rpm_files):
|
||||
+ """
|
||||
+ Scan system paths for Python files and categorize them by ownership.
|
||||
+
|
||||
+ :param system_paths: List of paths to scan for Python files
|
||||
+ :param rpm_files: Dictionary mapping file paths to RPM package names
|
||||
+ :return: Tuple of (rpms_to_check, third_party_unowned_files) where:
|
||||
+ - rpms_to_check is a dict mapping RPM names to list of their files
|
||||
+ - third_party_unowned_files is a list of files not owned by any RPM
|
||||
+ """
|
||||
+ rpms_to_check = defaultdict(list)
|
||||
+ third_party_unowned_files = []
|
||||
+
|
||||
+ for path in system_paths:
|
||||
+ if not path.is_dir():
|
||||
+ continue
|
||||
+ for file in find_python_related(path):
|
||||
+ if _should_skip_file(file):
|
||||
+ continue
|
||||
+
|
||||
+ file_path = str(file)
|
||||
+ owner = rpm_files.get(file_path)
|
||||
+ if owner:
|
||||
+ rpms_to_check[owner].append(file_path)
|
||||
+ else:
|
||||
+ third_party_unowned_files.append(file_path)
|
||||
+
|
||||
+ return rpms_to_check, third_party_unowned_files
|
||||
+
|
||||
+
|
||||
+def identify_unsigned_rpms(rpms_to_check):
|
||||
+ """
|
||||
+ Identify which RPMs are third-party (not signed by the distribution).
|
||||
+
|
||||
+ :param rpms_to_check: Dictionary mapping RPM names to list of their files
|
||||
+ :return: Tuple of (third_party_rpms, third_party_files) where:
|
||||
+ - third_party_rpms is a list of third-party RPM package names
|
||||
+ - third_party_files is a list of files from third-party RPMs
|
||||
+ """
|
||||
+ third_party_rpms = []
|
||||
+ third_party_files = []
|
||||
+
|
||||
+ for rpm_name, files in rpms_to_check.items():
|
||||
+ if not has_package(DistributionSignedRPM, rpm_name):
|
||||
+ third_party_rpms.append(rpm_name)
|
||||
+ api.current_logger().warning(
|
||||
+ 'Found Python files from non-distribution RPM package: {}'.format(rpm_name)
|
||||
+ )
|
||||
+ third_party_files.extend(files)
|
||||
+
|
||||
+ return third_party_rpms, third_party_files
|
||||
+
|
||||
+
|
||||
+def process():
|
||||
+ """
|
||||
+ Main function to scan for third-party Python modules/RPMs on the target system.
|
||||
+
|
||||
+ This function:
|
||||
+ 1. Validates the target RHEL version and Python interpreter
|
||||
+ 2. Scans system paths for Python files
|
||||
+ 3. Identifies third-party RPMs and modules
|
||||
+ 4. Produces a message if any third-party modules/RPMs are detected
|
||||
+ """
|
||||
+ target_version = get_target_major_version()
|
||||
+ target_python = get_python_binary_for_rhel(target_version)
|
||||
+
|
||||
+ if not target_python:
|
||||
+ api.current_logger().info(
|
||||
+ "RHEL version {} is not supported for third-party Python modules scanning, "
|
||||
+ "skipping check.".format(target_version)
|
||||
+ )
|
||||
+ return
|
||||
+
|
||||
+ if not is_target_python_present(target_python):
|
||||
+ api.current_logger().info(
|
||||
+ "Target Python interpreter {} is not installed on the source system, "
|
||||
+ "skipping check of 3rd party python modules.".format(target_python)
|
||||
+ )
|
||||
+ return
|
||||
+ system_paths = get_python_sys_paths(target_python)
|
||||
+ rpm_files = identify_files_of_pypackages(system_paths[1:])
|
||||
+
|
||||
+ rpms_to_check, third_party_unowned_files = scan_python_files(system_paths[1:], rpm_files)
|
||||
+
|
||||
+ third_party_rpms, third_party_rpm_files = identify_unsigned_rpms(rpms_to_check)
|
||||
+
|
||||
+ # Combine all third-party files (unowned + from third-party RPMs)
|
||||
+ all_third_party_files = third_party_unowned_files + third_party_rpm_files
|
||||
+
|
||||
+ if third_party_rpms or all_third_party_files:
|
||||
+ api.current_logger().warning(
|
||||
+ 'Found {} third-party RPM package(s) and {} third-party Python file(s) '
|
||||
+ 'for target Python {}'.format(
|
||||
+ len(third_party_rpms), len(all_third_party_files), target_python
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ if third_party_rpms:
|
||||
+ api.current_logger().info(
|
||||
+ 'Complete list of third-party RPM packages:{}'.format(
|
||||
+ ''.join(_formatted_list_output(third_party_rpms))
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ if all_third_party_files:
|
||||
+ api.current_logger().info(
|
||||
+ 'Complete list of third-party Python modules:{}'.format(
|
||||
+ ''.join(_formatted_list_output(all_third_party_files))
|
||||
+ )
|
||||
+ )
|
||||
+
|
||||
+ api.produce(ThirdPartyTargetPythonModules(
|
||||
+ target_python=target_python,
|
||||
+ third_party_modules=all_third_party_files,
|
||||
+ third_party_rpm_names=third_party_rpms
|
||||
+ ))
|
||||
diff --git a/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/tests/test_scan_third_party_target_python_modules.py b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/tests/test_scan_third_party_target_python_modules.py
|
||||
new file mode 100644
|
||||
index 00000000..796185ae
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/actors/scanthirdpartytargetpythonmodules/tests/test_scan_third_party_target_python_modules.py
|
||||
@@ -0,0 +1,136 @@
|
||||
+from collections import defaultdict, namedtuple
|
||||
+from pathlib import Path
|
||||
+
|
||||
+import pytest
|
||||
+
|
||||
+from leapp.libraries.actor import scanthirdpartytargetpythonmodules
|
||||
+from leapp.libraries.common.testutils import logger_mocked
|
||||
+from leapp.libraries.stdlib import api
|
||||
+from leapp.models import DistributionSignedRPM
|
||||
+
|
||||
+Parent = namedtuple('Parent', ['name'])
|
||||
+MockFile = namedtuple('MockFile', ['name', 'parent', 'path'])
|
||||
+
|
||||
+
|
||||
+def _mock_file_str(self):
|
||||
+ return self.path
|
||||
+
|
||||
+
|
||||
+MockFile.__str__ = _mock_file_str
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('rhel_version,expected_python', [
|
||||
+ ('9', 'python3.9'),
|
||||
+ ('10', 'python3.12'),
|
||||
+ ('8', None),
|
||||
+ ('7', None),
|
||||
+ ('', None),
|
||||
+ ('invalid', None),
|
||||
+ (None, None),
|
||||
+])
|
||||
+def test_get_python_binary_for_rhel(rhel_version, expected_python):
|
||||
+ assert scanthirdpartytargetpythonmodules.get_python_binary_for_rhel(rhel_version) == expected_python
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('file_name,parent_name,should_skip', [
|
||||
+ ('module.pyc', '__pycache__', True),
|
||||
+ ('module.pyc', 'site-packages', False),
|
||||
+ ('module.py', '__pycache__', False),
|
||||
+ ('module.so', '__pycache__', False),
|
||||
+ ('module.py', 'site-packages', False),
|
||||
+ ('module.so', 'site-packages', False),
|
||||
+])
|
||||
+def test_should_skip_file(file_name, parent_name, should_skip):
|
||||
+ mock_file = MockFile(name=file_name, parent=Parent(name=parent_name), path='/dummy/path')
|
||||
+ assert scanthirdpartytargetpythonmodules._should_skip_file(mock_file) is should_skip
|
||||
+
|
||||
+
|
||||
+def test_scan_python_files(monkeypatch):
|
||||
+ system_paths = [Path('/usr/lib/python3.9/site-packages')]
|
||||
+ rpm_files = {
|
||||
+ '/usr/lib/python3.9/site-packages/rpm_module.py': 'rpm-package',
|
||||
+ '/usr/lib/python3.9/site-packages/another.py': 'another-rpm',
|
||||
+ }
|
||||
+
|
||||
+ def mock_is_dir(self):
|
||||
+ return True
|
||||
+
|
||||
+ def mock_find_python_related(root):
|
||||
+ files = [
|
||||
+ MockFile('rpm_module.py', Parent('site-packages'), '/usr/lib/python3.9/site-packages/rpm_module.py'),
|
||||
+ MockFile('unowned.py', Parent('site-packages'), '/usr/lib/python3.9/site-packages/unowned.py'),
|
||||
+ MockFile('another.py', Parent('site-packages'), '/usr/lib/python3.9/site-packages/another.py'),
|
||||
+ ]
|
||||
+ return iter(files)
|
||||
+
|
||||
+ monkeypatch.setattr(Path, 'is_dir', mock_is_dir)
|
||||
+ monkeypatch.setattr(scanthirdpartytargetpythonmodules, 'find_python_related', mock_find_python_related)
|
||||
+
|
||||
+ rpms_to_check, unowned = scanthirdpartytargetpythonmodules.scan_python_files(system_paths, rpm_files)
|
||||
+
|
||||
+ assert 'rpm-package' in rpms_to_check
|
||||
+ assert 'another-rpm' in rpms_to_check
|
||||
+ assert '/usr/lib/python3.9/site-packages/unowned.py' in unowned
|
||||
+ assert len(unowned) == 1
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('path_exists,mock_files', [
|
||||
+ (False, None),
|
||||
+ (True, [MockFile('module.pyc', Parent('__pycache__'), '/usr/lib/python3.9/site-packages/__pycache__/module.pyc')]),
|
||||
+])
|
||||
+def test_scan_python_files_filtering(monkeypatch, path_exists, mock_files):
|
||||
+ system_paths = [Path('/usr/lib/python3.9/site-packages')]
|
||||
+ rpm_files = {}
|
||||
+
|
||||
+ def mock_is_dir(self):
|
||||
+ return path_exists
|
||||
+
|
||||
+ monkeypatch.setattr(Path, 'is_dir', mock_is_dir)
|
||||
+
|
||||
+ if mock_files is not None:
|
||||
+ def mock_find_python_related(root):
|
||||
+ return iter(mock_files)
|
||||
+ monkeypatch.setattr(scanthirdpartytargetpythonmodules, 'find_python_related', mock_find_python_related)
|
||||
+
|
||||
+ rpms_to_check, unowned = scanthirdpartytargetpythonmodules.scan_python_files(system_paths, rpm_files)
|
||||
+
|
||||
+ assert len(rpms_to_check) == 0
|
||||
+ assert len(unowned) == 0
|
||||
+
|
||||
+
|
||||
+@pytest.mark.parametrize('is_signed,expected_rpm_count,expected_file_count', [
|
||||
+ (False, 1, 2),
|
||||
+ (True, 0, 0),
|
||||
+])
|
||||
+def test_identify_unsigned_rpms(monkeypatch, is_signed, expected_rpm_count, expected_file_count):
|
||||
+ rpms_to_check = defaultdict(list)
|
||||
+ package_name = 'test-package'
|
||||
+ rpms_to_check[package_name] = [
|
||||
+ '/path/to/file1.py',
|
||||
+ '/path/to/file2.py',
|
||||
+ ]
|
||||
+
|
||||
+ def mock_has_package(model, pkg_name):
|
||||
+ return is_signed
|
||||
+
|
||||
+ monkeypatch.setattr(scanthirdpartytargetpythonmodules, 'has_package', mock_has_package)
|
||||
+ monkeypatch.setattr(api, 'current_logger', logger_mocked())
|
||||
+
|
||||
+ third_party_rpms, third_party_files = scanthirdpartytargetpythonmodules.identify_unsigned_rpms(rpms_to_check)
|
||||
+
|
||||
+ assert len(third_party_rpms) == expected_rpm_count
|
||||
+ assert len(third_party_files) == expected_file_count
|
||||
+
|
||||
+ if not is_signed:
|
||||
+ assert package_name in third_party_rpms
|
||||
+ assert '/path/to/file1.py' in third_party_files
|
||||
+ assert '/path/to/file2.py' in third_party_files
|
||||
+
|
||||
+
|
||||
+def test_identify_unsigned_rpms_empty_input():
|
||||
+ rpms_to_check = defaultdict(list)
|
||||
+
|
||||
+ third_party_rpms, third_party_files = scanthirdpartytargetpythonmodules.identify_unsigned_rpms(rpms_to_check)
|
||||
+
|
||||
+ assert len(third_party_rpms) == 0
|
||||
+ assert len(third_party_files) == 0
|
||||
diff --git a/repos/system_upgrade/common/models/thirdpartytagetpythonmodules.py b/repos/system_upgrade/common/models/thirdpartytagetpythonmodules.py
|
||||
new file mode 100644
|
||||
index 00000000..105e9f2c
|
||||
--- /dev/null
|
||||
+++ b/repos/system_upgrade/common/models/thirdpartytagetpythonmodules.py
|
||||
@@ -0,0 +1,25 @@
|
||||
+from leapp.models import fields, Model
|
||||
+from leapp.topics import SystemInfoTopic
|
||||
+
|
||||
+
|
||||
+class ThirdPartyTargetPythonModules(Model):
|
||||
+ """
|
||||
+ Information about third-party target Python modules found on system.
|
||||
+
|
||||
+ """
|
||||
+ topic = SystemInfoTopic
|
||||
+
|
||||
+ target_python = fields.String()
|
||||
+ """
|
||||
+ Target system Python version.
|
||||
+ """
|
||||
+
|
||||
+ third_party_modules = fields.List(fields.String(), default=[])
|
||||
+ """
|
||||
+ List of third-party target Python modules found on the source system. Empty list if no modules found.
|
||||
+ """
|
||||
+
|
||||
+ third_party_rpm_names = fields.List(fields.String(), default=[])
|
||||
+ """
|
||||
+ List of third-party RPMs found on the source system. Empty list if no modules found.
|
||||
+ """
|
||||
diff --git a/requirements.txt b/requirements.txt
|
||||
index a1bb4725..3c79b23d 100644
|
||||
--- a/requirements.txt
|
||||
+++ b/requirements.txt
|
||||
@@ -14,3 +14,4 @@ git+https://github.com/oamg/leapp
|
||||
requests
|
||||
# pinning a py27 troublemaking transitive dependency
|
||||
lazy-object-proxy==1.5.2; python_version < '3'
|
||||
+rpm
|
||||
--
|
||||
2.51.1
|
||||
|
||||
9768
SOURCES/0051-Update-data-files-to-a-new-version-4.1.patch
Normal file
9768
SOURCES/0051-Update-data-files-to-a-new-version-4.1.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,39 @@
|
||||
From d9fe5528d6e92702e2188ee28f2620275d032d53 Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 11 Aug 2025 14:32:16 +0200
|
||||
Subject: [PATCH 52/55] Makefile: Make sanity-check respect $(REPOSITORIES)
|
||||
|
||||
Since b6e84f7, the sanity check, runs in each repository and doesn't
|
||||
respect $(REPOSITORIES). This breaks the sanity-check when it's run with
|
||||
a version of Python which is incompatible with the code in particular
|
||||
repository.
|
||||
|
||||
For example with python3.6 and el9toel10 repo, python crashes with the
|
||||
following because python3.6 doesn't understand the type hint:
|
||||
File "/payload/repos/system_upgrade/el9toel10/actors/mysql/scanmysql/libraries/scanmysql.py", line 35, in <module>
|
||||
def _check_incompatible_config() -> set[str]:
|
||||
TypeError: 'type' object is not subscriptable
|
||||
---
|
||||
Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 64115006..b1d807e1 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -373,9 +373,9 @@ lint_fix:
|
||||
test_no_lint:
|
||||
@. $(VENVNAME)/bin/activate; \
|
||||
snactor repo find --path repos/; \
|
||||
- for dir in repos/system_upgrade/*/; do \
|
||||
- echo "Running sanity-check in $$dir"; \
|
||||
- (cd $$dir && snactor workflow sanity-check ipu); \
|
||||
+ for dir in $$(echo $(REPOSITORIES) | tr "," " "); do \
|
||||
+ echo "Running sanity-check in $(_SYSUPG_REPOS)/$$dir"; \
|
||||
+ (cd $(_SYSUPG_REPOS)/$$dir && snactor workflow sanity-check ipu); \
|
||||
done; \
|
||||
$(_PYTHON_VENV) -m pytest $(REPORT_ARG) $(TEST_PATHS) $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,178 @@
|
||||
From 60a1fa88d3a8c93063eb67b9604ac030ed7f1c3a Mon Sep 17 00:00:00 2001
|
||||
From: Matej Matuska <mmatuska@redhat.com>
|
||||
Date: Mon, 11 Aug 2025 14:32:40 +0200
|
||||
Subject: [PATCH 53/55] Makefile: Partially fix ACTOR tests and enable them in
|
||||
containers
|
||||
|
||||
The ACTOR variable for running tests of a single actor has long been
|
||||
unusable, git bisect led me to dc3abf6 as the commit where
|
||||
it was (first?) broken due to the same model module being defined in
|
||||
both el7toel8 and el8toel9 repos.
|
||||
|
||||
This patch unfortunately doesn't fix that, but works around it by
|
||||
enabling the utils/actor_path.py script to search in specific
|
||||
repositories. These are passed from the Makefile via REPOSITORIES
|
||||
variable.
|
||||
|
||||
As the Makefile rules for containerized tests already use repositories,
|
||||
the ACTOR variable is just passed along.
|
||||
|
||||
NOTE: the code in actor_path.py is ugly and uses private APIs, however
|
||||
that's nothing new :).
|
||||
---
|
||||
Makefile | 44 +++++++++++++++++++++++++++++++-------------
|
||||
utils/actor_path.py | 35 ++++++++++++++++++++++++++---------
|
||||
2 files changed, 57 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index b1d807e1..59671f06 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -12,24 +12,29 @@ REPOS_PATH=repos
|
||||
_SYSUPG_REPOS="$(REPOS_PATH)/system_upgrade"
|
||||
LIBRARY_PATH=
|
||||
REPORT_ARG=
|
||||
-REPOSITORIES ?= $(shell ls $(_SYSUPG_REPOS) | xargs echo | tr " " ",")
|
||||
-SYSUPG_TEST_PATHS=$(shell echo $(REPOSITORIES) | sed -r "s|(,\\|^)| $(_SYSUPG_REPOS)/|g")
|
||||
-TEST_PATHS:=commands repos/common $(SYSUPG_TEST_PATHS)
|
||||
-
|
||||
-# Several commands can take arbitrary user supplied arguments from environment
|
||||
-# variables as well:
|
||||
-PYTEST_ARGS ?=
|
||||
-PYLINT_ARGS ?=
|
||||
-FLAKE8_ARGS ?=
|
||||
|
||||
# python version to run test with
|
||||
_PYTHON_VENV=$${PYTHON_VENV:-python3.6}
|
||||
|
||||
ifdef ACTOR
|
||||
- TEST_PATHS=`$(_PYTHON_VENV) utils/actor_path.py $(ACTOR)`
|
||||
+ # If REPOSITORIES is set, the utils/actor_path.py script searches for the
|
||||
+ # actor only in the specified repositories.
|
||||
+ # if REPOSITORIES is not set i.e. it's empty, all repositories are searched
|
||||
+ # - this is broken due to name collisions in repositories (FIXME)
|
||||
+ TEST_PATHS=$(shell . $(VENVNAME)/bin/activate && $(_PYTHON_VENV) utils/actor_path.py $(ACTOR) $(REPOSITORIES))
|
||||
APPROX_TEST_PATHS=$(shell $(_PYTHON_VENV) utils/find_actors.py -C repos $(ACTOR)) # Dev only
|
||||
+else
|
||||
+ REPOSITORIES ?= $(shell ls $(_SYSUPG_REPOS) | xargs echo | tr " " ",")
|
||||
+ SYSUPG_TEST_PATHS=$(shell echo $(REPOSITORIES) | sed -r "s|(,\\|^)| $(_SYSUPG_REPOS)/|g")
|
||||
+ TEST_PATHS:=commands repos/common $(SYSUPG_TEST_PATHS)
|
||||
endif
|
||||
|
||||
+# Several commands can take arbitrary user supplied arguments from environment
|
||||
+# variables as well:
|
||||
+PYTEST_ARGS ?=
|
||||
+PYLINT_ARGS ?=
|
||||
+FLAKE8_ARGS ?=
|
||||
+
|
||||
ifeq ($(TEST_LIBS),y)
|
||||
LIBRARY_PATH=`python utils/library_path.py`
|
||||
endif
|
||||
@@ -371,12 +376,24 @@ lint_fix:
|
||||
echo "--- isort inplace fixing done. ---;"
|
||||
|
||||
test_no_lint:
|
||||
- @. $(VENVNAME)/bin/activate; \
|
||||
+ @if [ -z "$(REPOSITORIES)" -a -n "$(ACTOR)" ]; then \
|
||||
+ printf "\033[0;31mWARNING\033[0m: Running tests with ACTOR without"; \
|
||||
+ printf " specifying REPOSITORIES is currently broken.\n" 2>&1; \
|
||||
+ printf " Specify REPOSITORIES with only one elXtoelY repository"; \
|
||||
+ printf " (e.g. REPOSITORIES=common,el8toel9).\n" 2>&1; \
|
||||
+ exit 1; \
|
||||
+ fi
|
||||
+
|
||||
+ @echo "============= snactor sanity-check ipu ===============" 2>&1
|
||||
+ . $(VENVNAME)/bin/activate; \
|
||||
snactor repo find --path repos/; \
|
||||
for dir in $$(echo $(REPOSITORIES) | tr "," " "); do \
|
||||
echo "Running sanity-check in $(_SYSUPG_REPOS)/$$dir"; \
|
||||
(cd $(_SYSUPG_REPOS)/$$dir && snactor workflow sanity-check ipu); \
|
||||
- done; \
|
||||
+ done
|
||||
+
|
||||
+ @echo "==================== unit tests ======================" 2>&1
|
||||
+ . $(VENVNAME)/bin/activate; \
|
||||
$(_PYTHON_VENV) -m pytest $(REPORT_ARG) $(TEST_PATHS) $(LIBRARY_PATH) $(PYTEST_ARGS)
|
||||
|
||||
test: lint test_no_lint
|
||||
@@ -407,7 +424,7 @@ _test_container_ipu:
|
||||
;; \
|
||||
esac && \
|
||||
$(_CONTAINER_TOOL) exec -w /repocopy $$_CONT_NAME make clean && \
|
||||
- $(_CONTAINER_TOOL) exec -w /repocopy -e REPOSITORIES $$_CONT_NAME make $${_TEST_CONT_TARGET:-test}
|
||||
+ $(_CONTAINER_TOOL) exec -w /repocopy -e ACTOR -e REPOSITORIES $$_CONT_NAME make $${_TEST_CONT_TARGET:-test}
|
||||
|
||||
|
||||
# Runs lint in a container
|
||||
@@ -449,6 +466,7 @@ test_container:
|
||||
$(_CONTAINER_TOOL) run -di --name $$_CONT_NAME -v "$$PWD":/repo:Z -e PYTHON_VENV=$$_VENV $$TEST_IMAGE && \
|
||||
$(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude 'tut/' --exclude 'docs/' --exclude '**/__pycache__/' --exclude 'packaging/' --exclude '.git/' /repo/ /repocopy && \
|
||||
$(_CONTAINER_TOOL) exec $$_CONT_NAME rsync -aur --delete --exclude '**/__pycache__/' /repo/commands/ /repocopy/tut/lib/$$_VENV/site-packages/leapp/cli/commands/ && \
|
||||
+ $(_CONTAINER_TOOL) exec -w /repocopy $$_CONT_NAME bash -c '. $(VENVNAME)/bin/activate && snactor repo find --path repos' && \
|
||||
export res=0; \
|
||||
case $$_VENV in \
|
||||
python3.6) \
|
||||
diff --git a/utils/actor_path.py b/utils/actor_path.py
|
||||
index 5c53a16a..3c61ce79 100755
|
||||
--- a/utils/actor_path.py
|
||||
+++ b/utils/actor_path.py
|
||||
@@ -1,7 +1,10 @@
|
||||
import logging
|
||||
+import os
|
||||
import sys
|
||||
|
||||
-from leapp.repository.scan import find_and_scan_repositories
|
||||
+from leapp.repository.manager import RepositoryManager
|
||||
+from leapp.repository.scan import _resolve_repository_links, find_and_scan_repositories, scan_repo
|
||||
+
|
||||
|
||||
def err_exit():
|
||||
# We want to be sure that `make test` (test_no_lint) will stop when expected
|
||||
@@ -10,22 +13,36 @@ def err_exit():
|
||||
sys.stdout.write('ERROR:__read_error_messages_above_this_one_on_stderr__')
|
||||
sys.exit(1)
|
||||
|
||||
+
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO, filename='/dev/null')
|
||||
logger = logging.getLogger('run_pytest.py')
|
||||
|
||||
BASE_REPO = 'repos'
|
||||
- repos = find_and_scan_repositories(BASE_REPO, include_locals=True)
|
||||
- repos.load()
|
||||
- if len(sys.argv) > 1:
|
||||
- actors = repos._lookup_actors(sys.argv[1])
|
||||
- if not actors:
|
||||
- sys.stderr.write('ERROR: No actor found for search "{}"\n'.format(sys.argv[1]))
|
||||
- err_exit()
|
||||
- print(' '.join([actor.full_path for actor in actors]))
|
||||
+ SYSUPG_REPO = os.path.join(BASE_REPO, 'system_upgrade')
|
||||
+
|
||||
+ if len(sys.argv) == 2:
|
||||
+ manager = find_and_scan_repositories(BASE_REPO, include_locals=True)
|
||||
+ manager.load()
|
||||
+ elif len(sys.argv) == 3:
|
||||
+ repos = sys.argv[2].split(',')
|
||||
+ # TODO: it would be nicer to have some function in the framework for
|
||||
+ # the scanning and resolving done below
|
||||
+ manager = RepositoryManager()
|
||||
+ for repo in repos:
|
||||
+ manager.add_repo(scan_repo(os.path.join(SYSUPG_REPO, repo)))
|
||||
+ _resolve_repository_links(manager=manager, include_locals=True)
|
||||
+ manager.load()
|
||||
else:
|
||||
sys.stderr.write('ERROR: Missing commandline argument\n')
|
||||
+ sys.stderr.write('Usage: actor_path.py <actor_name> [repositories]\n')
|
||||
+ err_exit()
|
||||
+
|
||||
+ actors = manager._lookup_actors(sys.argv[1])
|
||||
+ if not actors:
|
||||
+ sys.stderr.write('ERROR: No actor found for search "{}"\n'.format(sys.argv[1]))
|
||||
err_exit()
|
||||
+ print(' '.join([actor.full_path for actor in actors]))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
--
|
||||
2.51.1
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
From 4e182e84fc8ebd499dfc9f9e2caf4ae7dd63fb60 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Hecko <mhecko@redhat.com>
|
||||
Date: Fri, 25 Jul 2025 16:27:42 +0200
|
||||
Subject: [PATCH 54/55] make: error uniformly when ACTOR without REPOSITORIES
|
||||
is used
|
||||
|
||||
Using ACTOR withtout REPOSITORIES leads to a dead lock during actor
|
||||
discovery (likely due to the 'multipathconfcheck' actor). This patch
|
||||
adds a new make target that prevents the use of ACTOR without
|
||||
REPOSITORIES.
|
||||
---
|
||||
Makefile | 22 ++++++++++++----------
|
||||
1 file changed, 12 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 59671f06..039b3e9e 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -339,7 +339,7 @@ install-deps-fedora:
|
||||
$(VENVNAME)/bin/pip install -I "git+https://github.com/oamg/leapp.git@refs/pull/$(REQ_LEAPP_PR)/head"; \
|
||||
fi
|
||||
|
||||
-lint:
|
||||
+lint: _warn_misssing_repos_if_using_actor
|
||||
. $(VENVNAME)/bin/activate; \
|
||||
echo "--- Linting ... ---" && \
|
||||
SEARCH_PATH="$(TEST_PATHS)" && \
|
||||
@@ -375,14 +375,7 @@ lint_fix:
|
||||
git diff $(MASTER_BRANCH) --name-only --diff-filter AMR | grep -v "^docs/" | xargs isort && \
|
||||
echo "--- isort inplace fixing done. ---;"
|
||||
|
||||
-test_no_lint:
|
||||
- @if [ -z "$(REPOSITORIES)" -a -n "$(ACTOR)" ]; then \
|
||||
- printf "\033[0;31mWARNING\033[0m: Running tests with ACTOR without"; \
|
||||
- printf " specifying REPOSITORIES is currently broken.\n" 2>&1; \
|
||||
- printf " Specify REPOSITORIES with only one elXtoelY repository"; \
|
||||
- printf " (e.g. REPOSITORIES=common,el8toel9).\n" 2>&1; \
|
||||
- exit 1; \
|
||||
- fi
|
||||
+test_no_lint: _warn_misssing_repos_if_using_actor
|
||||
|
||||
@echo "============= snactor sanity-check ipu ===============" 2>&1
|
||||
. $(VENVNAME)/bin/activate; \
|
||||
@@ -538,5 +531,14 @@ dashboard_data:
|
||||
$(_PYTHON_VENV) ../../../utils/dashboard-json-dump.py > ../../../discover.json; \
|
||||
popd
|
||||
|
||||
-.PHONY: help build clean prepare source srpm copr_build _build_local build_container print_release register install-deps install-deps-fedora lint test_no_lint test dashboard_data fast_lint
|
||||
+_warn_misssing_repos_if_using_actor:
|
||||
+ @if [ -z "$(REPOSITORIES)" -a -n "$(ACTOR)" ]; then \
|
||||
+ printf "\033[0;31mERROR\033[0m: Running linters/tests with ACTOR without"; \
|
||||
+ printf " specifying REPOSITORIES is currently broken.\n" 2>&1; \
|
||||
+ printf " Specify REPOSITORIES with only one elXtoelY repository"; \
|
||||
+ printf " (e.g. REPOSITORIES=common,el8toel9).\n" 2>&1; \
|
||||
+ exit 1; \
|
||||
+ fi
|
||||
+
|
||||
+.PHONY: help build clean prepare source srpm copr_build _build_local build_container print_release register install-deps install-deps-fedora lint test_no_lint test dashboard_data fast_lint _warn_missing_repos_if_using_actor
|
||||
.PHONY: test_container test_container_no_lint test_container_all test_container_all_no_lint clean_containers _build_container_image _test_container_ipu dev_test_no_lint
|
||||
--
|
||||
2.51.1
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user