From 8a219917a50b0582e6f38bd1640e980f3cbc7f3c Mon Sep 17 00:00:00 2001 From: Piotr Szczesniak Date: Wed, 24 Jun 2015 14:30:45 +0200 Subject: [PATCH] Added test that verify Internet connection from inside of container. Fixes #9662 --- test/e2e/networking.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/e2e/networking.go b/test/e2e/networking.go index 2fec16512bc..32403b5d48e 100644 --- a/test/e2e/networking.go +++ b/test/e2e/networking.go @@ -50,6 +50,36 @@ var _ = Describe("Networking", func() { } }) + It("should provide Internet connection for containers", func() { + By("Running container which pings google.com") + podName := "ping-test" + contName := "ping-test-container" + pod := &api.Pod{ + TypeMeta: api.TypeMeta{ + Kind: "Pod", + }, + ObjectMeta: api.ObjectMeta{ + Name: podName, + }, + Spec: api.PodSpec{ + Containers: []api.Container{ + { + Name: contName, + Image: "gcr.io/google_containers/busybox", + Command: []string{"ping", "-c", "3", "-w", "10", "google.com"}, + }, + }, + RestartPolicy: api.RestartPolicyNever, + }, + } + _, err := f.Client.Pods(f.Namespace.Name).Create(pod) + expectNoError(err) + defer f.Client.Pods(f.Namespace.Name).Delete(podName, nil) + + By("Verify that the pod succeed") + expectNoError(waitForPodSuccessInNamespace(f.Client, podName, contName, f.Namespace.Name)) + }) + // First test because it has no dependencies on variables created later on. It("should provide unchanging, static URL paths for kubernetes api services.", func() { tests := []struct {