test/e2e_node

This commit is contained in:
Chao Xu
2016-11-18 12:55:46 -08:00
parent f3b5d514ab
commit 29400ac195
23 changed files with 386 additions and 384 deletions

View File

@@ -21,7 +21,7 @@ import (
"strings"
"time"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
docker "k8s.io/kubernetes/pkg/kubelet/dockertools"
"k8s.io/kubernetes/test/e2e/framework"
@@ -230,7 +230,7 @@ func containerGCTest(f *framework.Framework, test testRun) {
AfterEach(func() {
for _, pod := range test.testPods {
By(fmt.Sprintf("Deleting Pod %v", pod.podName))
f.PodClient().DeleteSync(pod.podName, &api.DeleteOptions{}, defaultRuntimeRequestTimeoutDuration)
f.PodClient().DeleteSync(pod.podName, &v1.DeleteOptions{}, defaultRuntimeRequestTimeoutDuration)
}
By("Making sure all containers get cleaned up")
@@ -279,12 +279,12 @@ func dockerContainerGCTest(f *framework.Framework, test testRun) {
containerGCTest(f, test)
}
func getPods(specs []*testPodSpec) (pods []*api.Pod) {
func getPods(specs []*testPodSpec) (pods []*v1.Pod) {
for _, spec := range specs {
By(fmt.Sprintf("Creating %v containers with restartCount: %v", spec.numContainers, spec.restartCount))
containers := []api.Container{}
containers := []v1.Container{}
for i := 0; i < spec.numContainers; i++ {
containers = append(containers, api.Container{
containers = append(containers, v1.Container{
Image: "gcr.io/google_containers/busybox:1.24",
Name: spec.getContainerName(i),
Command: []string{
@@ -299,18 +299,18 @@ func getPods(specs []*testPodSpec) (pods []*api.Pod) {
while true; do sleep 1; done
`, i, spec.restartCount+1),
},
VolumeMounts: []api.VolumeMount{
VolumeMounts: []v1.VolumeMount{
{MountPath: "/test-empty-dir-mnt", Name: "test-empty-dir"},
},
})
}
pods = append(pods, &api.Pod{
ObjectMeta: api.ObjectMeta{Name: spec.podName},
Spec: api.PodSpec{
RestartPolicy: api.RestartPolicyAlways,
pods = append(pods, &v1.Pod{
ObjectMeta: v1.ObjectMeta{Name: spec.podName},
Spec: v1.PodSpec{
RestartPolicy: v1.RestartPolicyAlways,
Containers: containers,
Volumes: []api.Volume{
{Name: "test-empty-dir", VolumeSource: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}},
Volumes: []v1.Volume{
{Name: "test-empty-dir", VolumeSource: v1.VolumeSource{EmptyDir: &v1.EmptyDirVolumeSource{}}},
},
},
})