From 8b0e3e033502140f70f258911d21e6076a1b8122 Mon Sep 17 00:00:00 2001 From: Samuel Bible Date: Thu, 12 Sep 2024 12:43:21 -0500 Subject: [PATCH] Change from module to function fixtures (#16345) --- tests/foreman/ui/test_host.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/foreman/ui/test_host.py b/tests/foreman/ui/test_host.py index 4b130b06234..119f031f7bf 100644 --- a/tests/foreman/ui/test_host.py +++ b/tests/foreman/ui/test_host.py @@ -2552,7 +2552,7 @@ def _cleanup(): @pytest.mark.parametrize('errata_to_install', ['1', '2']) @pytest.mark.parametrize('manage_by_custom_rex', [True, False]) @pytest.mark.parametrize( - 'module_repos_collection_with_setup', + 'function_repos_collection_with_manifest', [ { 'distro': 'rhel8', @@ -2570,9 +2570,9 @@ def _cleanup(): def test_all_hosts_manage_errata( session, module_target_sat, - module_org, - mod_content_hosts, - module_repos_collection_with_setup, + function_sca_manifest_org, + content_hosts, + function_repos_collection_with_manifest, manage_by_custom_rex, errata_to_install, new_host_ui, @@ -2591,9 +2591,11 @@ def test_all_hosts_manage_errata( errata_ids = settings.repos.yum_3.errata[25] if errata_to_install == '2': errata_ids = [settings.repos.yum_3.errata[25], settings.repos.yum_1.errata[1]] - for host in mod_content_hosts: + for host in content_hosts: host.add_rex_key(module_target_sat) - module_repos_collection_with_setup.setup_virtual_machine(host, enable_custom_repos=True) + function_repos_collection_with_manifest.setup_virtual_machine( + host, enable_custom_repos=True + ) host.run(f'yum install -y {FAKE_7_CUSTOM_PACKAGE}') result = host.run(f'rpm -q {FAKE_7_CUSTOM_PACKAGE}') assert result.status == 0 @@ -2602,16 +2604,16 @@ def test_all_hosts_manage_errata( result = host.run(f'rpm -q {FAKE_1_CUSTOM_PACKAGE}') assert result.status == 0 with module_target_sat.ui_session() as session: - session.organization.select(module_org.name) + session.organization.select(function_sca_manifest_org.name) session.location.select(loc_name=DEFAULT_LOC) session.all_hosts.manage_errata( - host_names=[mod_content_hosts[0].hostname, mod_content_hosts[1].hostname], + host_names=[content_hosts[0].hostname, content_hosts[1].hostname], erratas_to_apply_by_id=errata_ids, manage_by_customized_rex=manage_by_custom_rex, ) if errata_to_install == '2': errata_ids = f'{errata_ids[0]},{errata_ids[1]}' - for host in mod_content_hosts: + for host in content_hosts: task_result = module_target_sat.wait_for_tasks( search_query=(f'"Install errata errata_id ^ ({errata_ids}) on {host.hostname}"'), search_rate=2,