Skip to content

Commit

Permalink
Add support of RHEL10 and update regex for tests parameterization
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed Dec 16, 2024
1 parent ea1716d commit 151cc1f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
13 changes: 7 additions & 6 deletions tests/foreman/api/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@

@pytest.mark.e2e
@pytest.mark.pit_client
@pytest.mark.rhel_ver_match('[^6]')
# @pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
@pytest.mark.no_containers
def test_host_registration_end_to_end(
module_sca_manifest_org,
Expand Down Expand Up @@ -89,7 +90,7 @@ def test_host_registration_end_to_end(

@pytest.mark.tier3
@pytest.mark.pit_client
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_allow_reregistration_when_dmi_uuid_changed(
module_sca_manifest_org,
rhel_contenthost,
Expand Down Expand Up @@ -133,7 +134,7 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed(
assert result.status == 0, f'Failed to register host: {result.stderr}'


@pytest.mark.rhel_ver_match('8')
@pytest.mark.rhel_ver_match('N-1')
def test_positive_update_packages_registration(
module_target_sat,
module_sca_manifest_org,
Expand Down Expand Up @@ -164,7 +165,7 @@ def test_positive_update_packages_registration(
assert result.status == 0


@pytest.mark.rhel_ver_match('8')
@pytest.mark.rhel_ver_match('N-1')
@pytest.mark.no_containers
def test_positive_rex_interface_for_global_registration(
module_target_sat,
Expand Down Expand Up @@ -270,7 +271,7 @@ def test_negative_capsule_without_registration_enabled(
)


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_host_registration_with_non_admin_user_with_setup_false(
module_org,
module_location,
Expand Down Expand Up @@ -331,7 +332,7 @@ def test_positive_host_registration_with_non_admin_user_with_setup_false(
assert rhel_contenthost.execute('cat ~/.ssh/authorized_keys | grep foreman-proxy').status == 1


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_negative_verify_bash_exit_status_failing_host_registration(
module_sca_manifest_org,
module_location,
Expand Down
4 changes: 2 additions & 2 deletions tests/foreman/cli/test_fact.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_negative_list_by_name(module_target_sat):
@pytest.mark.e2e
@pytest.mark.no_containers
@pytest.mark.pit_client
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
@pytest.mark.rhel_ver_list('910')
def test_positive_facts_end_to_end(
module_target_sat, rhel_contenthost, module_org, module_location, module_activation_key
):
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_positive_facts_end_to_end(
), f'Assertion failed: {fact} (expected: {expected_value}, actual: {actual_value})'


@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
@pytest.mark.rhel_ver_list('910')
def test_positive_custom_facts_and_clean_orphaned_facts(
module_target_sat, module_org, module_location, module_activation_key, rhel_contenthost
):
Expand Down
4 changes: 2 additions & 2 deletions tests/foreman/cli/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_upgrade_katello_ca_consumer_rpm(
assert result.status == 0


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
@pytest.mark.tier3
def test_negative_register_twice(module_ak_with_cv, module_org, rhel_contenthost, target_sat):
"""Attempt to register a host twice to Satellite
Expand All @@ -191,7 +191,7 @@ def test_negative_register_twice(module_ak_with_cv, module_org, rhel_contenthost
assert 'This system is already registered' in str(result.stderr)


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
@pytest.mark.tier3
def test_positive_force_register_twice(module_ak_with_cv, module_org, rhel_contenthost, target_sat):
"""Register a host twice to Satellite, with force=true
Expand Down
4 changes: 1 addition & 3 deletions tests/foreman/ui/test_fact.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

import pytest

from robottelo.config import settings


@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
@pytest.mark.rhel_ver_list('910')
def test_positive_upload_host_facts(
module_target_sat,
rhel_contenthost,
Expand Down
10 changes: 5 additions & 5 deletions tests/foreman/ui/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_negative_global_registration_without_ak(
@pytest.mark.no_containers
@pytest.mark.pit_client
@pytest.mark.tier3
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_global_registration_end_to_end(
module_activation_key,
module_org,
Expand Down Expand Up @@ -429,7 +429,7 @@ def test_global_registration_with_gpg_repo_and_default_package(


@pytest.mark.tier3
@pytest.mark.rhel_ver_match('9')
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
def test_global_re_registration_host_with_force_ignore_error_options(
module_activation_key, rhel_contenthost, module_target_sat, module_org
):
Expand Down Expand Up @@ -470,7 +470,7 @@ def test_global_re_registration_host_with_force_ignore_error_options(


@pytest.mark.tier2
@pytest.mark.rhel_ver_match('8')
@pytest.mark.rhel_ver_match('N-1')
def test_global_registration_token_restriction(
module_activation_key, rhel_contenthost, module_target_sat, module_org
):
Expand Down Expand Up @@ -510,7 +510,7 @@ def test_global_registration_token_restriction(
assert 'Unable to authenticate user' in result.stdout


@pytest.mark.rhel_ver_match('8')
@pytest.mark.rhel_ver_match('N-1')
def test_positive_host_registration_with_non_admin_user(
test_name,
module_sca_manifest_org,
Expand Down Expand Up @@ -630,7 +630,7 @@ def test_positive_global_registration_form(


@pytest.mark.tier2
@pytest.mark.rhel_ver_match('8')
@pytest.mark.rhel_ver_match('N-1')
def test_global_registration_with_capsule_host(
capsule_configured,
rhel_contenthost,
Expand Down

0 comments on commit 151cc1f

Please sign in to comment.