Skip to content

Commit

Permalink
Enable EL10 client repo testing in provisioning
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Talreja <[email protected]>
  • Loading branch information
Gauravtalreja1 committed Feb 14, 2025
1 parent 12770ab commit 0e38cde
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
1 change: 1 addition & 0 deletions conf/repos.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ REPOS:
RHEL7: replace-with-rhel7-http-link
RHEL8: replace-with-rhel8-http-link
RHEL9: replace-with-rhel9-http-link
RHEL10: replace-with-rhel10-http-link
# Downstream Satellite-maintain repo
SATMAINTENANCE_REPO: replace-with-sat-maintain-repo
# Software Collection Repo
Expand Down
41 changes: 19 additions & 22 deletions pytest_fixtures/component/provision_pxe.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ def module_provisioning_rhel_content(
rh_repo_id = ""
content_view = sat.api.ContentView(organization=module_sca_manifest_org).create()

if int(rhel_ver) < 10:
# Custom Content for Client repo
custom_product = sat.api.Product(
organization=module_sca_manifest_org, name=f'rhel{rhel_ver}_{gen_string("alpha")}'
).create()
client_repo = sat.api.Repository(
organization=module_sca_manifest_org,
product=custom_product,
content_type='yum',
url=settings.repos.SATCLIENT_REPO[f'rhel{rhel_ver}'],
).create()
task = client_repo.sync(synchronous=False)
tasks.append(task)
content_view.repository = [client_repo]
# Custom Content for Client repo
custom_product = sat.api.Product(
organization=module_sca_manifest_org, name=f'rhel{rhel_ver}_{gen_string("alpha")}'
).create()
client_repo = sat.api.Repository(
organization=module_sca_manifest_org,
product=custom_product,
content_type='yum',
url=settings.repos.SATCLIENT_REPO[f'rhel{rhel_ver}'],
).create()
task = client_repo.sync(synchronous=False)
tasks.append(task)
content_view.repository = [client_repo]

if int(rhel_ver) < 10:
for name in repo_names:
rh_kickstart_repo_id = sat.api_factory.enable_rhrepo_and_fetchid(
basearch=constants.DEFAULT_ARCHITECTURE,
Expand Down Expand Up @@ -147,14 +147,11 @@ def module_provisioning_rhel_content(
).create()

# Ensure client repo is enabled in the activation key
if int(rhel_ver) < 10:
content = ak.product_content(data={'content_access_mode_all': '1'})['results']
client_repo_label = [repo['label'] for repo in content if repo['name'] == client_repo.name][
0
]
ak.content_override(
data={'content_overrides': [{'content_label': client_repo_label, 'value': '1'}]}
)
content = ak.product_content(data={'content_access_mode_all': '1'})['results']
client_repo_label = [repo['label'] for repo in content if repo['name'] == client_repo.name][0]
ak.content_override(
data={'content_overrides': [{'content_label': client_repo_label, 'value': '1'}]}
)
return Box(os=os, ak=ak, ksrepo=ksrepo, cv=content_view)


Expand Down
3 changes: 3 additions & 0 deletions tests/foreman/api/test_provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ def test_rhel_pxe_provisioning(

# Host should do call back to the Satellite reporting
# the result of the installation. Wait until Satellite reports that the host is installed.
import time

time.sleep(600)
wait_for(
lambda: host.read().build_status_label != 'Pending installation',
timeout=1500,
Expand Down

0 comments on commit 0e38cde

Please sign in to comment.