117 lines
4.7 KiB
Diff
117 lines
4.7 KiB
Diff
From 08756574378232de12ebbdf15801c52bc0090ce6 Mon Sep 17 00:00:00 2001
|
|
From: Petr Stodulka <xstodu05@gmail.com>
|
|
Date: Fri, 25 Nov 2022 11:19:14 +0100
|
|
Subject: [PATCH 51/63] Enable upgrades on s390x when /boot is part of rootfs
|
|
|
|
Regarding the fix provided in commit a6445b39 we do not need to
|
|
inhibit the IPU on the s390x architecture when /boot is not separated
|
|
on its own partition, but it's part of the rootfs.
|
|
---
|
|
.../actors/checknonmountboots390/actor.py | 21 -------------
|
|
.../libraries/checknonmountboots390.py | 27 -----------------
|
|
.../tests/test_checknonmountboots390.py | 30 -------------------
|
|
3 files changed, 78 deletions(-)
|
|
delete mode 100644 repos/system_upgrade/common/actors/checknonmountboots390/actor.py
|
|
delete mode 100644 repos/system_upgrade/common/actors/checknonmountboots390/libraries/checknonmountboots390.py
|
|
delete mode 100644 repos/system_upgrade/common/actors/checknonmountboots390/tests/test_checknonmountboots390.py
|
|
|
|
diff --git a/repos/system_upgrade/common/actors/checknonmountboots390/actor.py b/repos/system_upgrade/common/actors/checknonmountboots390/actor.py
|
|
deleted file mode 100644
|
|
index 82dcf30f..00000000
|
|
--- a/repos/system_upgrade/common/actors/checknonmountboots390/actor.py
|
|
+++ /dev/null
|
|
@@ -1,21 +0,0 @@
|
|
-from leapp.actors import Actor
|
|
-from leapp.libraries.actor import checknonmountboots390
|
|
-from leapp.models import Report
|
|
-from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
|
|
-
|
|
-
|
|
-class CheckNonMountBootS390(Actor):
|
|
- """
|
|
- Inhibits on s390 when /boot is NOT on a separate partition.
|
|
-
|
|
- Due to some problems, if /boot is not on a separate partition, leapp is deleting the content of /boot.
|
|
- To avoid this from happening, we are inhibiting the upgrade process until this problem has been solved.
|
|
- """
|
|
-
|
|
- name = 'check_non_mount_boot_s390'
|
|
- consumes = ()
|
|
- produces = (Report,)
|
|
- tags = (ChecksPhaseTag, IPUWorkflowTag)
|
|
-
|
|
- def process(self):
|
|
- checknonmountboots390.perform_check()
|
|
diff --git a/repos/system_upgrade/common/actors/checknonmountboots390/libraries/checknonmountboots390.py b/repos/system_upgrade/common/actors/checknonmountboots390/libraries/checknonmountboots390.py
|
|
deleted file mode 100644
|
|
index bd165603..00000000
|
|
--- a/repos/system_upgrade/common/actors/checknonmountboots390/libraries/checknonmountboots390.py
|
|
+++ /dev/null
|
|
@@ -1,27 +0,0 @@
|
|
-import os
|
|
-
|
|
-from leapp import reporting
|
|
-from leapp.libraries.common.config import architecture
|
|
-
|
|
-
|
|
-def perform_check():
|
|
- if not architecture.matches_architecture(architecture.ARCH_S390X):
|
|
- return
|
|
-
|
|
- if os.path.ismount('/boot'):
|
|
- return
|
|
-
|
|
- data = [
|
|
- reporting.Title('Leapp detected known issue related to /boot on s390x architecture'),
|
|
- reporting.Summary((
|
|
- 'Due to a bug in the Leapp code, there is a situation when the upgrade process'
|
|
- ' removes content of /boot when the directory is not on a separate partition and'
|
|
- ' the system is running on S390x architecture. To avoid this from happening, we'
|
|
- ' are inhibiting the upgrade process in this release until the issue has been fixed.'
|
|
- )),
|
|
- reporting.Groups([reporting.Groups.INHIBITOR]),
|
|
- reporting.Groups([reporting.Groups.FILESYSTEM, reporting.Groups.UPGRADE_PROCESS, reporting.Groups.BOOT]),
|
|
- reporting.Severity(reporting.Severity.HIGH),
|
|
- ]
|
|
-
|
|
- reporting.create_report(data)
|
|
diff --git a/repos/system_upgrade/common/actors/checknonmountboots390/tests/test_checknonmountboots390.py b/repos/system_upgrade/common/actors/checknonmountboots390/tests/test_checknonmountboots390.py
|
|
deleted file mode 100644
|
|
index e6d7ae1d..00000000
|
|
--- a/repos/system_upgrade/common/actors/checknonmountboots390/tests/test_checknonmountboots390.py
|
|
+++ /dev/null
|
|
@@ -1,30 +0,0 @@
|
|
-import pytest
|
|
-
|
|
-from leapp.libraries.actor import checknonmountboots390
|
|
-
|
|
-
|
|
-class CheckNonMountBootS390ReportCreated(Exception):
|
|
- pass
|
|
-
|
|
-
|
|
-@pytest.mark.parametrize(
|
|
- 'matches_arch,ismount,should_report', (
|
|
- (True, True, False),
|
|
- (True, False, True),
|
|
- (False, True, False),
|
|
- (False, False, False),
|
|
- )
|
|
-)
|
|
-def test_checknonmountboots390_perform_check(monkeypatch, matches_arch, ismount, should_report):
|
|
- def _create_report(data):
|
|
- raise CheckNonMountBootS390ReportCreated()
|
|
-
|
|
- monkeypatch.setattr(checknonmountboots390.architecture, 'matches_architecture', lambda x: matches_arch)
|
|
- monkeypatch.setattr(checknonmountboots390.os.path, 'ismount', lambda x: ismount)
|
|
- monkeypatch.setattr(checknonmountboots390.reporting, 'create_report', _create_report)
|
|
-
|
|
- if should_report:
|
|
- with pytest.raises(CheckNonMountBootS390ReportCreated):
|
|
- checknonmountboots390.perform_check()
|
|
- else:
|
|
- checknonmountboots390.perform_check()
|
|
--
|
|
2.39.0
|
|
|