Skip to content

Commit

Permalink
[6.15.z] FAM: only setup libvirt for tests that need them (#15958) (#…
Browse files Browse the repository at this point in the history
…15993)

FAM: only setup libvirt for tests that need them (#15958)

Co-authored-by: Evgeni Golov <evgeni@redhat.com>
  • Loading branch information
jameerpathan111 and evgeni authored Aug 21, 2024
1 parent ac24f06 commit 64ac2ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1978,6 +1978,12 @@
"webhook",
]

FAM_TEST_LIBVIRT_PLAYBOOKS = [
"compute_attribute",
"compute_profile",
"hostgroup",
]

FAM_ROOT_DIR = '/usr/share/ansible/collections/ansible_collections/redhat/satellite'

FAM_MODULE_PATH = f'{FAM_ROOT_DIR}/plugins/modules'
Expand Down
8 changes: 6 additions & 2 deletions tests/foreman/sys/test_fam.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from robottelo.constants import (
FAM_MODULE_PATH,
FAM_ROOT_DIR,
FAM_TEST_LIBVIRT_PLAYBOOKS,
FAM_TEST_PLAYBOOKS,
FOREMAN_ANSIBLE_MODULES,
RH_SAT_ROLES,
Expand Down Expand Up @@ -58,8 +59,7 @@ def setup_fam(module_target_sat, module_sca_manifest, install_import_ansible_rol
# Execute AAP WF for FAM setup
Broker().execute(workflow='fam-test-setup', source_vm=module_target_sat.name)

# Setup provisioning resources and copy config files to the Satellite
module_target_sat.configure_libvirt_cr()
# Copy config files to the Satellite
module_target_sat.put(
settings.fam.server.to_yaml(),
f'{FAM_ROOT_DIR}/tests/test_playbooks/vars/server.yml',
Expand Down Expand Up @@ -135,6 +135,10 @@ def test_positive_run_modules_and_roles(module_target_sat, setup_fam, ansible_mo
:expectedresults: All modules and roles run successfully
"""
# Setup provisioning resources
if ansible_module in FAM_TEST_LIBVIRT_PLAYBOOKS:
module_target_sat.configure_libvirt_cr()

# Execute test_playbook
result = module_target_sat.execute(
f'export NO_COLOR=True && . ~/localenv/bin/activate && cd {FAM_ROOT_DIR} && make livetest_{ansible_module}'
Expand Down

0 comments on commit 64ac2ed

Please sign in to comment.