Merge pull request #10986 from wojtek-t/test_in_non_default_namespaces

Migrate tests to non-default namespaces
pull/6/head
Wojciech Tyczynski 2015-07-23 13:00:27 +02:00
commit db2d4a2b08
8 changed files with 71 additions and 164 deletions

View File

@ -20,34 +20,13 @@ import (
"fmt"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Downward API", func() {
var c *client.Client
var ns string
BeforeEach(func() {
var err error
c, err = loadClient()
Expect(err).NotTo(HaveOccurred())
ns_, err := createTestingNS("downward-api", c)
ns = ns_.Name
Expect(err).NotTo(HaveOccurred())
})
AfterEach(func() {
// Clean up the namespace if a non-default one was used
if ns != api.NamespaceDefault {
By("Cleaning up the namespace")
err := c.Namespaces().Delete(ns)
expectNoError(err)
}
})
framework := NewFramework("downward-api")
It("should provide pod name and namespace as env vars", func() {
podName := "downward-api-" + string(util.NewUUID())
@ -88,9 +67,9 @@ var _ = Describe("Downward API", func() {
},
}
testContainerOutputInNamespace("downward api env vars", c, pod, 0, []string{
framework.TestContainerOutput("downward api env vars", pod, 0, []string{
fmt.Sprintf("POD_NAME=%v", podName),
fmt.Sprintf("POD_NAMESPACE=%v", ns),
}, ns)
fmt.Sprintf("POD_NAMESPACE=%v", framework.Namespace.Name),
})
})
})

View File

@ -84,7 +84,7 @@ func etcdFailTest(framework Framework, failCommand, fixCommand string) {
checkExistingRCRecovers(framework)
ServeImageOrFail(framework.Client, "basic", "gcr.io/google_containers/serve_hostname:1.1")
ServeImageOrFail(&framework, "basic", "gcr.io/google_containers/serve_hostname:1.1")
}
// For this duration, etcd will be failed by executing a failCommand on the master.

View File

@ -22,7 +22,6 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
@ -33,17 +32,11 @@ import (
)
var _ = Describe("Events", func() {
var c *client.Client
BeforeEach(func() {
var err error
c, err = loadClient()
Expect(err).NotTo(HaveOccurred())
})
framework := NewFramework("events")
It("should be sent by kubelets and the scheduler about pods scheduling and running", func() {
podClient := c.Pods(api.NamespaceDefault)
podClient := framework.Client.Pods(framework.Namespace.Name)
By("creating the pod")
name := "send-events-" + string(util.NewUUID())
@ -76,7 +69,7 @@ var _ = Describe("Events", func() {
Failf("Failed to create pod: %v", err)
}
expectNoError(waitForPodRunning(c, pod.Name))
expectNoError(framework.WaitForPodRunning(pod.Name))
By("verifying the pod is in kubernetes")
pods, err := podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything())
@ -92,12 +85,12 @@ var _ = Describe("Events", func() {
// Check for scheduler event about the pod.
By("checking for scheduler event about the pod")
expectNoError(wait.Poll(time.Second*2, time.Second*60, func() (bool, error) {
events, err := c.Events(api.NamespaceDefault).List(
events, err := framework.Client.Events(framework.Namespace.Name).List(
labels.Everything(),
fields.Set{
"involvedObject.kind": "Pod",
"involvedObject.uid": string(podWithUid.UID),
"involvedObject.namespace": api.NamespaceDefault,
"involvedObject.namespace": framework.Namespace.Name,
"source": "scheduler",
}.AsSelector(),
)
@ -113,12 +106,12 @@ var _ = Describe("Events", func() {
// Check for kubelet event about the pod.
By("checking for kubelet event about the pod")
expectNoError(wait.Poll(time.Second*2, time.Second*60, func() (bool, error) {
events, err = c.Events(api.NamespaceDefault).List(
events, err = framework.Client.Events(framework.Namespace.Name).List(
labels.Everything(),
fields.Set{
"involvedObject.uid": string(podWithUid.UID),
"involvedObject.kind": "Pod",
"involvedObject.namespace": api.NamespaceDefault,
"involvedObject.namespace": framework.Namespace.Name,
"source": "kubelet",
}.AsSelector(),
)

View File

@ -18,34 +18,13 @@ package e2e
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Variable Expansion", func() {
var c *client.Client
var ns string
BeforeEach(func() {
var err error
c, err = loadClient()
Expect(err).NotTo(HaveOccurred())
ns_, err := createTestingNS("var-expansion", c)
ns = ns_.Name
Expect(err).NotTo(HaveOccurred())
})
AfterEach(func() {
// Clean up the namespace if a non-default one was used
if ns != api.NamespaceDefault {
By("Cleaning up the namespace")
err := c.Namespaces().Delete(ns)
expectNoError(err)
}
})
framework := NewFramework("var-expansion")
It("should allow composing env vars into new env vars", func() {
podName := "var-expansion-" + string(util.NewUUID())
@ -80,11 +59,11 @@ var _ = Describe("Variable Expansion", func() {
},
}
testContainerOutputInNamespace("env composition", c, pod, 0, []string{
framework.TestContainerOutput("env composition", pod, 0, []string{
"FOO=foo-value",
"BAR=bar-value",
"FOOBAR=foo-value;;bar-value",
}, ns)
})
})
It("should allow substituting values in a container's command", func() {
@ -112,9 +91,9 @@ var _ = Describe("Variable Expansion", func() {
},
}
testContainerOutputInNamespace("substitution in container's command", c, pod, 0, []string{
framework.TestContainerOutput("substitution in container's command", pod, 0, []string{
"test-value",
}, ns)
})
})
It("should allow substituting values in a container's args", func() {
@ -143,8 +122,8 @@ var _ = Describe("Variable Expansion", func() {
},
}
testContainerOutputInNamespace("substitution in container's args", c, pod, 0, []string{
framework.TestContainerOutput("substitution in container's args", pod, 0, []string{
"test-value",
}, ns)
})
})
})

View File

@ -37,22 +37,18 @@ import (
var _ = Describe("Pod Disks", func() {
var (
c *client.Client
podClient client.PodInterface
host0Name string
host1Name string
)
framework := NewFramework("pod-disks")
BeforeEach(func() {
var err error
c, err = loadClient()
expectNoError(err)
SkipUnlessNodeCountIsAtLeast(2)
podClient = c.Pods(api.NamespaceDefault)
podClient = framework.Client.Pods(framework.Namespace.Name)
nodes, err := c.Nodes().List(labels.Everything(), fields.Everything())
nodes, err := framework.Client.Nodes().List(labels.Everything(), fields.Everything())
expectNoError(err, "Failed to list nodes for e2e cluster.")
Expect(len(nodes.Items)).To(BeNumerically(">=", 2), "Requires at least 2 nodes")
@ -86,12 +82,12 @@ var _ = Describe("Pod Disks", func() {
_, err = podClient.Create(host0Pod)
expectNoError(err, fmt.Sprintf("Failed to create host0Pod: %v", err))
expectNoError(waitForPodRunning(c, host0Pod.Name))
expectNoError(framework.WaitForPodRunning(host0Pod.Name))
testFile := "/testpd/tracker"
testFileContents := fmt.Sprintf("%v", math_rand.Int())
expectNoError(writeFileOnPod(c, host0Pod.Name, testFile, testFileContents))
expectNoError(writeFileOnPod(framework.Client, host0Pod.Name, testFile, testFileContents))
Logf("Wrote value: %v", testFileContents)
By("deleting host0Pod")
@ -101,9 +97,9 @@ var _ = Describe("Pod Disks", func() {
_, err = podClient.Create(host1Pod)
expectNoError(err, "Failed to create host1Pod")
expectNoError(waitForPodRunning(c, host1Pod.Name))
expectNoError(framework.WaitForPodRunning(host1Pod.Name))
v, err := readFileOnPod(c, host1Pod.Name, testFile)
v, err := readFileOnPod(framework.Client, host1Pod.Name, testFile)
expectNoError(err)
Logf("Read value: %v", v)
@ -153,7 +149,7 @@ var _ = Describe("Pod Disks", func() {
By("submitting rwPod to ensure PD is formatted")
_, err = podClient.Create(rwPod)
expectNoError(err, "Failed to create rwPod")
expectNoError(waitForPodRunning(c, rwPod.Name))
expectNoError(framework.WaitForPodRunning(rwPod.Name))
expectNoError(podClient.Delete(rwPod.Name, nil), "Failed to delete host0Pod")
By("submitting host0ROPod to kubernetes")
@ -164,9 +160,9 @@ var _ = Describe("Pod Disks", func() {
_, err = podClient.Create(host1ROPod)
expectNoError(err, "Failed to create host1ROPod")
expectNoError(waitForPodRunning(c, host0ROPod.Name))
expectNoError(framework.WaitForPodRunning(host0ROPod.Name))
expectNoError(waitForPodRunning(c, host1ROPod.Name))
expectNoError(framework.WaitForPodRunning(host1ROPod.Name))
By("deleting host0ROPod")
expectNoError(podClient.Delete(host0ROPod.Name, nil), "Failed to delete host0ROPod")

View File

@ -35,18 +35,9 @@ import (
. "github.com/onsi/gomega"
)
func runLivenessTest(c *client.Client, podDescr *api.Pod, expectRestart bool) {
namespace, err := createTestingNS("pods-liveness", c)
Expect(err).NotTo(HaveOccurred())
ns := namespace.Name
defer func() {
if err := c.Namespaces().Delete(ns); err != nil {
Failf("Couldn't delete ns %q: %s", namespace, err)
}
}()
func runLivenessTest(c *client.Client, ns string, podDescr *api.Pod, expectRestart bool) {
By(fmt.Sprintf("Creating pod %s in namespace %s", podDescr.Name, ns))
_, err = c.Pods(ns).Create(podDescr)
_, err := c.Pods(ns).Create(podDescr)
expectNoError(err, fmt.Sprintf("creating pod %s", podDescr.Name))
// At the end of the test, clean up by removing the pod.
@ -91,20 +82,11 @@ func runLivenessTest(c *client.Client, podDescr *api.Pod, expectRestart bool) {
}
// testHostIP tests that a pod gets a host IP
func testHostIP(c *client.Client, pod *api.Pod) {
namespace, err := createTestingNS("pods-host-ip", c)
Expect(err).NotTo(HaveOccurred())
ns := namespace.Name
defer func() {
if err := c.Namespaces().Delete(ns); err != nil {
Failf("Couldn't delete ns %q: %s", namespace, err)
}
}()
func testHostIP(c *client.Client, ns string, pod *api.Pod) {
podClient := c.Pods(ns)
By("creating pod")
defer podClient.Delete(pod.Name, nil)
_, err = podClient.Create(pod)
_, err := podClient.Create(pod)
if err != nil {
Fail(fmt.Sprintf("Failed to create pod: %v", err))
}
@ -133,18 +115,11 @@ func testHostIP(c *client.Client, pod *api.Pod) {
}
var _ = Describe("Pods", func() {
var c *client.Client
// TODO convert this to use the NewFramework(...)
BeforeEach(func() {
var err error
c, err = loadClient()
expectNoError(err)
})
framework := NewFramework("pods")
PIt("should get a host IP", func() {
name := "pod-hostip-" + string(util.NewUUID())
testHostIP(c, &api.Pod{
testHostIP(framework.Client, framework.Namespace.Name, &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: name,
},
@ -158,8 +133,9 @@ var _ = Describe("Pods", func() {
},
})
})
It("should be schedule with cpu and memory limits", func() {
podClient := c.Pods(api.NamespaceDefault)
podClient := framework.Client.Pods(framework.Namespace.Name)
By("creating the pod")
name := "pod-update-" + string(util.NewUUID())
@ -192,10 +168,11 @@ var _ = Describe("Pods", func() {
if err != nil {
Fail(fmt.Sprintf("Error creating a pod: %v", err))
}
expectNoError(waitForPodRunning(c, pod.Name))
expectNoError(framework.WaitForPodRunning(pod.Name))
})
It("should be submitted and removed", func() {
podClient := c.Pods(api.NamespaceDefault)
podClient := framework.Client.Pods(framework.Namespace.Name)
By("creating the pod")
name := "pod-update-" + string(util.NewUUID())
@ -295,7 +272,7 @@ var _ = Describe("Pods", func() {
})
It("should be updated", func() {
podClient := c.Pods(api.NamespaceDefault)
podClient := framework.Client.Pods(framework.Namespace.Name)
By("creating the pod")
name := "pod-update-" + string(util.NewUUID())
@ -338,7 +315,7 @@ var _ = Describe("Pods", func() {
Failf("Failed to create pod: %v", err)
}
expectNoError(waitForPodRunning(c, pod.Name))
expectNoError(framework.WaitForPodRunning(pod.Name))
By("verifying the pod is in kubernetes")
pods, err := podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything())
@ -368,7 +345,7 @@ var _ = Describe("Pods", func() {
return false, fmt.Errorf("failed to update pod: %v", err)
}))
expectNoError(waitForPodRunning(c, pod.Name))
expectNoError(framework.WaitForPodRunning(pod.Name))
By("verifying the updated pod is in kubernetes")
pods, err = podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything())
@ -395,12 +372,12 @@ var _ = Describe("Pods", func() {
},
},
}
defer c.Pods(api.NamespaceDefault).Delete(serverPod.Name, nil)
_, err := c.Pods(api.NamespaceDefault).Create(serverPod)
defer framework.Client.Pods(framework.Namespace.Name).Delete(serverPod.Name, nil)
_, err := framework.Client.Pods(framework.Namespace.Name).Create(serverPod)
if err != nil {
Fail(fmt.Sprintf("Failed to create serverPod: %v", err))
}
expectNoError(waitForPodRunning(c, serverPod.Name))
expectNoError(framework.WaitForPodRunning(serverPod.Name))
// This service exposes port 8080 of the test pod as a service on port 8765
// TODO(filbranden): We would like to use a unique service name such as:
@ -427,8 +404,8 @@ var _ = Describe("Pods", func() {
},
},
}
defer c.Services(api.NamespaceDefault).Delete(svc.Name)
_, err = c.Services(api.NamespaceDefault).Create(svc)
defer framework.Client.Services(framework.Namespace.Name).Delete(svc.Name)
_, err = framework.Client.Services(framework.Namespace.Name).Create(svc)
if err != nil {
Fail(fmt.Sprintf("Failed to create service: %v", err))
}
@ -452,7 +429,7 @@ var _ = Describe("Pods", func() {
},
}
testContainerOutput("service env", c, pod, 0, []string{
framework.TestContainerOutput("service env", pod, 0, []string{
"FOOSERVICE_SERVICE_HOST=",
"FOOSERVICE_SERVICE_PORT=",
"FOOSERVICE_PORT=",
@ -464,7 +441,7 @@ var _ = Describe("Pods", func() {
})
It("should be restarted with a docker exec \"cat /tmp/health\" liveness probe", func() {
runLivenessTest(c, &api.Pod{
runLivenessTest(framework.Client, framework.Namespace.Name, &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "liveness-exec",
Labels: map[string]string{"test": "liveness"},
@ -490,7 +467,7 @@ var _ = Describe("Pods", func() {
})
It("should *not* be restarted with a docker exec \"cat /tmp/health\" liveness probe", func() {
runLivenessTest(c, &api.Pod{
runLivenessTest(framework.Client, framework.Namespace.Name, &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "liveness-exec",
Labels: map[string]string{"test": "liveness"},
@ -516,7 +493,7 @@ var _ = Describe("Pods", func() {
})
It("should be restarted with a /healthz http liveness probe", func() {
runLivenessTest(c, &api.Pod{
runLivenessTest(framework.Client, framework.Namespace.Name, &api.Pod{
ObjectMeta: api.ObjectMeta{
Name: "liveness-http",
Labels: map[string]string{"test": "liveness"},
@ -554,7 +531,7 @@ var _ = Describe("Pods", func() {
Fail(fmt.Sprintf("Failed to create client config: %v", err))
}
podClient := c.Pods(api.NamespaceDefault)
podClient := framework.Client.Pods(framework.Namespace.Name)
By("creating the pod")
name := "pod-exec-" + string(util.NewUUID())
@ -590,7 +567,7 @@ var _ = Describe("Pods", func() {
}()
By("waiting for the pod to start running")
expectNoError(waitForPodRunning(c, pod.Name, 300*time.Second))
expectNoError(framework.WaitForPodRunning(pod.Name))
By("verifying the pod is in kubernetes")
pods, err := podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})))
@ -602,11 +579,11 @@ var _ = Describe("Pods", func() {
pod = &pods.Items[0]
By(fmt.Sprintf("executing command on host %s pod %s in container %s",
pod.Status.Host, pod.Name, pod.Spec.Containers[0].Name))
req := c.Get().
req := framework.Client.Get().
Prefix("proxy").
Resource("minions").
Name(pod.Status.Host).
Suffix("exec", api.NamespaceDefault, pod.Name, pod.Spec.Containers[0].Name)
Suffix("exec", framework.Namespace.Name, pod.Name, pod.Spec.Containers[0].Name)
out := &bytes.Buffer{}
e := remotecommand.New(req, clientConfig, []string{"whoami"}, nil, out, nil, false)
@ -626,7 +603,7 @@ var _ = Describe("Pods", func() {
Fail(fmt.Sprintf("Failed to create client config: %v", err))
}
podClient := c.Pods(api.NamespaceDefault)
podClient := framework.Client.Pods(framework.Namespace.Name)
By("creating the pod")
name := "pod-portforward-" + string(util.NewUUID())
@ -663,7 +640,7 @@ var _ = Describe("Pods", func() {
}()
By("waiting for the pod to start running")
expectNoError(waitForPodRunning(c, pod.Name, 300*time.Second))
expectNoError(framework.WaitForPodRunning(pod.Name))
By("verifying the pod is in kubernetes")
pods, err := podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})))
@ -676,11 +653,11 @@ var _ = Describe("Pods", func() {
By(fmt.Sprintf("initiating port forwarding to host %s pod %s in container %s",
pod.Status.Host, pod.Name, pod.Spec.Containers[0].Name))
req := c.Get().
req := framework.Client.Get().
Prefix("proxy").
Resource("minions").
Name(pod.Status.Host).
Suffix("portForward", api.NamespaceDefault, pod.Name)
Suffix("portForward", framework.Namespace.Name, pod.Name)
stopChan := make(chan struct{})
pf, err := portforward.New(req, clientConfig, []string{"5678:80"}, stopChan)

View File

@ -21,7 +21,6 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
@ -34,31 +33,24 @@ import (
)
var _ = Describe("ReplicationController", func() {
var c *client.Client
BeforeEach(func() {
var err error
c, err = loadClient()
Expect(err).NotTo(HaveOccurred())
})
framework := NewFramework("replication-controller")
It("should serve a basic image on each replica with a public image", func() {
ServeImageOrFail(c, "basic", "gcr.io/google_containers/serve_hostname:1.1")
ServeImageOrFail(framework, "basic", "gcr.io/google_containers/serve_hostname:1.1")
})
It("should serve a basic image on each replica with a private image", func() {
// requires private images
SkipUnlessProviderIs("gce", "gke")
ServeImageOrFail(c, "private", "gcr.io/_b_k8s_authenticated_test/serve_hostname:1.1")
ServeImageOrFail(framework, "private", "gcr.io/_b_k8s_authenticated_test/serve_hostname:1.1")
})
})
// A basic test to check the deployment of an image using
// a replication controller. The image serves its hostname
// which is checked for each replica.
func ServeImageOrFail(c *client.Client, test string, image string) {
ns := api.NamespaceDefault
func ServeImageOrFail(f *Framework, test string, image string) {
name := "my-hostname-" + test + "-" + string(util.NewUUID())
replicas := 2
@ -67,7 +59,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
// The source for the Docker containter kubernetes/serve_hostname is
// in contrib/for-demos/serve_hostname
By(fmt.Sprintf("Creating replication controller %s", name))
controller, err := c.ReplicationControllers(ns).Create(&api.ReplicationController{
controller, err := f.Client.ReplicationControllers(f.Namespace.Name).Create(&api.ReplicationController{
ObjectMeta: api.ObjectMeta{
Name: name,
},
@ -97,11 +89,11 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
defer func() {
// Resize the replication controller to zero to get rid of pods.
By("Cleaning up the replication controller")
rcReaper, err := kubectl.ReaperFor("ReplicationController", c)
rcReaper, err := kubectl.ReaperFor("ReplicationController", f.Client)
if err != nil {
Logf("Failed to cleanup replication controller %v: %v.", controller.Name, err)
}
if _, err = rcReaper.Stop(ns, controller.Name, 0, nil); err != nil {
if _, err = rcReaper.Stop(f.Namespace.Name, controller.Name, 0, nil); err != nil {
Logf("Failed to stop replication controller %v: %v.", controller.Name, err)
}
}()
@ -109,7 +101,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
// List the pods, making sure we observe all the replicas.
listTimeout := time.Minute
label := labels.SelectorFromSet(labels.Set(map[string]string{"name": name}))
pods, err := c.Pods(ns).List(label, fields.Everything())
pods, err := f.Client.Pods(f.Namespace.Name).List(label, fields.Everything())
Expect(err).NotTo(HaveOccurred())
t := time.Now()
for {
@ -122,7 +114,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
name, replicas, len(pods.Items), time.Since(t).Seconds())
}
time.Sleep(5 * time.Second)
pods, err = c.Pods(ns).List(label, fields.Everything())
pods, err = f.Client.Pods(f.Namespace.Name).List(label, fields.Everything())
Expect(err).NotTo(HaveOccurred())
}
@ -131,7 +123,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
// Wait for the pods to enter the running state. Waiting loops until the pods
// are running so non-running pods cause a timeout for this test.
for _, pod := range pods.Items {
err = waitForPodRunning(c, pod.Name)
err = f.WaitForPodRunning(pod.Name)
Expect(err).NotTo(HaveOccurred())
}
@ -139,7 +131,7 @@ func ServeImageOrFail(c *client.Client, test string, image string) {
By("Trying to dial each unique pod")
retryTimeout := 2 * time.Minute
retryInterval := 5 * time.Second
err = wait.Poll(retryInterval, retryTimeout, podResponseChecker{c, ns, label, name, true, pods}.checkAllResponses)
err = wait.Poll(retryInterval, retryTimeout, podResponseChecker{f.Client, f.Namespace.Name, label, name, true, pods}.checkAllResponses)
if err != nil {
Failf("Did not get expected responses within the timeout period of %.2f seconds.", retryTimeout.Seconds())
}

View File

@ -513,10 +513,6 @@ func waitForPodRunningInNamespace(c *client.Client, podName string, namespace st
})
}
func waitForPodRunning(c *client.Client, podName string) error {
return waitForPodRunningInNamespace(c, podName, api.NamespaceDefault)
}
// waitForPodNotPending returns an error if it took too long for the pod to go out of pending state.
func waitForPodNotPending(c *client.Client, ns, podName string) error {
return waitForPodCondition(c, ns, podName, "!pending", podStartTimeout, func(pod *api.Pod) (bool, error) {
@ -888,11 +884,6 @@ func startCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err e
return
}
// testContainerOutput runs testContainerOutputInNamespace with the default namespace.
func testContainerOutput(scenarioName string, c *client.Client, pod *api.Pod, containerIndex int, expectedOutput []string) {
testContainerOutputInNamespace(scenarioName, c, pod, containerIndex, expectedOutput, api.NamespaceDefault)
}
// testContainerOutputInNamespace runs the given pod in the given namespace and waits
// for all of the containers in the podSpec to move into the 'Success' status. It retrieves
// the exact container log and searches for lines of expected output.