Skip to content

Commit

Permalink
Hosts: add supported RHEL clients for glob. registration
Browse files Browse the repository at this point in the history
Use all supported RHEL versions for global registration tests,
i.e., RHEL 7,8,9, including FIPS.
  • Loading branch information
pnovotny committed Oct 4, 2023
1 parent d16f5f6 commit b272c54
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions tests/foreman/ui/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ def test_global_registration_form_populate(
def test_global_registration_with_capsule_host(
session,
capsule_configured,
rhel7_contenthost,
rhel_contenthost,
module_org,
module_location,
module_product,
Expand Down Expand Up @@ -1342,7 +1342,7 @@ def test_global_registration_with_capsule_host(
:CaseAutomation: Automated
"""
client = rhel7_contenthost
client = rhel_contenthost
repo = target_sat.api.Repository(
url=settings.repos.yum_1.url,
content_type=REPO_TYPE['yum'],
Expand Down Expand Up @@ -1412,7 +1412,7 @@ def test_global_registration_with_capsule_host(
@pytest.mark.usefixtures('enable_capsule_for_registration')
@pytest.mark.no_containers
def test_global_registration_with_gpg_repo_and_default_package(
session, module_activation_key, default_os, default_smart_proxy, rhel7_contenthost
session, module_activation_key, default_os, default_smart_proxy, rhel_contenthost
):
"""Host registration form produces a correct registration command and host is
registered successfully with gpg repo enabled and have default package
Expand All @@ -1435,7 +1435,7 @@ def test_global_registration_with_gpg_repo_and_default_package(
:parametrized: yes
"""
client = rhel7_contenthost
client = rhel_contenthost
repo_name = 'foreman_register'
repo_url = settings.repos.gr_yum_repo.url
repo_gpg_url = settings.repos.gr_yum_repo.gpg_url
Expand All @@ -1455,7 +1455,15 @@ def test_global_registration_with_gpg_repo_and_default_package(

# rhel repo required for insights client installation,
# syncing it to the satellite would take too long
client.create_custom_repos(rhel7=settings.repos.rhel7_os)
rhelver = client.os_version.major
if rhelver > 7:
repos = {f'rhel{rhelver}_os': settings.repos[f'rhel{rhelver}_os']['baseos']}
else:
repos = {
'rhel7_os': settings.repos['rhel7_os'],
'rhel7_extras': settings.repos['rhel7_extras'],
}
client.create_custom_repos(**repos)
# run curl
result = client.execute(cmd)
assert result.status == 0
Expand Down Expand Up @@ -1571,7 +1579,7 @@ def test_global_re_registration_host_with_force_ignore_error_options(
@pytest.mark.tier2
@pytest.mark.usefixtures('enable_capsule_for_registration')
def test_global_registration_token_restriction(
session, module_activation_key, rhel7_contenthost, default_os, default_smart_proxy, target_sat
session, module_activation_key, rhel_contenthost, default_os, default_smart_proxy, target_sat
):
"""Global registration token should be only used for registration call, it
should be restricted for any other api calls.
Expand All @@ -1589,7 +1597,7 @@ def test_global_registration_token_restriction(
:parametrized: yes
"""
client = rhel7_contenthost
client = rhel_contenthost
with session:
cmd = session.host.get_register_command(
{
Expand Down

0 comments on commit b272c54

Please sign in to comment.