From 789f8f8eb9f9dd0843eb5bd836802207661ae5d1 Mon Sep 17 00:00:00 2001 From: Rodolfo Olivieri Date: Thu, 1 Dec 2022 10:04:04 -0300 Subject: [PATCH 1/8] Add missing integration tests for single yum transaction While testing convert2rhel manually in a vagrant box, I realized that the conversion stopped in the yum transaction validation phase, generating a traceback and not doing a proper rollback after the error appeared. Since the transaction validation is supposed to trigger the rollback in case of any failures, it was strange that the tool was not behaving the way it should. As part of #674 that introduced the fix, we left out the integration tests that were supposed to cover this scenario. Signed-off-by: Rodolfo Olivieri --- .../pkgmanager/handlers/yum/__init__.py | 37 +++--- .../pkgmanager/handlers/yum/yum_test.py | 9 ++ plans/tier0.fmf | 4 + .../main.fmf | 26 +++++ .../test_single_yum_transaction_validation.py | 105 ++++++++++++++++++ .../tier1/single-yum-transaction/main.fmf | 7 +- 6 files changed, 169 insertions(+), 19 deletions(-) create mode 100644 tests/integration/tier0/single-yum-transaction-validation/main.fmf create mode 100644 tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py diff --git a/convert2rhel/pkgmanager/handlers/yum/__init__.py b/convert2rhel/pkgmanager/handlers/yum/__init__.py index 7f3c7b7901..1ea9640beb 100644 --- a/convert2rhel/pkgmanager/handlers/yum/__init__.py +++ b/convert2rhel/pkgmanager/handlers/yum/__init__.py @@ -126,7 +126,11 @@ def _set_up_base(self): self._base.conf.yumvar["releasever"] = system_info.releasever def _enable_repos(self): - """Enable a list of required repositories.""" + """Enable a list of required repositories. + + :raises SystemInfo: If there is no way to connect to the mirrors in the + repos. + """ self._base.repos.disableRepo("*") # Set the download progress display self._base.repos.setProgressBar(PackageDownloadCallback()) @@ -149,22 +153,23 @@ def _perform_operations(self): loggerinst.info("Adding %s packages to the yum transaction set.", system_info.name) - for pkg in original_os_pkgs: - self._base.update(pattern=pkg) - try: - self._base.reinstall(pattern=pkg) - except ( - pkgmanager.Errors.ReinstallInstallError, - pkgmanager.Errors.ReinstallRemoveError, - ): + try: + for pkg in original_os_pkgs: + self._base.update(pattern=pkg) try: - self._base.downgrade(pattern=pkg) - except ( - pkgmanager.Errors.ReinstallInstallError, - pkgmanager.Errors.ReinstallRemoveError, - pkgmanager.Errors.DowngradeError, - ): - loggerinst.warning("Package %s not available in RHEL repositories.", pkg) + self._base.reinstall(pattern=pkg) + except (pkgmanager.Errors.ReinstallInstallError, pkgmanager.Errors.ReinstallRemoveError): + try: + self._base.downgrade(pattern=pkg) + except ( + pkgmanager.Errors.ReinstallInstallError, + pkgmanager.Errors.ReinstallRemoveError, + pkgmanager.Errors.DowngradeError, + ): + loggerinst.warning("Package %s not available in RHEL repositories.", pkg) + except pkgmanager.Errors.NoMoreMirrorsRepoError as e: + loggerinst.debug("Got the following exception message: %s", e) + loggerinst.critical("There are no suitable mirrors available for the loaded repositories.") def _resolve_dependencies(self, validate_transaction): """Try to resolve the transaction dependencies. diff --git a/convert2rhel/unit_tests/pkgmanager/handlers/yum/yum_test.py b/convert2rhel/unit_tests/pkgmanager/handlers/yum/yum_test.py index d9e49a201e..5db38a12e1 100644 --- a/convert2rhel/unit_tests/pkgmanager/handlers/yum/yum_test.py +++ b/convert2rhel/unit_tests/pkgmanager/handlers/yum/yum_test.py @@ -129,6 +129,15 @@ def test_perform_operations_downgrade_exception( assert pkgmanager.YumBase.downgrade.call_count == len(system_packages) assert "not available in RHEL repositories." in caplog.records[-1].message + @centos7 + def test_perform_operations_no_more_mirrors_repo_exception(self, pretend_os, _mock_yum_api_calls, monkeypatch): + monkeypatch.setattr(pkgmanager.handlers.yum, "get_system_packages_for_replacement", lambda: ["pkg-1"]) + pkgmanager.YumBase.update.side_effect = pkgmanager.Errors.NoMoreMirrorsRepoError + instance = YumTransactionHandler() + + with pytest.raises(SystemExit, match="There are no suitable mirrors available for the loaded repositories."): + instance._perform_operations() + @centos7 @pytest.mark.parametrize( ("ret_code", "message", "validate_transaction", "expected"), diff --git a/plans/tier0.fmf b/plans/tier0.fmf index 2655e3580b..e4e8c8f3a0 100644 --- a/plans/tier0.fmf +++ b/plans/tier0.fmf @@ -77,3 +77,7 @@ /log_command_verification: discover+: test: log-command + +/single_yum_transaction_validation: + discover+: + test: single-yum-transaction-validation diff --git a/tests/integration/tier0/single-yum-transaction-validation/main.fmf b/tests/integration/tier0/single-yum-transaction-validation/main.fmf new file mode 100644 index 0000000000..e263d80726 --- /dev/null +++ b/tests/integration/tier0/single-yum-transaction-validation/main.fmf @@ -0,0 +1,26 @@ +summary: Single Yum Transaction Validation +description: > + Verify that we are doing a proper rollback during (and before) the + validation phase in our transactions. + +tier: 0 + +tag+: + - yum + - dnf + - transaction + +/transaction_validation_error: + adjust+: + - enabled: false + when: distro == centos-8 or distro == oraclelinux-8 + tag+: + - transaction-validation-error + test: | + pytest -svv -m transaction_validation_error + +/package_download_error: + tag+: + - package-download-error + test: | + pytest -svv -m package_download_error diff --git a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py new file mode 100644 index 0000000000..86f15aba1a --- /dev/null +++ b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py @@ -0,0 +1,105 @@ +import os +import shutil + +import pytest + +from conftest import SYSTEM_RELEASE +from envparse import env + + +PKI_ENTITLEMENT_KEYS_PATH = "/etc/pki/entitlement" + + +def backup_entitlement_keys(): + original_keys = os.listdir(PKI_ENTITLEMENT_KEYS_PATH) + + for key in original_keys: + full_key = "{}/{}".format(PKI_ENTITLEMENT_KEYS_PATH, key) + new_key = "{}.bk".format(full_key) + shutil.move(full_key, new_key) + + +def rollback_entitlement_keys(): + """""" + backup_keys = os.listdir(PKI_ENTITLEMENT_KEYS_PATH) + + for key in backup_keys: + # This is already in the format with a .bk at the end of it + backup_key = "{}/{}".format(PKI_ENTITLEMENT_KEYS_PATH, key) + original_key = "{}".format(backup_key) + shutil.move(backup_key, original_key) + + +@pytest.mark.package_download_error +def test_package_download_error(convert2rhel): + """ + Remove the entitlement keys found at /etc/pki/entitlement during package + download phase for both yum and dnf transactions. + + This will run the conversion up to the point where we valiate the + transaction, when it reaches a specific point of the validation, we remove + the entitlement keys found in /etc/pki/entitlement/*.pem to ensure that the + tool is doing a proper rollback when there is any failure during the package + download. + + The package download happens in different phases for yum and dnf, yum + download the packages during the `processTransaction` method call, while dnf + has a specific method that process and download the packages in the + transaction. + """ + + server_sub = "CentOS Linux" + pkgmanager = "yum" + final_message = "There are no suitable mirrors available for the loaded repositories." + + if "oracle" in SYSTEM_RELEASE: + server_sub = "Oracle Linux Server" + + if "8" in SYSTEM_RELEASE: + pkgmanager = "dnf" + final_message = "Failed to download the transaction packages." + + with convert2rhel( + "-y --no-rpm-va --serverurl {} --username {} --password {} --pool {} --debug".format( + env.str("RHSM_SERVER_URL"), + env.str("RHSM_USERNAME"), + env.str("RHSM_PASSWORD"), + env.str("RHSM_POOL"), + ) + ) as c2r: + c2r.expect("Adding {} packages to the {} transaction set.".format(server_sub, pkgmanager)) + backup_entitlement_keys() + assert c2r.expect_exact(final_message, timeout=600) == 0 + + assert c2r.exitstatus == 1 + + rollback_entitlement_keys() + + +@pytest.mark.transaction_validation_error +def test_transaction_validation_error(convert2rhel): + """ + Remove the entitlement keys found at /etc/pki/entitlement during transaction + processing to throw the following yum error: pkgmanager.Errors.YumDownloadError + + This will run the conversion up to the point where we valiate the + transaction, when it reaches a specific point of the validation, we remove + the entitlement keys found in /etc/pki/entitlement/*.pem to ensure that the + tool is doing a proper rollback when the transaction is being processed. + """ + + with convert2rhel( + "-y --no-rpm-va --serverurl {} --username {} --password {} --pool {} --debug".format( + env.str("RHSM_SERVER_URL"), + env.str("RHSM_USERNAME"), + env.str("RHSM_PASSWORD"), + env.str("RHSM_POOL"), + ) + ) as c2r: + c2r.expect("Validating the yum transaction set, no modifications to the system will happen this time.") + backup_entitlement_keys() + assert c2r.expect_exact("Failed to validate the yum transaction.", timeout=600) == 0 + + assert c2r.exitstatus == 1 + + rollback_entitlement_keys() diff --git a/tests/integration/tier1/single-yum-transaction/main.fmf b/tests/integration/tier1/single-yum-transaction/main.fmf index 62d1a719cb..55f918d317 100644 --- a/tests/integration/tier1/single-yum-transaction/main.fmf +++ b/tests/integration/tier1/single-yum-transaction/main.fmf @@ -1,8 +1,9 @@ -summary: Single yum transaction +summary: Verify the single yum transaction description: | - Handle the unified yum transactions so that it handles packages without error. Previous iterations used a lot of - different steps, whereas now it is one transaction that can be rolled back more easily. + Handle the unified yum transactions so that it handles packages without + error. Previous iterations used a lot of different steps, whereas now it is + one transaction that can be rolled back more easily. link: https://issues.redhat.com/browse/RHELC-576 From cc8f861552362e4be7127705590b477e846790f0 Mon Sep 17 00:00:00 2001 From: Rodolfo Olivieri Date: Thu, 12 Jan 2023 09:31:10 -0300 Subject: [PATCH 2/8] Improve tier0 description with link Signed-off-by: Rodolfo Olivieri --- .../single-yum-transaction-validation/main.fmf | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/integration/tier0/single-yum-transaction-validation/main.fmf b/tests/integration/tier0/single-yum-transaction-validation/main.fmf index e263d80726..2f94c6e8c8 100644 --- a/tests/integration/tier0/single-yum-transaction-validation/main.fmf +++ b/tests/integration/tier0/single-yum-transaction-validation/main.fmf @@ -1,7 +1,14 @@ -summary: Single Yum Transaction Validation +summary: Verify single yum transaction validation + description: > - Verify that we are doing a proper rollback during (and before) the - validation phase in our transactions. + Verify that we are doing a proper rollback during the validation phase in + our transactions. + + If any errors occurs during the transaction resolution, either by + downloading a package, dependency resolver and etc... A rollback should + start and revert the changes to the system. + +link: https://issues.redhat.com/browse/RHELC-576 tier: 0 From 873cccddc649a999045794527de19a0a131a741d Mon Sep 17 00:00:00 2001 From: Rodolfo Olivieri Date: Thu, 9 Feb 2023 15:55:37 -0300 Subject: [PATCH 3/8] Fix integration test Signed-off-by: Rodolfo Olivieri --- .../test_single_yum_transaction_validation.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py index 86f15aba1a..43fa11936a 100644 --- a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py +++ b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py @@ -11,6 +11,10 @@ def backup_entitlement_keys(): + """ + Utillity function to backup and remove the entitlment key as soon as we + notice then in the the `PKI_ENTITLEMENT_KEYS_PATH`. + """ original_keys = os.listdir(PKI_ENTITLEMENT_KEYS_PATH) for key in original_keys: @@ -20,7 +24,7 @@ def backup_entitlement_keys(): def rollback_entitlement_keys(): - """""" + """Utillity function to rollback entitlment keys and clean-up after the test.""" backup_keys = os.listdir(PKI_ENTITLEMENT_KEYS_PATH) for key in backup_keys: @@ -87,7 +91,6 @@ def test_transaction_validation_error(convert2rhel): the entitlement keys found in /etc/pki/entitlement/*.pem to ensure that the tool is doing a proper rollback when the transaction is being processed. """ - with convert2rhel( "-y --no-rpm-va --serverurl {} --username {} --password {} --pool {} --debug".format( env.str("RHSM_SERVER_URL"), @@ -96,7 +99,9 @@ def test_transaction_validation_error(convert2rhel): env.str("RHSM_POOL"), ) ) as c2r: - c2r.expect("Validating the yum transaction set, no modifications to the system will happen this time.") + c2r.expect( + "Downloading and validating the yum transaction set, no modifications to the system will happen this time." + ) backup_entitlement_keys() assert c2r.expect_exact("Failed to validate the yum transaction.", timeout=600) == 0 From 993803404cf775780303dc110c4ee32cd4683a21 Mon Sep 17 00:00:00 2001 From: Rodolfo Olivieri Date: Tue, 14 Feb 2023 14:27:12 -0300 Subject: [PATCH 4/8] Fix pre-commit Signed-off-by: Rodolfo Olivieri --- .../test_single_yum_transaction_validation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py index 43fa11936a..0a4fb424bd 100644 --- a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py +++ b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py @@ -3,7 +3,7 @@ import pytest -from conftest import SYSTEM_RELEASE +from conftest import SYSTEM_RELEASE_ENV from envparse import env @@ -56,10 +56,10 @@ def test_package_download_error(convert2rhel): pkgmanager = "yum" final_message = "There are no suitable mirrors available for the loaded repositories." - if "oracle" in SYSTEM_RELEASE: + if "oracle" in SYSTEM_RELEASE_ENV: server_sub = "Oracle Linux Server" - if "8" in SYSTEM_RELEASE: + if "8" in SYSTEM_RELEASE_ENV: pkgmanager = "dnf" final_message = "Failed to download the transaction packages." From 82b5eb7f22dfae8d6775116d13edcc65bd702cbc Mon Sep 17 00:00:00 2001 From: Rodolfo Olivieri Date: Wed, 15 Feb 2023 09:45:45 -0300 Subject: [PATCH 5/8] Remove the rollback for entitlement certs Signed-off-by: Rodolfo Olivieri --- .../test_single_yum_transaction_validation.py | 45 +++++++------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py index 0a4fb424bd..6fc75f70de 100644 --- a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py +++ b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py @@ -7,42 +7,31 @@ from envparse import env -PKI_ENTITLEMENT_KEYS_PATH = "/etc/pki/entitlement" +PKI_ENTITLEMENT_CERTS_PATH = "/etc/pki/entitlement" -def backup_entitlement_keys(): +def backup_entitlement_certs(): """ - Utillity function to backup and remove the entitlment key as soon as we - notice then in the the `PKI_ENTITLEMENT_KEYS_PATH`. + Utillity function to backup and remove the entitlment cert as soon as we + notice then in the the `PKI_ENTITLEMENT_CERTS_PATH`. """ - original_keys = os.listdir(PKI_ENTITLEMENT_KEYS_PATH) + original_certs = os.listdir(PKI_ENTITLEMENT_CERTS_PATH) - for key in original_keys: - full_key = "{}/{}".format(PKI_ENTITLEMENT_KEYS_PATH, key) - new_key = "{}.bk".format(full_key) - shutil.move(full_key, new_key) - - -def rollback_entitlement_keys(): - """Utillity function to rollback entitlment keys and clean-up after the test.""" - backup_keys = os.listdir(PKI_ENTITLEMENT_KEYS_PATH) - - for key in backup_keys: - # This is already in the format with a .bk at the end of it - backup_key = "{}/{}".format(PKI_ENTITLEMENT_KEYS_PATH, key) - original_key = "{}".format(backup_key) - shutil.move(backup_key, original_key) + for cert in original_certs: + full_cert = "{}/{}".format(PKI_ENTITLEMENT_CERTS_PATH, cert) + new_cert = "{}.bk".format(full_cert) + shutil.move(full_cert, new_cert) @pytest.mark.package_download_error def test_package_download_error(convert2rhel): """ - Remove the entitlement keys found at /etc/pki/entitlement during package + Remove the entitlement certs found at /etc/pki/entitlement during package download phase for both yum and dnf transactions. This will run the conversion up to the point where we valiate the transaction, when it reaches a specific point of the validation, we remove - the entitlement keys found in /etc/pki/entitlement/*.pem to ensure that the + the entitlement certs found in /etc/pki/entitlement/*.pem to ensure that the tool is doing a proper rollback when there is any failure during the package download. @@ -72,23 +61,21 @@ def test_package_download_error(convert2rhel): ) ) as c2r: c2r.expect("Adding {} packages to the {} transaction set.".format(server_sub, pkgmanager)) - backup_entitlement_keys() + backup_entitlement_certs() assert c2r.expect_exact(final_message, timeout=600) == 0 assert c2r.exitstatus == 1 - rollback_entitlement_keys() - @pytest.mark.transaction_validation_error def test_transaction_validation_error(convert2rhel): """ - Remove the entitlement keys found at /etc/pki/entitlement during transaction + Remove the entitlement certs found at /etc/pki/entitlement during transaction processing to throw the following yum error: pkgmanager.Errors.YumDownloadError This will run the conversion up to the point where we valiate the transaction, when it reaches a specific point of the validation, we remove - the entitlement keys found in /etc/pki/entitlement/*.pem to ensure that the + the entitlement certs found in /etc/pki/entitlement/*.pem to ensure that the tool is doing a proper rollback when the transaction is being processed. """ with convert2rhel( @@ -102,9 +89,7 @@ def test_transaction_validation_error(convert2rhel): c2r.expect( "Downloading and validating the yum transaction set, no modifications to the system will happen this time." ) - backup_entitlement_keys() + backup_entitlement_certs() assert c2r.expect_exact("Failed to validate the yum transaction.", timeout=600) == 0 assert c2r.exitstatus == 1 - - rollback_entitlement_keys() From 1aac9f0042cebee5df515970fa1912873888953f Mon Sep 17 00:00:00 2001 From: Rodolfo Olivieri Date: Wed, 15 Feb 2023 12:45:41 -0300 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: Michal Bocek --- .../test_single_yum_transaction_validation.py | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py index 6fc75f70de..f8142a307a 100644 --- a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py +++ b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py @@ -10,17 +10,22 @@ PKI_ENTITLEMENT_CERTS_PATH = "/etc/pki/entitlement" -def backup_entitlement_certs(): +def remove_entitlement_certs(): """ - Utillity function to backup and remove the entitlment cert as soon as we - notice then in the the `PKI_ENTITLEMENT_CERTS_PATH`. + Utility function to remove the entitlement certificate as soon as we + notice it in the `PKI_ENTITLEMENT_CERTS_PATH`. + + We don't need to back it up and then restore it because the PKI_ENTITLEMENT_CERTS_PATH folder is only created during + the conversion when the subscription-manager package is installed. And the .pem certificate is being generated by + subscription-manager in the folder during the system registration. So to have the test system clean after the test + finishes the certs shouldn't be present. """ - original_certs = os.listdir(PKI_ENTITLEMENT_CERTS_PATH) - - for cert in original_certs: - full_cert = "{}/{}".format(PKI_ENTITLEMENT_CERTS_PATH, cert) - new_cert = "{}.bk".format(full_cert) - shutil.move(full_cert, new_cert) + for cert_filename in os.listdir(PKI_ENTITLEMENT_CERTS_PATH): + cert_path = os.path.join(PKI_ENTITLEMENT_CERTS_PATH, cert_filename) + try: + os.unlink(cert_path) + except Exception as e: + print('Failed to delete %s. Reason: %s' % (cert_path, e)) @pytest.mark.package_download_error From eabbf05243a5ba340ca0e09f62df7f10f6a42a96 Mon Sep 17 00:00:00 2001 From: Rodolfo Olivieri Date: Wed, 15 Feb 2023 12:46:20 -0300 Subject: [PATCH 7/8] Update tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py --- .../test_single_yum_transaction_validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py index f8142a307a..1185c430ff 100644 --- a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py +++ b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py @@ -66,7 +66,7 @@ def test_package_download_error(convert2rhel): ) ) as c2r: c2r.expect("Adding {} packages to the {} transaction set.".format(server_sub, pkgmanager)) - backup_entitlement_certs() + remove_entitlement_certs() assert c2r.expect_exact(final_message, timeout=600) == 0 assert c2r.exitstatus == 1 @@ -94,7 +94,7 @@ def test_transaction_validation_error(convert2rhel): c2r.expect( "Downloading and validating the yum transaction set, no modifications to the system will happen this time." ) - backup_entitlement_certs() + remove_entitlement_certs() assert c2r.expect_exact("Failed to validate the yum transaction.", timeout=600) == 0 assert c2r.exitstatus == 1 From 94213f9c52e54fa7a2b012679145db0f7440485b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 15:46:32 +0000 Subject: [PATCH 8/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../test_single_yum_transaction_validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py index 1185c430ff..01a4ae916d 100644 --- a/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py +++ b/tests/integration/tier0/single-yum-transaction-validation/test_single_yum_transaction_validation.py @@ -14,7 +14,7 @@ def remove_entitlement_certs(): """ Utility function to remove the entitlement certificate as soon as we notice it in the `PKI_ENTITLEMENT_CERTS_PATH`. - + We don't need to back it up and then restore it because the PKI_ENTITLEMENT_CERTS_PATH folder is only created during the conversion when the subscription-manager package is installed. And the .pem certificate is being generated by subscription-manager in the folder during the system registration. So to have the test system clean after the test @@ -25,7 +25,7 @@ def remove_entitlement_certs(): try: os.unlink(cert_path) except Exception as e: - print('Failed to delete %s. Reason: %s' % (cert_path, e)) + print("Failed to delete %s. Reason: %s" % (cert_path, e)) @pytest.mark.package_download_error