@@ -467,6 +467,7 @@ func TestCadvisorListPodCPUAndMemoryStats(t *testing.T) {
467
467
assert .EqualValues (t , testTime (creationTime , seedPod0Container0 ).Unix (), con .StartTime .Time .Unix ())
468
468
checkCPUStats (t , "Pod0Container0" , seedPod0Container0 , con .CPU )
469
469
checkMemoryStats (t , "Pod0Conainer0" , seedPod0Container0 , infos ["/pod0-c0" ], con .Memory )
470
+ checkSwapStats (t , "Pod0Conainer0" , seedPod0Container0 , infos ["/pod0-c0" ], con .Swap )
470
471
assert .Nil (t , con .Rootfs )
471
472
assert .Nil (t , con .Logs )
472
473
assert .Nil (t , con .Accelerators )
@@ -476,6 +477,7 @@ func TestCadvisorListPodCPUAndMemoryStats(t *testing.T) {
476
477
assert .EqualValues (t , testTime (creationTime , seedPod0Container1 ).Unix (), con .StartTime .Time .Unix ())
477
478
checkCPUStats (t , "Pod0Container1" , seedPod0Container1 , con .CPU )
478
479
checkMemoryStats (t , "Pod0Container1" , seedPod0Container1 , infos ["/pod0-c1" ], con .Memory )
480
+ checkSwapStats (t , "Pod0Container1" , seedPod0Container1 , infos ["/pod0-c1" ], con .Swap )
479
481
assert .Nil (t , con .Rootfs )
480
482
assert .Nil (t , con .Logs )
481
483
assert .Nil (t , con .Accelerators )
@@ -491,6 +493,9 @@ func TestCadvisorListPodCPUAndMemoryStats(t *testing.T) {
491
493
if ps .Memory != nil {
492
494
checkMemoryStats (t , "Pod0" , seedPod0Infra , infos ["/pod0-i" ], ps .Memory )
493
495
}
496
+ if ps .Swap != nil {
497
+ checkSwapStats (t , "Pod0" , seedPod0Infra , infos ["/pod0-i" ], ps .Swap )
498
+ }
494
499
495
500
// Validate Pod1 Results
496
501
ps , found = indexPods [prf1 ]
@@ -500,6 +505,7 @@ func TestCadvisorListPodCPUAndMemoryStats(t *testing.T) {
500
505
assert .Equal (t , cName10 , con .Name )
501
506
checkCPUStats (t , "Pod1Container0" , seedPod1Container , con .CPU )
502
507
checkMemoryStats (t , "Pod1Container0" , seedPod1Container , infos ["/pod1-c0" ], con .Memory )
508
+ checkSwapStats (t , "Pod1Container0" , seedPod1Container , infos ["/pod1-c0" ], con .Swap )
503
509
assert .Nil (t , ps .EphemeralStorage )
504
510
assert .Nil (t , ps .VolumeStats )
505
511
assert .Nil (t , ps .Network )
@@ -512,6 +518,7 @@ func TestCadvisorListPodCPUAndMemoryStats(t *testing.T) {
512
518
assert .Equal (t , cName20 , con .Name )
513
519
checkCPUStats (t , "Pod2Container0" , seedPod2Container , con .CPU )
514
520
checkMemoryStats (t , "Pod2Container0" , seedPod2Container , infos ["/pod2-c0" ], con .Memory )
521
+ checkSwapStats (t , "Pod2Container0" , seedPod2Container , infos ["/pod2-c0" ], con .Swap )
515
522
assert .Nil (t , ps .EphemeralStorage )
516
523
assert .Nil (t , ps .VolumeStats )
517
524
assert .Nil (t , ps .Network )
0 commit comments