Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHEL10 Clients coverage in Content, rhel7 & 8 hosts bumped #17003

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
15 changes: 10 additions & 5 deletions pytest_fixtures/component/provisioning_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def module_sync_kickstart_content(
rhel_ver = request.param['rhel_version']
if int(rhel_ver) <= 7:
repo_names.append(f'rhel{rhel_ver}')
elif rhel_ver == 10: # TODO: Remove once rhel10 is GA
repo_names.append(f'rhel{rhel_ver}_bos_beta')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these be switched to the GA repos once RHEL 10 goes GA?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, for now I've put this because the kickstart and some other repos
have been merged by others as rhel10_bos_beta

else:
repo_names.append(f'rhel{rhel_ver}_bos')
for name in repo_names:
Expand All @@ -88,11 +90,14 @@ def module_sync_kickstart_content(
)
task_status = module_target_sat.api.ForemanTask(id=task['id']).poll()
assert task_status['result'] == 'success'
rhel_xy = Version(
constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version']
if rhel_ver == 7
else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version']
)
if rhel_ver == 10: # TODO: Remove once rhel10 is GA
rhel_xy = Version(constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos_beta']['version'])
else:
rhel_xy = Version(
constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version']
if rhel_ver == 7
else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version']
)
o_systems = module_target_sat.api.OperatingSystem().search(
query={'search': f'family=Redhat and major={rhel_xy.major} and minor={rhel_xy.minor}'}
)
Expand Down
26 changes: 20 additions & 6 deletions pytest_fixtures/core/contenthosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,30 @@ def rhel8_contenthost_module(request):
yield host


@pytest.fixture(params=[{'rhel_version': 6}])
def rhel6_contenthost(request):
"""A function-level fixture that provides a rhel6 content host object"""
@pytest.fixture(params=[{'rhel_version': '9'}])
def rhel9_contenthost(request):
"""A 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': '9'}])
def rhel9_contenthost(request):
"""A fixture that provides a rhel9 content host object"""
@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

Expand Down
15 changes: 14 additions & 1 deletion robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@


DISTRO_DEFAULT = 'rhel7'
DISTROS_SUPPORTED = ['rhel6', 'rhel7', 'rhel8', 'rhel9']
DISTROS_SUPPORTED = ['rhel6', 'rhel7', 'rhel8', 'rhel9', 'rhel10']
DISTROS_MAJOR_VERSION = {
'rhel6': 6,
'rhel7': 7,
'rhel8': 8,
'rhel9': 9,
'rhel10': 10,
}
MAJOR_VERSION_DISTRO = {value: key for key, value in DISTROS_MAJOR_VERSION.items()}

Expand Down Expand Up @@ -881,6 +882,12 @@
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_NAME = ''
REAL_RHEL9_1_PACKAGE_FILENAME = ''
REAL_RHEL9_2_PACKAGE_FILENAME = ''
REAL_RHEL10_PACKAGE_NAME = ''
REAL_RHEL10_1_PACKAGE_FILENAME = ''
REAL_RHEL10_2_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 @@ -937,6 +944,10 @@
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_RHEL8_ERRATA_CVES = ['CVE-2021-27023', 'CVE-2021-27025']
REAL_RHEL9_ERRATA_ID = '' # for rhel9 RH package
REAL_RHEL9_ERRATA_CVES = []
REAL_RHEL10_ERRATA_ID = '' # for rhel10 RH package
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 Expand Up @@ -1757,6 +1768,7 @@
'dsrhel7': 'DISA STIG for Red Hat Enterprise Linux 7',
'dsrhel8': 'DISA STIG for Red Hat Enterprise Linux 8',
'dsrhel9': 'DISA STIG for Red Hat Enterprise Linux 9',
'dsrhel10': 'DISA STIG for Red Hat Enterprise Linux 10',
'esp': 'Example Server Profile',
'rhccp': 'Red Hat Corporate Profile for Certified Cloud Providers (RH CCP)',
'firefox': 'Mozilla Firefox STIG',
Expand All @@ -1769,6 +1781,7 @@
'cbrhel7': 'PCI-DSS v3.2.1 Control Baseline for Red Hat Enterprise Linux 7',
'cbrhel8': 'PCI-DSS v3.2.1 Control Baseline for Red Hat Enterprise Linux 8',
'cbrhel9': 'PCI-DSS v4.0 Control Baseline for Red Hat Enterprise Linux 9',
'cbrhel10': '',
'ppgpo': 'Protection Profile for General Purpose Operating Systems',
'acscee': 'Australian Cyber Security Centre (ACSC) Essential Eight',
'ospp7': 'OSPP - Protection Profile for General Purpose Operating Systems v4.2.1',
Expand Down
5 changes: 3 additions & 2 deletions tests/foreman/api/test_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ def test_positive_ansible_job_on_multiple_host(
self,
target_sat,
module_org,
rhel10_contenthost,
rhel9_contenthost,
rhel8_contenthost,
rhel7_contenthost,
Expand All @@ -426,7 +427,7 @@ def test_positive_ansible_job_on_multiple_host(

:BZ: 2167396, 2190464, 2184117
"""
hosts = [rhel9_contenthost, rhel8_contenthost, rhel7_contenthost]
hosts = [rhel10_contenthost, rhel9_contenthost, rhel8_contenthost, rhel7_contenthost]
SELECTED_ROLE = 'RedHatInsights.insights-client'
for host in hosts:
result = host.register(
Expand Down Expand Up @@ -474,7 +475,7 @@ def test_positive_ansible_job_on_multiple_host(
assert result.status_label == 'failed'

@pytest.mark.no_containers
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$') # all major versions, excluding fips
def test_positive_ansible_localhost_job_on_host(
self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost
):
Expand Down
4 changes: 2 additions & 2 deletions tests/foreman/api/test_capsulecontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ def test_flatpak_pulpcore_enpoint(self, target_sat, module_capsule_configured):
@pytest.mark.e2e
@pytest.mark.tier4
@pytest.mark.skip_if_not_set('capsule')
@pytest.mark.parametrize('distro', ['rhel7', 'rhel8_bos', 'rhel9_bos'])
@pytest.mark.parametrize('distro', ['rhel7', 'rhel8_bos', 'rhel9_bos', 'rhel10_bos_beta'])
def test_positive_sync_kickstart_repo(
self, target_sat, module_capsule_configured, function_sca_manifest_org, distro
):
Expand Down Expand Up @@ -1450,7 +1450,7 @@ def test_positive_remove_capsule_orphans(
'repos_collection',
[
{
'distro': 'rhel9',
'distro': 'rhel10',
'YumRepository': {'url': settings.repos.yum_0.url},
}
],
Expand Down
Loading
Loading