From 842f4937b42a0913a7bdf288cd0db26646b5831f Mon Sep 17 00:00:00 2001 From: David Moore Date: Tue, 26 Nov 2024 17:02:11 -0500 Subject: [PATCH] RHEL10 Clients parametrizations --- pytest_fixtures/core/contenthosts.py | 21 ++++ robottelo/constants/__init__.py | 9 ++ tests/foreman/api/test_capsulecontent.py | 2 +- tests/foreman/api/test_errata.py | 137 ++++++++++++----------- tests/foreman/api/test_http_proxy.py | 2 +- tests/foreman/cli/test_errata.py | 10 +- tests/foreman/cli/test_http_proxy.py | 2 +- tests/foreman/cli/test_repositories.py | 2 +- tests/foreman/cli/test_repository.py | 2 +- tests/foreman/ui/test_errata.py | 7 +- tests/foreman/ui/test_repositories.py | 6 +- tests/upgrades/test_errata.py | 2 +- tests/upgrades/test_repository.py | 2 +- 13 files changed, 121 insertions(+), 83 deletions(-) diff --git a/pytest_fixtures/core/contenthosts.py b/pytest_fixtures/core/contenthosts.py index fc34a22f80c..e96e5758591 100644 --- a/pytest_fixtures/core/contenthosts.py +++ b/pytest_fixtures/core/contenthosts.py @@ -108,6 +108,27 @@ def rhel9_contenthost(request): yield host +@pytest.fixture(scope='module', params=[{'rhel_version': '9'}]) +def rhel9_contenthost_module(request): + """A module-level fixture that provides a rhel9 content host object""" + with Broker(**host_conf(request), host_class=ContentHost) as host: + yield host + + +@pytest.fixture(params=[{'rhel_version': '10'}]) +def rhel10_contenthost(request): + """A fixture that provides a rhel10 content host object""" + with Broker(**host_conf(request), host_class=ContentHost) as host: + yield host + + +@pytest.fixture(scope='module', params=[{'rhel_version': '10'}]) +def rhel10_contenthost_module(request): + """A module-level fixture that provides a rhel10 content host object""" + with Broker(**host_conf(request), host_class=ContentHost) as host: + yield host + + @pytest.fixture def content_hosts(request): """A function-level fixture that provides two rhel content hosts object""" diff --git a/robottelo/constants/__init__.py b/robottelo/constants/__init__.py index 25bc67ab1bb..e64ea64934b 100644 --- a/robottelo/constants/__init__.py +++ b/robottelo/constants/__init__.py @@ -271,6 +271,7 @@ 'rhae': 'Red Hat Ansible Engine', 'rhel8': 'Red Hat Enterprise Linux for x86_64', 'rhel9': 'Red Hat Enterprise Linux for x86_64', + 'rhel10': 'Red Hat Enterprise Linux for x86_64', } REPOSET = { @@ -303,10 +304,12 @@ 'rhel8_aps': 'Red Hat Enterprise Linux 8 for x86_64 - AppStream (Kickstart)', 'rhel9_bos': 'Red Hat Enterprise Linux 9 for x86_64 - BaseOS (Kickstart)', 'rhel9_aps': 'Red Hat Enterprise Linux 9 for x86_64 - AppStream (Kickstart)', + 'rhel10_bos': 'Red Hat Enterprise Linux 10 for x86_64 - BaseOS (Kickstart)', }, 'rhel8_bos': 'Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)', 'rhel8_aps': 'Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)', 'rhel9_bos': 'Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)', + 'rhel10_bos': 'Red Hat Enterprise Linux 10 for x86_64 - BaseOS (RPMs)', 'rhel9_aps': 'Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)', 'rhel7_extra': 'Red Hat Enterprise Linux 7 Server - Extras (RPMs)', 'rhel7_optional': 'Red Hat Enterprise Linux 7 Server - Optional (RPMs)', @@ -789,6 +792,8 @@ REAL_RHEL8_1_PACKAGE_NAME = 'puppet-agent' # for RHSA-2022:4867 REAL_RHEL8_1_PACKAGE_FILENAME = 'puppet-agent-6.19.1-1.el8sat.x86_64' REAL_RHEL8_2_PACKAGE_FILENAME = 'puppet-agent-6.26.0-1.el8sat.x86_64' +REAL_RHEL9_PACKAGE_FILENAME = '' +REAL_RHEL10_PACKAGE_FILENAME = '' FAKE_0_CUSTOM_PACKAGE_GROUP_NAME = 'birds' FAKE_3_YUM_OUTDATED_PACKAGES = [ 'acme-package-1.0.1-1.noarch', @@ -844,7 +849,11 @@ REAL_RHEL7_0_ERRATA_ID = 'RHBA-2020:3615' # for REAL_RHEL7_0_0_PACKAGE REAL_RHEL7_1_ERRATA_ID = 'RHBA-2017:0395' # tcsh bug fix update REAL_RHEL8_1_ERRATA_ID = 'RHSA-2022:4867' # for REAL_RHEL8_1_PACKAGE +REAL_RHEL9_ERRATA_ID = '' +REAL_RHEL10_ERRATA_ID = '' REAL_RHEL8_ERRATA_CVES = ['CVE-2021-27023', 'CVE-2021-27025'] +REAL_RHEL9_ERRATA_CVES = [] +REAL_RHEL10_ERRATA_CVES = [] REAL_RHSCLIENT_ERRATA = 'RHSA-2023:5982' # for RH Satellite Client 8 FAKE_1_YUM_REPOS_COUNT = 32 FAKE_3_YUM_REPOS_COUNT = 78 diff --git a/tests/foreman/api/test_capsulecontent.py b/tests/foreman/api/test_capsulecontent.py index 3a5cf7e5187..47d34e58571 100644 --- a/tests/foreman/api/test_capsulecontent.py +++ b/tests/foreman/api/test_capsulecontent.py @@ -1440,7 +1440,7 @@ def test_positive_remove_capsule_orphans( ], indirect=True, ) - @pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) + @pytest.mark.rhel_ver_match('N-1') def test_complete_sync_fixes_metadata( self, module_target_sat, diff --git a/tests/foreman/api/test_errata.py b/tests/foreman/api/test_errata.py index 34fb1262947..8d6afff7047 100644 --- a/tests/foreman/api/test_errata.py +++ b/tests/foreman/api/test_errata.py @@ -158,7 +158,7 @@ def _fetch_available_errata(host, expected_amount=None, timeout=120): def _fetch_available_errata_instances(sat, host, expected_amount=None, timeout=120): - """Fetch list of instances of avaliable errata for host.""" + """Fetch list of instances of available errata for host.""" _errata_dict = _fetch_available_errata(host.nailgun_host, expected_amount, timeout) _errata_ids = [errata['id'] for errata in _errata_dict] instances = [sat.api.Errata(id=_id).read() for _id in _errata_ids] @@ -1008,7 +1008,7 @@ def test_positive_list_sorted_filtered(custom_repo, target_sat): @pytest.fixture(scope='module') -def setup_content_rhel8( +def setup_fake_yum_content( module_sca_manifest_org, rh_repo_module_manifest, activation_key, @@ -1017,8 +1017,8 @@ def setup_content_rhel8( module_target_sat, return_result=True, ): - """Setup content for rhel8 content host - Using RH SAT-TOOLS RHEL8 for sat-tools, and FAKE_YUM_9 as custom-repo. + """Setup yum content for rhel content host w/ errata + Using rh repo satellite-tools, and custom repo FAKE_YUM_9. Published to content-view and promoted to lifecycle-environment. Raises `AssertionError` if one or more of the setup components read are empty. @@ -1067,7 +1067,7 @@ def setup_content_rhel8( @pytest.mark.tier2 def test_positive_get_count_for_host( - setup_content_rhel8, activation_key, rhel8_contenthost, module_target_sat + setup_fake_yum_content, activation_key, rhel10_contenthost, module_target_sat ): """Available errata count when retrieving Host @@ -1092,10 +1092,10 @@ def test_positive_get_count_for_host( :CaseImportance: Medium """ - org = setup_content_rhel8['organization'] - custom_repo = setup_content_rhel8['rh_repo'] - rhel8_contenthost.create_custom_repos(**{f'{custom_repo.name}': custom_repo.url}) - result = rhel8_contenthost.register( + org = setup_fake_yum_content['organization'] + custom_repo = setup_fake_yum_content['rh_repo'] + rhel10_contenthost.create_custom_repos(**{f'{custom_repo.name}': custom_repo.url}) + result = rhel10_contenthost.register( org=org, activation_keys=activation_key.name, target=module_target_sat, @@ -1103,39 +1103,42 @@ def test_positive_get_count_for_host( ) assert ( result.status == 0 - ), f'Failed to register the host - {rhel8_contenthost.hostname}: {result.stderr}' - assert rhel8_contenthost.subscribed - rhel8_contenthost.execute(r'subscription-manager repos --enable \*') - host = rhel8_contenthost.nailgun_host.read() + ), f'Failed to register the host - {rhel10_contenthost.hostname}: {result.stderr}' + assert rhel10_contenthost.subscribed + rhel10_contenthost.execute(r'subscription-manager repos --enable \*') + host = rhel10_contenthost.nailgun_host.read() # No applicable errata to start - assert rhel8_contenthost.applicable_errata_count == 0 + assert rhel10_contenthost.applicable_errata_count == 0 for errata in ('security', 'bugfix', 'enhancement'): _validate_errata_counts(host, errata_type=errata, expected_value=0) # One bugfix errata after installing outdated Kangaroo - result = rhel8_contenthost.execute(f'yum install -y {FAKE_9_YUM_OUTDATED_PACKAGES[7]}') + result = rhel10_contenthost.execute(f'yum install -y {FAKE_9_YUM_OUTDATED_PACKAGES[7]}') assert result.status == 0, f'Failed to install package {FAKE_9_YUM_OUTDATED_PACKAGES[7]}' _validate_errata_counts(host, errata_type='bugfix', expected_value=1) # One enhancement errata after installing outdated Gorilla - result = rhel8_contenthost.execute(f'yum install -y {FAKE_9_YUM_OUTDATED_PACKAGES[3]}') + result = rhel10_contenthost.execute(f'yum install -y {FAKE_9_YUM_OUTDATED_PACKAGES[3]}') assert result.status == 0, f'Failed to install package {FAKE_9_YUM_OUTDATED_PACKAGES[3]}' _validate_errata_counts(host, errata_type='enhancement', expected_value=1) # Install and check two outdated packages, with applicable security erratum # custom_repo outdated Walrus - result = rhel8_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') + result = rhel10_contenthost.execute(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') assert result.status == 0, f'Failed to install package {FAKE_1_CUSTOM_PACKAGE}' _validate_errata_counts(host, errata_type='security', expected_value=1) # rh_repo outdated Puppet-agent - result = rhel8_contenthost.execute(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}') + result = rhel10_contenthost.execute(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}') assert result.status == 0, f'Failed to install package {REAL_RHEL8_1_PACKAGE_FILENAME}' _validate_errata_counts(host, errata_type='security', expected_value=2) - # All avaliable errata present - assert rhel8_contenthost.applicable_errata_count == 4 + # All available errata present + assert rhel10_contenthost.applicable_errata_count == 4 @pytest.mark.upgrade @pytest.mark.tier3 def test_positive_get_applicable_for_host( - setup_content_rhel8, activation_key, rhel8_contenthost, target_sat + activation_key, + rhel10_contenthost, + target_sat, + setup_fake_yum_content, ): """Get applicable errata ids for a host @@ -1159,11 +1162,11 @@ def test_positive_get_applicable_for_host( :CaseImportance: Medium """ - org = setup_content_rhel8['organization'] - custom_repo = setup_content_rhel8['rh_repo'] + org = setup_fake_yum_content['organization'] + custom_repo = setup_fake_yum_content['rh_repo'] - rhel8_contenthost.create_custom_repos(**{f'{custom_repo.name}': custom_repo.url}) - result = rhel8_contenthost.register( + rhel10_contenthost.create_custom_repos(**{f'{custom_repo.name}': custom_repo.url}) + result = rhel10_contenthost.register( activation_keys=activation_key.name, target=target_sat, org=org, @@ -1171,29 +1174,29 @@ def test_positive_get_applicable_for_host( ) assert ( result.status == 0 - ), f'Failed to register the host - {rhel8_contenthost.hostname}: {result.stderr}' - assert rhel8_contenthost.subscribed - rhel8_contenthost.execute(r'subscription-manager repos --enable \*') + ), f'Failed to register the host - {rhel10_contenthost.hostname}: {result.stderr}' + assert rhel10_contenthost.subscribed + rhel10_contenthost.execute(r'subscription-manager repos --enable \*') for errata in REPO_WITH_ERRATA['errata']: # Remove custom package if present, old or new. package_name = errata['package_name'] - result = rhel8_contenthost.execute(f'yum erase -y {package_name}') + result = rhel10_contenthost.execute(f'yum erase -y {package_name}') if result.status != 0: pytest.fail(f'Failed to remove {package_name}: {result.stdout} {result.stderr}') - rhel8_contenthost.execute('subscription-manager repos') - assert rhel8_contenthost.applicable_errata_count == 0 - host = rhel8_contenthost.nailgun_host.read() + rhel10_contenthost.execute('subscription-manager repos') + assert rhel10_contenthost.applicable_errata_count == 0 + host = rhel10_contenthost.nailgun_host.read() # Check no applicable errata to start erratum = _fetch_available_errata(host, expected_amount=0) assert len(erratum) == 0 # Install outdated applicable custom package - rhel8_contenthost.run(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') + rhel10_contenthost.run(f'yum install -y {FAKE_1_CUSTOM_PACKAGE}') erratum = _fetch_available_errata(host, 1) assert len(erratum) == 1 assert CUSTOM_REPO_ERRATA_ID in [errata['errata_id'] for errata in erratum] # Install outdated applicable real package (from RH repo) - rhel8_contenthost.run(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}') + rhel10_contenthost.run(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}') erratum = _fetch_available_errata(host, 2) assert len(erratum) == 2 assert REAL_RHEL8_1_ERRATA_ID in [errata['errata_id'] for errata in erratum] @@ -1260,7 +1263,7 @@ def test_positive_incremental_update_required( activation_key, module_cv, rh_repo_module_manifest, - rhel8_contenthost, + rhel10_contenthost, target_sat, ): """Given a set of hosts and errata, check for content view version @@ -1304,18 +1307,18 @@ def test_positive_incremental_update_required( _cv = cv_publish_promote(target_sat, org, module_cv, module_lce) module_cv = _cv['content-view'] - result = rhel8_contenthost.register( + result = rhel10_contenthost.register( org=org, activation_keys=activation_key.name, target=target_sat, loc=None, ) - assert result.status == 0, f'Failed to register the host: {rhel8_contenthost.hostname}' - assert rhel8_contenthost.subscribed - rhel8_contenthost.execute(r'subscription-manager repos --enable \*') - host = rhel8_contenthost.nailgun_host.read() + assert result.status == 0, f'Failed to register the host: {rhel10_contenthost.hostname}' + assert rhel10_contenthost.subscribed + rhel10_contenthost.execute(r'subscription-manager repos --enable \*') + host = rhel10_contenthost.nailgun_host.read() # install package to create demand for an Erratum - result = rhel8_contenthost.run(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}') + result = rhel10_contenthost.run(f'yum install -y {REAL_RHEL8_1_PACKAGE_FILENAME}') assert result.status == 0, f'Failed to install package: {REAL_RHEL8_1_PACKAGE_FILENAME}' # Call nailgun to make the API POST to see if any incremental updates are required response = target_sat.api.Host().bulk_available_incremental_updates( @@ -1333,7 +1336,7 @@ def test_positive_incremental_update_required( ).create() module_cv = target_sat.api.ContentView(id=module_cv.id).read() module_cv = cv_publish_promote(target_sat, org, module_cv, module_lce)['content-view'] - rhel8_contenthost.execute('subscription-manager repos') + rhel10_contenthost.execute('subscription-manager repos') # Call nailgun to make the API POST to ensure an incremental update is required response = target_sat.api.Host().bulk_available_incremental_updates( data={ @@ -1342,7 +1345,7 @@ def test_positive_incremental_update_required( 'errata_ids': [REAL_RHEL8_1_ERRATA_ID], }, ) - assert response, 'Nailgun response for host(s) with avaliable incremental update was None' + assert response, 'Nailgun response for host(s) with available incremental update was None' assert 'next_version' in response[0], 'Incremental update should be suggested at this point' @@ -1354,7 +1357,7 @@ def errata_host_lce(module_sca_manifest_org, target_sat): @pytest.fixture(scope='module') def rh_repo_module_manifest(module_sca_manifest_org, module_target_sat): - """Use module manifest org, creates tools repo, syncs and returns RH repo.""" + """Use module manifest org, creates RHEL8 tools repo, syncs and returns RH repo.""" # enable rhel repo and return its ID rh_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid( basearch=DEFAULT_ARCHITECTURE, @@ -1374,7 +1377,7 @@ def rh_repo_module_manifest(module_sca_manifest_org, module_target_sat): def test_positive_incremental_update_apply_to_envs_cvs( target_sat, module_sca_manifest_org, - rhel8_contenthost, + rhel10_contenthost, module_product, ): """With multiple environments and content views, register a host to one, @@ -1475,21 +1478,21 @@ def test_positive_incremental_update_apply_to_envs_cvs( content_view=host_cv, ).create() # content host, global registration - result = rhel8_contenthost.register( + result = rhel10_contenthost.register( org=module_sca_manifest_org, activation_keys=ak.name, target=target_sat, loc=None, ) - assert result.status == 0, f'Failed to register the host: {rhel8_contenthost.hostname}' - assert rhel8_contenthost.subscribed - rhel8_contenthost.execute(r'subscription-manager repos --enable \*') + assert result.status == 0, f'Failed to register the host: {rhel10_contenthost.hostname}' + assert rhel10_contenthost.subscribed + rhel10_contenthost.execute(r'subscription-manager repos --enable \*') # Installing all outdated packages pkgs = ' '.join(FAKE_9_YUM_OUTDATED_PACKAGES) - assert rhel8_contenthost.execute(f'yum install -y {pkgs}').status == 0 - rhel8_contenthost.execute('subscription-manager repos') + assert rhel10_contenthost.execute(f'yum install -y {pkgs}').status == 0 + rhel10_contenthost.execute('subscription-manager repos') # After installing packages, check available incremental updates - host = rhel8_contenthost.nailgun_host.read() + host = rhel10_contenthost.nailgun_host.read() response = target_sat.api.Host().bulk_available_incremental_updates( data={ 'organization_id': module_sca_manifest_org.id, @@ -1500,7 +1503,7 @@ def test_positive_incremental_update_apply_to_envs_cvs( # expecting no available updates before CV change assert ( response == [] - ), f'No incremental updates should currently be available to host: {rhel8_contenthost.hostname}.' + ), f'No incremental updates should currently be available to host: {rhel10_contenthost.hostname}.' # New Erratum CV filter created for host view target_sat.api.ErratumContentViewFilter(content_view=host_cv, inclusion=True).create() @@ -1515,11 +1518,11 @@ def test_positive_incremental_update_apply_to_envs_cvs( )['content-view-version'] # cv is not updated to host yet, applicable errata should be zero - rhel8_contenthost.execute('subscription-manager repos') - host_app_errata = rhel8_contenthost.applicable_errata_count + rhel10_contenthost.execute('subscription-manager repos') + host_app_errata = rhel10_contenthost.applicable_errata_count assert host_app_errata == 0 # After adding filter to cv, check available incremental updates - host_app_packages = rhel8_contenthost.applicable_package_count + host_app_packages = rhel10_contenthost.applicable_package_count response = target_sat.api.Host().bulk_available_incremental_updates( data={ 'organization_id': module_sca_manifest_org.id, @@ -1529,11 +1532,11 @@ def test_positive_incremental_update_apply_to_envs_cvs( ) assert ( response - ), f'Expected one incremental update, but found none, for host: {rhel8_contenthost.hostname}.' + ), f'Expected one incremental update, but found none, for host: {rhel10_contenthost.hostname}.' # find that only expected CV version has incremental update available assert ( len(response) == 1 - ), f'Incremental update should currently be available to only one host: {rhel8_contenthost.hostname}.' + ), f'Incremental update should currently be available to only one host: {rhel10_contenthost.hostname}.' next_version = float(response[0]['next_version']) assert float(host_cvv.version) + 0.1 == next_version # example: 2.0 > 2.1 assert response[0]['content_view_version']['id'] == host_cvv.id @@ -1577,34 +1580,34 @@ def test_positive_incremental_update_apply_to_envs_cvs( assert host_version_number == next_version host_cvv = target_sat.api.ContentViewVersion(id=created_version_id).read() assert float(host_cvv.version) == next_version - rhel8_contenthost.execute('subscription-manager repos') + rhel10_contenthost.execute('subscription-manager repos') # expected errata from FAKE_9 Security list added added_errata = response['output']['changed_content'][0]['added_units']['erratum'] assert set(added_errata) == set(FAKE_9_YUM_SECURITY_ERRATUM) # applicable errata count increased by length of security ids list - assert rhel8_contenthost.applicable_errata_count == host_app_errata + len( + assert rhel10_contenthost.applicable_errata_count == host_app_errata + len( FAKE_9_YUM_SECURITY_ERRATUM ) # newly added errata from incremental version are now applicable to host post_app_errata_ids = errata_id_set( - _fetch_available_errata_instances(target_sat, rhel8_contenthost) + _fetch_available_errata_instances(target_sat, rhel10_contenthost) ) assert set(FAKE_9_YUM_SECURITY_ERRATUM).issubset(post_app_errata_ids) # expected packages from the security erratum were added to host added_packages = response['output']['changed_content'][0]['added_units']['rpm'] assert len(added_packages) == 12 # expected that not all of the added packages will be applicable - assert 8 == host_app_packages == rhel8_contenthost.applicable_package_count + assert 8 == host_app_packages == rhel10_contenthost.applicable_package_count # install all of the newly added packages, recalculate applicability for pkg in added_packages: - assert rhel8_contenthost.run(f'yum install -y {pkg}').status == 0 - rhel8_contenthost.execute('subscription-manager repos') + assert rhel10_contenthost.run(f'yum install -y {pkg}').status == 0 + rhel10_contenthost.execute('subscription-manager repos') # security errata should not be applicable after installing updated packages post_app_errata_ids = errata_id_set( - _fetch_available_errata_instances(target_sat, rhel8_contenthost) + _fetch_available_errata_instances(target_sat, rhel10_contenthost) ) assert set(FAKE_9_YUM_SECURITY_ERRATUM).isdisjoint(post_app_errata_ids) - assert rhel8_contenthost.applicable_errata_count == 0 + assert rhel10_contenthost.applicable_errata_count == 0 # after applying the incremental update, check for any more available response = target_sat.api.Host().bulk_available_incremental_updates( @@ -1617,4 +1620,4 @@ def test_positive_incremental_update_apply_to_envs_cvs( # expect no remaining updates, after applying the only one assert ( response == [] - ), f'No incremental updates should currently be available to host: {rhel8_contenthost.hostname}.' + ), f'No incremental updates should currently be available to host: {rhel10_contenthost.hostname}.' diff --git a/tests/foreman/api/test_http_proxy.py b/tests/foreman/api/test_http_proxy.py index 5d8cc686438..83170145516 100644 --- a/tests/foreman/api/test_http_proxy.py +++ b/tests/foreman/api/test_http_proxy.py @@ -149,7 +149,7 @@ def test_positive_end_to_end( @pytest.mark.e2e @pytest.mark.upgrade -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-2') # newest N, and two prior [10,9,8] @pytest.mark.run_in_one_thread @pytest.mark.parametrize( 'setup_http_proxy', diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index 8f07107d8ae..ab6d3f272ba 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -150,9 +150,9 @@ def rh_repo_module_manifest(module_sca_manifest_org, module_target_sat): rh_repo_id = module_target_sat.api_factory.enable_rhrepo_and_fetchid( basearch=DEFAULT_ARCHITECTURE, org_id=module_sca_manifest_org.id, - product=PRDS['rhel8'], - repo=REPOS['rhsclient8']['name'], - reposet=REPOSET['rhsclient8'], + product=PRDS['rhel9'], + repo=REPOS['rhsclient9']['name'], + reposet=REPOSET['rhsclient9'], releasever=None, ) # Sync step because repo is not synced by default @@ -165,7 +165,7 @@ def rh_repo_module_manifest(module_sca_manifest_org, module_target_sat): def hosts(request): """Deploy hosts via broker.""" num_hosts = getattr(request, 'param', 2) - with Broker(nick='rhel8', host_class=ContentHost, _count=num_hosts) as hosts: + with Broker(nick='rhel10', host_class=ContentHost, _count=num_hosts) as hosts: if not isinstance(hosts, list) or len(hosts) != num_hosts: pytest.fail('Failed to provision the expected number of hosts.') yield hosts @@ -1167,7 +1167,7 @@ def new_module_ak( ).create() # Ensure tools repo is enabled in the activation key new_module_ak.content_override( - data={'content_overrides': [{'content_label': REPOS['rhsclient8']['id'], 'value': '1'}]} + data={'content_overrides': [{'content_label': REPOS['rhsclient9']['id'], 'value': '1'}]} ) return new_module_ak.read() diff --git a/tests/foreman/cli/test_http_proxy.py b/tests/foreman/cli/test_http_proxy.py index c583ff8e638..de09d61fa01 100644 --- a/tests/foreman/cli/test_http_proxy.py +++ b/tests/foreman/cli/test_http_proxy.py @@ -87,7 +87,7 @@ def test_positive_create_update_delete(module_org, module_location, target_sat): @pytest.mark.tier3 @pytest.mark.no_containers -@pytest.mark.rhel_ver_match(r'^(?!6$)\d+$') +@pytest.mark.rhel_ver_match('N-3') # Newest supported N, and 3 prior @pytest.mark.parametrize( 'setup_http_proxy', [True, False], diff --git a/tests/foreman/cli/test_repositories.py b/tests/foreman/cli/test_repositories.py index 2db5d59984e..55b850c0807 100644 --- a/tests/foreman/cli/test_repositories.py +++ b/tests/foreman/cli/test_repositories.py @@ -18,7 +18,7 @@ from robottelo.constants import DEFAULT_ARCHITECTURE, REPOS, REPOSET -@pytest.mark.rhel_ver_match('[^6]') +@pytest.mark.rhel_ver_match('N-3') # Newest supported N, and 3 prior 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 f3f75057ab3..c9b6f78bdd7 100644 --- a/tests/foreman/cli/test_repository.py +++ b/tests/foreman/cli/test_repository.py @@ -2703,7 +2703,7 @@ def test_positive_syncable_yum_format_repo_import(target_sat, module_org): @pytest.mark.pit_client -@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version]) +@pytest.mark.rhel_ver_list([settings.content_host.default_rhel_version, 10]) def test_positive_install_uploaded_rpm_on_host( target_sat, rhel_contenthost, function_org, function_lce ): diff --git a/tests/foreman/ui/test_errata.py b/tests/foreman/ui/test_errata.py index d2bff98e1b5..104aa5e93ff 100644 --- a/tests/foreman/ui/test_errata.py +++ b/tests/foreman/ui/test_errata.py @@ -865,12 +865,17 @@ def test_positive_apply_for_all_hosts( hosts. """ num_hosts = 4 - distro = 'rhel10' + # newest major rhel distro from supportability + major_versions = [ + ver for ver in settings.supportability.content_hosts.rhel.versions if isinstance(ver, int) + ] + distro = 'rhel' + str(max(major_versions)) # one custom repo on satellite, for all hosts to use custom_repo = target_sat.api.Repository(url=CUSTOM_REPO_URL, product=module_product).create() custom_repo.sync() module_cv.repository = [custom_repo] module_cv.update(['repository']) + with Broker( nick=distro, workflow='deploy-template', diff --git a/tests/foreman/ui/test_repositories.py b/tests/foreman/ui/test_repositories.py index 081c2d96fd8..aaf85157230 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_match(r'^(?!.*fips).*$') # all major versions, excluding fips def test_positive_custom_products_disabled_by_default( session, default_location, @@ -56,7 +56,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_match(r'^(?!.*fips).*$') # all major versions, excluding fips def test_positive_override_custom_products_using_select_all( session, default_location, @@ -99,7 +99,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_match(r'^(?!.*fips).*$') # all major versions, excluding fips def test_positive_override_custom_products_not_using_select_all( session, default_location, diff --git a/tests/upgrades/test_errata.py b/tests/upgrades/test_errata.py index 4b03a7e232b..593fd636681 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([7, 8, 9, 10]) @pytest.mark.no_containers @pytest.mark.pre_upgrade def test_pre_scenario_generate_errata_for_client( diff --git a/tests/upgrades/test_repository.py b/tests/upgrades/test_repository.py index bb730ca847e..bfaf35b4108 100644 --- a/tests/upgrades/test_repository.py +++ b/tests/upgrades/test_repository.py @@ -393,7 +393,7 @@ class TestSimpleContentAccessOnly: satellite with simple content access mode only. """ - @pytest.mark.rhel_ver_list([7, 8, 9]) + @pytest.mark.rhel_ver_list([7, 8, 9, 10]) @pytest.mark.no_containers @pytest.mark.pre_upgrade def test_pre_simple_content_access_only(