Skip to content

Commit

Permalink
enhancements, module sync kickstart - rhel10_bos_beta until GA
Browse files Browse the repository at this point in the history
  • Loading branch information
damoore044 committed Jan 13, 2025
1 parent a8ea644 commit 77ecb95
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 157 deletions.
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')
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
13 changes: 12 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
3 changes: 2 additions & 1 deletion 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
Loading

0 comments on commit 77ecb95

Please sign in to comment.