Added unit test for node operation in schedulercache.

This commit is contained in:
Klaus Ma
2017-05-04 15:29:45 +08:00
parent f0962765a7
commit fd2575e43e
9 changed files with 324 additions and 28 deletions

View File

@@ -29,6 +29,7 @@ import (
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"
schedulertesting "k8s.io/kubernetes/plugin/pkg/scheduler/testing"
schedutil "k8s.io/kubernetes/plugin/pkg/scheduler/util"
)
type FakeNodeInfo v1.Node
@@ -563,7 +564,7 @@ func TestGetUsedPorts(t *testing.T) {
}
for _, test := range tests {
ports := GetUsedPorts(test.pods...)
ports := schedutil.GetUsedPorts(test.pods...)
if !reflect.DeepEqual(test.ports, ports) {
t.Errorf("%s: expected %v, got %v", "test get used ports", test.ports, ports)
}