@@ -444,34 +444,34 @@ func TestStaticPolicyAdd(t *testing.T) {
444
444
}
445
445
446
446
container := & testCase .pod .Spec .Containers [0 ]
447
- err := policy .AddContainer (st , testCase .pod , container )
447
+ err := policy .Allocate (st , testCase .pod , container )
448
448
if ! reflect .DeepEqual (err , testCase .expErr ) {
449
- t .Errorf ("StaticPolicy AddContainer () error (%v). expected add error: %v but got: %v" ,
449
+ t .Errorf ("StaticPolicy Allocate () error (%v). expected add error: %v but got: %v" ,
450
450
testCase .description , testCase .expErr , err )
451
451
}
452
452
453
453
if testCase .expCPUAlloc {
454
454
cset , found := st .assignments [string (testCase .pod .UID )][container .Name ]
455
455
if ! found {
456
- t .Errorf ("StaticPolicy AddContainer () error (%v). expected container %v to be present in assignments %v" ,
456
+ t .Errorf ("StaticPolicy Allocate () error (%v). expected container %v to be present in assignments %v" ,
457
457
testCase .description , container .Name , st .assignments )
458
458
}
459
459
460
460
if ! reflect .DeepEqual (cset , testCase .expCSet ) {
461
- t .Errorf ("StaticPolicy AddContainer () error (%v). expected cpuset %v but got %v" ,
461
+ t .Errorf ("StaticPolicy Allocate () error (%v). expected cpuset %v but got %v" ,
462
462
testCase .description , testCase .expCSet , cset )
463
463
}
464
464
465
465
if ! cset .Intersection (st .defaultCPUSet ).IsEmpty () {
466
- t .Errorf ("StaticPolicy AddContainer () error (%v). expected cpuset %v to be disoint from the shared cpuset %v" ,
466
+ t .Errorf ("StaticPolicy Allocate () error (%v). expected cpuset %v to be disoint from the shared cpuset %v" ,
467
467
testCase .description , cset , st .defaultCPUSet )
468
468
}
469
469
}
470
470
471
471
if ! testCase .expCPUAlloc {
472
472
_ , found := st .assignments [string (testCase .pod .UID )][container .Name ]
473
473
if found {
474
- t .Errorf ("StaticPolicy AddContainer () error (%v). Did not expect container %v to be present in assignments %v" ,
474
+ t .Errorf ("StaticPolicy Allocate () error (%v). Did not expect container %v to be present in assignments %v" ,
475
475
testCase .description , container .Name , st .assignments )
476
476
}
477
477
}
@@ -786,34 +786,34 @@ func TestStaticPolicyAddWithResvList(t *testing.T) {
786
786
}
787
787
788
788
container := & testCase .pod .Spec .Containers [0 ]
789
- err := policy .AddContainer (st , testCase .pod , container )
789
+ err := policy .Allocate (st , testCase .pod , container )
790
790
if ! reflect .DeepEqual (err , testCase .expErr ) {
791
- t .Errorf ("StaticPolicy AddContainer () error (%v). expected add error: %v but got: %v" ,
791
+ t .Errorf ("StaticPolicy Allocate () error (%v). expected add error: %v but got: %v" ,
792
792
testCase .description , testCase .expErr , err )
793
793
}
794
794
795
795
if testCase .expCPUAlloc {
796
796
cset , found := st .assignments [string (testCase .pod .UID )][container .Name ]
797
797
if ! found {
798
- t .Errorf ("StaticPolicy AddContainer () error (%v). expected container %v to be present in assignments %v" ,
798
+ t .Errorf ("StaticPolicy Allocate () error (%v). expected container %v to be present in assignments %v" ,
799
799
testCase .description , container .Name , st .assignments )
800
800
}
801
801
802
802
if ! reflect .DeepEqual (cset , testCase .expCSet ) {
803
- t .Errorf ("StaticPolicy AddContainer () error (%v). expected cpuset %v but got %v" ,
803
+ t .Errorf ("StaticPolicy Allocate () error (%v). expected cpuset %v but got %v" ,
804
804
testCase .description , testCase .expCSet , cset )
805
805
}
806
806
807
807
if ! cset .Intersection (st .defaultCPUSet ).IsEmpty () {
808
- t .Errorf ("StaticPolicy AddContainer () error (%v). expected cpuset %v to be disoint from the shared cpuset %v" ,
808
+ t .Errorf ("StaticPolicy Allocate () error (%v). expected cpuset %v to be disoint from the shared cpuset %v" ,
809
809
testCase .description , cset , st .defaultCPUSet )
810
810
}
811
811
}
812
812
813
813
if ! testCase .expCPUAlloc {
814
814
_ , found := st .assignments [string (testCase .pod .UID )][container .Name ]
815
815
if found {
816
- t .Errorf ("StaticPolicy AddContainer () error (%v). Did not expect container %v to be present in assignments %v" ,
816
+ t .Errorf ("StaticPolicy Allocate () error (%v). Did not expect container %v to be present in assignments %v" ,
817
817
testCase .description , container .Name , st .assignments )
818
818
}
819
819
}
0 commit comments