@@ -28,7 +28,7 @@ func TestClient() *metalv1.APIClient {
28
28
configuration .AddDefaultHeader ("X-Auth-Token" , os .Getenv ("METAL_AUTH_TOKEN" ))
29
29
configuration .UserAgent = fmt .Sprintf ("metal-cli/test-helper %s" , configuration .UserAgent )
30
30
// For debug purpose
31
- // configuration.Debug = true
31
+ configuration .Debug = true
32
32
apiClient := metalv1 .NewAPIClient (configuration )
33
33
return apiClient
34
34
}
@@ -188,33 +188,6 @@ func WaitForDeviceState(t *testing.T, deviceId string, states ...metalv1.DeviceS
188
188
return false , fmt .Errorf ("timed out waiting for device %v state %v to become one of %v" , deviceId , device .GetState (), states )
189
189
}
190
190
191
- func WaitForVrfRouteState (t * testing.T , routeId string , statuses ... metalv1.VrfRouteStatus ) bool {
192
- var route * metalv1.VrfRoute
193
- var err error
194
- t .Helper ()
195
- predefinedTime := 900 * time .Second // Adjust this as needed
196
- retryInterval := 10 * time .Second // Adjust this as needed
197
- startTime := time .Now ()
198
- client := TestClient ()
199
- for time .Since (startTime ) < predefinedTime {
200
- route , _ , err = client .VRFsApi .FindVrfRouteById (context .Background (), routeId ).Execute ()
201
- if err != nil {
202
- t .Fatal (err )
203
- return false
204
- }
205
- for _ , status := range statuses {
206
- if route .GetStatus () == status {
207
- return true
208
- }
209
- }
210
-
211
- // Sleep for the specified interval
212
- time .Sleep (retryInterval )
213
- }
214
- t .Fatalf ("timed out waiting for VRF route %v status %v to become one of %v" , routeId , route .GetStatus (), statuses )
215
- return false
216
- }
217
-
218
191
func WaitForAttachVlanToPort (t * testing.T , portId string , attach bool ) error {
219
192
t .Helper ()
220
193
ticker := time .NewTicker (5 * time .Second )
0 commit comments