Skip to content

Commit

Permalink
Fix katello-agent pre-upgrade warning
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik committed Apr 16, 2024
1 parent fcc7819 commit 680d0e5
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/foreman/destructive/test_katello_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from robottelo import constants
from robottelo.config import settings
from robottelo.utils import ohsnap

pytestmark = [
pytest.mark.run_in_one_thread,
Expand Down Expand Up @@ -153,8 +154,7 @@ def test_positive_upgrade_warning(sat_with_katello_agent):
"""
sat = sat_with_katello_agent
ver = sat.version.split('.')
target_ver = f'{ver[0]}.{int(ver[1]) + 1}'
target_ver = '6.15'
warning = (
'The katello-agent feature is enabled on this system. As of Satellite 6.15, katello-agent '
'is removed and will no longer function. Before proceeding with the upgrade, you should '
Expand All @@ -167,14 +167,16 @@ def test_positive_upgrade_warning(sat_with_katello_agent):
'which will automatically uninstall katello-agent.'
)

upstream_rpms = sat.get_repo_files_by_url(constants.FOREMAN_NIGHTLY_URL)
fm_rpm = [rpm for rpm in upstream_rpms if 'foreman_maintain' in rpm]
assert fm_rpm, 'No upstream foreman-maintain package found'

for rpm in fm_rpm:
res = sat.execute(f'yum -y install {constants.FOREMAN_NIGHTLY_URL}{rpm}')
assert res.status == 0, f'{rpm} installation failed'
maintain_repo = ohsnap.dogfood_repository(
settings.ohsnap,
product='satellite',
repo='maintenance',
release=target_ver,
os_release=settings.server.version.rhel_version,
)
sat.create_custom_repos(next_maintain=maintain_repo.baseurl)

sat.cli.Upgrade.list_versions() # f-m self-update
res = sat.cli.Upgrade.list_versions()
assert res.status == 0, 'Upgrade list-versions command failed'
assert target_ver in res.stdout, 'Target version or Scenario not found'
Expand Down

0 comments on commit 680d0e5

Please sign in to comment.