Skip to content

Commit

Permalink
Enbale rhsm ipv6 proxy for test_positive_register bootstrap test
Browse files Browse the repository at this point in the history
  • Loading branch information
jameerpathan111 committed Dec 12, 2024
1 parent 9c1a753 commit 05b11ef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 14 additions & 3 deletions robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,18 @@ def enable_dnf_proxy(self, hostname, scheme=None, port=None):
logger.info(f'Configuring {hostname} HTTP proxy for dnf.')
self.execute(cmd)

def enable_ipv6_rhsm_proxy(self):
"""Execute procedures for enabling rhsm IPv6 HTTP Proxy"""
if self.ipv6:
url = urlparse(settings.http_proxy.http_proxy_ipv6_url)
self.enable_rhsm_proxy(url.hostname, url.port)

def enable_ipv6_dnf_proxy(self):
"""Execute procedures for enabling dnf IPv6 HTTP Proxy"""
if self.ipv6:
url = urlparse(settings.http_proxy.http_proxy_ipv6_url)
self.enable_dnf_proxy(url.hostname, url.scheme, url.port)

def disable_rhsm_proxy(self):
"""Disables HTTP proxy for subscription manager"""
self.execute('subscription-manager remove server.proxy_hostname server.proxy_port')
Expand All @@ -883,9 +895,8 @@ def disable_dnf_proxy(self):
def enable_ipv6_dnf_and_rhsm_proxy(self):
"""Execute procedures for enabling rhsm and dnf IPv6 HTTP Proxy"""
if self.ipv6:
url = urlparse(settings.http_proxy.http_proxy_ipv6_url)
self.enable_rhsm_proxy(url.hostname, url.port)
self.enable_dnf_proxy(url.hostname, url.scheme, url.port)
self.enable_ipv6_rhsm_proxy()
self.enable_ipv6_dnf_proxy()

def add_authorized_key(self, pub_key):
"""Inject a public key into the authorized keys file
Expand Down
4 changes: 4 additions & 0 deletions tests/foreman/cli/test_bootstrap_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def test_positive_register(
:BZ: 2001476
"""
# Workaround for a bug in bootstrap.py https://github.com/Katello/katello-client-bootstrap/pull/373
# rhel_contenthost has internet-based repos enabled, which it can't reach in IPv6-only setups,
# but also shouldn't have configured to begin with.
rhel_contenthost.enable_ipv6_dnf_and_rhsm_proxy()
if rhel_contenthost.os_version.major == 7:
python_cmd = 'python'
elif rhel_contenthost.os_version.major == 8:
Expand Down

0 comments on commit 05b11ef

Please sign in to comment.