@@ -313,6 +313,7 @@ func TestCadvisorListPodStats(t *testing.T) {
313
313
}
314
314
if ps .Swap != nil {
315
315
checkSwapStats (t , "Pod0" , seedPod0Infra , infos ["/pod0-i" ], ps .Swap )
316
+ checkContainersSwapStats (t , ps , infos ["/pod0-c0" ], infos ["/pod0-c1" ])
316
317
}
317
318
318
319
// Validate Pod1 Results
@@ -325,6 +326,7 @@ func TestCadvisorListPodStats(t *testing.T) {
325
326
checkMemoryStats (t , "Pod1Container0" , seedPod1Container , infos ["/pod1-c0" ], con .Memory )
326
327
checkSwapStats (t , "Pod1Container0" , seedPod1Container , infos ["/pod1-c0" ], con .Swap )
327
328
checkNetworkStats (t , "Pod1" , seedPod1Infra , ps .Network )
329
+ checkContainersSwapStats (t , ps , infos ["/pod1-c0" ])
328
330
329
331
// Validate Pod2 Results
330
332
ps , found = indexPods [prf2 ]
@@ -336,6 +338,7 @@ func TestCadvisorListPodStats(t *testing.T) {
336
338
checkMemoryStats (t , "Pod2Container0" , seedPod2Container , infos ["/pod2-c0" ], con .Memory )
337
339
checkSwapStats (t , "Pod2Container0" , seedPod2Container , infos ["/pod2-c0" ], con .Swap )
338
340
checkNetworkStats (t , "Pod2" , seedPod2Infra , ps .Network )
341
+ checkContainersSwapStats (t , ps , infos ["/pod2-c0" ])
339
342
340
343
// Validate Pod3 Results
341
344
@@ -352,6 +355,7 @@ func TestCadvisorListPodStats(t *testing.T) {
352
355
checkCPUStats (t , "Pod3Container1" , seedPod3Container1 , con .CPU )
353
356
checkMemoryStats (t , "Pod3Container1" , seedPod3Container1 , infos ["/pod3-c1" ], con .Memory )
354
357
checkSwapStats (t , "Pod3Container1" , seedPod3Container1 , infos ["/pod3-c1" ], con .Swap )
358
+ checkContainersSwapStats (t , ps , infos ["/pod3-c1" ])
355
359
}
356
360
357
361
func TestCadvisorListPodCPUAndMemoryStats (t * testing.T ) {
@@ -495,6 +499,7 @@ func TestCadvisorListPodCPUAndMemoryStats(t *testing.T) {
495
499
}
496
500
if ps .Swap != nil {
497
501
checkSwapStats (t , "Pod0" , seedPod0Infra , infos ["/pod0-i" ], ps .Swap )
502
+ checkContainersSwapStats (t , ps , infos ["/pod0-c0" ], infos ["/pod0-c1" ])
498
503
}
499
504
500
505
// Validate Pod1 Results
@@ -506,6 +511,7 @@ func TestCadvisorListPodCPUAndMemoryStats(t *testing.T) {
506
511
checkCPUStats (t , "Pod1Container0" , seedPod1Container , con .CPU )
507
512
checkMemoryStats (t , "Pod1Container0" , seedPod1Container , infos ["/pod1-c0" ], con .Memory )
508
513
checkSwapStats (t , "Pod1Container0" , seedPod1Container , infos ["/pod1-c0" ], con .Swap )
514
+ checkContainersSwapStats (t , ps , infos ["/pod1-c0" ])
509
515
assert .Nil (t , ps .EphemeralStorage )
510
516
assert .Nil (t , ps .VolumeStats )
511
517
assert .Nil (t , ps .Network )
@@ -519,6 +525,7 @@ func TestCadvisorListPodCPUAndMemoryStats(t *testing.T) {
519
525
checkCPUStats (t , "Pod2Container0" , seedPod2Container , con .CPU )
520
526
checkMemoryStats (t , "Pod2Container0" , seedPod2Container , infos ["/pod2-c0" ], con .Memory )
521
527
checkSwapStats (t , "Pod2Container0" , seedPod2Container , infos ["/pod2-c0" ], con .Swap )
528
+ checkContainersSwapStats (t , ps , infos ["/pod2-c0" ])
522
529
assert .Nil (t , ps .EphemeralStorage )
523
530
assert .Nil (t , ps .VolumeStats )
524
531
assert .Nil (t , ps .Network )
0 commit comments