Use gcr.io tagged images when testing

This commit is contained in:
Janet Kuo 2016-05-25 17:25:02 -07:00
parent 1f78d5ce37
commit f433d21a90
2 changed files with 28 additions and 21 deletions

View File

@ -18,18 +18,23 @@ package framework
import "k8s.io/kubernetes/test/e2e/generated" import "k8s.io/kubernetes/test/e2e/generated"
// ReadOrDie reads a file from gobindata. To generate gobindata, run /*
// ReadOrDie reads a file from gobindata. To generate gobindata, run
// # Install the program
// go get -u github.com/jteeuwen/go-bindata/... # Install the program
// go get -u github.com/jteeuwen/go-bindata/...
// # Generate the bindata file.
// go-bindata \ # Generate the bindata file.
// -pkg generated -ignore .jpg -ignore .png -ignore .md \ go-bindata \
// ./examples/* ./docs/user-guide/* test/e2e/testing-manifests/kubectl/* test/images/* -pkg generated -ignore .jpg -ignore .png -ignore .md \
// ./examples/* ./docs/user-guide/* test/e2e/testing-manifests/kubectl/* test/images/*
// # Copy it into the generated directory if the results are what you expected.
// cp bindata.go test/e2e/generated # Copy it into the generated directory if the results are what you expected.
cp bindata.go test/e2e/generated
# Don't forget to gofmt it
gofmt -s -w test/e2e/generated/bindata.go
*/
func ReadOrDie(filePath string) []byte { func ReadOrDie(filePath string) []byte {
fileBytes, err := generated.Asset(filePath) fileBytes, err := generated.Asset(filePath)
if err != nil { if err != nil {

View File

@ -78,6 +78,8 @@ const (
simplePodName = "nginx" simplePodName = "nginx"
nginxDefaultOutput = "Welcome to nginx!" nginxDefaultOutput = "Welcome to nginx!"
simplePodPort = 80 simplePodPort = 80
pausePodSelector = "name=pause"
pausePodName = "pause"
runJobTimeout = 5 * time.Minute runJobTimeout = 5 * time.Minute
busyboxImage = "gcr.io/google_containers/busybox:1.24" busyboxImage = "gcr.io/google_containers/busybox:1.24"
nginxImage = "gcr.io/google_containers/nginx:1.7.9" nginxImage = "gcr.io/google_containers/nginx:1.7.9"
@ -643,14 +645,14 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
var pod []byte var pod []byte
var nsFlag string var nsFlag string
BeforeEach(func() { BeforeEach(func() {
pod := framework.ReadOrDie("docs/user-guide/pod.yaml") pod = readTestFileOrDie("pause-pod.yaml")
By("creating the pod") By("creating the pod")
nsFlag = fmt.Sprintf("--namespace=%v", ns) nsFlag = fmt.Sprintf("--namespace=%v", ns)
framework.RunKubectlOrDieInput(string(pod), "create", "-f", "-", nsFlag) framework.RunKubectlOrDieInput(string(pod), "create", "-f", "-", nsFlag)
Expect(framework.CheckPodsRunningReady(c, ns, []string{simplePodName}, framework.PodStartTimeout)).To(BeTrue()) Expect(framework.CheckPodsRunningReady(c, ns, []string{pausePodName}, framework.PodStartTimeout)).To(BeTrue())
}) })
AfterEach(func() { AfterEach(func() {
cleanupKubectlInputs(string(pod[:]), ns, simplePodSelector) cleanupKubectlInputs(string(pod[:]), ns, pausePodSelector)
}) })
It("should update the label on a resource [Conformance]", func() { It("should update the label on a resource [Conformance]", func() {
@ -658,19 +660,19 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
labelValue := "testing-label-value" labelValue := "testing-label-value"
By("adding the label " + labelName + " with value " + labelValue + " to a pod") By("adding the label " + labelName + " with value " + labelValue + " to a pod")
framework.RunKubectlOrDie("label", "pods", simplePodName, labelName+"="+labelValue, nsFlag) framework.RunKubectlOrDie("label", "pods", pausePodName, labelName+"="+labelValue, nsFlag)
By("verifying the pod has the label " + labelName + " with the value " + labelValue) By("verifying the pod has the label " + labelName + " with the value " + labelValue)
output := framework.RunKubectlOrDie("get", "pod", simplePodName, "-L", labelName, nsFlag) output := framework.RunKubectlOrDie("get", "pod", pausePodName, "-L", labelName, nsFlag)
if !strings.Contains(output, labelValue) { if !strings.Contains(output, labelValue) {
framework.Failf("Failed updating label " + labelName + " to the pod " + simplePodName) framework.Failf("Failed updating label " + labelName + " to the pod " + pausePodName)
} }
By("removing the label " + labelName + " of a pod") By("removing the label " + labelName + " of a pod")
framework.RunKubectlOrDie("label", "pods", simplePodName, labelName+"-", nsFlag) framework.RunKubectlOrDie("label", "pods", pausePodName, labelName+"-", nsFlag)
By("verifying the pod doesn't have the label " + labelName) By("verifying the pod doesn't have the label " + labelName)
output = framework.RunKubectlOrDie("get", "pod", simplePodName, "-L", labelName, nsFlag) output = framework.RunKubectlOrDie("get", "pod", pausePodName, "-L", labelName, nsFlag)
if strings.Contains(output, labelValue) { if strings.Contains(output, labelValue) {
framework.Failf("Failed removing label " + labelName + " of the pod " + simplePodName) framework.Failf("Failed removing label " + labelName + " of the pod " + pausePodName)
} }
}) })
}) })