Skip to content

Commit

Permalink
[6.14.z] Add test to ensure katello-agent availability in Client repos (
Browse files Browse the repository at this point in the history
#12988)

* Fix Client repos in constants

* Add test to ensure katello-agent availability

Katello-agent was deprecated and removed from 6.15 and upstream
repos, but we still need to have it available in Client repos
for older Satellite versions which support it. This test just
verifies that.
  • Loading branch information
vsedmik authored Oct 31, 2023
1 parent 9f7a4b8 commit 27d218f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
10 changes: 5 additions & 5 deletions robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ class Colored(Box):
'rhsc7': 'Red Hat Satellite Capsule 6.11 (for RHEL 7 Server) (RPMs)',
'rhsc8': 'Red Hat Satellite Capsule 6.13 for RHEL 8 x86_64 (RPMs)',
'rhsc7_iso': 'Red Hat Satellite Capsule 6.4 (for RHEL 7 Server) (ISOs)',
'rhsclient7': 'Red Hat Satellite Client 6 for RHEL 7 Server RPMs x86_64',
'rhsclient8': 'Red Hat Satellite Client 6 for RHEL 8 x86_64 RPMs',
'rhsclient9': 'Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs',
'rhsclient7': 'Red Hat Satellite Client 6 (for RHEL 7 Server) (RPMs)',
'rhsclient8': 'Red Hat Satellite Client 6 for RHEL 8 x86_64 (RPMs)',
'rhsclient9': 'Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)',
'rhst7': 'Red Hat Satellite Tools 6.9 (for RHEL 7 Server) (RPMs)',
'rhst7_610': 'Red Hat Satellite Tools 6.10 (for RHEL 7 Server) (RPMs)',
'rhst6': 'Red Hat Satellite Tools 6.9 (for RHEL 6 Server) (RPMs)',
Expand Down Expand Up @@ -408,7 +408,7 @@ class Colored(Box):
'name': ('Red Hat Satellite Client 6 for RHEL 8 x86_64 RPMs'),
'version': '6',
'reposet': REPOSET['rhsclient8'],
'product': PRDS['rhel'],
'product': PRDS['rhel8'],
'distro': 'rhel8',
'key': PRODUCT_KEY_SAT_CLIENT,
},
Expand All @@ -417,7 +417,7 @@ class Colored(Box):
'name': ('Red Hat Satellite Client 6 for RHEL 9 x86_64 RPMs'),
'version': '6',
'reposet': REPOSET['rhsclient9'],
'product': PRDS['rhel'],
'product': PRDS['rhel9'],
'distro': 'rhel9',
'key': PRODUCT_KEY_SAT_CLIENT,
},
Expand Down
36 changes: 36 additions & 0 deletions tests/foreman/api/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,42 @@ def test_positive_sync_with_treeinfo_ignore(
f'{repo.full_path}.treeinfo'
), 'The treeinfo file is missing in the KS repo but it should be there.'

@pytest.mark.tier3
@pytest.mark.parametrize('client_repo', ['rhsclient7', 'rhsclient8', 'rhsclient9'])
def test_positive_katello_agent_availability(
self, target_sat, function_sca_manifest_org, client_repo
):
"""Verify katello-agent package remains available in the RH Satellite Client repos
for older Satellite versions (Sat 6.14 is the last one supporting it).
:id: cd5b4e5b-e4f1-4d00-b171-30cd5b1e7ce8
:parametrized: yes
:steps:
1. Enable RH Satellite Client repo and sync it.
2. Read the repo packages.
:expectedresults:
1. Katello-agent remains available in the Client repos.
"""
# Enable RH Satellite Client repo and sync it.
repo_id = target_sat.api_factory.enable_rhrepo_and_fetchid(
basearch='x86_64',
org_id=function_sca_manifest_org.id,
product=constants.REPOS[client_repo]['product'],
reposet=constants.REPOS[client_repo]['reposet'],
repo=constants.REPOS[client_repo]['name'],
releasever=constants.REPOS[client_repo]['version'],
)
repo = target_sat.api.Repository(id=repo_id).read()
repo.sync()
# Make sure katello-agent lives in the repo happily.
repo_pkgs = target_sat.api.Repository(id=repo_id).packages()['results']
agent_pkgs = [pkg['filename'] for pkg in repo_pkgs if 'katello-agent' in pkg['name']]
assert len(agent_pkgs), 'Katello-agent package is missing from the RH Client repo!'


@pytest.mark.run_in_one_thread
class TestRepositorySync:
Expand Down

0 comments on commit 27d218f

Please sign in to comment.