Skip to content

Commit

Permalink
Change from module to function fixtures (SatelliteQE#16345)
Browse files Browse the repository at this point in the history
  • Loading branch information
sambible authored and jyejare committed Oct 19, 2024
1 parent 418d0d0 commit 8e36fe1
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/foreman/ui/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 8e36fe1

Please sign in to comment.