kubelet: Remove newTestKubeletWithFakeRuntime() and other depreciated functions.

This cleans up the kubelet tests. Almost no docker specified tests now.
This commit is contained in:
Yifan Gu
2015-06-05 15:44:16 -07:00
parent 91e198cb70
commit 40e46bbb37
2 changed files with 67 additions and 208 deletions

View File

@@ -18,6 +18,8 @@ package kubelet
import (
"fmt"
"reflect"
"sort"
"testing"
"time"
@@ -73,6 +75,20 @@ func makeContainerDetailMap(funcs ...func(map[string]*docker.Container)) map[str
return m
}
func verifyStringArrayEqualsAnyOrder(t *testing.T, actual, expected []string) {
act := make([]string, len(actual))
exp := make([]string, len(expected))
copy(act, actual)
copy(exp, expected)
sort.StringSlice(act).Sort()
sort.StringSlice(exp).Sort()
if !reflect.DeepEqual(exp, act) {
t.Errorf("Expected(sorted): %#v, Actual(sorted): %#v", exp, act)
}
}
func TestGarbageCollectZeroMaxContainers(t *testing.T) {
gc, fakeDocker := newTestContainerGC(t, time.Minute, 1, 0)
fakeDocker.ContainerList = []docker.APIContainers{