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 17, 2024
1 parent fcc7819 commit 0a2ed6f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 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 @@ -167,14 +168,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 0a2ed6f

Please sign in to comment.