diff --git a/conf/capsule.yaml.template b/conf/capsule.yaml.template index 11ae548d61a..079f5410638 100644 --- a/conf/capsule.yaml.template +++ b/conf/capsule.yaml.template @@ -7,7 +7,7 @@ CAPSULE: # The snap version currently testing (if applicable) # SNAP: # The source of Capsule packages. Can be one of: - # internal, ga, beta + # internal, ga, nightly, beta SOURCE: "internal" # The base os rhel version where the capsule installed # RHEL_VERSION: diff --git a/conf/dynaconf_hooks.py b/conf/dynaconf_hooks.py index ff5c538f86d..0372bb233f7 100644 --- a/conf/dynaconf_hooks.py +++ b/conf/dynaconf_hooks.py @@ -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: diff --git a/conf/server.yaml.template b/conf/server.yaml.template index c5b844e6509..b68a7932444 100644 --- a/conf/server.yaml.template +++ b/conf/server.yaml.template @@ -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, beta + # internal, ga, nightly, beta SOURCE: "internal" # The RHEL Base OS Version(x.y) where the Satellite is installed RHEL_VERSION: '7' diff --git a/pytest_fixtures/core/sat_cap_factory.py b/pytest_fixtures/core/sat_cap_factory.py index a1efc5b16a3..71f7735d963 100644 --- a/pytest_fixtures/core/sat_cap_factory.py +++ b/pytest_fixtures/core/sat_cap_factory.py @@ -329,13 +329,28 @@ def installer_satellite(request): else: sat = lru_sat_ready_rhel(getattr(request, 'param', None)) sat.setup_firewall() - # # Register for RHEL8 repos, get Ohsnap repofile, and enable and download satellite + # register to cdn (also enables rhel repos from cdn) sat.register_to_cdn() - sat.download_repofile( - product='satellite', - release=settings.server.version.release, - snap=settings.server.version.snap, - ) + + # setup source repositories + if settings.server.version.source == "ga": + # enable satellite repos + for repo in sat.SATELLITE_CDN_REPOS.values(): + sat.enable_repo(repo, force=True) + else: + 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, + ) + sat.install_satellite_or_capsule_package() # Install Satellite sat.execute( diff --git a/robottelo/config/validators.py b/robottelo/config/validators.py index b4211dc7f05..9a453825d47 100644 --- a/robottelo/config/validators.py +++ b/robottelo/config/validators.py @@ -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', must_exist=True), + 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'] @@ -78,7 +78,9 @@ ], capsule=[ Validator('capsule.version.release', must_exist=True), - Validator('capsule.version.source', must_exist=True), + 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),