Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix old networking test to use version 1.3 #8972

Merged
merged 1 commit into from
May 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 4 additions & 44 deletions test/e2e/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,46 +31,6 @@ import (
. "github.com/onsi/gomega"
)

func LaunchNetTestPodPerNodeNew(f *Framework, nodes *api.NodeList, name string) []string {
podNames := []string{}

totalPods := len(nodes.Items)

Expect(totalPods).NotTo(Equal(0))

for _, node := range nodes.Items {
pod, err := f.Client.Pods(f.Namespace.Name).Create(&api.Pod{
ObjectMeta: api.ObjectMeta{
GenerateName: name + "-",
Labels: map[string]string{
"name": name,
},
},
Spec: api.PodSpec{
Containers: []api.Container{
{
Name: "webserver",
Image: "gcr.io/google_containers/nettest:1.4",
Args: []string{
"-service=" + name,
//peers >= totalPods should be asserted by the container.
//the nettest container finds peers by looking up list of svc endpoints.
fmt.Sprintf("-peers=%d", totalPods),
"-namespace=" + f.Namespace.Name},
Ports: []api.ContainerPort{{ContainerPort: 8080}},
},
},
NodeName: node.Name,
RestartPolicy: api.RestartPolicyNever,
},
})
Expect(err).NotTo(HaveOccurred())
Logf("Created pod %s on node %s", pod.ObjectMeta.Name, node.Name)
podNames = append(podNames, pod.ObjectMeta.Name)
}
return podNames
}

var _ = Describe("NetworkingNew", func() {
f := NewFramework("nettestnew")

Expand Down Expand Up @@ -157,7 +117,7 @@ var _ = Describe("NetworkingNew", func() {
Failf("Failed to list nodes: %v", err)
}

podNames := LaunchNetTestPodPerNodeNew(f, nodes, svcname)
podNames := LaunchNetTestPodPerNode(f, nodes, svcname, "1.4")

// Clean up the pods
defer func() {
Expand Down Expand Up @@ -244,7 +204,7 @@ var _ = Describe("NetworkingNew", func() {

})

func LaunchNetTestPodPerNode(f *Framework, nodes *api.NodeList, name string) []string {
func LaunchNetTestPodPerNode(f *Framework, nodes *api.NodeList, name, version string) []string {
podNames := []string{}

totalPods := len(nodes.Items)
Expand All @@ -263,7 +223,7 @@ func LaunchNetTestPodPerNode(f *Framework, nodes *api.NodeList, name string) []s
Containers: []api.Container{
{
Name: "webserver",
Image: "gcr.io/google_containers/nettest:1.4",
Image: "gcr.io/google_containers/nettest:" + version,
Args: []string{
"-service=" + name,
//peers >= totalPods should be asserted by the container.
Expand Down Expand Up @@ -370,7 +330,7 @@ var _ = Describe("Networking", func() {
Failf("Failed to list nodes: %v", err)
}

podNames := LaunchNetTestPodPerNode(f, nodes, svcname)
podNames := LaunchNetTestPodPerNode(f, nodes, svcname, "1.3")

// Clean up the pods
defer func() {
Expand Down