Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ def register(
hostgroup=None,
auth_username=None,
auth_password=None,
download_utility=None,
):
"""Registers content host to the Satellite or Capsule server
using a global registration template.
Expand Down Expand Up @@ -704,6 +705,8 @@ def register(
options['ignore-subman-errors'] = str(ignore_subman_errors).lower()
if force:
options['force'] = str(force).lower()
if download_utility is not None:
options['download-utility'] = download_utility

self._satellite = target.satellite
if auth_username and auth_password:
Expand Down
33 changes: 33 additions & 0 deletions tests/foreman/cli/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,39 @@ def test_positive_global_registration_with_gpg_repo(
assert rhel_contenthost.execute('dnf install -y bear').status == 0


@pytest.mark.upgrade
@pytest.mark.no_containers
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
@pytest.mark.parametrize('download_utility', ['wget', 'curl'])
def test_positive_register_download_utility(
module_sca_manifest_org,
module_location,
module_activation_key,
module_target_sat,
rhel_contenthost,
download_utility,
):
"""Verify host registration command gets generated and host is registered successfully with all supported download utilities.

:id: 80c3204a-7923-4c70-b7c1-7b368c61d4b8

:steps:
1. Register host with global registration template using different download utilities.

:expectedresults: Host is successfully registered.
"""
org = module_sca_manifest_org
result = rhel_contenthost.register(
org,
module_location,
module_activation_key.name,
module_target_sat,
download_utility=download_utility,
)
assert result.status == 0
assert rhel_contenthost.subscribed


@pytest.mark.parametrize('setting_update', ['default_location_subscribed_hosts'], indirect=True)
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
def test_positive_verify_default_location_for_registered_host(
Expand Down