Skip to content

Commit

Permalink
+ [e2e] update fixture for VM machine types
Browse files Browse the repository at this point in the history
  • Loading branch information
lanfon72 committed Mar 26, 2024
1 parent e3d881c commit d55058b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions harvester_e2e_tests/integrations/test_3_vm_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ def unset_cpu_memory_overcommit(api_client):
api_client.settings.update('overcommit-config', spec)


@pytest.fixture
def machine_types(request, api_client):
major, minor, micro = api_client.cluster_version.release
if major > 1 or minor > 2 or (minor == 2 and micro > 1):
# > 1.y.z || > 1.3.z || > 1.2.1
return "_".join(request.param).replace("pc", "pc-q35").split("_")
return request.param


@pytest.mark.p0
@pytest.mark.virtualmachines
@pytest.mark.dependency(name="minimal_vm")
Expand Down Expand Up @@ -1642,10 +1651,12 @@ def test_create_vm_no_available_resources(resource, api_client, image,

@pytest.mark.p0
@pytest.mark.virtualmachines
@pytest.mark.parametrize("machine_types", [("pc", "q35"), ("q35", "pc")],
ids=['pc_to_q35', 'q35_to_pc'])
def test_update_vm_machine_type(api_client, image, unique_vm_name,
wait_timeout, machine_types, sleep_timeout):
@pytest.mark.parametrize(
"machine_types", [("q35", "pc"), ("pc", "q35")], ids=['q35_to_pc', 'pc_to_q35'], indirect=True
)
def test_update_vm_machine_type(
api_client, image, unique_vm_name, wait_timeout, machine_types, sleep_timeout
):
"""Create a VM with machine type then update to another
Prerequisite:
Expand Down

0 comments on commit d55058b

Please sign in to comment.