From b9760e156f4dfab0a895cf26c1ddb3a714a27f92 Mon Sep 17 00:00:00 2001 From: Mark LaBonte Date: Fri, 1 Aug 2025 14:16:14 -0400 Subject: [PATCH 1/2] Updates for Azure machinesets --- tests/interop/test_validate_gpu_nodes.py | 28 ++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/interop/test_validate_gpu_nodes.py b/tests/interop/test_validate_gpu_nodes.py index f38c8efc..39e75b86 100644 --- a/tests/interop/test_validate_gpu_nodes.py +++ b/tests/interop/test_validate_gpu_nodes.py @@ -27,7 +27,11 @@ def test_validate_gpu_nodes(openshift_dyn_client): found = False for machineset in machinesets: logger.info(machineset.instance.metadata.name) - if re.search("gpu", machineset.instance.metadata.name): + # "gpu" for AWS machineset + # "nvidia" for Azure machineset + if re.search("gpu", machineset.instance.metadata.name) or re.search( + "nvidia", machineset.instance.metadata.name + ): gpu_machineset = machineset found = True break @@ -86,18 +90,20 @@ def test_validate_gpu_nodes(openshift_dyn_client): logger.info("Checking GPU machineset instance type") err_msg = "No instanceType found for GPU machineset" - try: - logger.info( - machineset.instance.spec.template.spec.providerSpec.value.instanceType - ) - except AttributeError: - logger.error(f"FAIL: {err_msg}") - assert False, err_msg - instance_type = str( - machineset.instance.spec.template.spec.providerSpec.value.instanceType + # for AWS + instance_type = ( + gpu_machineset.instance.spec.template.spec.providerSpec.value.instanceType ) - if instance_type == "None": + if instance_type == None: + # for Azure + instance_type = ( + gpu_machineset.instance.spec.template.spec.providerSpec.value.vmSize + ) + + logger.info(instance_type) + + if instance_type == None: logger.error(f"FAIL: {err_msg}") assert False, err_msg From f7475684d61ff2c2d73c3e8074bee90103a95a64 Mon Sep 17 00:00:00 2001 From: Mark LaBonte Date: Fri, 1 Aug 2025 14:22:20 -0400 Subject: [PATCH 2/2] Fix linting errors --- tests/interop/test_validate_gpu_nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/interop/test_validate_gpu_nodes.py b/tests/interop/test_validate_gpu_nodes.py index 39e75b86..c3ae585c 100644 --- a/tests/interop/test_validate_gpu_nodes.py +++ b/tests/interop/test_validate_gpu_nodes.py @@ -95,7 +95,7 @@ def test_validate_gpu_nodes(openshift_dyn_client): instance_type = ( gpu_machineset.instance.spec.template.spec.providerSpec.value.instanceType ) - if instance_type == None: + if instance_type is None: # for Azure instance_type = ( gpu_machineset.instance.spec.template.spec.providerSpec.value.vmSize @@ -103,7 +103,7 @@ def test_validate_gpu_nodes(openshift_dyn_client): logger.info(instance_type) - if instance_type == None: + if instance_type is None: logger.error(f"FAIL: {err_msg}") assert False, err_msg