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 11, 2024
1 parent 9c1a753 commit e2fae45
Show file tree
Hide file tree
Showing 2 changed files with 15 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 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)

def enable_ipv6_dnf_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_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
1 change: 1 addition & 0 deletions tests/foreman/cli/test_bootstrap_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_positive_register(
:BZ: 2001476
"""
rhel_contenthost.enable_ipv6_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 e2fae45

Please sign in to comment.