Skip to content

Commit

Permalink
[6.15.z] - changes to use the beaker urls for running upstream sanity (
Browse files Browse the repository at this point in the history
#16549) (#16623)

changes to use the beaker urls for running upstream sanity (#16549)
  • Loading branch information
omkarkhatavkar authored Oct 11, 2024
1 parent 0cdc448 commit 133996d
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion conf/capsule.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CAPSULE:
# The snap version currently testing (if applicable)
# SNAP:
# The source of Capsule packages. Can be one of:
# internal, ga
# internal, ga, nightly
SOURCE: "internal"
# The base os rhel version where the capsule installed
# RHEL_VERSION:
Expand Down
8 changes: 6 additions & 2 deletions conf/dynaconf_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@


def post(settings):
settings_cache_path = Path(f'settings_cache-{settings.server.version.release}.json')
if getattr(settings.robottelo.settings, 'get_fresh', True):
settings_cache_path = Path(
f'settings_cache-{settings.server.version.release}-{settings.server.version.snap}.json'
)
if settings.server.version.source == 'nightly':
data = Box({'REPOS': {}})
elif getattr(settings.robottelo.settings, 'get_fresh', True):
data = get_repos_config(settings)
write_cache(settings_cache_path, data)
else:
Expand Down
2 changes: 1 addition & 1 deletion conf/server.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SERVER:
# The snap version currently testing (if applicable)
SNAP: 1.0
# The source of Satellite packages. Can be one of:
# internal, ga
# internal, ga, nightly
SOURCE: "internal"
# The RHEL Base OS Version(x.y) where the Satellite is installed
RHEL_VERSION: '8'
Expand Down
19 changes: 13 additions & 6 deletions pytest_fixtures/core/sat_cap_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,19 @@ def installer_satellite(request):
for repo in sat.SATELLITE_CDN_REPOS.values():
sat.enable_repo(repo, force=True)
else:
# get ohsnap repofile
sat.download_repofile(
product='satellite',
release=settings.server.version.release,
snap=settings.server.version.snap,
)
if settings.server.version.source == 'nightly':
sat.create_custom_repos(
satellite_repo=settings.repos.satellite_repo,
satmaintenance_repo=settings.repos.satmaintenance_repo,
)
else:
# get ohsnap repofile
sat.download_repofile(
product='satellite',
release=settings.server.version.release,
snap=settings.server.version.snap,
)

if settings.robottelo.rhel_source == "internal":
# disable rhel repos from cdn
sat.disable_repo("rhel-*")
Expand Down
6 changes: 4 additions & 2 deletions robottelo/config/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Validator('server.hostname', is_type_of=str),
Validator('server.hostnames', must_exist=True, is_type_of=list),
Validator('server.version.release', must_exist=True),
Validator('server.version.source', default='internal', is_in=['internal', 'ga']),
Validator('server.version.source', default='internal', is_in=['internal', 'ga', 'nightly']),
Validator('server.version.rhel_version', must_exist=True, cast=str),
Validator(
'server.xdist_behavior', must_exist=True, is_in=['run-on-one', 'balance', 'on-demand']
Expand Down Expand Up @@ -79,7 +79,9 @@
],
capsule=[
Validator('capsule.version.release', must_exist=True),
Validator('capsule.version.source', default='internal', is_in=['internal', 'ga']),
Validator(
'capsule.version.source', default='internal', is_in=['internal', 'ga', 'nightly']
),
Validator('capsule.deploy_workflows', must_exist=True, is_type_of=dict),
Validator('capsule.deploy_workflows.product', must_exist=True),
Validator('capsule.deploy_workflows.os', must_exist=True),
Expand Down
27 changes: 17 additions & 10 deletions tests/foreman/installer/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1449,21 +1449,28 @@ def setup_capsule_repos(satellite, capsule_host, org, ak):
else:
# configure internal source as custom repos
product_capsule = satellite.api.Product(organization=org.id).create()
for repo_variant in ['capsule', 'maintenance']:
dogfood_repo = dogfood_repository(
ohsnap=settings.ohsnap,
repo=repo_variant,
product="capsule",
release=settings.capsule.version.release,
os_release=capsule_host.os_version.major,
snap=settings.capsule.version.snap,
)
for repo_variant, repo_default_url in [
('capsule', 'capsule_repo'),
('maintenance', 'satmaintenance_repo'),
]:
if settings.capsule.version.source == 'nightly':
repo_url = getattr(settings.repos, repo_default_url)
else:
repo_url = dogfood_repository(
ohsnap=settings.ohsnap,
repo=repo_variant,
product="capsule",
release=settings.capsule.version.release,
os_release=capsule_host.os_version.major,
snap=settings.capsule.version.snap,
).baseurl
repo = satellite.api.Repository(
organization=org.id,
product=product_capsule,
content_type='yum',
url=dogfood_repo.baseurl,
url=repo_url,
).create()

# custom repos need to be explicitly enabled
ak.content_override(
data={
Expand Down

0 comments on commit 133996d

Please sign in to comment.