From 4ac61e1d12d69e3c205b8bf0c63329eb2e332c12 Mon Sep 17 00:00:00 2001 From: xiangpengzhao Date: Tue, 17 Oct 2017 13:08:49 +0800 Subject: [PATCH 1/2] Combine downward api e2e test cases. --- test/e2e/common/downward_api.go | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/test/e2e/common/downward_api.go b/test/e2e/common/downward_api.go index 4b4b76a366f..d4a6e74bb1f 100644 --- a/test/e2e/common/downward_api.go +++ b/test/e2e/common/downward_api.go @@ -38,11 +38,11 @@ var _ = Describe("[sig-api-machinery] Downward API", func() { f := framework.NewDefaultFramework("downward-api") /* - Testname: downwardapi-env-name-namespace - Description: Ensure that downward API can provide pod's name and - namespaces as environment variables. + Testname: downwardapi-env-name-namespace-podip + Description: Ensure that downward API can provide pod's name, namespace + and IP address as environment variables. */ - framework.ConformanceIt("should provide pod name and namespace as env vars ", func() { + framework.ConformanceIt("should provide pod name, namespace and IP address as env vars ", func() { podName := "downward-api-" + string(uuid.NewUUID()) env := []v1.EnvVar{ { @@ -63,24 +63,6 @@ var _ = Describe("[sig-api-machinery] Downward API", func() { }, }, }, - } - - expectations := []string{ - fmt.Sprintf("POD_NAME=%v", podName), - fmt.Sprintf("POD_NAMESPACE=%v", f.Namespace.Name), - } - - testDownwardAPI(f, podName, env, expectations) - }) - - /* - Testname: downwardapi-env-pod-ip - Description: Ensure that downward API can provide an IP address for - pod as an environment variable. - */ - framework.ConformanceIt("should provide pod IP as an env var ", func() { - podName := "downward-api-" + string(uuid.NewUUID()) - env := []v1.EnvVar{ { Name: "POD_IP", ValueFrom: &v1.EnvVarSource{ @@ -93,6 +75,8 @@ var _ = Describe("[sig-api-machinery] Downward API", func() { } expectations := []string{ + fmt.Sprintf("POD_NAME=%v", podName), + fmt.Sprintf("POD_NAMESPACE=%v", f.Namespace.Name), "POD_IP=(?:\\d+)\\.(?:\\d+)\\.(?:\\d+)\\.(?:\\d+)", } From eddd9a208fecb536e9c12fe51774b752118113e1 Mon Sep 17 00:00:00 2001 From: xiangpengzhao Date: Tue, 31 Oct 2017 10:58:05 +0800 Subject: [PATCH 2/2] Update conformance testdata for downward api test --- test/conformance/testdata/conformance.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/conformance/testdata/conformance.txt b/test/conformance/testdata/conformance.txt index a1b79a138ff..54347e7cd81 100755 --- a/test/conformance/testdata/conformance.txt +++ b/test/conformance/testdata/conformance.txt @@ -26,8 +26,7 @@ test/e2e/common/docker_containers.go: "should use the image defaults if command test/e2e/common/docker_containers.go: "should be able to override the image's default arguments (docker cmd) " test/e2e/common/docker_containers.go: "should be able to override the image's default commmand (docker entrypoint) " test/e2e/common/docker_containers.go: "should be able to override the image's default command and arguments " -test/e2e/common/downward_api.go: "should provide pod name and namespace as env vars " -test/e2e/common/downward_api.go: "should provide pod IP as an env var " +test/e2e/common/downward_api.go: "should provide pod name, namespace and IP address as env vars " test/e2e/common/downward_api.go: "should provide host IP as an env var " test/e2e/common/downward_api.go: "should provide container's limits.cpu/memory and requests.cpu/memory as env vars " test/e2e/common/downward_api.go: "should provide default limits.cpu/memory from node allocatable "