Skip to content

Commit

Permalink
Add RHEL10 support for Provisioning tests
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Ganar <[email protected]>
  • Loading branch information
shubhamsg199 committed Dec 17, 2024
1 parent 3ac153b commit 15c7d90
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 21 deletions.
4 changes: 4 additions & 0 deletions pytest_fixtures/component/provision_pxe.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,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 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',
},
'rhel7_optional': {
'id': 'rhel-7-server-optional-rpms',
'name': 'Red Hat Enterprise Linux 7 Server - Optional RPMs x86_64 7Server',
Expand Down
13 changes: 6 additions & 7 deletions tests/foreman/api/test_provisioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from wrapanapi.systems.virtualcenter import VMWareVirtualMachine

from robottelo.config import settings
from robottelo.hosts import get_sat_rhel_version
from robottelo.logging import logger
from robottelo.utils.installer import InstallerCommand
from robottelo.utils.issue_handlers import is_open
Expand Down Expand Up @@ -66,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 @@ -199,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 @@ -329,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 @@ -457,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 @@ -599,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([get_sat_rhel_version().major])
@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$')
def test_rhel_pxe_provisioning_secureboot_enabled(
request,
module_provisioning_sat,
Expand Down Expand Up @@ -705,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

0 comments on commit 15c7d90

Please sign in to comment.