From f2202eebfcd634155e088ef4ff63f1e7fbf25af0 Mon Sep 17 00:00:00 2001 From: David Moore Date: Thu, 7 Nov 2024 09:41:53 -0500 Subject: [PATCH] New parametrizations for Errata rhel chosts --- conf/supportability.yaml | 2 +- pytest_plugins/fixture_markers.py | 2 +- pytest_plugins/markers.py | 2 +- tests/foreman/api/test_errata.py | 4 ++-- tests/foreman/cli/test_errata.py | 12 ++++++------ tests/foreman/ui/test_errata.py | 32 +++++++++++++++---------------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/conf/supportability.yaml b/conf/supportability.yaml index 03c2e948c90..a9b0888d890 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', 10, '10_fips'] + versions: [7,'7_fips', 8, '8_fips', 9, '9_fips', 10,] diff --git a/pytest_plugins/fixture_markers.py b/pytest_plugins/fixture_markers.py index f36b215115a..c2570ec921a 100644 --- a/pytest_plugins/fixture_markers.py +++ b/pytest_plugins/fixture_markers.py @@ -46,7 +46,7 @@ def pytest_generate_tests(metafunc): if 'fips' not in str(setting_rhel_ver) ][-(num_versions + 1) :] # inclusive (+1) to collect N as well match_params.extend(filtered_versions) - # match versions with existing markers + # match versions with existing regex markers else: for matcher in matchers: match_params.extend( diff --git a/pytest_plugins/markers.py b/pytest_plugins/markers.py index 5398dbb3588..87f2129906e 100644 --- a/pytest_plugins/markers.py +++ b/pytest_plugins/markers.py @@ -20,7 +20,7 @@ def pytest_configure(config): "run_in_one_thread: Sequential tests", "build_sanity: Fast, basic tests that confirm build is ready for full test suite", "rhel_ver_list: Filter rhel_contenthost versions by list", - "rhel_ver_match: Filter rhel_contenthost versions by regexp", + "rhel_ver_match: Filter rhel_contenthost versions by regexp, or format 'N-#'", "no_containers: Disable container hosts from being used in favor of VMs", "include_capsule: For satellite-maintain tests to run on Satellite and Capsule both", "capsule_only: For satellite-maintain tests to run only on Capsules", diff --git a/tests/foreman/api/test_errata.py b/tests/foreman/api/test_errata.py index 1b82c4ee195..34fb1262947 100644 --- a/tests/foreman/api/test_errata.py +++ b/tests/foreman/api/test_errata.py @@ -509,7 +509,7 @@ def _publish_and_wait(sat, org, cv, search_rate=1, max_tries=10): @pytest.mark.upgrade @pytest.mark.tier3 -@pytest.mark.rhel_ver_match('N-2') # latest 3 major ver supported, exclude fips +@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$') # all major versions, excluding fips @pytest.mark.no_containers @pytest.mark.e2e def test_positive_install_in_hc( @@ -656,7 +656,7 @@ def test_positive_install_in_hc( @pytest.mark.tier3 -@pytest.mark.rhel_ver_match(r'^(?!.*(7|fips)).*$') # exclude any fips or major ver 7 +@pytest.mark.rhel_ver_match(r'^(?!.*fips).*$') # all major versions, excluding fips @pytest.mark.no_containers @pytest.mark.e2e @pytest.mark.pit_client diff --git a/tests/foreman/cli/test_errata.py b/tests/foreman/cli/test_errata.py index f161ab5355b..8f07107d8ae 100644 --- a/tests/foreman/cli/test_errata.py +++ b/tests/foreman/cli/test_errata.py @@ -1230,7 +1230,7 @@ def errata_host( @pytest.mark.tier2 @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-1') # Newest major RHEL version (N), and the one prior. 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. @@ -1281,7 +1281,7 @@ def test_apply_errata_using_default_content_view(errata_host, module_sca_manifes @pytest.mark.tier2 @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-1') 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. @@ -1340,7 +1340,7 @@ def test_update_applicable_package_using_default_content_view(errata_host, targe @pytest.mark.tier2 @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-1') 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. @@ -1389,7 +1389,7 @@ def test_downgrade_applicable_package_using_default_content_view(errata_host, ta @pytest.mark.tier2 -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-2') 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. @@ -1437,7 +1437,7 @@ def test_install_applicable_package_to_registered_host(errata_host, target_sat): @pytest.mark.tier2 @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-2') def test_downgrading_package_shows_errata_from_library( errata_host, module_sca_manifest_org, target_sat ): @@ -1542,7 +1542,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_match('N-2') 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/ui/test_errata.py b/tests/foreman/ui/test_errata.py index ff5c1ef99ac..27fbcc427de 100644 --- a/tests/foreman/ui/test_errata.py +++ b/tests/foreman/ui/test_errata.py @@ -292,7 +292,7 @@ def cleanup(): @pytest.mark.e2e @pytest.mark.tier3 -@pytest.mark.rhel_ver_match('[^7]|10') +@pytest.mark.rhel_ver_match('N-3') # Newest major RHEL version (N), and three prior. @pytest.mark.parametrize('registered_contenthost', [[CUSTOM_REPO_URL]], indirect=True) @pytest.mark.no_containers def test_end_to_end( @@ -486,7 +486,7 @@ def test_end_to_end( @pytest.mark.tier2 @pytest.mark.no_containers -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-2') @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( @@ -502,7 +502,7 @@ def test_host_content_errata_tab_pagination( # Test apply by REX using Select All for BZ#1846670 :setup: - 1. rhel8 registered contenthost with custom repos enabled. + 1. registered contenthost with custom repos enabled. 2. enable and sync rh repository. 3. add rh repo to cv for registered host and publish/promote. @@ -793,7 +793,7 @@ def test_positive_list_permission( product only. """ module_target_sat.api_factory.enable_sync_redhat_repo( - constants.REPOS['rhsclient8'], + constants.REPOS['rhsclient9'], function_sca_manifest_org.id, ) custom_repo = module_target_sat.api.Repository( @@ -808,7 +808,7 @@ def test_positive_list_permission( query={'search': 'resource_type="Katello::Product"'} ), role=role, - search=f'name = "{PRDS["rhel8"]}"', + search=f'name = "{PRDS["rhel9"]}"', ).create() # generate login credentials for new role user_password = gen_string('alphanumeric') @@ -854,7 +854,7 @@ def test_positive_apply_for_all_hosts( :setup: 1. Create and sync one custom repo for all hosts, add to a content-view. - 2. Checkout four rhel9 contenthosts via Broker. + 2. Checkout four contenthosts, latest rhel ver, via Broker. 3. Register all of the hosts to the same AK, CV, single repo. :steps: @@ -968,7 +968,7 @@ def test_positive_apply_for_all_hosts( @pytest.mark.tier2 @pytest.mark.upgrade -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-1') def test_positive_view_cve(session, module_product, module_sca_manifest_org, target_sat): """View CVE number(s) in Errata Details page @@ -1034,7 +1034,7 @@ def test_positive_filter_by_environment( module_cv.repository = [custom_repo] module_cv.update(['repository']) - with Broker(nick='rhel8', host_class=ContentHost, _count=3) as clients: + with Broker(nick='rhel9', workflow='deploy-rhel', host_class=ContentHost, _count=3) as clients: for client in clients: # register all hosts to the same AK, CV: setup = target_sat.api_factory.register_host_and_needed_setup( @@ -1093,7 +1093,7 @@ def test_positive_filter_by_environment( [[CUSTOM_REPO_URL]], indirect=True, ) -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-2') def test_positive_content_host_previous_env( session, module_cv, @@ -1162,7 +1162,7 @@ def test_positive_content_host_previous_env( @pytest.mark.tier2 -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-2') @pytest.mark.parametrize( 'registered_contenthost', [[CUSTOM_REPO_URL]], @@ -1194,7 +1194,7 @@ def test_positive_check_errata(session, registered_contenthost): @pytest.mark.tier3 -@pytest.mark.rhel_ver_match('[8, 9]') +@pytest.mark.rhel_ver_match('N-2') @pytest.mark.parametrize( 'registered_contenthost', [['Library', CUSTOM_REPO_URL]], @@ -1266,7 +1266,7 @@ def test_positive_host_content_library( @pytest.mark.tier3 -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-1') @pytest.mark.parametrize( 'registered_contenthost', [[CUSTOM_REPO_URL]], @@ -1331,7 +1331,7 @@ def test_positive_errata_search_type(session, module_sca_manifest_org, registere @pytest.mark.tier3 -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-2') @pytest.mark.parametrize( 'registered_contenthost', [[CUSTOM_REPO_URL]], @@ -1437,7 +1437,7 @@ def test_positive_show_count_on_host_pages(session, module_org, registered_conte @pytest.mark.tier3 -@pytest.mark.rhel_ver_match('8') +@pytest.mark.rhel_ver_match('N-2') @pytest.mark.parametrize( 'registered_contenthost', [[CUSTOM_REPO_URL]], @@ -1511,7 +1511,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_match('N-1') @pytest.mark.parametrize( 'registered_contenthost', [[CUSTOM_REPO_URL]], @@ -1663,7 +1663,7 @@ def test_content_host_errata_search_commands( cvs = [module_cv.read(), content_view.read()] # client0, client1 # walrus-0.71-1.noarch (RHSA), kangaroo-0.1-1.noarch (RHBA) packages = [FAKE_1_CUSTOM_PACKAGE, FAKE_4_CUSTOM_PACKAGE] - with Broker(nick='rhel8', host_class=ContentHost, _count=2) as clients: + with Broker(nick='rhel9', workflow='deploy-rhel', host_class=ContentHost, _count=2) as clients: for ( client, cv,