File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,11 @@ def test_validate_gpu_nodes(openshift_dyn_client):
2727 found = False
2828 for machineset in machinesets :
2929 logger .info (machineset .instance .metadata .name )
30- if re .search ("gpu" , machineset .instance .metadata .name ):
30+ # "gpu" for AWS machineset
31+ # "nvidia" for Azure machineset
32+ if re .search ("gpu" , machineset .instance .metadata .name ) or re .search (
33+ "nvidia" , machineset .instance .metadata .name
34+ ):
3135 gpu_machineset = machineset
3236 found = True
3337 break
@@ -86,18 +90,20 @@ def test_validate_gpu_nodes(openshift_dyn_client):
8690 logger .info ("Checking GPU machineset instance type" )
8791
8892 err_msg = "No instanceType found for GPU machineset"
89- try :
90- logger .info (
91- machineset .instance .spec .template .spec .providerSpec .value .instanceType
92- )
93- except AttributeError :
94- logger .error (f"FAIL: { err_msg } " )
95- assert False , err_msg
9693
97- instance_type = str (
98- machineset .instance .spec .template .spec .providerSpec .value .instanceType
94+ # for AWS
95+ instance_type = (
96+ gpu_machineset .instance .spec .template .spec .providerSpec .value .instanceType
9997 )
100- if instance_type == "None" :
98+ if instance_type == None :
99+ # for Azure
100+ instance_type = (
101+ gpu_machineset .instance .spec .template .spec .providerSpec .value .vmSize
102+ )
103+
104+ logger .info (instance_type )
105+
106+ if instance_type == None :
101107 logger .error (f"FAIL: { err_msg } " )
102108 assert False , err_msg
103109
You can’t perform that action at this time.
0 commit comments