Skip to content

Commit

Permalink
Modify tests
Browse files Browse the repository at this point in the history
* use `CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK` instead of deprecated `CONVERT2RHEL_UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK`

Signed-off-by: Daniel Diblik <[email protected]>
  • Loading branch information
danmyway committed May 2, 2023
1 parent e7bc0b8 commit c5ca369
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
48 changes: 24 additions & 24 deletions plans/rerun.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -176,29 +176,6 @@
filter: tag:yum-excld-kernel


/sub_man_rollback:
summary: |
Back up and restore subscription-manager
description: |
When the subscription-manager package is installed from the BaseOS repository prior to running convert2rhel, it is
removed during the conversion run. This test makes sure that subscription-manager and its dependencies are correctly
backed up and re-installed during the rollback together with the certificate.


enabled: false

adjust+:
- enabled: true
when: >
distro == centos-8
- environment+:
TEST_REQUIRES: subscription-manager


discover+:
filter: tag:sub-man-rollback


/single_yum_transaction_validation:
summary: |
Single yum transaction validation
Expand Down Expand Up @@ -241,6 +218,29 @@
filter: tag:package-download-error


/sub_man_rollback:
summary: |
Back up and restore subscription-manager
description: |
When the subscription-manager package is installed from the BaseOS repository prior to running convert2rhel, it is
removed during the conversion run. This test makes sure that subscription-manager and its dependencies are correctly
backed up and re-installed during the rollback together with the certificate.


enabled: false

adjust+:
- enabled: true
when: >
distro == centos-8
- environment+:
TEST_REQUIRES: subscription-manager


discover+:
filter: tag:sub-man-rollback


/config_file:
summary: |
Config file
Expand Down Expand Up @@ -667,7 +667,7 @@
description+: |
Install subscription-manager and katello package from the Satellite.
Remove all repositories from the system.
Set the "CONVERT2RHEL_UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK" envar to bypass kernel check.
Set the "CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK" envar to bypass kernel check.
Verify that the /etc/os-release file is restored after the rollback.
/backup_os_release_no_envar:
summary+: |
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tier0/system-release-backup/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tag+:
description+: |
Install subscription-manager and katello package from the Satellite.
Remove all repositories from the system.
Set the "CONVERT2RHEL_UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK" envar to bypass kernel check.
Set the "CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK" envar to bypass kernel check.
Verify that the /etc/os-release file is restored after the rollback.
/backup_os_release_no_envar:
summary+: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def repositories(shell):
assert shell(f"mv /usr/share/convert2rhel/repos/* {BACKUP_DIR_EUS}").returncode == 0

# Since we are moving all repos away, we need to bypass kernel check
os.environ["CONVERT2RHEL_UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK"] = "1"
os.environ["CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK"] = "1"

yield

Expand All @@ -100,7 +100,7 @@ def repositories(shell):
assert shell(f"mv {BACKUP_DIR_EUS}/* /usr/share/convert2rhel/repos/").returncode == 0
assert shell(f"rm -rf {BACKUP_DIR_EUS}")
# Remove the envar skipping the kernel check
del os.environ["CONVERT2RHEL_UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK"]
del os.environ["CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK"]


@pytest.mark.test_unsuccessful_satellite_registration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_run_conversion_using_custom_repos(shell, convert2rhel):
shell("rm /etc/yum.repos.d/copr_build-convert2rhel-1.repo")

os.environ["CONVERT2RHEL_UNSUPPORTED_INCOMPLETE_ROLLBACK"] = "1"
os.environ["CONVERT2RHEL_UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK"] = "1"
os.environ["CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK"] = "1"

with convert2rhel("-y --no-rpm-va --disable-submgr {} --debug".format(enable_repo_opt)) as c2r:
c2r.expect("Conversion successful!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_skip_kernel_check(shell, convert2rhel):
c2r.expect("Could not find any kernel-core from repositories to compare against the loaded kernel.")
assert c2r.exitstatus != 0

os.environ["CONVERT2RHEL_UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK"] = "1"
os.environ["CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK"] = "1"

with convert2rhel(
"--no-rpm-va --serverurl {} --username {} --password {} --pool {} --debug".format(
Expand All @@ -48,7 +48,7 @@ def test_skip_kernel_check(shell, convert2rhel):
c2r.expect("Continue with the system conversion?")
c2r.sendline("y")

c2r.expect("Detected 'CONVERT2RHEL_UNSUPPORTED_SKIP_KERNEL_CURRENCY_CHECK' environment variable")
c2r.expect("Detected 'CONVERT2RHEL_SKIP_KERNEL_CURRENCY_CHECK' environment variable")
c2r.sendcontrol("c")
assert c2r.exitstatus != 0

Expand Down

0 comments on commit c5ca369

Please sign in to comment.