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, 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
6 changes: 5 additions & 1 deletion pytest_fixtures/component/provisioning_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ 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']
constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos_beta']['version']
if rhel_ver == 10 # TODO: Remove beta repos once RHEL10 is GA
else 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 @@ -896,6 +897,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 = '' # TODO: Add when updated packages are available for RHEL10
FAKE_0_CUSTOM_PACKAGE_GROUP_NAME = 'birds'
FAKE_3_YUM_OUTDATED_PACKAGES = [
'acme-package-1.0.1-1.noarch',
Expand Down Expand Up @@ -952,6 +959,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 = '' # TODO: add when real errata is available for RHEL10
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 @@ -1773,6 +1784,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 @@ -1785,6 +1797,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
9 changes: 5 additions & 4 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 @@ -465,16 +466,16 @@ def test_positive_ansible_job_on_multiple_host(
)
target_sat.wait_for_tasks(
f'resource_type = JobInvocation and resource_id = {job["id"]}',
poll_timeout=1000,
poll_timeout=1500,
must_succeed=False,
)
result = target_sat.api.JobInvocation(id=job['id']).read()
assert result.succeeded == 2 # SELECTED_ROLE working on rhel8/rhel9 clients
assert result.succeeded == len(hosts) - 1 # SELECTED_ROLE working on rhel8/9/10 clients
assert result.failed == 1 # SELECTED_ROLE failing on rhel7 client
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
8 changes: 4 additions & 4 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_endpoint(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 @@ -868,18 +868,18 @@ def test_positive_sync_kickstart_repo(
module_capsule_configured.wait_for_sync(start_time=timestamp)
cvv = cvv.read()
assert len(cvv.environment) == 2

# Check for kickstart content on SAT and CAPS
tail = (
f'rhel/server/7/{REPOS["kickstart"][distro]["version"]}/x86_64/kickstart'
if distro == 'rhel7'
else f'{distro.split("_")[0]}/{REPOS["kickstart"][distro]["version"]}/beta/x86_64/baseos/kickstart'
if 'beta' in distro # for future beta rhel distros
else f'{distro.split("_")[0]}/{REPOS["kickstart"][distro]["version"]}/x86_64/baseos/kickstart' # noqa:E501
)
url_base = (
f'pulp/content/{function_sca_manifest_org.label}/{lce.label}/{cv.label}/'
f'content/dist/{tail}'
)

# Check kickstart specific files
for file in KICKSTART_CONTENT:
sat_file = target_sat.checksum_by_url(f'{target_sat.url}/{url_base}/{file}')
Expand Down Expand Up @@ -1447,7 +1447,7 @@ def test_positive_remove_capsule_orphans(
'repos_collection',
[
{
'distro': 'rhel9',
'distro': 'rhel10',
'YumRepository': {'url': settings.repos.yum_0.url},
}
],
Expand Down
Loading
Loading