diff --git a/conf/server.yaml.template b/conf/server.yaml.template index c5b844e6509..f85a28a4e6e 100644 --- a/conf/server.yaml.template +++ b/conf/server.yaml.template @@ -13,6 +13,10 @@ SERVER: SOURCE: "internal" # The RHEL Base OS Version(x.y) where the Satellite is installed RHEL_VERSION: '7' + # If the the satellite server is IPv6 server + # IS_IPV6: + # HTTP Proxy in format for IPv6 satellite to connect for outer world access + # HTTP_PROXY_IPV6: # run-on-one - All xdist runners default to the first satellite # balance - xdist runners will be split between available satellites # on-demand - any xdist runner without a satellite will have a new one provisioned. diff --git a/pytest_fixtures/component/maintain.py b/pytest_fixtures/component/maintain.py index 68aa82f5c86..1e0e264e0ca 100644 --- a/pytest_fixtures/component/maintain.py +++ b/pytest_fixtures/component/maintain.py @@ -24,7 +24,9 @@ def module_stash(request): @pytest.fixture(scope='module') def sat_maintain(request, module_target_sat, module_capsule_configured): if settings.remotedb.server: - yield Satellite(settings.remotedb.server) + sat = Satellite(settings.remotedb.server) + sat.enable_ipv6_http_proxy() + yield sat else: module_target_sat.register_to_cdn(pool_ids=settings.subscription.fm_rhn_poolid.split()) hosts = {'satellite': module_target_sat, 'capsule': module_capsule_configured} diff --git a/pytest_fixtures/core/broker.py b/pytest_fixtures/core/broker.py index 9d207fcd9d7..228ff1dffcf 100644 --- a/pytest_fixtures/core/broker.py +++ b/pytest_fixtures/core/broker.py @@ -13,7 +13,9 @@ def _default_sat(align_to_satellite): """Returns a Satellite object for settings.server.hostname""" if settings.server.hostname: try: - return Satellite.get_host_by_hostname(settings.server.hostname) + sat = Satellite.get_host_by_hostname(settings.server.hostname) + sat.enable_ipv6_http_proxy() + return sat except ContentHostError: return Satellite() diff --git a/pytest_fixtures/core/sat_cap_factory.py b/pytest_fixtures/core/sat_cap_factory.py index c63a70e4d19..fa543f4c9c3 100644 --- a/pytest_fixtures/core/sat_cap_factory.py +++ b/pytest_fixtures/core/sat_cap_factory.py @@ -68,7 +68,9 @@ def factory(retry_limit=3, delay=300, workflow=None, **broker_args): ) timeout = (1200 + delay) * retry_limit sat = wait_for(vmb.checkout, timeout=timeout, delay=delay, fail_condition=[]) - return sat.out + sat = sat.out + sat.enable_ipv6_http_proxy() + return sat return factory @@ -77,6 +79,7 @@ def factory(retry_limit=3, delay=300, workflow=None, **broker_args): def large_capsule_host(capsule_factory): """A fixture that provides a Capsule based on config settings""" new_cap = capsule_factory(deploy_flavor=settings.flavors.custom_db) + # TO_DO - a question to resolve - How does the dynamic capsule talks to the CDN for contents ? yield new_cap new_cap.teardown() Broker(hosts=[new_cap]).checkin() @@ -100,6 +103,7 @@ def factory(retry_limit=3, delay=300, workflow=None, **broker_args): ) timeout = (1200 + delay) * retry_limit cap = wait_for(vmb.checkout, timeout=timeout, delay=delay, fail_condition=[]) + ## TO-DO: Need to add http proxy here for this capsule to talk outside/CDN return cap.out return factory @@ -222,6 +226,7 @@ def module_lb_capsule(retry_limit=3, delay=300, **broker_args): ) cap_hosts = wait_for(hosts.checkout, timeout=timeout, delay=delay) + ## TO_DO : Need to add Proxy here for these capsules yield cap_hosts.out [cap.teardown() for cap in cap_hosts.out] @@ -299,6 +304,7 @@ def cap_ready_rhel(): 'workflow': settings.capsule.deploy_workflows.os, } with Broker(**deploy_args, host_class=Capsule) as host: + ## TO_DO: Need to add Proxy here for this capsule yield host @@ -317,6 +323,7 @@ def installer_satellite(request): else: sat = lru_sat_ready_rhel(getattr(request, 'param', None)) sat.setup_firewall() + sat.enable_ipv6_http_proxy() # # Register for RHEL8 repos, get Ohsnap repofile, and enable and download satellite sat.register_to_cdn() sat.download_repofile( diff --git a/robottelo/hosts.py b/robottelo/hosts.py index 2ff72bbe367..8504b83e64f 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1634,6 +1634,7 @@ def capsule_setup(self, sat_host=None, capsule_cert_opts=None, **installer_kwarg self.satellite.session.remote_copy(certs_tar, self) installer.update(**installer_kwargs) result = self.install(installer) + ## TO_DO : Add a http proxy for this to communicate outside if result.status: # before exit download the capsule log file self.session.sftp_read( @@ -1757,6 +1758,28 @@ def _swap_nailgun(self, new_version): to_clear = [k for k in sys.modules.keys() if 'nailgun' in k] [sys.modules.pop(k) for k in to_clear] + def enable_ipv6_http_proxy(self): + # Execute procedures for enabling IPv6 HTTP Proxy + if settings.server.is_ipv6 and settings.server.http_proxy_ipv6: + # TO_DO: Enable only if its not already enabled + robottelo_proxy = self.cli.HttpProxy.create( + { + 'name': 'Robottelo IPv6 Automation Proxy', + 'url': settings.server.http_proxy_ipv6 + # Proxy port if it proxy has it + } + ) + self.cli.Settings.set( + { + 'name': 'content_default_http_proxy', + 'value': robottelo_proxy, + } + ) + else: + logger.warning( + 'The IPv6 HTTP Proxy setting is not enabled!! Skipping the IPv6 HTTP Proxy setup.' + ) + @property def api(self): """Import all nailgun entities and wrap them under self.api""" diff --git a/tests/foreman/installer/test_installer.py b/tests/foreman/installer/test_installer.py index 9766412db85..a7696344d94 100644 --- a/tests/foreman/installer/test_installer.py +++ b/tests/foreman/installer/test_installer.py @@ -1381,7 +1381,9 @@ def sat_default_install(module_sat_ready_rhels): f'foreman-initial-admin-password {settings.server.admin_password}', ] install_satellite(module_sat_ready_rhels[0], installer_args) - yield module_sat_ready_rhels[0] + sat = module_sat_ready_rhels[0] + sat.enable_ipv6_http_proxy() + yield common_sat_install_assertions(module_sat_ready_rhels[0]) @@ -1395,7 +1397,9 @@ def sat_non_default_install(module_sat_ready_rhels): 'foreman-proxy-content-pulpcore-hide-guarded-distributions false', ] install_satellite(module_sat_ready_rhels[1], installer_args, enable_fapolicyd=True) - yield module_sat_ready_rhels[1] + sat = module_sat_ready_rhels[1] + sat.enable_ipv6_http_proxy() + yield sat common_sat_install_assertions(module_sat_ready_rhels[1])