Skip to content

Commit

Permalink
Let katello-agent run on a standard VM
Browse files Browse the repository at this point in the history
  • Loading branch information
vsedmik committed Sep 4, 2023
1 parent c0138a4 commit 1334900
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pytest_fixtures/component/katello_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def katello_agent_client(sat_with_katello_agent, rhel_contenthost):
org = sat_with_katello_agent.api.Organization().create()
client_repo = settings.repos['SATCLIENT_REPO'][f'RHEL{rhel_contenthost.os_version.major}']
sat_with_katello_agent.register_host_custom_repo(
org, rhel_contenthost, [client_repo, settings.repos.yum_1.url]
org,
rhel_contenthost,
[client_repo, settings.repos.yum_1.url],
override=True,
)
rhel_contenthost.install_katello_agent()
host_info = sat_with_katello_agent.cli.Host.info({'name': rhel_contenthost.hostname})
Expand Down
9 changes: 7 additions & 2 deletions robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1993,13 +1993,14 @@ def install_cockpit(self):
)
self.add_rex_key(self)

def register_host_custom_repo(self, module_org, rhel_contenthost, repo_urls):
def register_host_custom_repo(self, module_org, rhel_contenthost, repo_urls, override=None):
"""Register content host to Satellite and sync repos
:param module_org: Org where contenthost will be registered.
:param rhel_contenthost: contenthost to be register with Satellite.
:param rhel_contenthost: contenthost to be registed with Satellite.
:param repo_urls: List of URLs to be synced and made available to contenthost
via subscription-manager.
:param override: Override the repos to enabled if needed.
:return: None
"""
# Create a new product, sync appropriate client and other passed repos on satellite
Expand Down Expand Up @@ -2057,6 +2058,10 @@ def register_host_custom_repo(self, module_org, rhel_contenthost, repo_urls):
# refresh repository metadata on the host
rhel_contenthost.execute('subscription-manager repos --list')

# Override the repos to enabled if needed
if override:
rhel_contenthost.execute(r'subscription-manager repos --enable \*')

def enroll_ad_and_configure_external_auth(self, ad_data):
"""Enroll Satellite Server to an AD Server.
Expand Down
1 change: 1 addition & 0 deletions tests/foreman/destructive/test_katello_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
pytestmark = [
pytest.mark.run_in_one_thread,
pytest.mark.destructive,
pytest.mark.no_containers,
pytest.mark.tier5,
pytest.mark.upgrade,
]
Expand Down

0 comments on commit 1334900

Please sign in to comment.