Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.16.z] Change from module to function fixtures #16346

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading