From 83dd93aee190fc3641c60b946fcf9c80f0a1c288 Mon Sep 17 00:00:00 2001 From: Jameer Pathan <21165044+jameerpathan111@users.noreply.github.com> Date: Fri, 13 Feb 2026 15:20:35 +0100 Subject: [PATCH 1/2] Mark tests for RHEL6 client testing --- tests/foreman/api/test_ansible.py | 33 ++++++---- tests/foreman/api/test_capsulecontent.py | 3 +- .../api/test_computeresource_vmware.py | 2 +- tests/foreman/api/test_discoveredhost.py | 9 +-- tests/foreman/api/test_errata.py | 14 +++-- tests/foreman/api/test_http_proxy.py | 3 +- tests/foreman/api/test_provisioning.py | 10 +-- tests/foreman/api/test_provisioning_puppet.py | 2 +- .../foreman/api/test_provisioningtemplate.py | 14 ++--- tests/foreman/api/test_registration.py | 34 +++++++---- tests/foreman/api/test_remoteexecution.py | 7 ++- tests/foreman/api/test_reporttemplates.py | 36 ++++++----- tests/foreman/api/test_repository.py | 2 +- tests/foreman/api/test_subscription.py | 11 ++-- tests/foreman/cli/test_activationkey.py | 15 +++-- tests/foreman/cli/test_ansible.py | 31 ++++++---- tests/foreman/cli/test_bootdisk.py | 2 +- .../cli/test_computeresource_libvirt.py | 2 +- .../foreman/cli/test_computeresource_rhev.py | 4 +- .../cli/test_computeresource_vmware.py | 4 +- tests/foreman/cli/test_contentaccess.py | 6 +- tests/foreman/cli/test_discoveredhost.py | 5 +- tests/foreman/cli/test_errata.py | 12 ++-- tests/foreman/cli/test_fact.py | 6 +- tests/foreman/cli/test_host.py | 61 +++++++++++-------- tests/foreman/cli/test_registration.py | 46 ++++++++------ tests/foreman/cli/test_remoteexecution.py | 17 ++++-- tests/foreman/cli/test_report.py | 2 +- tests/foreman/cli/test_reporttemplates.py | 5 +- tests/foreman/cli/test_repositories.py | 2 +- tests/foreman/cli/test_repository.py | 6 +- tests/foreman/cli/test_satellitesync.py | 9 +-- tests/foreman/destructive/test_host.py | 2 +- tests/foreman/destructive/test_infoblox.py | 2 +- .../foreman/destructive/test_registration.py | 3 +- .../destructive/test_remoteexecution.py | 4 +- tests/foreman/endtoend/test_api_endtoend.py | 3 +- tests/foreman/longrun/test_oscap.py | 9 +-- tests/foreman/longrun/test_remoteexecution.py | 4 +- .../foreman/sys/test_capsule_loadbalancer.py | 9 ++- tests/foreman/ui/test_activationkey.py | 14 +++-- tests/foreman/ui/test_ansible.py | 21 ++++--- .../ui/test_computeresource_libvirt.py | 2 +- tests/foreman/ui/test_discoveredhost.py | 6 +- tests/foreman/ui/test_errata.py | 14 ++--- tests/foreman/ui/test_fact.py | 3 +- tests/foreman/ui/test_host.py | 17 +++--- tests/foreman/ui/test_package.py | 2 +- tests/foreman/ui/test_registration.py | 21 ++++--- tests/foreman/ui/test_remoteexecution.py | 11 ++-- tests/foreman/ui/test_reporttemplates.py | 12 ++-- tests/foreman/ui/test_repositories.py | 15 +++-- tests/foreman/ui/test_rhcloud_insights.py | 2 +- tests/foreman/ui/test_rhcloud_inventory.py | 2 +- tests/new_upgrades/test_client.py | 6 +- tests/new_upgrades/test_remoteexecution.py | 10 +-- tests/new_upgrades/test_subscription.py | 2 +- tests/upgrades/test_client.py | 4 +- tests/upgrades/test_errata.py | 2 +- tests/upgrades/test_remoteexecution.py | 4 +- tests/upgrades/test_repository.py | 2 +- tests/upgrades/test_subscription.py | 2 +- 62 files changed, 366 insertions(+), 259 deletions(-) diff --git a/tests/foreman/api/test_ansible.py b/tests/foreman/api/test_ansible.py index c3c7df0ef84..06349ca5056 100644 --- a/tests/foreman/api/test_ansible.py +++ b/tests/foreman/api/test_ansible.py @@ -334,7 +334,7 @@ class TestAnsibleREX: @pytest.mark.e2e @pytest.mark.pit_client @pytest.mark.no_containers - @pytest.mark.rhel_ver_match('[^6].*') + @pytest.mark.rhel_ver_match('[^6]') def test_positive_ansible_job_on_host( self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost ): @@ -357,13 +357,16 @@ def test_positive_ansible_job_on_host( :BZ: 2164400 """ SELECTED_ROLE = 'RedHatInsights.insights-client' - if rhel_contenthost.os_version.major <= 7: - rhel_contenthost.create_custom_repos(rhel7=settings.repos.rhel7_os) + rhelver = rhel_contenthost.os_version.major + if rhelver <= 7: + rhel_contenthost.create_custom_repos(**settings.repos[f'rhel{rhelver}_os']) assert rhel_contenthost.execute('yum install -y insights-client').status == 0 result = rhel_contenthost.register( module_org, module_location, module_ak_with_synced_repo.name, target_sat ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhelver != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' + assert rhel_contenthost.subscribed proxy_id = target_sat.nailgun_smart_proxy.id target_host = rhel_contenthost.nailgun_host target_sat.api.AnsibleRoles().sync( @@ -437,7 +440,9 @@ def test_positive_ansible_job_on_multiple_host( result = host.register( module_org, module_location, module_ak_with_synced_repo.name, target_sat ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if host.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' + assert host.subscribed proxy_id = target_sat.nailgun_smart_proxy.id target_host = host.nailgun_host target_sat.api.AnsibleRoles().sync( @@ -479,7 +484,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_list(r'^[\d]+$') def test_positive_ansible_localhost_job_on_host( self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost ): @@ -512,8 +517,9 @@ def test_positive_ansible_localhost_job_on_host( result = rhel_contenthost.register( module_org, module_location, module_ak_with_synced_repo.name, target_sat ) - assert result.status == 0, f'Failed to register host: {result.stderr}' - + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' + assert rhel_contenthost.subscribed template_id = ( target_sat.api.JobTemplate() .search(query={'search': 'name="Ansible - Run playbook"'})[0] @@ -541,7 +547,7 @@ def test_positive_ansible_localhost_job_on_host( assert [i['output'] for i in result if i['output'] == 'Exit status: 0'] @pytest.mark.no_containers - @pytest.mark.rhel_ver_list('8') + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_negative_ansible_job_timeout_to_kill( self, target_sat, module_org, module_location, module_ak_with_synced_repo, rhel_contenthost ): @@ -575,8 +581,9 @@ def test_negative_ansible_job_timeout_to_kill( result = rhel_contenthost.register( module_org, module_location, module_ak_with_synced_repo.name, target_sat ) - assert result.status == 0, f'Failed to register host: {result.stderr}' - + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' + assert rhel_contenthost.subscribed template_id = ( target_sat.api.JobTemplate() .search(query={'search': 'name="Ansible - Run playbook"'})[0] @@ -659,7 +666,9 @@ def test_positive_ansible_job_privilege_escalation( result = rhel_contenthost.register( module_org, module_location, module_ak_with_synced_repo.name, target_sat ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' + assert rhel_contenthost.subscribed assert rhel_contenthost.execute('useradd testing').status == 0 pwd = rhel_contenthost.execute( f'echo {settings.server.ssh_password} | passwd testing --stdin' diff --git a/tests/foreman/api/test_capsulecontent.py b/tests/foreman/api/test_capsulecontent.py index ab2ae453d1a..bc3204e994c 100644 --- a/tests/foreman/api/test_capsulecontent.py +++ b/tests/foreman/api/test_capsulecontent.py @@ -1518,7 +1518,8 @@ def test_complete_sync_fixes_metadata( location=default_location, activation_keys=[repos_collection.setup_content_data['activation_key']['name']], ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' host = module_target_sat.api.Host().search( query={'search': f'name="{rhel_contenthost.hostname}"'} )[0] diff --git a/tests/foreman/api/test_computeresource_vmware.py b/tests/foreman/api/test_computeresource_vmware.py index 7480aaed680..4366b7547d0 100644 --- a/tests/foreman/api/test_computeresource_vmware.py +++ b/tests/foreman/api/test_computeresource_vmware.py @@ -25,7 +25,7 @@ @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('[8]') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_provision_end_to_end( request, setting_update, diff --git a/tests/foreman/api/test_discoveredhost.py b/tests/foreman/api/test_discoveredhost.py index f361da1a3c9..3d7d8236729 100644 --- a/tests/foreman/api/test_discoveredhost.py +++ b/tests/foreman/api/test_discoveredhost.py @@ -17,6 +17,7 @@ import pytest from wait_for import TimedOutError, wait_for +from robottelo.config import settings from robottelo.logging import logger from robottelo.utils.datafactory import valid_data_list @@ -169,7 +170,7 @@ class TestDiscoveredHost: @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True) @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) - @pytest.mark.rhel_ver_list([8, 9]) + @pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_provision_pxe_host( self, module_provisioning_rhel_content, @@ -223,7 +224,7 @@ def test_positive_provision_pxe_host( @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True) @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) - @pytest.mark.rhel_ver_list([8, 9]) + @pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_provision_pxe_less_host( self, module_discovery_sat, @@ -352,7 +353,7 @@ def test_positive_refresh_facts_pxe_host(self, module_target_sat): @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True) @pytest.mark.parametrize('pxe_loader', ['uefi'], indirect=True) - @pytest.mark.rhel_ver_match('9') + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_reboot_pxe_host( self, module_provisioning_rhel_content, @@ -394,7 +395,7 @@ def test_positive_reboot_pxe_host( @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True) - @pytest.mark.rhel_ver_match('9') + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_reboot_all_pxe_hosts( self, module_provisioning_rhel_content, diff --git a/tests/foreman/api/test_errata.py b/tests/foreman/api/test_errata.py index 62c5cf61db4..7a590677a79 100644 --- a/tests/foreman/api/test_errata.py +++ b/tests/foreman/api/test_errata.py @@ -515,7 +515,7 @@ def _publish_and_wait(sat, org, cv, search_rate=1, max_tries=10): @pytest.mark.upgrade -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.e2e def test_positive_install_in_hc( @@ -579,9 +579,10 @@ def test_positive_install_in_hc( target=target_sat, loc=None, ) - assert result.status == 0, ( - f'Failed to register the host - {client.hostname}: {result.stderr}' - ) + if client.os_version.major != 6: + assert result.status == 0, ( + f'Failed to register the host - {client.hostname}: {result.stderr}' + ) client.add_rex_key(satellite=target_sat) assert client.subscribed client.run(r'subscription-manager repos --enable \*') @@ -705,7 +706,7 @@ def test_positive_install_in_hc( ) -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.e2e @pytest.mark.pit_client @@ -1496,7 +1497,8 @@ def test_positive_incremental_update_apply_to_envs_cvs( target=target_sat, loc=None, ) - assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}' assert rhel_contenthost.subscribed rhel_contenthost.execute(r'subscription-manager repos --enable \*') diff --git a/tests/foreman/api/test_http_proxy.py b/tests/foreman/api/test_http_proxy.py index c582ecc81f0..c9865834921 100644 --- a/tests/foreman/api/test_http_proxy.py +++ b/tests/foreman/api/test_http_proxy.py @@ -215,7 +215,8 @@ def test_positive_install_content_with_http_proxy( target=module_target_sat, loc=None, ) - assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register the host: {rhel_contenthost.hostname}' assert rhel_contenthost.subscribed result = rhel_contenthost.execute(f'yum install -y {pkg_name}') diff --git a/tests/foreman/api/test_provisioning.py b/tests/foreman/api/test_provisioning.py index 3d4f422a6d4..3731f09139a 100644 --- a/tests/foreman/api/test_provisioning.py +++ b/tests/foreman/api/test_provisioning.py @@ -66,7 +66,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_list(r'^[\d]+$') def test_rhel_pxe_provisioning( request, module_provisioning_sat, @@ -208,7 +208,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_list(r'^[\d]+$') def test_rhel_ipxe_provisioning( request, module_provisioning_sat, @@ -338,7 +338,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_list(r'^[\d]+$') def test_rhel_httpboot_provisioning( request, module_provisioning_sat, @@ -465,7 +465,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_list(r'^[\d]+$') def test_rhel_pxe_provisioning_fips_enabled( request, module_provisioning_sat, @@ -711,7 +711,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_list(r'^[\d]+$') def test_capsule_pxe_provisioning( request, capsule_provisioning_sat, diff --git a/tests/foreman/api/test_provisioning_puppet.py b/tests/foreman/api/test_provisioning_puppet.py index d5ae8e8db6c..8e7539e103f 100644 --- a/tests/foreman/api/test_provisioning_puppet.py +++ b/tests/foreman/api/test_provisioning_puppet.py @@ -94,7 +94,7 @@ def test_positive_puppet_bootstrap( @pytest.mark.on_premises_provisioning -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_host_provisioning_with_external_puppetserver( request, external_puppet_server, diff --git a/tests/foreman/api/test_provisioningtemplate.py b/tests/foreman/api/test_provisioningtemplate.py index 35e1f20353c..6e61a0772a9 100644 --- a/tests/foreman/api/test_provisioningtemplate.py +++ b/tests/foreman/api/test_provisioningtemplate.py @@ -240,7 +240,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_list(r'^[\d]+$') def test_positive_template_check_ipxe( self, module_sync_kickstart_content, @@ -288,7 +288,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_list(r'^[\d]+$') def test_positive_template_check_vlan_parameter( self, module_sync_kickstart_content, @@ -357,7 +357,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_list(r'^[\d]+$') def test_positive_template_subnet_with_boot_mode( self, module_sync_kickstart_content, @@ -452,7 +452,7 @@ def test_positive_template_use_graphical_installer( assert 'skipx' not in render assert 'chvt 6' in render - @pytest.mark.rhel_ver_match('[8]') + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_template_check_aap_snippet( self, module_sync_kickstart_content, @@ -509,7 +509,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_list(r'^[\d]+$') def test_positive_template_check_rex_snippet( self, module_sync_kickstart_content, @@ -649,7 +649,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_list(r'^[\d]+$') def test_positive_template_check_fips_enabled( self, module_sync_kickstart_content, @@ -696,7 +696,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_list(r'^[\d]+$') def test_positive_verify_chronyd_timesource_kickstart_template( self, module_sync_kickstart_content, diff --git a/tests/foreman/api/test_registration.py b/tests/foreman/api/test_registration.py index 07750b0c21a..0fdbf9e4035 100644 --- a/tests/foreman/api/test_registration.py +++ b/tests/foreman/api/test_registration.py @@ -27,7 +27,7 @@ @pytest.mark.e2e @pytest.mark.pit_client -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers def test_host_registration_end_to_end( module_sca_manifest_org, @@ -56,7 +56,8 @@ def test_host_registration_end_to_end( organization=org, activation_keys=[module_activation_key.name], ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # Verify server.hostname and server.port from subscription-manager config assert module_target_sat.hostname == rhel_contenthost.subscription_config['server']['hostname'] @@ -75,7 +76,8 @@ def test_host_registration_end_to_end( location=module_location, force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # Verify server.hostname and server.port from subscription-manager config assert ( @@ -86,7 +88,7 @@ def test_host_registration_end_to_end( @pytest.mark.pit_client -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_allow_reregistration_when_dmi_uuid_changed( module_sca_manifest_org, rhel_contenthost, @@ -115,7 +117,8 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed( activation_keys=[module_activation_key.name], location=module_location, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' target_sat.execute(f'echo \'{{"dmi.system.uuid": "{uuid_2}"}}\' > /etc/rhsm/facts/uuid.facts') result = rhel_contenthost.execute('subscription-manager unregister') assert result.status == 0 @@ -127,10 +130,11 @@ def test_positive_allow_reregistration_when_dmi_uuid_changed( activation_keys=[module_activation_key.name], location=module_location, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_update_packages_registration( module_target_sat, module_sca_manifest_org, @@ -152,7 +156,8 @@ def test_positive_update_packages_registration( location=module_location, update_packages=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' package = constants.FAKE_7_CUSTOM_PACKAGE repo_url = settings.repos.yum_3['url'] @@ -161,7 +166,7 @@ def test_positive_update_packages_registration( assert result.status == 0 -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.no_containers def test_positive_rex_interface_for_global_registration( module_target_sat, @@ -198,7 +203,8 @@ def test_positive_rex_interface_for_global_registration( update_packages=True, remote_execution_interface='eth1', ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' host = module_target_sat.api.Host().search( query={'search': f'name={rhel_contenthost.hostname}'} @@ -315,7 +321,8 @@ def test_positive_host_registration_with_non_admin_user_with_setup_false( setup_remote_execution_pull=False, update_packages=False, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # verify package install for insights-client didn't run when Setup Insights is false assert 'dnf -y install insights-client' not in result.stdout @@ -327,7 +334,7 @@ def test_positive_host_registration_with_non_admin_user_with_setup_false( assert rhel_contenthost.execute('cat ~/.ssh/authorized_keys | grep foreman-proxy').status == 1 -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_negative_verify_bash_exit_status_failing_host_registration( module_sca_manifest_org, module_location, @@ -400,7 +407,8 @@ def test_positive_katello_ca_crt_refresh( organization=org, activation_keys=[module_activation_key.name], ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' ca_cert_file = len(str(rhel_contenthost.execute(f'cat {katello_ca_crt_path}'))) # corrupt the certificate file diff --git a/tests/foreman/api/test_remoteexecution.py b/tests/foreman/api/test_remoteexecution.py index 44dafb14826..5cd4f65c261 100644 --- a/tests/foreman/api/test_remoteexecution.py +++ b/tests/foreman/api/test_remoteexecution.py @@ -38,7 +38,7 @@ def test_positive_find_capsule_upgrade_playbook(target_sat): @pytest.mark.no_containers -@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) +@pytest.mark.rhel_ver_match('[^6]') @pytest.mark.parametrize( 'setting_update', ['remote_execution_global_proxy=False'], @@ -97,7 +97,8 @@ def test_negative_time_to_pickup( .search(query={'search': 'name="Run Command - Script Default"'})[0] .id ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if client.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # check mqtt client is running service_name = client.get_yggdrasil_service_name() result = client.execute(f'systemctl status {service_name}') @@ -170,7 +171,7 @@ def test_negative_time_to_pickup( @pytest.mark.no_containers -@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) +@pytest.mark.rhel_ver_match('[^6]') @pytest.mark.parametrize( 'setting_update', ['remote_execution_global_proxy=False'], diff --git a/tests/foreman/api/test_reporttemplates.py b/tests/foreman/api/test_reporttemplates.py index 6d241e10622..ceca5614fda 100644 --- a/tests/foreman/api/test_reporttemplates.py +++ b/tests/foreman/api/test_reporttemplates.py @@ -352,7 +352,7 @@ def test_negative_create_report_without_name(module_target_sat): assert "Name can't be blank" in report_response.value.response.text -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers def test_positive_applied_errata( function_org, function_location, function_lce, rhel_contenthost, target_sat @@ -388,7 +388,8 @@ def test_positive_applied_errata( result = rhel_contenthost.register( function_org, function_location, activation_key.name, target_sat ) - assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout + if rhel_contenthost.os_version.major != 6: + assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout assert rhel_contenthost.subscribed rhel_contenthost.execute(r'subscription-manager repos --enable \*') assert rhel_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 @@ -427,7 +428,7 @@ def test_positive_applied_errata( assert res[0]['issued'] -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers def test_positive_applied_errata_report_with_invalid_errata( function_org, function_location, function_lce, rhel_contenthost, target_sat @@ -465,7 +466,8 @@ def test_positive_applied_errata_report_with_invalid_errata( result = rhel_contenthost.register( function_org, function_location, activation_key.name, target_sat ) - assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout + if rhel_contenthost.os_version.major != 6: + assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout assert rhel_contenthost.subscribed rhel_contenthost.execute(r'subscription-manager repos --enable \*') assert rhel_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 @@ -502,7 +504,7 @@ def test_positive_applied_errata_report_with_invalid_errata( ) -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers def test_positive_applied_errata_by_search( function_org, function_lce, rhel_contenthost, target_sat @@ -542,7 +544,8 @@ def test_positive_applied_errata_by_search( .description ) result = rhel_contenthost.register(function_org, None, activation_key.name, target_sat) - assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout + if rhel_contenthost.os_version.major != 6: + assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout assert rhel_contenthost.subscribed rhel_contenthost.execute(r'subscription-manager repos --enable \*') assert rhel_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}').status == 0 @@ -636,8 +639,9 @@ def test_positive_applied_errata_for_specific_hosts( for host_info in [RHSA, RHBA]: chost = host_info['host'] result = chost.register(module_org, None, activation_key.name, module_target_sat) - assert f'The registered system name is: {chost.hostname}' in result.stdout - assert chost.subscribed + if chost.os_version.major != 6: + assert f'The registered system name is: {chost.hostname}' in result.stdout + assert chost.subscribed assert chost.execute(f'yum install -y {host_info["outdated_pkg"]}').status == 0 # now each erratum is applicable to one host, @@ -869,7 +873,8 @@ def test_positive_generate_job_report(setup_content, module_target_sat, content_ for host in content_hosts: host.register(org, None, ak.name, module_target_sat) host.add_rex_key(module_target_sat) - assert host.subscribed + if host.os_version.major != 6: + assert host.subscribed # Run a Job on the Host template_id = ( module_target_sat.api.JobTemplate() @@ -908,7 +913,7 @@ def test_positive_generate_job_report(setup_content, module_target_sat, content_ @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_installable_errata( target_sat, function_org, function_lce, function_location, rhel_contenthost ): @@ -951,7 +956,8 @@ def test_positive_installable_errata( result = rhel_contenthost.register( function_org, function_location, activation_key.name, target_sat ) - assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout + if rhel_contenthost.os_version.major != 6: + assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout assert rhel_contenthost.subscribed # Remove package if already installed on this host @@ -1021,7 +1027,7 @@ def test_positive_installable_errata( assert installable_errata['Erratum'] == ERRATUM_ID -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_installed_products( target_sat, rhel_contenthost, @@ -1073,8 +1079,10 @@ def test_positive_installed_products( content_view=cv, organization=org, environment=cv.environment[-1] ).create() - rhel_contenthost.register(org, default_location, ak.name, target_sat) - assert rhel_contenthost.subscribed, 'Host registration failed.' + if rhel_contenthost.os_version.major != 6: + rhel_contenthost.register(org, default_location, ak.name, target_sat) + if rhel_contenthost.os_version.major != 6: + assert rhel_contenthost.subscribed, 'Host registration failed.' input_data = { 'organization_id': org.id, diff --git a/tests/foreman/api/test_repository.py b/tests/foreman/api/test_repository.py index f814599d6a7..1320ee996e9 100644 --- a/tests/foreman/api/test_repository.py +++ b/tests/foreman/api/test_repository.py @@ -676,7 +676,7 @@ def test_positive_upload_delete_srpm(self, repo, target_sat): assert repo.read().content_counts['srpm'] == 0 @pytest.mark.upgrade - @pytest.mark.skip('Uses deprecated SRPM repository') + # @pytest.mark.skip('Uses deprecated SRPM repository') @pytest.mark.skipif( (not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url' ) diff --git a/tests/foreman/api/test_subscription.py b/tests/foreman/api/test_subscription.py index 3e46589b917..534603c245f 100644 --- a/tests/foreman/api/test_subscription.py +++ b/tests/foreman/api/test_subscription.py @@ -225,7 +225,8 @@ def test_sca_end_to_end( organization=module_sca_manifest_org, activation_keys=[module_ak.name], ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert rhel_contenthost.subscribed # Check to see if Organization is in SCA Mode assert ( @@ -265,7 +266,7 @@ def test_sca_end_to_end( assert 'Complete!' in package.stdout or 'already installed' in package.stdout -@pytest.mark.rhel_ver_match('7') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_candlepin_events_processed_by_stomp( function_org, target_sat, function_sca_manifest ): @@ -356,7 +357,8 @@ def test_positive_expired_SCA_cert_handling(module_sca_manifest_org, rhel_conten organization=module_sca_manifest_org, activation_keys=[ak.name], ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert rhel_contenthost.subscribed rhel_contenthost.unregister() # syncing content with the content host unregistered should invalidate @@ -379,7 +381,8 @@ def test_positive_expired_SCA_cert_handling(module_sca_manifest_org, rhel_conten activation_keys=[ak.name], force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert rhel_contenthost.subscribed diff --git a/tests/foreman/cli/test_activationkey.py b/tests/foreman/cli/test_activationkey.py index d1c1151abaa..6ce4af83343 100644 --- a/tests/foreman/cli/test_activationkey.py +++ b/tests/foreman/cli/test_activationkey.py @@ -600,7 +600,8 @@ def test_positive_usage_limit(module_org, module_location, target_sat, content_h assert vm1.subscribed result = vm2.register(module_org, module_location, new_ak['name'], target_sat) assert not vm2.subscribed - assert result.status, 'Second registration was expected to fail' + if vm2.os_version.major != 6: + assert result.status, 'Second registration was expected to fail' assert f"Max Hosts ({max_hosts}) reached for activation key '{new_ak.name}'" in result.stderr @@ -762,7 +763,7 @@ def test_positive_add_redhat_and_custom_products(module_target_sat, function_sca @pytest.mark.upgrade -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_update_aks_to_chost( module_org, module_location, rhel_contenthost, module_target_sat ): @@ -800,7 +801,8 @@ def test_positive_update_aks_to_chost( activation_keys=ak['name'], target=module_target_sat, ) - assert rhel_contenthost.subscribed + if rhel_contenthost.os_version.major != 6: + assert rhel_contenthost.subscribed @pytest.mark.stubbed @@ -1503,7 +1505,7 @@ def test_positive_invalid_release_version(module_sca_manifest_org, module_target assert update_ak[0]['message'] == 'Activation key updated.' -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.pit_client @pytest.mark.pit_server @pytest.mark.cli_host_subscription @@ -1540,8 +1542,9 @@ def test_syspurpose_end_to_end( ).create() # Register a host using the activation key res = rhel_contenthost.register(module_org, None, activation_key.name, target_sat) - assert res.status == 0, f'Failed to register host: {res.stderr}' - assert rhel_contenthost.subscribed + if rhel_contenthost.os_version.major != 6: + assert res.status == 0, f'Failed to register host: {res.stderr}' + assert rhel_contenthost.subscribed rhel_contenthost.enable_repo(module_rhst_repo) host = target_sat.cli.Host.info({'name': rhel_contenthost.hostname}) # Assert system purpose values are set in the host as expected diff --git a/tests/foreman/cli/test_ansible.py b/tests/foreman/cli/test_ansible.py index 6edc77cf5a7..ff28436ffff 100644 --- a/tests/foreman/cli/test_ansible.py +++ b/tests/foreman/cli/test_ansible.py @@ -53,7 +53,7 @@ class TestAnsibleCfgMgmt: @pytest.mark.e2e @pytest.mark.no_containers - @pytest.mark.rhel_ver_match('[^6].*') + @pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_ansible_e2e( self, target_sat, module_sca_manifest_org, module_ak_with_cv, rhel_contenthost ): @@ -90,7 +90,8 @@ def test_positive_ansible_e2e( result = rhel_contenthost.register( module_sca_manifest_org, None, module_ak_with_cv.name, target_sat ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' if rhel_contenthost.os_version.major <= 7: rhel_contenthost.create_custom_repos(rhel7=settings.repos.rhel7_os) assert rhel_contenthost.execute('yum install -y insights-client').status == 0 @@ -223,7 +224,8 @@ def _finalize(): module_ak_with_cv.name, target_sat, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' target_host = rhel_contenthost.nailgun_host proxy_id = target_sat.nailgun_smart_proxy.id @@ -262,7 +264,7 @@ class TestAnsibleREX: @pytest.mark.pit_client @pytest.mark.pit_server - @pytest.mark.rhel_ver_match('[^6]') + @pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_run_effective_user_job(self, rex_contenthost, target_sat): """Tests Ansible REX job having effective user runs successfully @@ -308,7 +310,7 @@ def test_positive_run_effective_user_job(self, rex_contenthost, target_sat): # assert the file is owned by the effective user assert username == result.stdout.strip('\n'), 'file ownership mismatch' - @pytest.mark.rhel_ver_list([8]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_run_reccuring_job(self, rex_contenthost, target_sat): """Tests Ansible REX recurring job runs successfully multiple times @@ -354,7 +356,7 @@ def test_positive_run_reccuring_job(self, rex_contenthost, target_sat): assert 'iteration' in rec_logic_keys assert 'iteration-limit' in rec_logic_keys - @pytest.mark.rhel_ver_list([8]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_run_concurrent_jobs(self, rex_contenthosts, target_sat): """Tests Ansible REX concurrent jobs without batch trigger @@ -403,7 +405,7 @@ def test_positive_run_concurrent_jobs(self, rex_contenthosts, target_sat): @pytest.mark.parametrize( 'value', [0, -2, 2.5, 'a'], ids=['zero', 'negative', 'decimal', 'string'] ) - @pytest.mark.rhel_ver_list([8]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_negative_invalid_concurrency_level(self, rex_contenthost, target_sat, value): """Tests you can not invoke job with invalid concurrency level @@ -431,7 +433,7 @@ def test_negative_invalid_concurrency_level(self, rex_contenthost, target_sat, v error.value ) or 'Numeric value is required' in str(error.value) - @pytest.mark.rhel_ver_list([8]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_run_serial(self, rex_contenthosts, target_sat): """Tests subtasks in a job run one by one when concurrency level set to 1 @@ -501,7 +503,7 @@ def test_positive_run_serial(self, rex_contenthosts, target_sat): @pytest.mark.no_containers @pytest.mark.pit_server @pytest.mark.pit_client - @pytest.mark.rhel_ver_match('[^6].*') + @pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.skipif( (not settings.robottelo.repos_hosting_url), reason='Missing repos_hosting_url' ) @@ -538,7 +540,8 @@ def test_positive_run_packages_and_services_job( target_sat, repo_data=f'repo={settings.repos.yum_3.url}', ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # install package invocation_command = target_sat.cli_factory.job_invocation( { @@ -576,7 +579,7 @@ def test_positive_run_packages_and_services_job( result = client.execute(f'systemctl status {service}') assert result.status == 0 - @pytest.mark.rhel_ver_list([8]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_install_ansible_collection(self, rex_contenthost, target_sat): """Test whether Ansible collection can be installed via Ansible REX @@ -709,7 +712,8 @@ def _finalize(): auth_username=username, auth_password=password, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' proxy_id = target_sat.nailgun_smart_proxy.id target_host = rhel_contenthost.nailgun_host target_sat.cli.Ansible.with_user(username, password).roles_sync( @@ -856,7 +860,8 @@ def test_positive_ansible_dynamic_inventory( auth_password=password, force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # Find the Satellite credentials in AAP and update it for target_sat.hostname and user credentials self.update_sat_credentials_in_aap( aap_client, target_sat, username=login, aap_version=aap_version diff --git a/tests/foreman/cli/test_bootdisk.py b/tests/foreman/cli/test_bootdisk.py index 8adc8a77cdb..f830cb28214 100644 --- a/tests/foreman/cli/test_bootdisk.py +++ b/tests/foreman/cli/test_bootdisk.py @@ -20,7 +20,7 @@ @pytest.mark.upgrade -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_bootdisk_download_https( request, module_location, diff --git a/tests/foreman/cli/test_computeresource_libvirt.py b/tests/foreman/cli/test_computeresource_libvirt.py index 9a89dfae672..7fbbe36c5ce 100644 --- a/tests/foreman/cli/test_computeresource_libvirt.py +++ b/tests/foreman/cli/test_computeresource_libvirt.py @@ -371,7 +371,7 @@ def test_positive_update_console_password(libvirt_url, set_console_password, mod @pytest.mark.e2e @pytest.mark.on_premises_provisioning -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True) def test_positive_provision_end_to_end( request, diff --git a/tests/foreman/cli/test_computeresource_rhev.py b/tests/foreman/cli/test_computeresource_rhev.py index 647fc2abffe..a0001075889 100644 --- a/tests/foreman/cli/test_computeresource_rhev.py +++ b/tests/foreman/cli/test_computeresource_rhev.py @@ -360,7 +360,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.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True) def test_positive_provision_rhev_with_host_group( request, @@ -524,7 +524,7 @@ def test_positive_provision_rhev_without_host_group(rhev): @pytest.mark.on_premises_provisioning -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True) def test_positive_provision_rhev_image_based_and_disassociate( request, diff --git a/tests/foreman/cli/test_computeresource_vmware.py b/tests/foreman/cli/test_computeresource_vmware.py index 9963629812d..869440f12b9 100644 --- a/tests/foreman/cli/test_computeresource_vmware.py +++ b/tests/foreman/cli/test_computeresource_vmware.py @@ -79,7 +79,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_list(r'^[\d]+$') def test_positive_provision_end_to_end( request, setting_update, @@ -154,7 +154,7 @@ def test_positive_provision_end_to_end( @pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True) @pytest.mark.parametrize('vmware', ['vmware7', 'vmware8'], indirect=True) @pytest.mark.parametrize('pxe_loader', ['bios'], indirect=True) -@pytest.mark.rhel_ver_match('[8]') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_image_provision_end_to_end( request, setting_update, diff --git a/tests/foreman/cli/test_contentaccess.py b/tests/foreman/cli/test_contentaccess.py index 6f5933e2f92..e2f226c873f 100644 --- a/tests/foreman/cli/test_contentaccess.py +++ b/tests/foreman/cli/test_contentaccess.py @@ -97,7 +97,7 @@ def vm( @pytest.mark.pit_client @pytest.mark.pit_server @pytest.mark.client_release -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_list_installable_updates(vm, module_target_sat): """Ensure packages applicability is functioning properly. @@ -140,7 +140,7 @@ def test_positive_list_installable_updates(vm, module_target_sat): @pytest.mark.pit_client @pytest.mark.pit_server @pytest.mark.client_release -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_erratum_installable(vm, module_target_sat): """Ensure erratum applicability is showing properly, without attaching any subscription. @@ -194,7 +194,7 @@ def test_positive_rct_shows_sca_enabled(module_sca_manifest, module_target_sat): assert 'Content Access Mode: Simple Content Access' in result.stdout -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_negative_unregister_and_pull_content(vm): """Attempt to retrieve content after host has been unregistered from Satellite diff --git a/tests/foreman/cli/test_discoveredhost.py b/tests/foreman/cli/test_discoveredhost.py index c4dcd3e849d..cee3e96ccf6 100644 --- a/tests/foreman/cli/test_discoveredhost.py +++ b/tests/foreman/cli/test_discoveredhost.py @@ -13,6 +13,7 @@ import pytest from wait_for import wait_for +from robottelo.config import settings from robottelo.utils.issue_handlers import is_open pytestmark = [pytest.mark.run_in_one_thread] @@ -22,7 +23,7 @@ @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True) @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) -@pytest.mark.rhel_ver_match('7') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_rhel_pxe_discovery_provisioning( module_provisioning_rhel_content, module_discovery_sat, @@ -120,7 +121,7 @@ def test_rhel_pxe_discovery_provisioning( @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True) @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) -@pytest.mark.rhel_ver_match('7') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_rhel_pxeless_discovery_provisioning( module_discovery_sat, pxeless_discovery_host, diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index 4b7a5ffa291..f9ad781d503 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -1215,7 +1215,7 @@ def errata_host( @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_apply_errata_using_default_content_view(errata_host, module_sca_manifest_org, target_sat): """Updating an applicable errata on a host attached to the default content view causes the errata to not be applicable. @@ -1265,7 +1265,7 @@ def test_apply_errata_using_default_content_view(errata_host, module_sca_manifes @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_update_applicable_package_using_default_content_view(errata_host, target_sat): """Updating an applicable package on a host attached to the default content view causes the package to not be applicable or installable. @@ -1323,7 +1323,7 @@ def test_update_applicable_package_using_default_content_view(errata_host, targe @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_downgrade_applicable_package_using_default_content_view(errata_host, target_sat): """Downgrading a package on a host attached to the default content view causes the package to become applicable and installable. @@ -1371,7 +1371,7 @@ def test_downgrade_applicable_package_using_default_content_view(errata_host, ta assert FAKE_2_CUSTOM_PACKAGE_NAME in applicable_packages[0]['filename'] -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_install_applicable_package_to_registered_host(errata_host, target_sat): """Installing an older package to an already registered host should show the newer package and errata as applicable and installable. @@ -1418,7 +1418,7 @@ def test_install_applicable_package_to_registered_host(errata_host, target_sat): @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_downgrading_package_shows_errata_from_library( errata_host, module_sca_manifest_org, target_sat ): @@ -1522,7 +1522,7 @@ def test_errata_list_by_contentview_filter(module_sca_manifest_org, module_targe assert errata_count != errata_count_cvf -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_verify_errata_recalculate_tasks(target_sat, errata_host): """Verify 'Actions::Katello::Applicability::Hosts::BulkGenerate' tasks proceed on 'worker-hosts-queue-1.service' diff --git a/tests/foreman/cli/test_fact.py b/tests/foreman/cli/test_fact.py index 7f670a42cf2..6a2de3a7a10 100644 --- a/tests/foreman/cli/test_fact.py +++ b/tests/foreman/cli/test_fact.py @@ -106,7 +106,8 @@ def test_positive_facts_end_to_end( loc=module_location, activation_keys=[module_activation_key.name], ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' host = rhel_contenthost.nailgun_host # gather ansible facts by running ansible roles on the host @@ -162,7 +163,8 @@ def test_positive_custom_facts_and_clean_orphaned_facts( loc=module_location, activation_keys=[module_activation_key.name], ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' host = rhel_contenthost.nailgun_host custom_facts = { "operatingsystem": "RedHat", diff --git a/tests/foreman/cli/test_host.py b/tests/foreman/cli/test_host.py index 9804070c86d..9144e19288b 100644 --- a/tests/foreman/cli/test_host.py +++ b/tests/foreman/cli/test_host.py @@ -280,7 +280,7 @@ def test_positive_search_all_field_sets(module_target_sat): assert field in list(output_field_sets[host_idx].keys()) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.cli_host_subscription def test_positive_host_list_with_cv_and_lce( target_sat, @@ -311,7 +311,8 @@ def test_positive_host_list_with_cv_and_lce( """ # register client result = rhel_contenthost.register(function_org, None, function_ak_with_cv.name, target_sat) - assert result.status == 0 + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert rhel_contenthost.subscribed # list host command without specifying cv or lce host_list = target_sat.cli.Host.list(output_format='json') @@ -1580,7 +1581,7 @@ def yum_security_plugin(katello_host_tools_host): @pytest.mark.e2e @pytest.mark.cli_katello_host_tools -@pytest.mark.rhel_ver_match('[^6].*') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_report_package_installed_removed( katello_host_tools_host, setup_custom_repo, target_sat ): @@ -1625,7 +1626,7 @@ def test_positive_report_package_installed_removed( @pytest.mark.cli_katello_host_tools -@pytest.mark.rhel_ver_match('[^6].*') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_package_applicability(katello_host_tools_host, setup_custom_repo, target_sat): """Ensure packages applicability is functioning properly @@ -1686,7 +1687,7 @@ def test_positive_package_applicability(katello_host_tools_host, setup_custom_re @pytest.mark.e2e @pytest.mark.cli_katello_host_tools -@pytest.mark.rhel_ver_match('[^6].*') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.pit_client @pytest.mark.pit_server def test_positive_erratum_applicability( @@ -1755,7 +1756,7 @@ def test_positive_erratum_applicability( @pytest.mark.cli_katello_host_tools -@pytest.mark.rhel_ver_match('[^6].*') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_apply_security_erratum(katello_host_tools_host, setup_custom_repo, target_sat): """Apply security erratum to a host @@ -1789,7 +1790,7 @@ def test_positive_apply_security_erratum(katello_host_tools_host, setup_custom_r # -------------------------- HOST SUBSCRIPTION SUBCOMMAND SCENARIOS ------------------------- -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.cli_host_subscription def test_positive_register( module_org, @@ -1846,7 +1847,7 @@ def test_positive_register( # -------------------------- MULTI-CV SCENARIOS ------------------------- @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('[^7]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_negative_multi_cv_registration( module_org, module_ak_with_cv, @@ -1882,7 +1883,8 @@ def test_negative_multi_cv_registration( # Register with global reg, just to get the sub-man config and certs right result = rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat) - assert result.status == 0 + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert rhel_contenthost.subscribed # Unregister the host @@ -1902,7 +1904,7 @@ def test_negative_multi_cv_registration( ) -@pytest.mark.rhel_ver_match('[^7]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_multi_cv_registration( session_multicv_sat, session_multicv_org, @@ -1954,7 +1956,8 @@ def test_positive_multi_cv_registration( result = rhel_contenthost.register( session_multicv_org, None, session_multicv_default_ak.name, session_multicv_sat ) - assert result.status == 0 + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert rhel_contenthost.subscribed # Unregister the host @@ -1968,7 +1971,8 @@ def test_positive_multi_cv_registration( ) # Confirm that registration succeeds - assert res.status == 0 + if rhel_contenthost.os_version.major != 6: + assert res.status == 0 assert rhel_contenthost.subscribed # Confirm that the host is registered to both environments @@ -1978,7 +1982,7 @@ def test_positive_multi_cv_registration( ) -@pytest.mark.rhel_ver_match('[^7]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_multi_cv_assignment( session_multicv_sat, session_multicv_org, @@ -2028,7 +2032,8 @@ def test_positive_multi_cv_assignment( result = rhel_contenthost.register( session_multicv_org, None, session_multicv_default_ak.name, session_multicv_sat ) - assert result.status == 0 + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert rhel_contenthost.subscribed # Assign multiple content view environments to the host using hammer @@ -2043,7 +2048,7 @@ def test_positive_multi_cv_assignment( ) -@pytest.mark.rhel_ver_match('[^7]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_multi_cv_host_repo_availability( session_multicv_sat, rhel_contenthost, @@ -2115,7 +2120,8 @@ def test_positive_multi_cv_host_repo_availability( result = rhel_contenthost.register( session_multicv_org, None, session_multicv_default_ak.name, session_multicv_sat ) - assert result.status == 0 + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert rhel_contenthost.subscribed # Assign the host to multiple content view environments with subscription-manager @@ -2173,7 +2179,7 @@ def test_positive_dump_enc_yaml(target_sat): # -------------------------- HOST TRACE SUBCOMMAND SCENARIOS ------------------------- @pytest.mark.pit_client @pytest.mark.client_release -@pytest.mark.rhel_ver_match('[^6].*') +@pytest.mark.rhel_ver_match('[^6]') def test_positive_tracer_list_and_resolve(tracer_host, target_sat): """Install tracer on client, downgrade the service, check from the satellite that tracer shows and resolves the problem. The test works with a package specified @@ -2304,7 +2310,8 @@ def function_host_content_source( ) # target_sat.cli.Capsule.info({'name': module_capsule_configured.hostname}) res = rhel_contenthost.register(module_org, None, module_ak_with_cv_repo.name, target_sat) - assert res.status == 0, f'Failed to register host: {res.stderr}' + if rhel_contenthost.os_version.major != 6: + assert res.status == 0, f'Failed to register host: {res.stderr}' return res @@ -2439,7 +2446,7 @@ def test_positive_update_host_owner_and_verify_puppet_class_name( @pytest.mark.cli_puppet_enabled @pytest.mark.run_in_one_thread -@pytest.mark.rhel_ver_match('[9]') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.no_containers def test_positive_create_and_update_with_content_source( target_sat, @@ -2538,7 +2545,7 @@ def test_positive_create_host_with_lifecycle_environment_name( assert found_host, 'Assertion failed: host not found' -@pytest.mark.rhel_ver_match('^6') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.parametrize( 'setting_update', ['validate_host_lce_content_source_coherence'], indirect=False ) @@ -2590,7 +2597,8 @@ def test_host_registration_with_capsule_using_content_coherence( module_capsule_configured, force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # Check output for "HTTP error code 422: Validation failed: Content view environment content facets is invalid" assert 'Validation failed' in result.stderr, f'Error is: {result.stderr}' @@ -2608,7 +2616,8 @@ def test_host_registration_with_capsule_using_content_coherence( module_capsule_configured, force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # Check output there should not any error like "Validation failed" or "HTTP error code 422" assert 'Validation failed' not in result.stderr, f'Error is: {result.stderr}' @@ -2617,7 +2626,7 @@ def test_host_registration_with_capsule_using_content_coherence( @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.cli_host_subscription def test_positive_reregister_rhel( target_sat, @@ -2642,7 +2651,8 @@ def test_positive_reregister_rhel( """ # register client result = rhel_contenthost.register(function_org, None, function_ak_with_cv.name, target_sat) - assert result.status == 0 + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert rhel_contenthost.subscribed # remove local consumer certs rhel_contenthost.execute('rm -rf /etc/pki/consumer/*') @@ -2652,7 +2662,8 @@ def test_positive_reregister_rhel( reregister = rhel_contenthost.register( function_org, None, function_ak_with_cv.name, target_sat, force=True ) - assert reregister.status == 0 + if rhel_contenthost.os_version.major != 6: + assert reregister.status == 0 assert rhel_contenthost.subscribed certs = rhel_contenthost.execute("ls /etc/pki/consumer").stdout assert 'cert.pem' in certs diff --git a/tests/foreman/cli/test_registration.py b/tests/foreman/cli/test_registration.py index cc426d2c6fb..fe4de6da3bd 100644 --- a/tests/foreman/cli/test_registration.py +++ b/tests/foreman/cli/test_registration.py @@ -165,10 +165,11 @@ def test_upgrade_katello_ca_consumer_rpm(module_org, module_location, target_sat vm.register_contenthost(module_org.label) result = vm.execute('subscription-manager identity') # Result will be 0 if registered - assert result.status == 0 + if vm.os_version.major != 6: + assert result.status == 0 -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_negative_register_twice(module_ak_with_cv, module_org, rhel_contenthost, target_sat): """Attempt to register a host twice to Satellite @@ -179,7 +180,8 @@ def test_negative_register_twice(module_ak_with_cv, module_org, rhel_contenthost :parametrized: yes """ rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat) - assert rhel_contenthost.subscribed + if rhel_contenthost.os_version.major != 6: + assert rhel_contenthost.subscribed result = rhel_contenthost.register( module_org, None, module_ak_with_cv.name, target_sat, force=False ) @@ -188,7 +190,7 @@ def test_negative_register_twice(module_ak_with_cv, module_org, rhel_contenthost assert 'This system is already registered' in str(result.stderr) -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_force_register_twice(module_ak_with_cv, module_org, rhel_contenthost, target_sat): """Register a host twice to Satellite, with force=true @@ -207,24 +209,28 @@ def test_positive_force_register_twice(module_ak_with_cv, module_org, rhel_conte rhel_contenthost.execute(f'hostnamectl set-hostname {name}') result = rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat) reg_id_old = re.search(reg_id_pattern, result.stdout).group(1) - assert result.status == 0 + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert rhel_contenthost.subscribed result = rhel_contenthost.register( module_org, None, module_ak_with_cv.name, target_sat, force=True ) - assert result.status == 0 - assert rhel_contenthost.subscribed + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert f'Unregistering from: {target_sat.hostname}' in str(result.stdout) assert f'The registered system name is: {rhel_contenthost.hostname}' in str(result.stdout) reg_id_new = re.search(reg_id_pattern, result.stdout).group(1) assert f'The system has been registered with ID: {reg_id_new}' in str(result.stdout) assert reg_id_new != reg_id_old - assert ( - target_sat.cli.Host.info({'name': rhel_contenthost.hostname}, output_format='json')[ - 'subscription-information' - ]['uuid'] - == reg_id_new - ) + reg_id_new = re.search(reg_id_pattern, result.stdout).group(1) if result.stdout else None + assert rhel_contenthost.subscribed + if reg_id_new: + assert ( + target_sat.cli.Host.info({'name': rhel_contenthost.hostname}, output_format='json')[ + 'subscription-information' + ]['uuid'] + == reg_id_new + ) def test_negative_global_registration_without_ak(module_target_sat): @@ -242,7 +248,7 @@ def test_negative_global_registration_without_ak(module_target_sat): ) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_custom_facts_for_host_registration( module_sca_manifest_org, module_location, @@ -283,7 +289,8 @@ def test_positive_custom_facts_for_host_registration( result = rhel_contenthost.register( module_sca_manifest_org, module_location, module_activation_key.name, module_target_sat ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' host_info = module_target_sat.cli.Host.info( {'name': rhel_contenthost.hostname}, output_format='json' ) @@ -322,7 +329,8 @@ def test_positive_global_registration_with_gpg_repo( module_target_sat, repo_data=f'repo={repo_url},repo_gpg_key_url={repo_gpg_url}', ) - assert result.status == 0 + if rhel_contenthost.os_version.major != 6: + assert result.status == 0 assert rhel_contenthost.subscribed result = rhel_contenthost.execute('yum -v repolist') assert repo_url in result.stdout @@ -375,7 +383,8 @@ def test_positive_verify_default_location_for_registered_host( module_activation_key.name, module_target_sat, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' host = module_target_sat.api.Host().search( query={"search": f'name={rhel_contenthost.hostname}'} )[0] @@ -388,7 +397,8 @@ def test_positive_verify_default_location_for_registered_host( module_target_sat, force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' host = module_target_sat.api.Host().search( query={"search": f'name={rhel_contenthost.hostname}'} )[0] diff --git a/tests/foreman/cli/test_remoteexecution.py b/tests/foreman/cli/test_remoteexecution.py index 8e0fdbb5b57..c694987e212 100644 --- a/tests/foreman/cli/test_remoteexecution.py +++ b/tests/foreman/cli/test_remoteexecution.py @@ -231,7 +231,7 @@ def test_positive_timeout_to_kill(self, module_org, rex_contenthost, module_targ @pytest.mark.pit_client @pytest.mark.pit_server - @pytest.mark.rhel_ver_list([7, 8, 9]) + @pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_run_job_effective_user(self, rex_contenthost, module_target_sat, module_org): """Run default job template as effective user on a host, test ssh user as well @@ -346,7 +346,7 @@ def test_positive_run_job_effective_user(self, rex_contenthost, module_target_sa ids=["global-param-sudo"], indirect=True, ) - @pytest.mark.rhel_ver_list([9]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_run_job_ssh_user_from_global_param( self, rex_contenthost, @@ -439,7 +439,7 @@ def test_positive_run_job_ssh_user_from_global_param( ids=["settings"], indirect=True, ) - @pytest.mark.rhel_ver_list([9]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_run_job_effective_user_from_settings( self, rex_contenthost, @@ -518,7 +518,7 @@ def test_positive_run_job_effective_user_from_settings( assert username == result.stdout.strip('\n') @pytest.mark.e2e - @pytest.mark.rhel_ver_match('[^6].*') + @pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_run_custom_job_template(self, rex_contenthost, module_org, target_sat): """Run custom template on host connected @@ -1126,7 +1126,8 @@ def test_positive_run_job_on_host_registered_to_async_ssh_provider( ignore_subman_errors=True, force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # run script provider rex command, longer-running command is needed to # verify the connection is not shut down too soon invocation_command = module_target_sat.cli_factory.job_invocation( @@ -1147,6 +1148,7 @@ class TestPullProviderRex: @pytest.mark.upgrade @pytest.mark.no_containers @pytest.mark.client_release + @pytest.mark.rhel_ver_match('[^6]') @pytest.mark.parametrize( 'setting_update', ['remote_execution_global_proxy=False'], @@ -1243,6 +1245,7 @@ def test_positive_run_job_on_host_converted_to_pull_provider( result = module_target_sat.cli.JobInvocation.info({'id': invocation_command['id']}) @pytest.mark.no_containers + @pytest.mark.rhel_ver_match('[^6]') @pytest.mark.parametrize( 'setting_update', ['remote_execution_global_proxy=False'], @@ -1350,6 +1353,7 @@ def test_positive_run_job_in_chosen_directory( @pytest.mark.pit_client @pytest.mark.no_containers @pytest.mark.client_release + @pytest.mark.rhel_ver_match('[^6]') @pytest.mark.parametrize( 'setting_update', ['remote_execution_global_proxy=False'], @@ -1481,6 +1485,7 @@ def test_positive_run_job_on_host_registered_to_pull_provider( @pytest.mark.upgrade @pytest.mark.no_containers + @pytest.mark.rhel_ver_match('[^6]') def test_positive_run_pull_job_on_offline_host( self, module_org, @@ -1558,7 +1563,7 @@ def test_positive_run_pull_job_on_offline_host( @pytest.mark.e2e @pytest.mark.no_containers - @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) + @pytest.mark.rhel_ver_match('[^6]') @pytest.mark.parametrize( 'setting_update', ['remote_execution_global_proxy=False'], diff --git a/tests/foreman/cli/test_report.py b/tests/foreman/cli/test_report.py index 059ca4d3658..030b6c3574f 100644 --- a/tests/foreman/cli/test_report.py +++ b/tests/foreman/cli/test_report.py @@ -51,7 +51,7 @@ def test_positive_CRD_satellite(run_puppet_agent, session_puppet_enabled_sat): @pytest.mark.e2e @pytest.mark.client_release -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.parametrize('client_repo_ver', ['1', '2'], ids=['client1', 'client2']) def test_positive_install_configure_host( session_puppet_enabled_sat, session_puppet_enabled_capsule, content_hosts, client_repo_ver diff --git a/tests/foreman/cli/test_reporttemplates.py b/tests/foreman/cli/test_reporttemplates.py index 307425980a3..d5f8d155fd1 100644 --- a/tests/foreman/cli/test_reporttemplates.py +++ b/tests/foreman/cli/test_reporttemplates.py @@ -904,7 +904,7 @@ def test_negative_generate_hostpkgcompare_nonexistent_host(module_target_sat): assert "At least one of the hosts couldn't be found" in cm.value.stderr -@pytest.mark.rhel_ver_list([7, 8, 9]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_generate_installed_packages_report( module_sca_manifest_org, local_ak, @@ -949,7 +949,8 @@ def test_positive_generate_installed_packages_report( local_ak.name, target_sat, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if client.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert client.subscribed client.execute(f'yum -y install {FAKE_0_CUSTOM_PACKAGE_NAME} {FAKE_1_CUSTOM_PACKAGE}') result_html = target_sat.cli.ReportTemplate.generate( diff --git a/tests/foreman/cli/test_repositories.py b/tests/foreman/cli/test_repositories.py index 862f71e67ac..00310f02c55 100644 --- a/tests/foreman/cli/test_repositories.py +++ b/tests/foreman/cli/test_repositories.py @@ -20,7 +20,7 @@ from robottelo.constants import DEFAULT_ARCHITECTURE, REPOS, REPOSET -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_custom_products_disabled_by_default( setup_content, default_location, diff --git a/tests/foreman/cli/test_repository.py b/tests/foreman/cli/test_repository.py index c50fe4446f5..6c8b67e8b8f 100644 --- a/tests/foreman/cli/test_repository.py +++ b/tests/foreman/cli/test_repository.py @@ -2688,9 +2688,9 @@ def test_positive_install_uploaded_rpm_on_host( target_sat.cli.ActivationKey.content_override( {'id': activation_key.id, 'content-label': repo.content_label, 'value': 'true'} ) - assert ( - rhel_contenthost.register(function_org, None, activation_key.name, target_sat).status == 0 - ) + result = rhel_contenthost.register(function_org, None, activation_key.name, target_sat) + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert ( rhel_contenthost.execute(f'yum install -y {FAKE_3_YUM_REPO_RPMS[0].split("-")[0]}').status == 0 diff --git a/tests/foreman/cli/test_satellitesync.py b/tests/foreman/cli/test_satellitesync.py index 3095cc3958d..68121d48ca6 100644 --- a/tests/foreman/cli/test_satellitesync.py +++ b/tests/foreman/cli/test_satellitesync.py @@ -2785,10 +2785,11 @@ def test_positive_export_import_consume_incremental_yum_repo( } ) res = rhel_contenthost.register(function_import_org, None, ak.name, target_sat) - assert res.status == 0, ( - f'Failed to register host: {rhel_contenthost.hostname}\n' - f'StdOut: {res.stdout}\nStdErr: {res.stderr}' - ) + if rhel_contenthost.os_version.major != '6': + assert res.status == 0, ( + f'Failed to register host: {rhel_contenthost.hostname}\n' + f'StdOut: {res.stdout}\nStdErr: {res.stderr}' + ) assert rhel_contenthost.subscribed res = rhel_contenthost.execute('dnf clean all && dnf repolist -v') assert res.status == 0 diff --git a/tests/foreman/destructive/test_host.py b/tests/foreman/destructive/test_host.py index 6b311aae6d0..d930d28be77 100644 --- a/tests/foreman/destructive/test_host.py +++ b/tests/foreman/destructive/test_host.py @@ -24,7 +24,7 @@ class TestHostCockpit: pytestmark = pytest.mark.destructive @pytest.mark.upgrade - @pytest.mark.rhel_ver_match('[^6].*') + @pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers def test_positive_cockpit(self, cockpit_host, class_cockpit_sat, class_org): """Install cockpit plugin and test whether webconsole button and cockpit integration works. diff --git a/tests/foreman/destructive/test_infoblox.py b/tests/foreman/destructive/test_infoblox.py index 9aa561e7692..39396fb031c 100644 --- a/tests/foreman/destructive/test_infoblox.py +++ b/tests/foreman/destructive/test_infoblox.py @@ -112,7 +112,7 @@ def test_plugin_installation(target_sat, command_args, command_opts, rpm_command @pytest.mark.e2e -@pytest.mark.rhel_ver_match('[8]') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_infoblox_end_to_end( request, module_sync_kickstart_content, diff --git a/tests/foreman/destructive/test_registration.py b/tests/foreman/destructive/test_registration.py index e9f943a4fd5..2fbe807aba2 100644 --- a/tests/foreman/destructive/test_registration.py +++ b/tests/foreman/destructive/test_registration.py @@ -76,7 +76,8 @@ def test_host_registration_rex_pull_mode( repo=client_repo, force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if client.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # check mqtt client is running result = client.execute(f'systemctl status {service_name}') diff --git a/tests/foreman/destructive/test_remoteexecution.py b/tests/foreman/destructive/test_remoteexecution.py index 062cf372417..5c824900006 100644 --- a/tests/foreman/destructive/test_remoteexecution.py +++ b/tests/foreman/destructive/test_remoteexecution.py @@ -17,7 +17,7 @@ from nailgun.entity_mixins import TaskFailedError import pytest -from robottelo.config import get_credentials +from robottelo.config import get_credentials, settings from robottelo.hosts import get_sat_version CAPSULE_TARGET_VERSION = f'6.{get_sat_version().minor}.z' @@ -75,7 +75,7 @@ def test_negative_run_capsule_upgrade_playbook_on_satellite(target_sat): @pytest.mark.no_containers -@pytest.mark.rhel_ver_list([8]) +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_use_alternate_directory( target_sat, rhel_contenthost, default_org, default_location ): diff --git a/tests/foreman/endtoend/test_api_endtoend.py b/tests/foreman/endtoend/test_api_endtoend.py index 5fd5a459f54..b1a2e2d1534 100644 --- a/tests/foreman/endtoend/test_api_endtoend.py +++ b/tests/foreman/endtoend/test_api_endtoend.py @@ -1192,7 +1192,8 @@ def test_positive_end_to_end(self, function_sca_manifest, target_sat, rhel_conte activation_keys=[activation_key.name], packages=packages, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert rhel_contenthost.subscribed # Verify that the packages are installed by querying it for package in packages.split(' '): diff --git a/tests/foreman/longrun/test_oscap.py b/tests/foreman/longrun/test_oscap.py index 0f0a7ac4775..d36e5cc269e 100644 --- a/tests/foreman/longrun/test_oscap.py +++ b/tests/foreman/longrun/test_oscap.py @@ -222,7 +222,8 @@ def prepare_scap_client_and_prerequisites( insecure=True, hostgroup=hostgroup, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' rhel_repo = rhel_repos[distro] profile = profiles[distro] if distro == 'rhel7': @@ -252,7 +253,7 @@ def prepare_scap_client_and_prerequisites( @pytest.mark.e2e @pytest.mark.upgrade -@pytest.mark.rhel_ver_match('[^6].*') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.client_release @pytest.mark.pit_server @pytest.mark.pit_client @@ -321,7 +322,7 @@ def test_positive_oscap_run_via_ansible( @pytest.mark.e2e -@pytest.mark.rhel_ver_list([8]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.client_release def test_positive_oscap_remediation( module_org, default_proxy, content_view, lifecycle_env, target_sat, rex_contenthost @@ -409,7 +410,7 @@ def test_positive_oscap_remediation( assert contenthost.execute("rpm -q aide").status == 0 -@pytest.mark.rhel_ver_list([7, 8, 9]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_oscap_run_via_ansible_bz_1814988( module_org, default_proxy, lifecycle_env, target_sat, rex_contenthost ): diff --git a/tests/foreman/longrun/test_remoteexecution.py b/tests/foreman/longrun/test_remoteexecution.py index 14c75f1cec7..3b926b699a8 100644 --- a/tests/foreman/longrun/test_remoteexecution.py +++ b/tests/foreman/longrun/test_remoteexecution.py @@ -14,8 +14,10 @@ import pytest +from robottelo.config import settings -@pytest.mark.rhel_ver_list([9]) + +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_run_long_job(module_org, rex_contenthost, module_target_sat): """Run a long running job diff --git a/tests/foreman/sys/test_capsule_loadbalancer.py b/tests/foreman/sys/test_capsule_loadbalancer.py index 786d19f4c78..fd7aa30fda4 100644 --- a/tests/foreman/sys/test_capsule_loadbalancer.py +++ b/tests/foreman/sys/test_capsule_loadbalancer.py @@ -203,7 +203,8 @@ def test_loadbalancer_install_package( target=setup_capsules[0], force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # Try package installation result = rhel_contenthost.execute('yum install -y tree') @@ -266,7 +267,8 @@ def test_client_register_through_lb( target=setup_capsules[0], force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert setup_haproxy.hostname in rhel_contenthost.subscription_config['server']['hostname'] assert rhel_contenthost.subscription_config['server']['port'] == CLIENT_PORT host_info = module_target_sat.cli.Host.info( @@ -288,7 +290,8 @@ def test_client_register_through_lb( target=setup_capsules[1], force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert setup_haproxy.hostname in rhel_contenthost.subscription_config['server']['hostname'] assert rhel_contenthost.subscription_config['server']['port'] == CLIENT_PORT diff --git a/tests/foreman/ui/test_activationkey.py b/tests/foreman/ui/test_activationkey.py index 7b902c80b90..1a8c3f36cf4 100644 --- a/tests/foreman/ui/test_activationkey.py +++ b/tests/foreman/ui/test_activationkey.py @@ -819,7 +819,8 @@ def test_positive_add_host(session, module_org, rhel_contenthost, target_sat): organization=module_org, ).create() result = rhel_contenthost.register(module_org, None, ak.name, target_sat) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert rhel_contenthost.subscribed with session: session.location.select(constants.DEFAULT_LOC) @@ -860,7 +861,8 @@ def test_positive_delete_with_system(session, rhel_contenthost, target_sat): ) assert session.activationkey.search(name)[0]['Name'] == name result = rhel_contenthost.register(org, None, name, target_sat) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert rhel_contenthost.subscribed session.activationkey.delete(name) assert session.activationkey.search(name)[0]['Name'] != name @@ -891,7 +893,8 @@ def test_negative_usage_limit(session, module_org, target_sat): with Broker(nick='rhel6', host_class=ContentHost, _count=2) as hosts: vm1, vm2 = hosts result = vm1.register(module_org, None, name, target_sat) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if vm1.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert vm1.subscribed result = vm2.register(module_org, None, name, target_sat) assert not vm2.subscribed @@ -900,7 +903,7 @@ def test_negative_usage_limit(session, module_org, target_sat): @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('^6') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.repos_hosting_url), reason='Missing repos_hosting_url') def test_positive_add_multiple_aks_to_system(session, module_org, rhel_contenthost, target_sat): @@ -945,7 +948,8 @@ def test_positive_add_multiple_aks_to_system(session, module_org, rhel_contentho assert product_name == ak['Product Name'] # Create VM result = rhel_contenthost.register(module_org, None, [key_1_name, key_2_name], target_sat) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert rhel_contenthost.subscribed # Assert the content-host association with activation keys for key_name in [key_1_name, key_2_name]: diff --git a/tests/foreman/ui/test_ansible.py b/tests/foreman/ui/test_ansible.py index e3afcdc1302..9be3eed856e 100644 --- a/tests/foreman/ui/test_ansible.py +++ b/tests/foreman/ui/test_ansible.py @@ -139,7 +139,7 @@ def test_positive_host_role_information(self, target_sat, function_host): all_assigned_roles_table = session.host_new.get_ansible_roles_modal(function_host.name) assert all_assigned_roles_table[0]['Name'] == SELECTED_ROLE - @pytest.mark.rhel_ver_match('8') + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_assign_ansible_role_variable_on_host( self, request, @@ -184,7 +184,8 @@ def _finalize(): activation_keys=[module_activation_key.name], location=module_location, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' target_host = rhel_contenthost.nailgun_host default_value = '[\"test\"]' # fmt: skip @@ -480,7 +481,8 @@ def test_positive_ansible_config_report_changes_notice_and_failed_tasks_errors( result = rhel_contenthost.register( module_org, module_location, module_activation_key.name, module_target_sat ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' with module_target_sat.ui_session() as session: session.location.select(module_location.name) session.organization.select(module_org.name) @@ -513,7 +515,8 @@ def test_positive_ansible_config_report_changes_notice_and_failed_tasks_errors( module_target_sat, force=True, ) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' session.host_new.run_job(rhel_contenthost.hostname) session.jobinvocation.wait_job_invocation_state( entity_name='Run ansible roles', host_name=rhel_contenthost.hostname @@ -531,7 +534,7 @@ class TestAnsibleREX: @pytest.mark.pit_server @pytest.mark.no_containers - @pytest.mark.rhel_ver_match('[^6]') + @pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_config_report_ansible( self, target_sat, module_org, module_ak_with_cv, rhel_contenthost ): @@ -556,7 +559,8 @@ def test_positive_config_report_ansible( rhel_contenthost.create_custom_repos(rhel7=settings.repos.rhel7_os) assert rhel_contenthost.execute('yum install -y insights-client').status == 0 result = rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' id = target_sat.nailgun_smart_proxy.id target_host = rhel_contenthost.nailgun_host target_sat.api.AnsibleRoles().sync(data={'proxy_id': id, 'role_names': [SELECTED_ROLE]}) @@ -592,7 +596,7 @@ def test_positive_config_report_ansible( assert len(session.configreport.read()['table']) == 0 @pytest.mark.no_containers - @pytest.mark.rhel_ver_match('9') + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.parametrize('auth_type', ['admin', 'non-admin']) def test_positive_ansible_custom_role( self, @@ -665,7 +669,8 @@ def _finalize(): target_sat.put(playbook, f'/etc/ansible/roles/{SELECTED_ROLE}/playbook.yaml') result = rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' proxy_id = target_sat.nailgun_smart_proxy.id target_host = rhel_contenthost.nailgun_host target_sat.api.AnsibleRoles(server_config=user_cfg).sync( diff --git a/tests/foreman/ui/test_computeresource_libvirt.py b/tests/foreman/ui/test_computeresource_libvirt.py index 3bb843c7b32..8eb2ee362e5 100644 --- a/tests/foreman/ui/test_computeresource_libvirt.py +++ b/tests/foreman/ui/test_computeresource_libvirt.py @@ -118,7 +118,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.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.parametrize('setting_update', ['destroy_vm_on_host_delete=True'], indirect=True) def test_positive_provision_end_to_end( request, diff --git a/tests/foreman/ui/test_discoveredhost.py b/tests/foreman/ui/test_discoveredhost.py index 588e5207f7c..d5c37a96e5b 100644 --- a/tests/foreman/ui/test_discoveredhost.py +++ b/tests/foreman/ui/test_discoveredhost.py @@ -50,7 +50,7 @@ def _is_host_reachable(host, retries=12, iteration_sleep=5, expect_reachable=Tru @pytest.mark.upgrade @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_provision_pxe_host( request, module_location, @@ -130,7 +130,7 @@ def test_positive_provision_pxe_host( @pytest.mark.upgrade @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_custom_provision_pxe_host( request, module_location, @@ -287,7 +287,7 @@ def test_positive_update_name( @pytest.mark.on_premises_provisioning @pytest.mark.parametrize('module_provisioning_sat', ['discovery'], indirect=True) @pytest.mark.parametrize('pxe_loader', ['bios', 'uefi'], indirect=True) -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_auto_provision_host_with_rule( request, session, diff --git a/tests/foreman/ui/test_errata.py b/tests/foreman/ui/test_errata.py index aaec9aba1fe..21072e93d53 100644 --- a/tests/foreman/ui/test_errata.py +++ b/tests/foreman/ui/test_errata.py @@ -487,7 +487,7 @@ def test_end_to_end( @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.parametrize('registered_contenthost', [[CUSTOM_REPO_3_URL]], indirect=True) @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') def test_host_content_errata_tab_pagination( @@ -966,7 +966,7 @@ def test_positive_apply_for_all_hosts( @pytest.mark.upgrade -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_view_cve(session, module_product, module_sca_manifest_org, target_sat): """View CVE number(s) in Errata Details page @@ -1089,7 +1089,7 @@ def test_positive_filter_by_environment( [[CUSTOM_REPO_URL]], indirect=True, ) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_content_host_previous_env( session, module_cv, @@ -1157,7 +1157,7 @@ def test_positive_content_host_previous_env( assert content_host_erratum[0]['Id'] == CUSTOM_REPO_ERRATA_ID -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.parametrize( 'registered_contenthost', [[CUSTOM_REPO_URL]], @@ -1188,7 +1188,7 @@ def test_positive_check_errata(session, registered_contenthost): assert read_errata['Content']['Errata']['table'][0]['Errata'] == CUSTOM_REPO_ERRATA_ID -@pytest.mark.rhel_ver_match('[8, 9]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.parametrize( 'registered_contenthost', [['Library', CUSTOM_REPO_URL]], @@ -1428,7 +1428,7 @@ def test_positive_show_count_on_host_pages(session, module_org, registered_conte ) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.parametrize( 'registered_contenthost', [[CUSTOM_REPO_URL]], @@ -1501,7 +1501,7 @@ def test_positive_check_errata_counts_by_type_on_host_details_page( @pytest.mark.upgrade @pytest.mark.skipif((not settings.robottelo.REPOS_HOSTING_URL), reason='Missing repos_hosting_url') @pytest.mark.parametrize('setting_update', ['errata_status_installable'], indirect=True) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.parametrize( 'registered_contenthost', [[CUSTOM_REPO_URL]], diff --git a/tests/foreman/ui/test_fact.py b/tests/foreman/ui/test_fact.py index d04c9ac0d86..13839b8eda5 100644 --- a/tests/foreman/ui/test_fact.py +++ b/tests/foreman/ui/test_fact.py @@ -50,7 +50,8 @@ def test_positive_upload_host_facts( } ) result = rhel_contenthost.execute(cmd) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' rhel_contenthost.execute('subscription-manager facts --update') host_facts = session.host_new.get_host_facts(rhel_contenthost.hostname, fact='fqdn') diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index bbb74e61e9e..4f92453ae55 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -857,7 +857,7 @@ def test_positive_search_by_parameter(session, module_org, smart_proxy_location, assert values[0]['Name'] == param_host.name -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) @pytest.mark.no_containers def test_positive_search_by_reported_data( target_sat, rhel_contenthost, module_org, module_ak_with_cv @@ -875,7 +875,8 @@ def test_positive_search_by_reported_data( :customerscenario: true """ result = rhel_contenthost.register(module_org, None, module_ak_with_cv.name, target_sat) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' client = rhel_contenthost reported_data_params = [ @@ -1851,7 +1852,7 @@ def test_positive_set_multi_line_and_with_spaces_parameter_value( @pytest.mark.pit_client -@pytest.mark.rhel_ver_match('[^6].*') +@pytest.mark.rhel_ver_match('[^6]') def test_positive_tracer_enable_reload(tracer_install_host, target_sat): """Using the new Host UI,enable tracer and verify that the page reloads @@ -2112,7 +2113,7 @@ def change_content_source_prep( @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('[789]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_change_content_source(session, change_content_source_prep, rhel_contenthost): """ This test exercises different ways to change host's content source @@ -2196,7 +2197,7 @@ def test_change_content_source(session, change_content_source_prep, rhel_content ) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_page_redirect_after_update(target_sat, current_sat_location): """Check that page redirects correctly after editing a host without making any changes. @@ -2222,7 +2223,7 @@ def test_positive_page_redirect_after_update(target_sat, current_sat_location): @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_host_status_honors_taxonomies( module_target_sat, test_name, rhel_contenthost, setup_content, default_location, default_org ): @@ -2275,7 +2276,9 @@ def test_host_status_honors_taxonomies( # register the host to org assert rhel_contenthost.unregister().status == 0 module_target_sat.cli.Host.delete({'id': host_id}) - assert rhel_contenthost.register(org, default_location, ak.name, module_target_sat).status == 0 + register_result = rhel_contenthost.register(org, default_location, ak.name, module_target_sat) + if rhel_contenthost.os_version.major != 6: + assert register_result.status == 0 with module_target_sat.ui_session(test_name, user=login, password=password) as session: statuses = session.host.host_statuses() assert len([status for status in statuses if int(status['count'].split(': ')[1]) != 0]) == 1 diff --git a/tests/foreman/ui/test_package.py b/tests/foreman/ui/test_package.py index c4f3ee8a85b..891dc0a05d5 100644 --- a/tests/foreman/ui/test_package.py +++ b/tests/foreman/ui/test_package.py @@ -90,7 +90,7 @@ def module_rhel8_repo(module_sca_manifest_org, module_target_sat): ) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) @pytest.mark.no_containers def test_positive_parse_package_name_url( session, module_target_sat, module_sca_manifest_org, module_rhel8_repo, rhel_contenthost diff --git a/tests/foreman/ui/test_registration.py b/tests/foreman/ui/test_registration.py index 059bad01eff..32b5120ca10 100644 --- a/tests/foreman/ui/test_registration.py +++ b/tests/foreman/ui/test_registration.py @@ -133,7 +133,7 @@ def test_negative_global_registration_without_ak( @pytest.mark.e2e @pytest.mark.no_containers @pytest.mark.pit_client -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_global_registration_end_to_end( module_activation_key, module_org, @@ -218,7 +218,8 @@ def test_positive_global_registration_end_to_end( rhel_contenthost.execute(f"yum install -y {package}") # run curl result = rhel_contenthost.execute(cmd) - assert result.status == 0 + if rhel_contenthost.os_version.major != '6': + assert result.status == 0 result = rhel_contenthost.execute('subscription-manager identity') assert result.status == 0 # Assert that a yum update was made this day ("Update" or "I, U" in history) @@ -410,7 +411,8 @@ def test_global_registration_with_gpg_repo_and_default_package( client.create_custom_repos(**repos) # run curl result = client.execute(cmd) - assert result.status == 0 + if client.os_version.major != 6: + assert result.status == 0 result = client.execute('yum list installed | grep mlocate') assert result.status == 0 assert 'mlocate' in result.stdout @@ -420,7 +422,7 @@ def test_global_registration_with_gpg_repo_and_default_package( assert repo_url in result.stdout -@pytest.mark.rhel_ver_match('9') +@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) def test_global_re_registration_host_with_force_ignore_error_options( module_activation_key, rhel_contenthost, module_target_sat, module_org ): @@ -460,7 +462,7 @@ def test_global_re_registration_host_with_force_ignore_error_options( assert result.status == 0 -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) def test_global_registration_token_restriction( module_activation_key, rhel_contenthost, module_target_sat, module_org ): @@ -500,7 +502,7 @@ def test_global_registration_token_restriction( assert 'Unable to authenticate user' in result.stdout -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) def test_positive_host_registration_with_non_admin_user( test_name, module_sca_manifest_org, @@ -548,7 +550,8 @@ def test_positive_host_registration_with_non_admin_user( ) result = rhel_contenthost.execute(cmd) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if rhel_contenthost.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' # Verify server.hostname and server.port from subscription-manager config assert ( @@ -618,7 +621,7 @@ def test_positive_global_registration_form( assert pair in cmd -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_global_registration_with_capsule_host( capsule_configured, rhel_contenthost, @@ -714,7 +717,7 @@ def test_global_registration_with_capsule_host( assert module_org.name in result.stdout -@pytest.mark.rhel_ver_match('[^6].*') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_subscription_manager_install_from_repository( module_activation_key, module_os, rhel_contenthost, target_sat, module_org ): diff --git a/tests/foreman/ui/test_remoteexecution.py b/tests/foreman/ui/test_remoteexecution.py index 4984bae29e0..76b3ad7e398 100644 --- a/tests/foreman/ui/test_remoteexecution.py +++ b/tests/foreman/ui/test_remoteexecution.py @@ -20,6 +20,7 @@ import pytest from wait_for import wait_for +from robottelo.config import settings from robottelo.utils.datafactory import ( gen_string, valid_hostgroups_list_short, @@ -94,7 +95,7 @@ def test_positive_hostgroups_full_nested_names( assert name in hostgroups -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) def test_positive_run_default_job_template( session, target_sat, @@ -150,7 +151,7 @@ def test_positive_run_default_job_template( assert job_name in [job['Name'] for job in success_jobs] -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) def test_rex_through_host_details(session, target_sat, rex_contenthost, module_org): """Run remote execution using the new host details page @@ -188,7 +189,7 @@ def test_rex_through_host_details(session, target_sat, rex_contenthost, module_o assert recent_jobs['recent_jobs']['finished']['table'][0]['column2'] == "succeeded" -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) @pytest.mark.parametrize( 'ui_user', [{'admin': True}, {'admin': False}], indirect=True, ids=['adminuser', 'nonadminuser'] ) @@ -251,7 +252,7 @@ def test_positive_run_custom_job_template( @pytest.mark.upgrade -@pytest.mark.rhel_ver_list([8]) +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_positive_run_job_template_multiple_hosts( session, module_org, target_sat, rex_contenthosts ): @@ -298,7 +299,7 @@ def test_positive_run_job_template_multiple_hosts( ) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match([settings.content_host.default_rhel_version]) def test_positive_run_scheduled_job_template_by_ip(session, module_org, rex_contenthost): """Schedule a job to be ran against a host by ip diff --git a/tests/foreman/ui/test_reporttemplates.py b/tests/foreman/ui/test_reporttemplates.py index 0031314b85d..65bad595de9 100644 --- a/tests/foreman/ui/test_reporttemplates.py +++ b/tests/foreman/ui/test_reporttemplates.py @@ -224,7 +224,7 @@ def test_positive_end_to_end(session, module_org, module_location): assert not session.reporttemplate.search(new_name) -@pytest.mark.rhel_ver_list([7, 8, 9]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.upgrade def test_positive_generate_registered_hosts_report( session, target_sat, module_setup_content, rhel_contenthost @@ -466,7 +466,7 @@ def test_negative_nonauthor_of_report_cant_download_it(session): """ -@pytest.mark.rhel_ver_list([7, 8, 9]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_generate_all_installed_packages_report( session, module_setup_content, rhel_contenthost, target_sat ): @@ -501,7 +501,8 @@ def test_positive_generate_all_installed_packages_report( ) client = rhel_contenthost result = client.register(org, None, ak.name, target_sat) - assert result.status == 0, f'Failed to register host: {result.stderr}' + if client.os_version.major != 6: + assert result.status == 0, f'Failed to register host: {result.stderr}' assert client.subscribed client.execute(f'yum -y install {FAKE_0_CUSTOM_PACKAGE_NAME} {FAKE_1_CUSTOM_PACKAGE}') with session: @@ -518,7 +519,7 @@ def test_positive_generate_all_installed_packages_report( @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_installable_errata_with_user( session, target_sat, function_org, function_lce, function_location, rhel_contenthost ): @@ -561,7 +562,8 @@ def test_positive_installable_errata_with_user( result = rhel_contenthost.register( function_org, function_location, activation_key.name, target_sat ) - assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout + if rhel_contenthost.os_version.major != 6: + assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout assert rhel_contenthost.subscribed # Remove package if already installed on this host diff --git a/tests/foreman/ui/test_repositories.py b/tests/foreman/ui/test_repositories.py index edc17630a8c..b6ff74e312e 100644 --- a/tests/foreman/ui/test_repositories.py +++ b/tests/foreman/ui/test_repositories.py @@ -15,7 +15,7 @@ import pytest -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_custom_products_disabled_by_default( session, default_location, @@ -42,7 +42,8 @@ def test_positive_custom_products_disabled_by_default( """ ak, org, custom_repo = setup_content rhel_contenthost.register(org, default_location, ak.name, target_sat) - assert rhel_contenthost.subscribed + if rhel_contenthost.os_version.major != 6: + assert rhel_contenthost.subscribed with session: session.organization.select(org.name) session.location.select(default_location.name) @@ -56,7 +57,7 @@ def test_positive_custom_products_disabled_by_default( assert repos[0]['Repository type'] == 'Custom' -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_override_custom_products_using_select_all( session, default_location, @@ -84,7 +85,8 @@ def test_positive_override_custom_products_using_select_all( ak, org, custom_repo = setup_content client = rhel_contenthost client.register(org, default_location, ak.name, target_sat) - assert client.subscribed + if client.os_version.major != 6: + assert client.subscribed with session: session.organization.select(org.name) session.location.select(default_location.name) @@ -99,7 +101,7 @@ def test_positive_override_custom_products_using_select_all( assert repo[0]['Status'] == 'Enabled' -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_positive_override_custom_products_not_using_select_all( session, default_location, @@ -131,7 +133,8 @@ def test_positive_override_custom_products_not_using_select_all( """ ak, org, custom_repo = setup_content rhel_contenthost.register(org, default_location, ak.name, target_sat) - assert rhel_contenthost.subscribed + if rhel_contenthost.os_version.major != 6: + assert rhel_contenthost.subscribed with session: session.organization.select(org.name) session.location.select(default_location.name) diff --git a/tests/foreman/ui/test_rhcloud_insights.py b/tests/foreman/ui/test_rhcloud_insights.py index 220cc52c219..17e713e83e2 100644 --- a/tests/foreman/ui/test_rhcloud_insights.py +++ b/tests/foreman/ui/test_rhcloud_insights.py @@ -211,7 +211,7 @@ def test_host_sorting_based_on_recommendation_count(): @pytest.mark.no_containers -@pytest.mark.rhel_ver_list([7, 8, 9]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_host_details_page( rhel_insights_vm, rhcloud_manifest_org, diff --git a/tests/foreman/ui/test_rhcloud_inventory.py b/tests/foreman/ui/test_rhcloud_inventory.py index 863a66f2afe..daad389f93a 100644 --- a/tests/foreman/ui/test_rhcloud_inventory.py +++ b/tests/foreman/ui/test_rhcloud_inventory.py @@ -357,7 +357,7 @@ def test_rhcloud_inventory_without_manifest(session, module_org, target_sat): @pytest.mark.e2e @pytest.mark.pit_server @pytest.mark.pit_client -@pytest.mark.rhel_ver_list([7, 8, 9, 10]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') def test_sync_inventory_status(rhcloud_manifest_org, rhcloud_registered_hosts, module_target_sat): """Test syncing Lightspeed inventory status diff --git a/tests/new_upgrades/test_client.py b/tests/new_upgrades/test_client.py index 6a6109903f3..fdf808a7f1e 100644 --- a/tests/new_upgrades/test_client.py +++ b/tests/new_upgrades/test_client.py @@ -97,7 +97,8 @@ def pre_client_package_installation_setup( activation_keys=[ak.name], location=location, ) - assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout + if rhel_contenthost.os_version.major != 6: + assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout rhel_contenthost.execute('subscription-manager repos --enable=* && yum clean all') target_sat.cli_factory.job_invocation( { @@ -201,7 +202,8 @@ def test_post_scenario_post_client_package_installation(pre_client_package_insta activation_keys=[ak.name], location=location, ) - assert f'The registered system name is: {rhel_client.hostname}' in result.stdout + if rhel_client.os_version.major != 6: + assert f'The registered system name is: {rhel_client.hostname}' in result.stdout rhel_client.execute('subscription-manager repos --enable=* && yum clean all') target_sat.cli_factory.job_invocation( { diff --git a/tests/new_upgrades/test_remoteexecution.py b/tests/new_upgrades/test_remoteexecution.py index 3383c4e6f35..12184e20421 100644 --- a/tests/new_upgrades/test_remoteexecution.py +++ b/tests/new_upgrades/test_remoteexecution.py @@ -82,7 +82,8 @@ def remote_execution_external_capsule_setup( activation_keys=[ak.name], location=location, ) - assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout + if rhel_contenthost.os_version.major != 6: + assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout # run rex command template_id = ( target_sat.api.JobTemplate() @@ -113,7 +114,7 @@ def remote_execution_external_capsule_setup( yield test_data -@pytest.mark.rhel_ver_list([7, 8, 9, 10]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.capsule_upgrades def test_post_scenario_remote_execution_external_capsule(remote_execution_external_capsule_setup): @@ -190,7 +191,8 @@ def remote_execution_satellite_setup( activation_keys=[ak.name], location=location, ) - assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout + if rhel_contenthost.os_version.major != 6: + assert f'The registered system name is: {rhel_contenthost.hostname}' in result.stdout # run rex command template_id = ( target_sat.api.JobTemplate() @@ -221,7 +223,7 @@ def remote_execution_satellite_setup( yield test_data -@pytest.mark.rhel_ver_list([7, 8, 9, 10]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.capsule_upgrades def test_post_scenario_remote_execution_satellite(remote_execution_satellite_setup): diff --git a/tests/new_upgrades/test_subscription.py b/tests/new_upgrades/test_subscription.py index 9e7758e5e85..57f72c158bd 100644 --- a/tests/new_upgrades/test_subscription.py +++ b/tests/new_upgrades/test_subscription.py @@ -175,7 +175,7 @@ def subscription_auto_attach_setup( @pytest.mark.subscription_upgrades -@pytest.mark.rhel_ver_list([7, 8, 9, 10]) +@pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.manifester def test_subscription_scenario_auto_attach(subscription_auto_attach_setup): diff --git a/tests/upgrades/test_client.py b/tests/upgrades/test_client.py index aa1467dc853..e238850fdaa 100644 --- a/tests/upgrades/test_client.py +++ b/tests/upgrades/test_client.py @@ -42,7 +42,7 @@ class TestScenarioUpgradeOldClientAndPackageInstallation: """ @pytest.mark.pre_upgrade - @pytest.mark.rhel_ver_list([8]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_pre_scenario_pre_client_package_installation( self, client_for_upgrade, @@ -130,7 +130,7 @@ class TestScenarioUpgradeNewClientAndPackageInstallation: """ @pytest.mark.post_upgrade - @pytest.mark.rhel_ver_list([8]) + @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) def test_post_scenario_post_client_package_installation( self, module_target_sat, diff --git a/tests/upgrades/test_errata.py b/tests/upgrades/test_errata.py index a724c034db2..4257c7ff49f 100644 --- a/tests/upgrades/test_errata.py +++ b/tests/upgrades/test_errata.py @@ -99,7 +99,7 @@ class TestScenarioErrataCount(TestScenarioErrataAbstract): 5. Check if the Errata Count in Satellite after the upgrade. """ - @pytest.mark.rhel_ver_list([7, 8, 9]) + @pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.pre_upgrade def test_pre_scenario_generate_errata_for_client( diff --git a/tests/upgrades/test_remoteexecution.py b/tests/upgrades/test_remoteexecution.py index 6eba06e1b73..d171517c7e5 100644 --- a/tests/upgrades/test_remoteexecution.py +++ b/tests/upgrades/test_remoteexecution.py @@ -29,7 +29,7 @@ class TestScenarioREXCapsule: 4. Check if REX job still getting success. """ - @pytest.mark.rhel_ver_list([7, 8, 9]) + @pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.pre_upgrade def test_pre_scenario_remote_execution_external_capsule( @@ -151,7 +151,7 @@ class TestScenarioREXSatellite: 7. Check if REX job still getting success. """ - @pytest.mark.rhel_ver_list([7, 8, 9]) + @pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.pre_upgrade def test_pre_scenario_remote_execution_satellite( diff --git a/tests/upgrades/test_repository.py b/tests/upgrades/test_repository.py index f71847311b0..7cab0c0caae 100644 --- a/tests/upgrades/test_repository.py +++ b/tests/upgrades/test_repository.py @@ -381,7 +381,7 @@ class TestSimpleContentAccessOnly: satellite with simple content access mode only. """ - @pytest.mark.rhel_ver_list([7, 8, 9]) + @pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.pre_upgrade def test_pre_simple_content_access_only( diff --git a/tests/upgrades/test_subscription.py b/tests/upgrades/test_subscription.py index bbe78198e0d..29758e82cb8 100644 --- a/tests/upgrades/test_subscription.py +++ b/tests/upgrades/test_subscription.py @@ -80,7 +80,7 @@ class TestSubscriptionAutoAttach: upgrade. """ - @pytest.mark.rhel_ver_list([7, 8, 9]) + @pytest.mark.rhel_ver_list(r'^[\d]+$') @pytest.mark.no_containers @pytest.mark.pre_upgrade def test_pre_subscription_scenario_auto_attach( From 2b8b91188b46749429c7b0ab7135cc12594fd362 Mon Sep 17 00:00:00 2001 From: Jameer Pathan <21165044+jameerpathan111@users.noreply.github.com> Date: Fri, 13 Feb 2026 15:21:22 +0100 Subject: [PATCH 2/2] Fix test failures for rhel6 client --- conf/supportability.yaml | 2 +- pytest_fixtures/component/provision_capsule_pxe.py | 2 +- pytest_fixtures/component/provision_pxe.py | 2 +- pytest_fixtures/component/provisioning_template.py | 2 +- robottelo/constants/__init__.py | 10 ++++++++++ tests/foreman/api/test_capsulecontent.py | 8 ++++---- tests/foreman/longrun/test_oscap.py | 4 ++++ tests/foreman/ui/test_errata.py | 3 ++- 8 files changed, 24 insertions(+), 9 deletions(-) diff --git a/conf/supportability.yaml b/conf/supportability.yaml index 6fd3346bce5..c0127bf1f54 100644 --- a/conf/supportability.yaml +++ b/conf/supportability.yaml @@ -2,4 +2,4 @@ supportability: content_hosts: default_os_name: "RedHat" rhel: - versions: [7,'7_fips', 8, '8_fips', 9, '9_fips'] + versions: [6, 7, '7_fips', 8, '8_fips', 9, '9_fips'] diff --git a/pytest_fixtures/component/provision_capsule_pxe.py b/pytest_fixtures/component/provision_capsule_pxe.py index b18bc1fce3f..e631c1d71c9 100644 --- a/pytest_fixtures/component/provision_capsule_pxe.py +++ b/pytest_fixtures/component/provision_capsule_pxe.py @@ -237,7 +237,7 @@ def capsule_provisioning_rhel_content( assert task_status['result'] == 'success' rhel_xy = Version( constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version'] - if rhel_ver == 7 + if rhel_ver <= 7 else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version'] ) o_systems = sat.api.OperatingSystem().search( diff --git a/pytest_fixtures/component/provision_pxe.py b/pytest_fixtures/component/provision_pxe.py index adfbb46c22c..fc64d59423d 100644 --- a/pytest_fixtures/component/provision_pxe.py +++ b/pytest_fixtures/component/provision_pxe.py @@ -98,7 +98,7 @@ def module_provisioning_rhel_content( assert task_status['result'] == 'success' rhel_xy = Version( constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version'] - if rhel_ver == 7 + if rhel_ver <= 7 else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version'] ) o_systems = sat.api.OperatingSystem().search( diff --git a/pytest_fixtures/component/provisioning_template.py b/pytest_fixtures/component/provisioning_template.py index eee5559d91c..7cea67025d4 100644 --- a/pytest_fixtures/component/provisioning_template.py +++ b/pytest_fixtures/component/provisioning_template.py @@ -90,7 +90,7 @@ def module_sync_kickstart_content( assert task_status['result'] == 'success' rhel_xy = Version( constants.REPOS['kickstart'][f'rhel{rhel_ver}']['version'] - if rhel_ver == 7 + if rhel_ver <= 7 else constants.REPOS['kickstart'][f'rhel{rhel_ver}_bos']['version'] ) o_systems = module_target_sat.api.OperatingSystem().search( diff --git a/robottelo/constants/__init__.py b/robottelo/constants/__init__.py index c98ff6c2d45..28409ea80d7 100644 --- a/robottelo/constants/__init__.py +++ b/robottelo/constants/__init__.py @@ -290,6 +290,7 @@ 'rhsc8': 'Red Hat Satellite Capsule 6.16 for RHEL 8 x86_64 (RPMs)', 'rhsc9': 'Red Hat Satellite Capsule 6.16 for RHEL 9 x86_64 (RPMs)', 'rhsc7_iso': 'Red Hat Satellite Capsule 6.4 (for RHEL 7 Server) (ISOs)', + 'rhsclient6': 'Red Hat Satellite Client 6 (for RHEL 6 Server - ELS) (RPMs)', 'rhsclient7': 'Red Hat Satellite Client 6 (for RHEL 7 Server) (RPMs)', 'rhsclient8': 'Red Hat Satellite Client 6 for RHEL 8 x86_64 (RPMs)', 'rhsclient9': 'Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs)', @@ -433,6 +434,15 @@ 'id': 'rhel-7-server-satellite-capsule-6.4-isos', 'name': ('Red Hat Satellite Capsule 6.4 for RHEL 7 Server ISOs x86_64'), }, + 'rhsclient6': { + 'id': 'rhel-6-server-els-satellite-client-6-rpms', + 'name': ('Red Hat Satellite Client 6 for RHEL 6 Server - ELS RPMs x86_64'), + 'version': '6', + 'reposet': REPOSET['rhsclient6'], + 'product': PRDS['rhel_els'], + 'distro': 'rhel6', + 'key': PRODUCT_KEY_SAT_CLIENT, + }, 'rhsclient7': { 'id': 'rhel-7-server-satellite-client-6-rpms', 'name': ('Red Hat Satellite Client 6 for RHEL 7 Server RPMs x86_64'), diff --git a/tests/foreman/api/test_capsulecontent.py b/tests/foreman/api/test_capsulecontent.py index bc3204e994c..07214d4ba72 100644 --- a/tests/foreman/api/test_capsulecontent.py +++ b/tests/foreman/api/test_capsulecontent.py @@ -1416,7 +1416,7 @@ def test_positive_remove_capsule_orphans( 'repos_collection', [ { - 'distro': 'rhel9', + 'distro': f'rhel{settings.content_host.default_rhel_version}', 'YumRepository': {'url': settings.repos.yum_0.url}, } ], @@ -1527,14 +1527,14 @@ def test_complete_sync_fixes_metadata( 'Expected to see the Capsule as the content source' ) - result = rhel_contenthost.execute('dnf repolist') + result = rhel_contenthost.execute('yum repolist') assert result.status == 0 assert repos_collection.setup_content_data['repos'][0].content_label in result.stdout - result = rhel_contenthost.execute('dnf install -y cheetah') # with dependencies + result = rhel_contenthost.execute('yum install -y cheetah') # with dependencies assert result.status == 0 - result = rhel_contenthost.execute('dnf -y update') + result = rhel_contenthost.execute('yum -y update') assert result.status == 0 @pytest.mark.skip_if_not_set('capsule') diff --git a/tests/foreman/longrun/test_oscap.py b/tests/foreman/longrun/test_oscap.py index d36e5cc269e..6756b40bdfc 100644 --- a/tests/foreman/longrun/test_oscap.py +++ b/tests/foreman/longrun/test_oscap.py @@ -31,21 +31,25 @@ 'rhel9': f'ak_{gen_string("alpha")}_rhel9', 'rhel8': f'ak_{gen_string("alpha")}_rhel8', 'rhel7': f'ak_{gen_string("alpha")}_rhel7', + 'rhel6': f'ak_{gen_string("alpha")}_rhel6', } cv_name = { 'rhel9': f'cv_{gen_string("alpha")}_rhel9', 'rhel8': f'cv_{gen_string("alpha")}_rhel8', 'rhel7': f'cv_{gen_string("alpha")}_rhel7', + 'rhel6': f'cv_{gen_string("alpha")}_rhel6', } profiles = { 'rhel9': OSCAP_PROFILE['ospp8+'], 'rhel8': OSCAP_PROFILE['ospp8+'], 'rhel7': OSCAP_PROFILE['security7'], + 'rhel6': OSCAP_PROFILE['security6'], } rhel_repos = { 'rhel9': settings.repos.rhel9_os, 'rhel8': settings.repos.rhel8_os, 'rhel7': settings.repos.rhel7_os, + 'rhel6': settings.repos.rhel6_os, } diff --git a/tests/foreman/ui/test_errata.py b/tests/foreman/ui/test_errata.py index 21072e93d53..0bf1e008f9d 100644 --- a/tests/foreman/ui/test_errata.py +++ b/tests/foreman/ui/test_errata.py @@ -240,7 +240,8 @@ def cleanup(): ) # no error setting up fixtures and registering client - assert setup['result'] != 'error', f'{setup["message"]}' + if rhel_contenthost.os_version.major != 6: + assert setup['result'] != 'error', f'{setup["message"]}' assert (client := setup['client']) # nothing applicable to start result = client.execute('subscription-manager repos')