@@ -153,12 +153,6 @@ var _ = Describe("[ref_id: 40307][pao]Resizing Network Queues", func() {
153153 }
154154 By ("Updating the performance profile" )
155155 profiles .UpdateWithRetry (profile )
156-
157- Eventually (func () bool {
158- err := checkDeviceSupport (workerRTNodes , nodesDevices )
159- Expect (err ).ToNot (HaveOccurred ())
160- return true
161- }, cluster .ComputeTestTimeout (200 * time .Second , RunningOnSingleNode ), testPollInterval * time .Second ).Should (BeTrue ())
162156 }
163157 //Verify the tuned profile is created on the worker-cnf nodes:
164158 tunedCmd := []string {"bash" , "-c" ,
@@ -205,11 +199,6 @@ var _ = Describe("[ref_id: 40307][pao]Resizing Network Queues", func() {
205199 },
206200 }
207201 profiles .UpdateWithRetry (profile )
208- Eventually (func () bool {
209- err := checkDeviceSupport (workerRTNodes , nodesDevices )
210- Expect (err ).ToNot (HaveOccurred ())
211- return true
212- }, cluster .ComputeTestTimeout (200 * time .Second , RunningOnSingleNode ), testPollInterval * time .Second ).Should (BeTrue ())
213202 }
214203 //Verify the tuned profile is created on the worker-cnf nodes:
215204 tunedCmd := []string {"bash" , "-c" ,
@@ -237,15 +226,14 @@ var _ = Describe("[ref_id: 40307][pao]Resizing Network Queues", func() {
237226
238227 It ("[test_id:40668] Verify reserved cpu count is added to networking devices matched with vendor and Device id" , func () {
239228 nodesDevices := make (map [string ]map [string ]int )
240- var device , vid , did string
241229 count := 0
242230 err := checkDeviceSupport (workerRTNodes , nodesDevices )
243231 Expect (err ).ToNot (HaveOccurred ())
244232 nodeName , device := getRandomNodeDevice (nodesDevices )
245- for _ , node := range workerRTNodes {
246- vid = getVendorID ( node , device )
247- did = getDeviceID ( node , device )
248- }
233+ node , err := nodes . GetByName ( nodeName )
234+ Expect ( err ). ToNot ( HaveOccurred () )
235+ vid := getVendorID ( * node , device )
236+ did := getDeviceID ( * node , device )
249237 profile , err = profiles .GetByNodeLabels (testutils .NodeSelectorLabels )
250238 Expect (err ).ToNot (HaveOccurred ())
251239 if profile .Spec .Net .UserLevelNetworking != nil && * profile .Spec .Net .UserLevelNetworking && len (profile .Spec .Net .Devices ) == 0 {
@@ -263,17 +251,12 @@ var _ = Describe("[ref_id: 40307][pao]Resizing Network Queues", func() {
263251 },
264252 }
265253 profiles .UpdateWithRetry (profile )
266- Eventually (func () bool {
267- err := checkDeviceSupport (workerRTNodes , nodesDevices )
268- Expect (err ).ToNot (HaveOccurred ())
269- return true
270- }, cluster .ComputeTestTimeout (240 * time .Second , RunningOnSingleNode ), testPollInterval * time .Second ).Should (BeTrue ())
271254 }
272255 //Verify the tuned profile is created on the worker-cnf nodes:
273256 tunedCmd := []string {"bash" , "-c" ,
274257 fmt .Sprintf ("cat /etc/tuned/openshift-node-performance-%s/tuned.conf | grep devices_udev_regex" , performanceProfileName )}
275258
276- node , err : = nodes .GetByName (nodeName )
259+ node , err = nodes .GetByName (nodeName )
277260 Expect (err ).ToNot (HaveOccurred ())
278261 tunedPod := nodes .TunedForNode (node , RunningOnSingleNode )
279262 out , err := pods .WaitForPodOutput (testclient .K8sClient , tunedPod , tunedCmd )
@@ -302,7 +285,9 @@ func checkDeviceSupport(workernodes []corev1.Node, nodesDevices map[string]map[s
302285 var noSupportedDevices = true
303286 var err error
304287 for _ , node := range workernodes {
305- nodesDevices [node .Name ] = make (map [string ]int )
288+ if nodesDevices [node .Name ] == nil {
289+ nodesDevices [node .Name ] = make (map [string ]int )
290+ }
306291 tunedPod := nodes .TunedForNode (& node , RunningOnSingleNode )
307292 phyDevs , err := pods .WaitForPodOutput (testclient .K8sClient , tunedPod , cmdGetPhysicalDevices )
308293 Expect (err ).ToNot (HaveOccurred ())
@@ -370,7 +355,7 @@ func getRandomNodeDevice(nodesDevices map[string]map[string]int) (string, string
370355 for d := range nodesDevices [node ] {
371356 if d != "" {
372357 device = d
373- break
358+ return node , device
374359 }
375360 }
376361 }
0 commit comments