Skip to content

Commit

Permalink
Add core and threads for rhel.9.realtime (#209)
Browse files Browse the repository at this point in the history
- rhel.9.realtime has SocketsCoresThreads

Signed-off-by: Geetika Kapoor <gkapoor@redhat.com>
Co-authored-by: Debarati Basu-Nag <dbasunag@redhat.com>
  • Loading branch information
geetikakay and dbasunag authored Feb 6, 2025
1 parent 15c1ca2 commit c646935
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions tests/infrastructure/instance_types/test_common_vm_preference.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,25 @@

def start_vm_with_cluster_preference(client, preference_name, namespace_name):
cluster_preference = VirtualMachineClusterPreference(name=preference_name)
with VirtualMachineForTests(
client=client,
name=f"rhel-vm-with-{preference_name}",
namespace=namespace_name,
# TODO add corresponding images to the vms
image=Images.Rhel.RHEL9_REGISTRY_GUEST_IMG,
memory_guest=cluster_preference.instance.spec.requirements.memory.guest,
cpu_sockets=cluster_preference.instance.spec.requirements.cpu.guest,
vm_preference=cluster_preference,
) as vm:

vm_args = {
"client": client,
"name": f"rhel-vm-with-{preference_name}",
"namespace": namespace_name,
# TODO add corresponding images to the VM based on preference
"image": Images.Rhel.RHEL9_REGISTRY_GUEST_IMG,
"memory_guest": cluster_preference.instance.spec.requirements.memory.guest,
"cpu_sockets": cluster_preference.instance.spec.requirements.cpu.guest,
"vm_preference": cluster_preference,
}

if preference_name == "rhel.9.realtime":
vm_args.update({
"cpu_cores": cluster_preference.instance.spec.requirements.cpu.guest,
"cpu_threads": cluster_preference.instance.spec.requirements.cpu.guest,
})

with VirtualMachineForTests(**vm_args) as vm:
running_vm(vm=vm, wait_for_interfaces=False, check_ssh_connectivity=False)


Expand Down

0 comments on commit c646935

Please sign in to comment.