Skip to content
Open
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
9 changes: 8 additions & 1 deletion tests/infrastructure/vhostmd/test_downwardmetrics_virtio.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using preferred_preference_for_rhel_version you can try using vm_preference_infer=True in the VM creation.
It should automatically assign the preference according to arch, but this needs validation

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
)
from pyhelper_utils.shell import run_ssh_commands

from utilities.constants import OS_FLAVOR_RHEL
from utilities.architecture import get_cluster_architecture
from utilities.constants import OS_FLAVOR_RHEL, S390X
from utilities.hco import ResourceEditorValidateHCOReconcile
from utilities.virt import VirtualMachineForTests, wait_for_running_vm

Expand Down Expand Up @@ -128,6 +129,12 @@ def preferred_cluster_instance_type(unprivileged_client):
@pytest.fixture()
def preferred_preference_for_rhel_version(rhel_version, unprivileged_client):
preference_name = re.sub(r"(\D+)(\d+)", r"\1.\2", rhel_version)
if get_cluster_architecture() == S390X:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use get_cluster_architecture fixture

preference_object = VirtualMachineClusterPreference(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe

if get_cluster_architecture() == S390X:
preference_name = f"{preference_name}.{S390X}"

preference_object = VirtualMachineClusterPreference(name=preference_name, client=unprivileged_client)

name=f"{preference_name}.{S390X}", client=unprivileged_client
)
if preference_object.exists:
return preference_object
preference_object = VirtualMachineClusterPreference(name=preference_name, client=unprivileged_client)
if preference_object.exists:
return preference_object
Expand Down