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

Add RHEL10 support for Provisioning tests #17192

Merged
merged 3 commits into from
Dec 25, 2024
Merged
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
45 changes: 28 additions & 17 deletions pytest_fixtures/component/provision_pxe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from robottelo import constants
from robottelo.config import settings
from robottelo.hosts import ContentHost
from robottelo.utils.issue_handlers import is_open


@pytest.fixture(scope='module')
Expand All @@ -38,6 +39,10 @@ def module_provisioning_rhel_content(
repo_names = []
if int(rhel_ver) <= 7:
repo_names.append(f'rhel{rhel_ver}')
# Provision using RHEL10 Beta repos until its GA
elif int(rhel_ver) == 10:
repo_names.append(f'rhel{rhel_ver}_bos_beta')
repo_names.append(f'rhel{rhel_ver}_aps_beta')
else:
repo_names.append(f'rhel{rhel_ver}_bos')
repo_names.append(f'rhel{rhel_ver}_aps')
Expand All @@ -47,18 +52,19 @@ def module_provisioning_rhel_content(
content_view = sat.api.ContentView(organization=module_sca_manifest_org).create()

# Custom Content for Client repo
custom_product = sat.api.Product(
organization=module_sca_manifest_org, name=f'rhel{rhel_ver}_{gen_string("alpha")}'
).create()
client_repo = sat.api.Repository(
organization=module_sca_manifest_org,
product=custom_product,
content_type='yum',
url=settings.repos.SATCLIENT_REPO[f'rhel{rhel_ver}'],
).create()
task = client_repo.sync(synchronous=False)
tasks.append(task)
content_view.repository = [client_repo]
if is_open('SAT-27193') and int(rhel_ver) != 10:
custom_product = sat.api.Product(
organization=module_sca_manifest_org, name=f'rhel{rhel_ver}_{gen_string("alpha")}'
).create()
client_repo = sat.api.Repository(
organization=module_sca_manifest_org,
product=custom_product,
content_type='yum',
url=settings.repos.SATCLIENT_REPO[f'rhel{rhel_ver}'],
).create()
task = client_repo.sync(synchronous=False)
tasks.append(task)
content_view.repository = [client_repo]

for name in repo_names:
rh_kickstart_repo_id = sat.api_factory.enable_rhrepo_and_fetchid(
Expand Down Expand Up @@ -99,6 +105,8 @@ def module_provisioning_rhel_content(
rhel_xy = Version(
constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version']
if rhel_ver == 7
else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos_beta']['version']
if rhel_ver == 10
else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version']
)
o_systems = sat.api.OperatingSystem().search(
Expand All @@ -125,11 +133,14 @@ def module_provisioning_rhel_content(
).create()

# Ensure client repo is enabled in the activation key
content = ak.product_content(data={'content_access_mode_all': '1'})['results']
client_repo_label = [repo['label'] for repo in content if repo['name'] == client_repo.name][0]
ak.content_override(
data={'content_overrides': [{'content_label': client_repo_label, 'value': '1'}]}
)
if is_open('SAT-27193') and int(rhel_ver) != 10:
content = ak.product_content(data={'content_access_mode_all': '1'})['results']
client_repo_label = [repo['label'] for repo in content if repo['name'] == client_repo.name][
0
]
ak.content_override(
data={'content_overrides': [{'content_label': client_repo_label, 'value': '1'}]}
)
return Box(os=os, ak=ak, ksrepo=ksrepo, cv=content_view)


Expand Down
43 changes: 43 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_beta': 'Red Hat Enterprise Linux for x86_64 Beta',
}

REPOSET = {
Expand Down Expand Up @@ -303,11 +304,15 @@
'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_beta': 'Red Hat Enterprise Linux 10 for x86_64 - BaseOS Beta (Kickstart)',
'rhel10_aps_beta': 'Red Hat Enterprise Linux 10 for x86_64 - AppStream Beta (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)',
'rhel9_aps': 'Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)',
'rhel10_bos_beta': 'Red Hat Enterprise Linux 10 for x86_64 - BaseOS Beta (RPMs)',
'rhel10_aps_beta': 'Red Hat Enterprise Linux 10 for x86_64 - AppStream Beta (RPMs)',
'rhel7_extra': 'Red Hat Enterprise Linux 7 Server - Extras (RPMs)',
'rhel7_optional': 'Red Hat Enterprise Linux 7 Server - Optional (RPMs)',
'rhel7_sup': 'Red Hat Enterprise Linux 7 Server - Supplementary (RPMs)',
Expand Down Expand Up @@ -558,6 +563,22 @@
'product': PRDS['rhel9'],
'distro': 'rhel9',
},
'rhel10_bos_beta': {
'id': 'rhel-10-for-x86_64-baseos-beta-kickstart',
'name': 'Red Hat Enterprise Linux 10 for x86_64 - BaseOS Beta Kickstart',
'version': '10',
'reposet': REPOSET['kickstart']['rhel10_bos_beta'],
'product': PRDS['rhel10_beta'],
'distro': 'rhel10',
},
'rhel10_aps_beta': {
'id': 'rhel-10-for-x86_64-appstream-beta-kickstart',
'name': 'Red Hat Enterprise Linux 10 for x86_64 - AppStream Beta Kickstart',
'version': '10',
'reposet': REPOSET['kickstart']['rhel10_aps_beta'],
'product': PRDS['rhel10_beta'],
'distro': 'rhel10',
},
},
'rhel8_bos': {
'id': 'rhel-8-for-x86_64-baseos-rpms',
Expand Down Expand Up @@ -603,6 +624,28 @@
'distro': 'rhel9',
'key': 'rhel9_aps',
},
'rhel10_bos_beta': {
'id': 'rhel-10-for-x86_64-baseos-beta-rpms',
'name': 'Red Hat Enterprise Linux 10 for x86_64 - BaseOS Beta RPMs',
'releasever': '10',
'version': '10',
'reposet': REPOSET['rhel10_bos_beta'],
'product': PRDS['rhel10_beta'],
'distro': 'rhel10',
'key': 'rhel10_bos_beta',
'basearch': 'x86_64',
},
'rhel10_aps_beta': {
'id': 'rhel-10-for-x86_64-appstream-beta-rpms',
'name': 'Red Hat Enterprise Linux 10 for x86_64 - AppStream Beta RPMs',
'releasever': '10',
'basearch': 'x86_64',
'version': '10',
'reposet': REPOSET['rhel10_aps_beta'],
'product': PRDS['rhel10_beta'],
'distro': 'rhel10',
'key': 'rhel10_aps_beta',
Gauravtalreja1 marked this conversation as resolved.
Show resolved Hide resolved
},
'rhel7_optional': {
'id': 'rhel-7-server-optional-rpms',
'name': 'Red Hat Enterprise Linux 7 Server - Optional RPMs x86_64 7Server',
Expand Down
12 changes: 6 additions & 6 deletions tests/foreman/api/test_provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def assert_host_logs(channel, pattern):
@pytest.mark.upgrade
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
@pytest.mark.on_premises_provisioning
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_rhel_pxe_provisioning(
request,
module_provisioning_sat,
Expand Down Expand Up @@ -198,7 +198,7 @@ def test_rhel_pxe_provisioning(
@pytest.mark.upgrade
@pytest.mark.parametrize('pxe_loader', ['ipxe'], indirect=True)
@pytest.mark.on_premises_provisioning
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_rhel_ipxe_provisioning(
request,
module_provisioning_sat,
Expand Down Expand Up @@ -328,7 +328,7 @@ def test_rhel_ipxe_provisioning(
@pytest.mark.upgrade
@pytest.mark.parametrize('pxe_loader', ['http_uefi'], indirect=True)
@pytest.mark.on_premises_provisioning
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_rhel_httpboot_provisioning(
request,
module_provisioning_sat,
Expand Down Expand Up @@ -456,7 +456,7 @@ def test_rhel_httpboot_provisioning(

@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
@pytest.mark.on_premises_provisioning
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_rhel_pxe_provisioning_fips_enabled(
request,
module_provisioning_sat,
Expand Down Expand Up @@ -598,7 +598,7 @@ def test_rhel_pxe_provisioning_fips_enabled(
@pytest.mark.upgrade
@pytest.mark.on_premises_provisioning
@pytest.mark.parametrize('pxe_loader', ['secureboot'], indirect=True)
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_rhel_pxe_provisioning_secureboot_enabled(
request,
module_provisioning_sat,
Expand Down Expand Up @@ -704,7 +704,7 @@ def test_rhel_pxe_provisioning_secureboot_enabled(
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
@pytest.mark.skip(reason='Skipping till we have destructive support')
@pytest.mark.on_premises_provisioning
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_capsule_pxe_provisioning(
request,
capsule_provisioning_sat,
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/api/test_provisioning_puppet.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_positive_puppet_bootstrap(


@pytest.mark.on_premises_provisioning
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_host_provisioning_with_external_puppetserver(
request,
external_puppet_server,
Expand Down
14 changes: 7 additions & 7 deletions tests/foreman/api/test_provisioningtemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_positive_build_pxe_default(self, tftpboot, module_target_sat):
)

@pytest.mark.e2e
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_template_check_ipxe(
self,
module_sync_kickstart_content,
Expand Down Expand Up @@ -290,7 +290,7 @@ def test_positive_template_check_ipxe(
ks_param = 'ks=' if module_sync_kickstart_content.rhel_ver <= 8 else 'inst.ks='
assert ipxe_template.count(ks_param) == 1

@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_template_check_vlan_parameter(
self,
module_sync_kickstart_content,
Expand Down Expand Up @@ -359,7 +359,7 @@ def test_positive_template_check_vlan_parameter(

@pytest.mark.parametrize('pxe_loader', ['uefi'], indirect=True)
@pytest.mark.parametrize('boot_mode', ['Static', 'DHCP'])
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_template_subnet_with_boot_mode(
self,
module_sync_kickstart_content,
Expand Down Expand Up @@ -511,7 +511,7 @@ def test_positive_template_check_aap_snippet(
assert f'"host_config_key":"{config_key}"' in render
assert '{"package_install": "zsh"}' in render

@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_template_check_rex_snippet(
self,
module_sync_kickstart_content,
Expand Down Expand Up @@ -590,7 +590,7 @@ def test_positive_template_check_rex_snippet(
)
assert ssh_key in rex_snippet

@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_template_check_rex_pull_mode_snippet(
self,
module_sync_kickstart_content,
Expand Down Expand Up @@ -651,7 +651,7 @@ def test_positive_template_check_rex_pull_mode_snippet(
assert 'yggdrasil status' in rex_snippet
assert 'Remote execution pull provider successfully configured!' in rex_snippet

@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_template_check_fips_enabled(
self,
module_sync_kickstart_content,
Expand Down Expand Up @@ -698,7 +698,7 @@ def test_positive_template_check_fips_enabled(
render = host.read_template(data={'template_kind': kind})['template']
assert 'fips=1' in render

@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_verify_chronyd_timesource_kickstart_template(
self,
module_sync_kickstart_content,
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/cli/test_bootdisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from robottelo.constants import HTTPS_MEDIUM_URL


@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_positive_bootdisk_download_https(
request,
module_location,
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/cli/test_computeresource_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def test_positive_update_console_password(libvirt_url, set_console_password, mod
@pytest.mark.e2e
@pytest.mark.on_premises_provisioning
@pytest.mark.tier3
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
@pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True)
def test_positive_provision_end_to_end(
request,
Expand Down
4 changes: 2 additions & 2 deletions tests/foreman/cli/test_computeresource_rhev.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def test_negative_add_image_rhev_with_invalid_name(rhev, module_os, module_targe
@pytest.mark.e2e
@pytest.mark.on_premises_provisioning
@pytest.mark.tier3
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
@pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True)
def test_positive_provision_rhev_with_host_group(
request,
Expand Down Expand Up @@ -537,7 +537,7 @@ def test_positive_provision_rhev_without_host_group(rhev):

@pytest.mark.on_premises_provisioning
@pytest.mark.tier3
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
@pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True)
def test_positive_provision_rhev_image_based_and_disassociate(
request,
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/cli/test_computeresource_vmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_positive_vmware_cr_end_to_end(target_sat, module_org, module_location,
@pytest.mark.parametrize('vmware', ['vmware7', 'vmware8'], indirect=True)
@pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True)
@pytest.mark.parametrize('provision_method', ['build', 'bootdisk'])
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
@pytest.mark.tier3
def test_positive_provision_end_to_end(
request,
Expand Down
2 changes: 1 addition & 1 deletion tests/foreman/ui/test_computeresource_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_positive_end_to_end(session, module_target_sat, module_org, module_loca
@pytest.mark.e2e
@pytest.mark.on_premises_provisioning
@pytest.mark.tier4
@pytest.mark.rhel_ver_match('[^6]')
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
@pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True)
def test_positive_provision_end_to_end(
request,
Expand Down
Loading