Skip to content

Commit

Permalink
RHEL10 Clients parametrizations
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Dec 7, 2024
1 parent 1bdd7f2 commit 842f493
Show file tree
Hide file tree
Showing 13 changed files with 121 additions and 83 deletions.
21 changes: 21 additions & 0 deletions pytest_fixtures/core/contenthosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,27 @@ def rhel9_contenthost(request):
yield host


@pytest.fixture(scope='module', params=[{'rhel_version': '9'}])
def rhel9_contenthost_module(request):
"""A module-level fixture that provides a rhel9 content host object"""
with Broker(**host_conf(request), host_class=ContentHost) as host:
yield host


@pytest.fixture(params=[{'rhel_version': '10'}])
def rhel10_contenthost(request):
"""A fixture that provides a rhel10 content host object"""
with Broker(**host_conf(request), host_class=ContentHost) as host:
yield host


@pytest.fixture(scope='module', params=[{'rhel_version': '10'}])
def rhel10_contenthost_module(request):
"""A module-level fixture that provides a rhel10 content host object"""
with Broker(**host_conf(request), host_class=ContentHost) as host:
yield host


@pytest.fixture
def content_hosts(request):
"""A function-level fixture that provides two rhel content hosts object"""
Expand Down
9 changes: 9 additions & 0 deletions robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
'rhae': 'Red Hat Ansible Engine',
'rhel8': 'Red Hat Enterprise Linux for x86_64',
'rhel9': 'Red Hat Enterprise Linux for x86_64',
'rhel10': 'Red Hat Enterprise Linux for x86_64',
}

REPOSET = {
Expand Down Expand Up @@ -303,10 +304,12 @@
'rhel8_aps': 'Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart)',
'rhel9_bos': 'Red Hat Enterprise Linux 9 for x86_64 - BaseOS (Kickstart)',
'rhel9_aps': 'Red Hat Enterprise Linux 9 for x86_64 - AppStream (Kickstart)',
'rhel10_bos': 'Red Hat Enterprise Linux 10 for x86_64 - BaseOS (Kickstart)',
},
'rhel8_bos': 'Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)',
'rhel8_aps': 'Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)',
'rhel9_bos': 'Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)',
'rhel10_bos': 'Red Hat Enterprise Linux 10 for x86_64 - BaseOS (RPMs)',
'rhel9_aps': 'Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)',
'rhel7_extra': 'Red Hat Enterprise Linux 7 Server - Extras (RPMs)',
'rhel7_optional': 'Red Hat Enterprise Linux 7 Server - Optional (RPMs)',
Expand Down Expand Up @@ -789,6 +792,8 @@
REAL_RHEL8_1_PACKAGE_NAME = 'puppet-agent' # for RHSA-2022:4867
REAL_RHEL8_1_PACKAGE_FILENAME = 'puppet-agent-6.19.1-1.el8sat.x86_64'
REAL_RHEL8_2_PACKAGE_FILENAME = 'puppet-agent-6.26.0-1.el8sat.x86_64'
REAL_RHEL9_PACKAGE_FILENAME = ''
REAL_RHEL10_PACKAGE_FILENAME = ''
FAKE_0_CUSTOM_PACKAGE_GROUP_NAME = 'birds'
FAKE_3_YUM_OUTDATED_PACKAGES = [
'acme-package-1.0.1-1.noarch',
Expand Down Expand Up @@ -844,7 +849,11 @@
REAL_RHEL7_0_ERRATA_ID = 'RHBA-2020:3615' # for REAL_RHEL7_0_0_PACKAGE
REAL_RHEL7_1_ERRATA_ID = 'RHBA-2017:0395' # tcsh bug fix update
REAL_RHEL8_1_ERRATA_ID = 'RHSA-2022:4867' # for REAL_RHEL8_1_PACKAGE
REAL_RHEL9_ERRATA_ID = ''
REAL_RHEL10_ERRATA_ID = ''
REAL_RHEL8_ERRATA_CVES = ['CVE-2021-27023', 'CVE-2021-27025']
REAL_RHEL9_ERRATA_CVES = []
REAL_RHEL10_ERRATA_CVES = []
REAL_RHSCLIENT_ERRATA = 'RHSA-2023:5982' # for RH Satellite Client 8
FAKE_1_YUM_REPOS_COUNT = 32
FAKE_3_YUM_REPOS_COUNT = 78
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/api/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ def test_positive_remove_capsule_orphans(
],
indirect=True,
)
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
@pytest.mark.rhel_ver_match('N-1')
def test_complete_sync_fixes_metadata(
self,
module_target_sat,
Expand Down
137 changes: 70 additions & 67 deletions tests/foreman/api/test_errata.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/foreman/api/test_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_positive_end_to_end(

@pytest.mark.e2e
@pytest.mark.upgrade
@pytest.mark.rhel_ver_match('8')
@pytest.mark.rhel_ver_match('N-2') # newest N, and two prior [10,9,8]
@pytest.mark.run_in_one_thread
@pytest.mark.parametrize(
'setup_http_proxy',
Expand Down
10 changes: 5 additions & 5 deletions tests/foreman/cli/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ def rh_repo_module_manifest(module_sca_manifest_org, module_target_sat):
rh_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid(
basearch=DEFAULT_ARCHITECTURE,
org_id=module_sca_manifest_org.id,
product=PRDS['rhel8'],
repo=REPOS['rhsclient8']['name'],
reposet=REPOSET['rhsclient8'],
product=PRDS['rhel9'],
repo=REPOS['rhsclient9']['name'],
reposet=REPOSET['rhsclient9'],
releasever=None,
)
# Sync step because repo is not synced by default
Expand All @@ -165,7 +165,7 @@ def rh_repo_module_manifest(module_sca_manifest_org, module_target_sat):
def hosts(request):
"""Deploy hosts via broker."""
num_hosts = getattr(request, 'param', 2)
with Broker(nick='rhel8', host_class=ContentHost, _count=num_hosts) as hosts:
with Broker(nick='rhel10', host_class=ContentHost, _count=num_hosts) as hosts:
if not isinstance(hosts, list) or len(hosts) != num_hosts:
pytest.fail('Failed to provision the expected number of hosts.')
yield hosts
Expand Down Expand Up @@ -1167,7 +1167,7 @@ def new_module_ak(
).create()
# Ensure tools repo is enabled in the activation key
new_module_ak.content_override(
data={'content_overrides': [{'content_label': REPOS['rhsclient8']['id'], 'value': '1'}]}
data={'content_overrides': [{'content_label': REPOS['rhsclient9']['id'], 'value': '1'}]}
)
return new_module_ak.read()

Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/cli/test_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_positive_create_update_delete(module_org, module_location, target_sat):

@pytest.mark.tier3
@pytest.mark.no_containers
@pytest.mark.rhel_ver_match(r'^(?!6$)\d+$')
@pytest.mark.rhel_ver_match('N-3') # Newest supported N, and 3 prior
@pytest.mark.parametrize(
'setup_http_proxy',
[True, False],
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/cli/test_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from robottelo.constants import DEFAULT_ARCHITECTURE, REPOS, REPOSET


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match('N-3') # Newest supported N, and 3 prior
def test_positive_custom_products_disabled_by_default(
setup_content,
default_location,
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/cli/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -2703,7 +2703,7 @@ def test_positive_syncable_yum_format_repo_import(target_sat, module_org):


@pytest.mark.pit_client
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version])
@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version, 10])
def test_positive_install_uploaded_rpm_on_host(
target_sat, rhel_contenthost, function_org, function_lce
):
Expand Down
7 changes: 6 additions & 1 deletion tests/foreman/ui/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,12 +865,17 @@ def test_positive_apply_for_all_hosts(
hosts.
"""
num_hosts = 4
distro = 'rhel10'
# newest major rhel distro from supportability
major_versions = [
ver for ver in settings.supportability.content_hosts.rhel.versions if isinstance(ver, int)
]
distro = 'rhel' + str(max(major_versions))
# one custom repo on satellite, for all hosts to use
custom_repo = target_sat.api.Repository(url=CUSTOM_REPO_URL, product=module_product).create()
custom_repo.sync()
module_cv.repository = [custom_repo]
module_cv.update(['repository'])

with Broker(
nick=distro,
workflow='deploy-template',
Expand Down
6 changes: 3 additions & 3 deletions tests/foreman/ui/test_repositories.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pytest


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$') # all major versions, excluding fips
def test_positive_custom_products_disabled_by_default(
session,
default_location,
Expand Down Expand Up @@ -56,7 +56,7 @@ def test_positive_custom_products_disabled_by_default(
assert repos[0]['Repository type'] == 'Custom'


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$') # all major versions, excluding fips
def test_positive_override_custom_products_using_select_all(
session,
default_location,
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_positive_override_custom_products_using_select_all(
assert repo[0]['Status'] == 'Enabled'


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$') # all major versions, excluding fips
def test_positive_override_custom_products_not_using_select_all(
session,
default_location,
Expand Down
2 changes: 1 addition & 1 deletion tests/upgrades/test_errata.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class TestScenarioErrataCount(TestScenarioErrataAbstract):
5. Check if the Errata Count in Satellite after the upgrade.
"""

@pytest.mark.rhel_ver_list([7, 8, 9])
@pytest.mark.rhel_ver_list([7, 8, 9, 10])
@pytest.mark.no_containers
@pytest.mark.pre_upgrade
def test_pre_scenario_generate_errata_for_client(
Expand Down
2 changes: 1 addition & 1 deletion tests/upgrades/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class TestSimpleContentAccessOnly:
satellite with simple content access mode only.
"""

@pytest.mark.rhel_ver_list([7, 8, 9])
@pytest.mark.rhel_ver_list([7, 8, 9, 10])
@pytest.mark.no_containers
@pytest.mark.pre_upgrade
def test_pre_simple_content_access_only(
Expand Down

0 comments on commit 842f493

Please sign in to comment.