Skip to content

Commit

Permalink
Add workaround for cpu_mode for EL9 Libvirt tests (#12973)
Browse files Browse the repository at this point in the history
Add workaround for cpu_mode for el9 libvirt tests

Signed-off-by: Gaurav Talreja <[email protected]>
  • Loading branch information
Gauravtalreja1 authored and vijaysawant committed Oct 26, 2023
1 parent 8b0eca5 commit 0dc601c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tests/foreman/cli/test_computeresource_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from robottelo.config import settings
from robottelo.constants import FOREMAN_PROVIDERS, LIBVIRT_RESOURCE_URL
from robottelo.utils.datafactory import parametrized
from robottelo.utils.issue_handlers import is_open

LIBVIRT_URL = LIBVIRT_RESOURCE_URL % settings.libvirt.libvirt_hostname

Expand Down Expand Up @@ -436,6 +437,7 @@ def test_positive_provision_end_to_end(
module_sca_manifest_org,
module_location,
provisioning_hostgroup,
module_provisioning_rhel_content,
):
"""Provision a host on Libvirt compute resource with the help of hostgroup.
Expand All @@ -453,10 +455,14 @@ def test_positive_provision_end_to_end(
:expectedresults: Host should be provisioned with hostgroup
:parametrized: yes
:BZ: 2236693
"""
sat = module_libvirt_provisioning_sat.sat
cr_name = gen_string('alpha')
hostname = gen_string('alpha').lower()
os_major_ver = module_provisioning_rhel_content.os.major
cpu_mode = 'host-passthrough' if is_open('BZ:2236693') and os_major_ver == '9' else 'default'
libvirt_cr = sat.cli.ComputeResource.create(
{
'name': cr_name,
Expand All @@ -476,7 +482,7 @@ def test_positive_provision_end_to_end(
'compute-resource-id': libvirt_cr['id'],
'ip': None,
'mac': None,
'compute-attributes': 'cpus=1, memory=6442450944, cpu_mode=default, start=1',
'compute-attributes': f'cpus=1, memory=6442450944, cpu_mode={cpu_mode}, start=1',
'interface': f'compute_type=bridge,compute_bridge=br-{settings.provisioning.vlan_id}',
'volume': 'capacity=10',
'provision-method': 'build',
Expand Down
6 changes: 5 additions & 1 deletion tests/foreman/ui/test_contenthost.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
if not setting_is_set('clients') or not setting_is_set('fake_manifest'):
pytest.skip('skipping tests due to missing settings', allow_module_level=True)

pytestmark = [pytest.mark.no_containers]


@pytest.fixture(scope='module', autouse=True)
def host_ui_default():
Expand Down Expand Up @@ -82,7 +84,9 @@ def vm(module_repos_collection_with_manifest, rhel7_contenthost, target_sat):
@pytest.fixture
def vm_module_streams(module_repos_collection_with_manifest, rhel8_contenthost, target_sat):
"""Virtual machine registered in satellite"""
module_repos_collection_with_manifest.setup_virtual_machine(rhel8_contenthost)
module_repos_collection_with_manifest.setup_virtual_machine(
rhel8_contenthost, enable_custom_repos=True
)
rhel8_contenthost.add_rex_key(satellite=target_sat)
yield rhel8_contenthost

Expand Down

0 comments on commit 0dc601c

Please sign in to comment.