LEAPP Release CTC-1 8.10/9.5

- Minor improvement of the summary overview in the console output.
- Store metadata about the LEAPP plugins inside leapp audit db.
- Prevent leapp from starting if an instance is already runnning.
- Resolves: RHEL-27848, RHEL-25407
This commit is contained in:
Toshio Kuratomi 2024-05-13 10:30:58 -07:00
parent 73dad4d4d1
commit 853180dbcf
8 changed files with 2556 additions and 2 deletions

View File

@ -0,0 +1,880 @@
From a504470d697cc24fb4805c4ab8ff120f16d87b77 Mon Sep 17 00:00:00 2001
From: Inessa Vasilevskaya <ivasilev@redhat.com>
Date: Fri, 1 Mar 2024 14:19:50 +0100
Subject: [PATCH 1/7] Update packit with currently supported upgrade paths
That' an adoptation of leapp-repository's packit update and
refactoring introduced in PR1176.
OAMG-10855
---
.packit.yaml | 595 ++++++++++++++++-----------------------------------
1 file changed, 186 insertions(+), 409 deletions(-)
diff --git a/.packit.yaml b/.packit.yaml
index 76a8777..bf22cd1 100644
--- a/.packit.yaml
+++ b/.packit.yaml
@@ -45,18 +45,30 @@ jobs:
- bash -c "grep -m1 '^Version:' packaging/leapp.spec | grep -om1 '[0-9].[0-9.]**'"
-- &sanity-79to86
+# NOTE: to see what envars, targets, .. can be set in tests, see
+# the configuration of tests here:
+# https://gitlab.cee.redhat.com/oamg/leapp-tests/-/blob/main/config.yaml
+# Available only to RH Employees.
+
+# ###################################################################### #
+# ############################### 7 TO 8 ############################### #
+# ###################################################################### #
+
+# ###################################################################### #
+# ### Abstract job definitions to make individual tests/jobs smaller ### #
+# ###################################################################### #
+- &sanity-abstract-7to8
job: tests
+ trigger: ignore
fmf_url: "https://gitlab.cee.redhat.com/oamg/leapp-tests"
fmf_ref: "main"
use_internal_tf: True
- trigger: pull_request
labels:
- sanity
targets:
epel-7-x86_64:
distros: [RHEL-7.9-ZStream]
- identifier: sanity-7.9to8.6
+ identifier: sanity-abstract-7to8
tmt_plan: ""
tf_extra_params:
test:
@@ -78,20 +90,16 @@ jobs:
provisioning:
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
- env:
- SOURCE_RELEASE: "7.9"
- TARGET_RELEASE: "8.6"
- LEAPPDATA_BRANCH: "upstream"
-- &sanity-79to86-aws
- <<: *sanity-79to86
+- &sanity-abstract-7to8-aws
+ <<: *sanity-abstract-7to8
labels:
- sanity
- aws
targets:
epel-7-x86_64:
distros: [RHEL-7.9-rhui]
- identifier: sanity-7.9to8.6-aws-e2e
+ identifier: sanity-abstract-7to8-aws
# NOTE(ivasilev) Unfortunately to use yaml templates we need to rewrite the whole tf_extra_params dict
# to use plan_filter (can't just specify one section test.tmt.plan_filter, need to specify environments.* as well)
tf_extra_params:
@@ -115,57 +123,14 @@ jobs:
post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys; yum-config-manager --enable rhel-7-server-rhui-optional-rpms"
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
- env:
- SOURCE_RELEASE: "7.9"
- TARGET_RELEASE: "8.6"
- RHUI: "aws"
- LEAPPDATA_BRANCH: "upstream"
- LEAPP_NO_RHSM: "1"
- USE_CUSTOM_REPOS: rhui
-
-- &sanity-79to88-aws
- <<: *sanity-79to86-aws
- identifier: sanity-7.9to8.8-aws-e2e
- env:
- SOURCE_RELEASE: "7.9"
- TARGET_RELEASE: "8.8"
- RHUI: "aws"
- LEAPPDATA_BRANCH: "upstream"
- LEAPP_NO_RHSM: "1"
- USE_CUSTOM_REPOS: rhui
-
-- &sanity-79to89-aws
- <<: *sanity-79to86-aws
- identifier: sanity-7.9to8.9-aws-e2e
- env:
- SOURCE_RELEASE: "7.9"
- TARGET_RELEASE: "8.9"
- RHUI: "aws"
- LEAPPDATA_BRANCH: "upstream"
- LEAPP_NO_RHSM: "1"
- USE_CUSTOM_REPOS: rhui
-
-# NOTE(mkluson) RHEL 8.10 content is not publicly available (via RHUI)
-#- &sanity-79to810-aws
-# <<: *sanity-79to86-aws
-# identifier: sanity-7.9to8.10-aws
-# env:
-# SOURCE_RELEASE: "7.9"
-# TARGET_RELEASE: "8.10"
-# RHUI: "aws"
-# LEAPPDATA_BRANCH: "upstream"
-# LEAPP_NO_RHSM: "1"
-# USE_CUSTOM_REPOS: rhui
# On-demand minimal beaker tests
-- &beaker-minimal-79to86
- <<: *sanity-79to86
+- &beaker-minimal-7to8-abstract-ondemand
+ <<: *sanity-abstract-7to8
manual_trigger: True
labels:
- beaker-minimal
- - beaker-minimal-7.9to8.6
- - 7.9to8.6
- identifier: sanity-7.9to8.6-beaker-minimal
+ identifier: beaker-minimal-7to8-abstract-ondemand
tf_extra_params:
test:
tmt:
@@ -188,13 +153,11 @@ jobs:
BusinessUnit: sst_upgrades@leapp_upstream_test
# On-demand kernel-rt tests
-- &kernel-rt-79to86
- <<: *beaker-minimal-79to86
+- &kernel-rt-abstract-7to8-ondemand
+ <<: *beaker-minimal-7to8-abstract-ondemand
labels:
- kernel-rt
- - kernel-rt-7.9to8.6
- - 7.9to8.6
- identifier: sanity-7.9to8.6-kernel-rt
+ identifier: sanity-7to8-kernel-rt-abstract-ondemand
tf_extra_params:
test:
tmt:
@@ -216,114 +179,133 @@ jobs:
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
+
+# ###################################################################### #
+# ######################### Individual tests ########################### #
+# ###################################################################### #
+
+# Tests: 7.9 -> 8.8
+- &sanity-79to88-aws
+ <<: *sanity-abstract-7to8-aws
+ trigger: pull_request
+ identifier: sanity-7.9to8.8-aws
+ env:
+ SOURCE_RELEASE: "7.9"
+ TARGET_RELEASE: "8.8"
+ RHUI: "aws"
+ LEAPPDATA_BRANCH: "upstream"
+ LEAPP_NO_RHSM: "1"
+ USE_CUSTOM_REPOS: rhui
+
- &sanity-79to88
- <<: *sanity-79to86
+ <<: *sanity-abstract-7to8
+ trigger: pull_request
identifier: sanity-7.9to8.8
env:
SOURCE_RELEASE: "7.9"
TARGET_RELEASE: "8.8"
LEAPPDATA_BRANCH: "upstream"
-# On-demand minimal beaker tests
- &beaker-minimal-79to88
- <<: *beaker-minimal-79to86
+ <<: *beaker-minimal-7to8-abstract-ondemand
+ trigger: pull_request
labels:
- beaker-minimal
- beaker-minimal-7.9to8.8
- 7.9to8.8
- identifier: sanity-7.9to8.8-beaker-minimal
+ identifier: sanity-7.9to8.8-beaker-minimal-ondemand
env:
SOURCE_RELEASE: "7.9"
TARGET_RELEASE: "8.8"
LEAPPDATA_BRANCH: "upstream"
-# On-demand kernel-rt tests
- &kernel-rt-79to88
- <<: *kernel-rt-79to86
+ <<: *kernel-rt-abstract-7to8-ondemand
+ trigger: pull_request
labels:
- kernel-rt
- kernel-rt-7.9to8.8
- 7.9to8.8
- identifier: sanity-7.9to8.8-kernel-rt
+ identifier: sanity-7.9to8.8-kernel-rt-ondemand
env:
SOURCE_RELEASE: "7.9"
TARGET_RELEASE: "8.8"
LEAPPDATA_BRANCH: "upstream"
-- &sanity-79to89
- <<: *sanity-79to86
- identifier: sanity-7.9to8.9
- env:
- SOURCE_RELEASE: "7.9"
- TARGET_RELEASE: "8.9"
- LEAPPDATA_BRANCH: "upstream"
-
-# On-demand minimal beaker tests
-- &beaker-minimal-79to89
- <<: *beaker-minimal-79to86
- labels:
- - beaker-minimal
- - beaker-minimal-7.9to8.9
- - 7.9to8.9
- identifier: sanity-7.9to8.9-beaker-minimal
- env:
- SOURCE_RELEASE: "7.9"
- TARGET_RELEASE: "8.9"
- LEAPPDATA_BRANCH: "upstream"
-
-# On-demand kernel-rt tests
-- &kernel-rt-79to89
- <<: *kernel-rt-79to88
- labels:
- - kernel-rt
- - kernel-rt-7.9to8.9
- - 7.9to8.9
- identifier: sanity-7.9to8.9-kernel-rt
- env:
- SOURCE_RELEASE: "7.9"
- TARGET_RELEASE: "8.9"
- LEAPPDATA_BRANCH: "upstream"
-
+# Tests: 7.9 -> 8.10
- &sanity-79to810
- <<: *sanity-79to86
+ <<: *sanity-abstract-7to8
+ trigger: pull_request
identifier: sanity-7.9to8.10
env:
SOURCE_RELEASE: "7.9"
TARGET_RELEASE: "8.10"
LEAPPDATA_BRANCH: "upstream"
-# On-demand minimal beaker tests
+# NOTE(mkluson) RHEL 8.10 content is not publicly available (via RHUI)
+#- &sanity-79to810-aws
+# <<: *sanity-abstract-7to8-aws
+# trigger: pull_request
+# identifier: sanity-7.9to8.10-aws
+# env:
+# SOURCE_RELEASE: "7.9"
+# TARGET_RELEASE: "8.10"
+# RHUI: "aws"
+# LEAPPDATA_BRANCH: "upstream"
+# LEAPP_NO_RHSM: "1"
+# USE_CUSTOM_REPOS: rhui
+
- &beaker-minimal-79to810
- <<: *beaker-minimal-79to86
+ <<: *beaker-minimal-7to8-abstract-ondemand
+ trigger: pull_request
labels:
- beaker-minimal
- beaker-minimal-7.9to8.10
- 7.9to8.10
- identifier: sanity-7.9to8.10-beaker-minimal
+ identifier: sanity-7.9to8.10-beaker-minimal-ondemand
env:
SOURCE_RELEASE: "7.9"
TARGET_RELEASE: "8.10"
LEAPPDATA_BRANCH: "upstream"
-# On-demand kernel-rt tests
- &kernel-rt-79to810
- <<: *kernel-rt-79to88
+ <<: *kernel-rt-abstract-7to8-ondemand
+ trigger: pull_request
labels:
- kernel-rt
- kernel-rt-7.9to8.10
- 7.9to8.10
- identifier: sanity-7.9to8.10-kernel-rt
+ identifier: sanity-7.9to8.10-kernel-rt-ondemand
env:
SOURCE_RELEASE: "7.9"
TARGET_RELEASE: "8.10"
LEAPPDATA_BRANCH: "upstream"
-- &sanity-86to90
- <<: *sanity-79to86
+
+# ###################################################################### #
+# ############################## 8 TO 10 ############################### #
+# ###################################################################### #
+
+# ###################################################################### #
+# ### Abstract job definitions to make individual tests/jobs smaller ### #
+# ###################################################################### #
+
+#NOTE(pstodulk) putting default values in abstract jobs as from 8.10, as this
+# is the last RHEL 8 release and all new future tests will start from this
+# one release.
+
+- &sanity-abstract-8to9
+ job: tests
+ trigger: ignore
+ fmf_url: "https://gitlab.cee.redhat.com/oamg/leapp-tests"
+ fmf_ref: "main"
+ use_internal_tf: True
+ labels:
+ - sanity
targets:
epel-8-x86_64:
- distros: [RHEL-8.6.0-Nightly]
- identifier: sanity-8.6to9.0
+ distros: [RHEL-8.10.0-Nightly]
+ identifier: sanity-abstract-8to9
tf_extra_params:
test:
tmt:
@@ -339,32 +321,25 @@ jobs:
order: 40
tmt:
context:
- distro: "rhel-8.6"
+ distro: "rhel-8.10"
settings:
provisioning:
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
- env:
- SOURCE_RELEASE: "8.6"
- TARGET_RELEASE: "9.0"
- RHSM_REPOS_EUS: "eus"
- LEAPPDATA_BRANCH: "upstream"
-# On-demand minimal beaker tests
-- &beaker-minimal-86to90
- <<: *beaker-minimal-79to86
+- &sanity-abstract-8to9-aws
+ <<: *sanity-abstract-8to9
labels:
- - beaker-minimal
- - beaker-minimal-8.6to9.0
- - 8.6to9.0
+ - sanity
+ - aws
targets:
epel-8-x86_64:
- distros: [RHEL-8.6.0-Nightly]
- identifier: sanity-8.6to9.0-beaker-minimal
+ distros: [RHEL-8.10-rhui]
+ identifier: sanity-abstract-8to9-aws
tf_extra_params:
test:
tmt:
- plan_filter: 'tag:partitioning & tag:8to9 & enabled:true'
+ plan_filter: 'tag:upgrade_happy_path & enabled:true'
environments:
- artifacts:
- type: "repository"
@@ -376,29 +351,26 @@ jobs:
order: 40
tmt:
context:
- distro: "rhel-8.6"
+ distro: "rhel-8.10"
settings:
provisioning:
+ post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
- env:
- SOURCE_RELEASE: "8.6"
- TARGET_RELEASE: "9.0"
- RHSM_REPOS_EUS: "eus"
- LEAPPDATA_BRANCH: "upstream"
-# On-demand kernel-rt tests
-- &kernel-rt-86to90
- <<: *beaker-minimal-86to90
+- &beaker-minimal-8to9-abstract-ondemand
+ <<: *sanity-abstract-8to9
+ manual_trigger: True
labels:
- - kernel-rt
- - kernel-rt-8.6to9.0
- - 8.6to9.0
- identifier: sanity-8.6to9.0-kernel-rt
+ - beaker-minimal
+ targets:
+ epel-8-x86_64:
+ distros: [RHEL-8.10.0-Nightly]
+ identifier: beaker-minimal-8to9-abstract-ondemand
tf_extra_params:
test:
tmt:
- plan_filter: 'tag:kernel-rt & tag:8to9 & enabled:true'
+ plan_filter: 'tag:partitioning & tag:8to9 & enabled:true'
environments:
- artifacts:
- type: "repository"
@@ -410,60 +382,43 @@ jobs:
order: 40
tmt:
context:
- distro: "rhel-8.6"
+ distro: "rhel-8.10"
settings:
provisioning:
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
-- &sanity-88to92
- <<: *sanity-86to90
- targets:
- epel-8-x86_64:
- distros: [RHEL-8.8.0-Nightly]
- identifier: sanity-8.8to9.2
+
+- &kernel-rt-abstract-8to9-ondemand
+ <<: *beaker-minimal-8to9-abstract-ondemand
+ labels:
+ - kernel-rt
+ identifier: sanity-8to9-kernel-rt-abstract-ondemand
tf_extra_params:
test:
tmt:
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
+ plan_filter: 'tag:kernel-rt & tag:8to9 & enabled:true'
environments:
- - artifacts:
- - type: "repository"
- id: "https://download.copr.fedorainfracloud.org/results/@oamg/leapp/epel-8-x86_64/"
- packages:
- - leapp-repository
- - python3-leapp
- - leapp-upgrade-el8toel9-deps
- order: 40
- tmt:
+ - tmt:
context:
- distro: "rhel-8.8"
+ distro: "rhel-8.10"
settings:
provisioning:
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
- env:
- SOURCE_RELEASE: "8.8"
- TARGET_RELEASE: "9.2"
- RHSM_REPOS_EUS: "eus"
- LEAPPDATA_BRANCH: "upstream"
- LEAPP_DEVEL_TARGET_RELEASE: "9.2"
-# On-demand minimal beaker tests
-- &beaker-minimal-88to92
- <<: *beaker-minimal-86to90
- labels:
- - beaker-minimal
- - beaker-minimal-8.8to9.2
- - 8.6to9.2
+# Tests: 8.8 -> 9.2
+- &sanity-88to92
+ <<: *sanity-abstract-8to9
+ trigger: pull_request
targets:
epel-8-x86_64:
distros: [RHEL-8.8.0-Nightly]
- identifier: sanity-8.8to9.2-beaker-minimal
+ identifier: sanity-8.8to9.2
tf_extra_params:
test:
tmt:
- plan_filter: 'tag:partitioning & tag:8to9 & enabled:true'
+ plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
environments:
- artifacts:
- type: "repository"
@@ -478,54 +433,27 @@ jobs:
distro: "rhel-8.8"
settings:
provisioning:
- post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
env:
SOURCE_RELEASE: "8.8"
TARGET_RELEASE: "9.2"
+ RHSM_REPOS_EUS: "eus"
LEAPPDATA_BRANCH: "upstream"
LEAPP_DEVEL_TARGET_RELEASE: "9.2"
-# On-demand kernel-rt tests
-- &kernel-rt-88to92
- <<: *beaker-minimal-88to92
- labels:
- - kernel-rt
- - kernel-rt-8.8to9.2
- - 8.8to9.2
- identifier: sanity-8.8to9.2-kernel-rt
- tf_extra_params:
- test:
- tmt:
- plan_filter: 'tag:kernel-rt & tag:8to9 & enabled:true'
- environments:
- - artifacts:
- - type: "repository"
- id: "https://download.copr.fedorainfracloud.org/results/@oamg/leapp/epel-8-x86_64/"
- packages:
- - leapp-repository
- - python3-leapp
- - leapp-upgrade-el8toel9-deps
- order: 40
- tmt:
- context:
- distro: "rhel-8.8"
- settings:
- provisioning:
- tags:
- BusinessUnit: sst_upgrades@leapp_upstream_test
-
-- &sanity-89to93
- <<: *sanity-88to92
+- &sanity-88to92-aws
+ <<: *sanity-abstract-8to9-aws
+ trigger: pull_request
targets:
epel-8-x86_64:
- distros: [RHEL-8.9.0-Nightly]
- identifier: sanity-8.9to9.3
+ distros: [RHEL-8.8-rhui]
+ identifier: sanity-8.8to9.2-aws
+ # NOTE(mkluson) Unfortunately to use yaml templates we need to rewrite the whole tf_extra_params dict
tf_extra_params:
test:
tmt:
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
+ plan_filter: 'tag:upgrade_happy_path & enabled:true'
environments:
- artifacts:
- type: "repository"
@@ -537,28 +465,32 @@ jobs:
order: 40
tmt:
context:
- distro: "rhel-8.9"
+ distro: "rhel-8.8"
settings:
provisioning:
+ post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
env:
- SOURCE_RELEASE: "8.9"
- TARGET_RELEASE: "9.3"
+ SOURCE_RELEASE: "8.8"
+ TARGET_RELEASE: "9.2"
+ RHSM_REPOS: "rhel-8-for-x86_64-appstream-eus-rpms,rhel-8-for-x86_64-baseos-eus-rpms"
+ RHUI: "aws"
LEAPPDATA_BRANCH: "upstream"
- LEAPP_DEVEL_TARGET_RELEASE: "9.3"
+ LEAPP_NO_RHSM: "1"
+ USE_CUSTOM_REPOS: rhui
-# On-demand minimal beaker tests
-- &beaker-minimal-89to93
- <<: *beaker-minimal-88to92
+- &beaker-minimal-88to92
+ <<: *beaker-minimal-8to9-abstract-ondemand
+ trigger: pull_request
labels:
- beaker-minimal
- - beaker-minimal-8.9to9.3
- - 8.9to9.3
+ - beaker-minimal-8.8to9.2
+ - 8.8to9.2
targets:
epel-8-x86_64:
- distros: [RHEL-8.9.0-Nightly]
- identifier: sanity-8.9to9.3-beaker-minimal
+ distros: [RHEL-8.8.0-Nightly]
+ identifier: sanity-8.8to9.2-beaker-minimal-ondemand
tf_extra_params:
test:
tmt:
@@ -574,25 +506,29 @@ jobs:
order: 40
tmt:
context:
- distro: "rhel-8.9"
+ distro: "rhel-8.8"
settings:
provisioning:
+ post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
env:
- SOURCE_RELEASE: "8.9"
- TARGET_RELEASE: "9.3"
+ SOURCE_RELEASE: "8.8"
+ TARGET_RELEASE: "9.2"
LEAPPDATA_BRANCH: "upstream"
- LEAPP_DEVEL_TARGET_RELEASE: "9.3"
+ LEAPP_DEVEL_TARGET_RELEASE: "9.2"
-# On-demand kernel-rt tests
-- &kernel-rt-89to93
- <<: *beaker-minimal-89to93
+- &kernel-rt-88to92
+ <<: *kernel-rt-abstract-8to9-ondemand
+ trigger: pull_request
labels:
- kernel-rt
- - kernel-rt-8.9to9.3
- - 8.9to9.3
- identifier: sanity-8.9to9.3-kernel-rt
+ - kernel-rt-8.8to9.2
+ - 8.8to9.2
+ identifier: sanity-8.8to9.2-kernel-rt-ondemand
+ targets:
+ epel-8-x86_64:
+ distros: [RHEL-8.8.0-Nightly]
tf_extra_params:
test:
tmt:
@@ -608,38 +544,23 @@ jobs:
order: 40
tmt:
context:
- distro: "rhel-8.9"
+ distro: "rhel-8.8"
settings:
provisioning:
tags:
BusinessUnit: sst_upgrades@leapp_upstream_test
+ env:
+ SOURCE_RELEASE: "8.8"
+ TARGET_RELEASE: "9.2"
+ LEAPPDATA_BRANCH: "upstream"
+ LEAPP_DEVEL_TARGET_RELEASE: "9.2"
+
+# Tests: 8.10 -> 9.4
- &sanity-810to94
- <<: *sanity-88to92
- targets:
- epel-8-x86_64:
- distros: [RHEL-8.10.0-Nightly]
+ <<: *sanity-abstract-8to9
+ trigger: pull_request
identifier: sanity-8.10to9.4
- tf_extra_params:
- test:
- tmt:
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
- environments:
- - artifacts:
- - type: "repository"
- id: "https://download.copr.fedorainfracloud.org/results/@oamg/leapp/epel-8-x86_64/"
- packages:
- - leapp-repository
- - python3-leapp
- - leapp-upgrade-el8toel9-deps
- order: 40
- tmt:
- context:
- distro: "rhel-8.10"
- settings:
- provisioning:
- tags:
- BusinessUnit: sst_upgrades@leapp_upstream_test
env:
SOURCE_RELEASE: "8.10"
TARGET_RELEASE: "9.4"
@@ -648,35 +569,13 @@ jobs:
# On-demand minimal beaker tests
- &beaker-minimal-810to94
- <<: *beaker-minimal-88to92
+ <<: *beaker-minimal-8to9-abstract-ondemand
+ trigger: pull_request
labels:
- beaker-minimal
- beaker-minimal-8.10to9.4
- 8.10to9.4
- targets:
- epel-8-x86_64:
- distros: [RHEL-8.10.0-Nightly]
- identifier: sanity-8.10to9.4-beaker-minimal
- tf_extra_params:
- test:
- tmt:
- plan_filter: 'tag:partitioning & tag:8to9 & enabled:true'
- environments:
- - artifacts:
- - type: "repository"
- id: "https://download.copr.fedorainfracloud.org/results/@oamg/leapp/epel-8-x86_64/"
- packages:
- - leapp-repository
- - python3-leapp
- - leapp-upgrade-el8toel9-deps
- order: 40
- tmt:
- context:
- distro: "rhel-8.10"
- settings:
- provisioning:
- tags:
- BusinessUnit: sst_upgrades@leapp_upstream_test
+ identifier: sanity-8.10to9.4-beaker-minimal-ondemand
env:
SOURCE_RELEASE: "8.10"
TARGET_RELEASE: "9.4"
@@ -684,137 +583,15 @@ jobs:
# On-demand kernel-rt tests
- &kernel-rt-810to94
- <<: *beaker-minimal-810to94
+ <<: *kernel-rt-abstract-8to9-ondemand
+ trigger: pull_request
labels:
- kernel-rt
- kernel-rt-8.10to9.4
- 8.10to9.4
- identifier: sanity-8.10to9.4-kernel-rt
- tf_extra_params:
- test:
- tmt:
- plan_filter: 'tag:kernel-rt & tag:8to9 & enabled:true'
- environments:
- - artifacts:
- - type: "repository"
- id: "https://download.copr.fedorainfracloud.org/results/@oamg/leapp/epel-8-x86_64/"
- packages:
- - leapp-repository
- - python3-leapp
- - leapp-upgrade-el8toel9-deps
- order: 40
- tmt:
- context:
- distro: "rhel-8.10"
- settings:
- provisioning:
- tags:
- BusinessUnit: sst_upgrades@leapp_upstream_test
-
-- &sanity-86to90-aws
- <<: *sanity-79to86-aws
- targets:
- epel-8-x86_64:
- distros: [RHEL-8.6-rhui]
- identifier: sanity-8.6to9.0-aws-e2e
- tf_extra_params:
- test:
- tmt:
- plan_filter: 'tag:upgrade_happy_path & enabled:true'
- environments:
- - artifacts:
- - type: "repository"
- id: "https://download.copr.fedorainfracloud.org/results/@oamg/leapp/epel-8-x86_64/"
- packages:
- - leapp-repository
- - python3-leapp
- - leapp-upgrade-el8toel9-deps
- order: 40
- tmt:
- context:
- distro: "rhel-8.6"
- settings:
- provisioning:
- post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
- tags:
- BusinessUnit: sst_upgrades@leapp_upstream_test
- env:
- SOURCE_RELEASE: "8.6"
- TARGET_RELEASE: "9.0"
- RHSM_REPOS: "rhel-8-for-x86_64-appstream-eus-rpms,rhel-8-for-x86_64-baseos-eus-rpms"
- RHUI: "aws"
- LEAPPDATA_BRANCH: "upstream"
- LEAPP_NO_RHSM: "1"
- USE_CUSTOM_REPOS: rhui
-
-- &sanity-88to92-aws
- <<: *sanity-86to90-aws
- targets:
- epel-8-x86_64:
- distros: [RHEL-8.8-rhui]
- identifier: sanity-8.8to9.2-aws
- tf_extra_params:
- test:
- tmt:
- plan_filter: 'tag:upgrade_happy_path & enabled:true'
- environments:
- - artifacts:
- - type: "repository"
- id: "https://download.copr.fedorainfracloud.org/results/@oamg/leapp/epel-8-x86_64/"
- packages:
- - leapp-repository
- - python3-leapp
- - leapp-upgrade-el8toel9-deps
- order: 40
- tmt:
- context:
- distro: "rhel-8.8"
- settings:
- provisioning:
- post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
- tags:
- BusinessUnit: sst_upgrades@leapp_upstream_test
+ identifier: sanity-8.10to9.4-kernel-rt-ondemand
env:
- SOURCE_RELEASE: "8.8"
- TARGET_RELEASE: "9.2"
- RHSM_REPOS: "rhel-8-for-x86_64-appstream-eus-rpms,rhel-8-for-x86_64-baseos-eus-rpms"
- RHUI: "aws"
- LEAPPDATA_BRANCH: "upstream"
- LEAPP_NO_RHSM: "1"
- USE_CUSTOM_REPOS: rhui
-
-- &sanity-89to93-aws
- <<: *sanity-86to90-aws
- targets:
- epel-8-x86_64:
- distros: [RHEL-8.9-rhui]
- identifier: sanity-8.9to9.3-aws
- tf_extra_params:
- test:
- tmt:
- plan_filter: 'tag:upgrade_happy_path & enabled:true'
- environments:
- - artifacts:
- - type: "repository"
- id: "https://download.copr.fedorainfracloud.org/results/@oamg/leapp/epel-8-x86_64/"
- packages:
- - leapp-repository
- - python3-leapp
- - leapp-upgrade-el8toel9-deps
- order: 40
- tmt:
- context:
- distro: "rhel-8.9"
- settings:
- provisioning:
- post_install_script: "#!/bin/sh\nsudo sed -i s/.*ssh-rsa/ssh-rsa/ /root/.ssh/authorized_keys"
- tags:
- BusinessUnit: sst_upgrades@leapp_upstream_test
- env:
- SOURCE_RELEASE: "8.9"
- TARGET_RELEASE: "9.3"
- RHSM_REPOS: "rhel-8-for-x86_64-appstream-rpms,rhel-8-for-x86_64-baseos-rpms"
- RHUI: "aws"
+ SOURCE_RELEASE: "8.10"
+ TARGET_RELEASE: "9.4"
+ RHSM_REPOS: "rhel-8-for-x86_64-appstream-beta-rpms,rhel-8-for-x86_64-baseos-beta-rpms"
LEAPPDATA_BRANCH: "upstream"
- LEAPP_NO_RHSM: "1"
- USE_CUSTOM_REPOS: rhui
--
2.42.0

View File

@ -0,0 +1,47 @@
From 9050ff0c540f0ceebfdc156b7ca8e28db70d4133 Mon Sep 17 00:00:00 2001
From: Inessa Vasilevskaya <ivasilev@redhat.com>
Date: Thu, 25 Apr 2024 13:32:47 +0200
Subject: [PATCH 2/7] Update packit config after tier redefinition
Now for basic sanity test verification in upstream tests
tagged by 'tier0' will be used instead of 'sanity'.
RHELMISC-3211
---
.packit.yaml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.packit.yaml b/.packit.yaml
index bf22cd1..4e9c239 100644
--- a/.packit.yaml
+++ b/.packit.yaml
@@ -73,7 +73,7 @@ jobs:
tf_extra_params:
test:
tmt:
- plan_filter: 'tag:sanity & enabled:true'
+ plan_filter: 'tag:tier0 & enabled:true'
environments:
- artifacts:
- type: "repository"
@@ -309,7 +309,7 @@ jobs:
tf_extra_params:
test:
tmt:
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
+ plan_filter: 'tag:tier0 & tag:8to9 & enabled:true'
environments:
- artifacts:
- type: "repository"
@@ -418,7 +418,7 @@ jobs:
tf_extra_params:
test:
tmt:
- plan_filter: 'tag:sanity & tag:8to9 & enabled:true'
+ plan_filter: 'tag:tier0 & tag:8to9 & enabled:true'
environments:
- artifacts:
- type: "repository"
--
2.42.0

View File

@ -0,0 +1,44 @@
From b21450ac397ad9aca7aa13a247f889e9dc354344 Mon Sep 17 00:00:00 2001
From: Petr Stodulka <pstodulk@redhat.com>
Date: Fri, 26 Apr 2024 13:46:00 +0200
Subject: [PATCH 3/7] Reword the report msg in the console output to note
remediations
Users who do not understand why they should read the generated leapp
report. They are missing that the console output is just a summary
overview of the report itself.
Rewording the msg little bit to make it explicitely clear that report
contains more details about discovered problems and possible remediation
instructions.
Also switch order of printed reports paths: txt first.
Jira: https://issues.redhat.com/browse/RHEL-25406
https://issues.redhat.com/browse/RHEL-25407
---
leapp/utils/output.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/leapp/utils/output.py b/leapp/utils/output.py
index 4bca481..4e91718 100644
--- a/leapp/utils/output.py
+++ b/leapp/utils/output.py
@@ -202,10 +202,12 @@ def report_info(context_id, report_paths, log_paths, answerfile=None, fail=False
_print_reports_summary(reports)
print(
- '\n{bold}Before continuing consult the full report:{reset}'
+ '\n{bold}Before continuing, review the full report below for details'
+ ' about discovered problems and possible remediation instructions:{reset}'
.format(bold=Color.bold, reset=Color.reset)
)
- for report_path in report_paths:
+ for report_path in sorted(report_paths, reverse=True):
+ # NOTE: sort hack -> print .txt first
sys.stdout.write(" A report has been generated at {path}\n".format(path=report_path))
if answerfile:
--
2.42.0

View File

@ -0,0 +1,25 @@
From 210b02021fc03f6ea86cc08fd129ecd3a62c6ee9 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 8 May 2024 12:45:08 +0000
Subject: [PATCH 4/7] Add renovate.json
---
renovate.json | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 renovate.json
diff --git a/renovate.json b/renovate.json
new file mode 100644
index 0000000..5db72dd
--- /dev/null
+++ b/renovate.json
@@ -0,0 +1,6 @@
+{
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
+ "extends": [
+ "config:recommended"
+ ]
+}
--
2.42.0

View File

@ -0,0 +1,29 @@
From 6bb9098f2e47c3d52f9129d8fc355f362b9ceae6 Mon Sep 17 00:00:00 2001
From: Rodolfo Olivieri <rolivier@redhat.com>
Date: Wed, 8 May 2024 10:12:48 -0300
Subject: [PATCH 5/7] Update renovate.json
---
renovate.json | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/renovate.json b/renovate.json
index 5db72dd..771ce84 100644
--- a/renovate.json
+++ b/renovate.json
@@ -1,6 +1,8 @@
{
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
- "extends": [
- "config:recommended"
- ]
+ "extends": [
+ "config:base"
+ ],
+ "enabledManagers": [
+ "github-actions"
+ ]
}
--
2.42.0

175
0006-Add-process-lock.patch Normal file
View File

@ -0,0 +1,175 @@
From b64c44bfb741e17650c7c0d65f25fc4ef67fdf19 Mon Sep 17 00:00:00 2001
From: David Kubek <dkubek@redhat.com>
Date: Thu, 22 Feb 2024 12:51:04 +0100
Subject: [PATCH 6/7] Add process lock
This commit addresses the potential risk of running multiple instances
of Leapp simultaneously on a single system. It implements a simple lock
mechanism to prevent concurrent executions on a single system using a
simple BSD lock (`flock(2)`).
Lock is acquired at the start of the execution and a PID number is
stored in lockfile. The PID in lockfile currently has purely
informational character.
---
leapp/cli/__init__.py | 10 ++++--
leapp/config.py | 3 ++
leapp/exceptions.py | 4 +++
leapp/utils/lock.py | 83 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 97 insertions(+), 3 deletions(-)
create mode 100644 leapp/utils/lock.py
diff --git a/leapp/cli/__init__.py b/leapp/cli/__init__.py
index fe997d4..ab16198 100644
--- a/leapp/cli/__init__.py
+++ b/leapp/cli/__init__.py
@@ -2,12 +2,12 @@ import os
import pkgutil
import socket
import sys
-import textwrap
from leapp import VERSION
from leapp.cli import commands
-from leapp.exceptions import UnknownCommandError
+from leapp.exceptions import UnknownCommandError, ProcessLockError
from leapp.utils.clicmd import command
+from leapp.utils.lock import leapp_lock
@command('')
@@ -42,7 +42,8 @@ def main():
os.environ['LEAPP_HOSTNAME'] = socket.getfqdn()
_load_commands(cli.command)
try:
- cli.command.execute('leapp version {}'.format(VERSION))
+ with leapp_lock():
+ cli.command.execute('leapp version {}'.format(VERSION))
except UnknownCommandError as e:
bad_cmd = (
"Command \"{CMD}\" is unknown.\nMost likely there is a typo in the command or particular "
@@ -54,3 +55,6 @@ def main():
bad_cmd = "No such argument {CMD}"
print(bad_cmd.format(CMD=e.requested))
sys.exit(1)
+ except ProcessLockError as e:
+ sys.stderr.write('{}\nAborting.\n'.format(e.message))
+ sys.exit(1)
diff --git a/leapp/config.py b/leapp/config.py
index 18c357d..2487e0f 100644
--- a/leapp/config.py
+++ b/leapp/config.py
@@ -40,6 +40,9 @@ _CONFIG_DEFAULTS = {
'dir': '/var/log/leapp/',
'files': ','.join(_FILES_TO_ARCHIVE),
},
+ 'lock': {
+ 'path': '/var/run/leapp.pid'
+ },
'logs': {
'dir': '/var/log/leapp/',
'files': ','.join(_LOGS),
diff --git a/leapp/exceptions.py b/leapp/exceptions.py
index 43c5905..9463a5c 100644
--- a/leapp/exceptions.py
+++ b/leapp/exceptions.py
@@ -148,3 +148,7 @@ class RequestStopAfterPhase(LeappError):
def __init__(self):
super(RequestStopAfterPhase, self).__init__('Stop after phase has been requested.')
+
+
+class ProcessLockError(LeappError):
+ """ This exception is used to represent an error within the process locking mechanism. """
diff --git a/leapp/utils/lock.py b/leapp/utils/lock.py
new file mode 100644
index 0000000..33e825c
--- /dev/null
+++ b/leapp/utils/lock.py
@@ -0,0 +1,83 @@
+import os
+import fcntl
+import logging
+
+from leapp.config import get_config
+from leapp.exceptions import ProcessLockError
+
+
+def leapp_lock(lockfile=None):
+ return ProcessLock(lockfile=lockfile)
+
+
+def _acquire_lock(fd):
+ try:
+ fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
+ return True
+ except OSError:
+ return False
+
+
+def _clear_lock(fd):
+ os.lseek(fd, 0, os.SEEK_SET)
+ os.ftruncate(fd, 0)
+
+
+def _read_pid(fd):
+ return os.read(fd, 20)
+
+
+def _write_pid(fd, pid):
+ _clear_lock(fd)
+ os.write(fd, str(pid).encode('utf-8'))
+
+
+class ProcessLock(object):
+
+ def __init__(self, lockfile=None):
+ self.log = logging.getLogger('leapp.utils.lock')
+ self.lockfile = lockfile if lockfile else get_config().get('lock', 'path')
+
+ self.fd = None
+
+ def _get_pid_from_lockfile(self):
+ running_pid = _read_pid(self.fd)
+ self.log.debug("_get_pid_from_lockfile: running_pid=%s", running_pid)
+ running_pid = int(running_pid)
+
+ return running_pid
+
+ def _try_lock(self, pid):
+ if not _acquire_lock(self.fd):
+ try:
+ running_pid = self._get_pid_from_lockfile()
+ except ValueError:
+ process_msg = ''
+ else:
+ process_msg = ' by process with PID {}'.format(running_pid)
+
+ msg = (
+ 'Leapp is currently locked{} and cannot be started.\n'
+ 'Please ensure no other instance of leapp is running and then delete the lockfile at {} and try again.'
+ ).format(process_msg, self.lockfile)
+ raise ProcessLockError(msg)
+
+ try:
+ _write_pid(self.fd, pid)
+ except OSError:
+ raise ProcessLockError('Could not write PID to lockfile.')
+
+ def __enter__(self):
+ my_pid = os.getpid()
+
+ self.fd = os.open(self.lockfile, os.O_CREAT | os.O_RDWR, 0o600)
+ try:
+ self._try_lock(my_pid)
+ except ProcessLockError:
+ os.close(self.fd)
+ raise
+
+ def __exit__(self, *exc_args):
+ _clear_lock(self.fd)
+ os.close(self.fd)
+ os.unlink(self.lockfile)
--
2.42.0

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@
Name: leapp
Version: 0.17.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: OS & Application modernization framework
License: ASL 2.0
@ -65,6 +65,13 @@ Requires: leapp-repository
# PATCHES HERE
# Patch0001: filename.patch
Patch0001: 0001-Update-packit-with-currently-supported-upgrade-paths.patch
Patch0002: 0002-Update-packit-config-after-tier-redefinition.patch
Patch0003: 0003-Reword-the-report-msg-in-the-console-output-to-note-.patch
Patch0004: 0004-Add-renovate.json.patch
Patch0005: 0005-Update-renovate.json.patch
Patch0006: 0006-Add-process-lock.patch
Patch0007: 0007-Extend-information-from-leapp-saved-to-leappdb-847.patch
%description
@ -159,7 +166,13 @@ Requires: findutils
# APPLY REGISTERED PATCHES HERE
# %%patch0001 -p1
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
%patch0005 -p1
%patch0006 -p1
%patch0007 -p1
##################################################
@ -243,6 +256,12 @@ install -m 0644 -p man/leapp.1 %{buildroot}%{_mandir}/man1/
# no files here
%changelog
* Mon May 13 2024 Toshio Kuratomi <toshio@fedoraproject.org> - 0.17.0-2
- Minor improvement of the summary overview in the console output.
- Store metadata about the LEAPP plugins inside leapp audit db.
- Prevent leapp from starting if an instance is already runnning.
- Resolves: RHEL-27848, RHEL-25407
* Tue Feb 13 2024 Toshio Kuratomi <toshio@fedoraproject.org> - - 0.17.0-1
- Rebase to upstream version v0.17.0.
- Resolves: RHEL-21451