From f79d5a19d410deca98fbc6363759ab4182388835 Mon Sep 17 00:00:00 2001 From: Maria Alejandra Kurylec Date: Tue, 7 Aug 2018 19:01:04 -0300 Subject: [PATCH 1/3] a) porting e2e_node lifecycle testcases into e2e folder, under common. b) placing them under conformance golden list. --- test/conformance/testdata/conformance.txt | 10 ++++++++++ test/e2e/common/BUILD | 1 + .../common/lifecycle_hook.go} | 2 +- test/e2e_node/BUILD | 1 - 4 files changed, 12 insertions(+), 2 deletions(-) rename test/{e2e_node/lifecycle_hook_test.go => e2e/common/lifecycle_hook.go} (99%) diff --git a/test/conformance/testdata/conformance.txt b/test/conformance/testdata/conformance.txt index 944bd726f69..21f59d6781e 100755 --- a/test/conformance/testdata/conformance.txt +++ b/test/conformance/testdata/conformance.txt @@ -92,6 +92,10 @@ test/e2e/common/init_container.go: "should invoke init containers on a RestartAl test/e2e/common/init_container.go: "should not start app containers if init containers fail on a RestartAlways pod" test/e2e/common/init_container.go: "should not start app containers and fail the pod if init containers fail on a RestartNever pod" test/e2e/common/kubelet_etc_hosts.go: "should test kubelet managed /etc/hosts file" +test/e2e/common/lifecycle_hook.go: "should execute poststart exec hook properly" +test/e2e/common/lifecycle_hook.go: "should execute prestop exec hook properly" +test/e2e/common/lifecycle_hook.go: "should execute poststart http hook properly" +test/e2e/common/lifecycle_hook.go: "should execute prestop http hook properly" test/e2e/common/networking.go: "should function for intra-pod communication: http" test/e2e/common/networking.go: "should function for intra-pod communication: udp" test/e2e/common/networking.go: "should function for node-pod communication: http" @@ -181,3 +185,9 @@ test/e2e/storage/subpath.go: "should support subpaths with configmap pod" test/e2e/storage/subpath.go: "should support subpaths with configmap pod with mountPath of existing file" test/e2e/storage/subpath.go: "should support subpaths with downward pod" test/e2e/storage/subpath.go: "should support subpaths with projected pod" +test/e2e_node/kubelet_test.go: "it should print the output to logs" +test/e2e_node/kubelet_test.go: "it should not write to root filesystem" +test/e2e_node/mirror_pod_test.go: "should be updated when static pod updated" +test/e2e_node/mirror_pod_test.go: "should be recreated when mirror pod gracefully deleted" +test/e2e_node/mirror_pod_test.go: "should be recreated when mirror pod forcibly deleted" +test/e2e_node/runtime_conformance_test.go: "it should run with the expected status" \ No newline at end of file diff --git a/test/e2e/common/BUILD b/test/e2e/common/BUILD index db4db98744f..98d2026fa95 100644 --- a/test/e2e/common/BUILD +++ b/test/e2e/common/BUILD @@ -22,6 +22,7 @@ go_library( "host_path.go", "init_container.go", "kubelet_etc_hosts.go", + "lifecycle_hook.go", "networking.go", "pods.go", "privileged.go", diff --git a/test/e2e_node/lifecycle_hook_test.go b/test/e2e/common/lifecycle_hook.go similarity index 99% rename from test/e2e_node/lifecycle_hook_test.go rename to test/e2e/common/lifecycle_hook.go index 6e6aa4f147b..082558f0882 100644 --- a/test/e2e_node/lifecycle_hook_test.go +++ b/test/e2e/common/lifecycle_hook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package e2e_node +package common import ( "time" diff --git a/test/e2e_node/BUILD b/test/e2e_node/BUILD index 03461b0c022..98e775cf9c0 100644 --- a/test/e2e_node/BUILD +++ b/test/e2e_node/BUILD @@ -93,7 +93,6 @@ go_test( "hugepages_test.go", "image_id_test.go", "kubelet_test.go", - "lifecycle_hook_test.go", "log_path_test.go", "mirror_pod_test.go", "node_container_manager_test.go", From 21c0cae4e908d208a24870b4233cd98b4e7c23ab Mon Sep 17 00:00:00 2001 From: Maria Alejandra Kurylec Date: Wed, 8 Aug 2018 09:17:28 -0300 Subject: [PATCH 2/3] a) fixing dependencies. --- test/e2e_node/BUILD | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e_node/BUILD b/test/e2e_node/BUILD index 98e775cf9c0..00d13e63f0d 100644 --- a/test/e2e_node/BUILD +++ b/test/e2e_node/BUILD @@ -135,7 +135,6 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/fields:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/util/intstr:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/uuid:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", From 95a6dc4f33f10af3d90e1d44f1291c6aba069d4d Mon Sep 17 00:00:00 2001 From: Maria Alejandra Kurylec Date: Wed, 8 Aug 2018 11:06:07 -0300 Subject: [PATCH 3/3] a) fixing rebase --- test/conformance/testdata/conformance.txt | 6 ------ test/e2e/common/lifecycle_hook.go | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/test/conformance/testdata/conformance.txt b/test/conformance/testdata/conformance.txt index 21f59d6781e..2e96dd563ae 100755 --- a/test/conformance/testdata/conformance.txt +++ b/test/conformance/testdata/conformance.txt @@ -185,9 +185,3 @@ test/e2e/storage/subpath.go: "should support subpaths with configmap pod" test/e2e/storage/subpath.go: "should support subpaths with configmap pod with mountPath of existing file" test/e2e/storage/subpath.go: "should support subpaths with downward pod" test/e2e/storage/subpath.go: "should support subpaths with projected pod" -test/e2e_node/kubelet_test.go: "it should print the output to logs" -test/e2e_node/kubelet_test.go: "it should not write to root filesystem" -test/e2e_node/mirror_pod_test.go: "should be updated when static pod updated" -test/e2e_node/mirror_pod_test.go: "should be recreated when mirror pod gracefully deleted" -test/e2e_node/mirror_pod_test.go: "should be recreated when mirror pod forcibly deleted" -test/e2e_node/runtime_conformance_test.go: "it should run with the expected status" \ No newline at end of file diff --git a/test/e2e/common/lifecycle_hook.go b/test/e2e/common/lifecycle_hook.go index 082558f0882..1790b236b37 100644 --- a/test/e2e/common/lifecycle_hook.go +++ b/test/e2e/common/lifecycle_hook.go @@ -89,7 +89,7 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() { Testname: Pod Lifecycle, post start exec hook Description: When a post start handler is specified in the container lifecycle using a ‘Exec’ action, then the handler MUST be invoked after the start of the container. A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a post start that invokes the server pod using ExecAction to validate that the post start is executed. */ - It("should execute poststart exec hook properly [NodeConformance]", func() { + framework.ConformanceIt("should execute poststart exec hook properly [NodeConformance]", func() { lifecycle := &v1.Lifecycle{ PostStart: &v1.Handler{ Exec: &v1.ExecAction{ @@ -105,7 +105,7 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() { Testname: Pod Lifecycle, prestop exec hook Description: When a pre-stop handler is specified in the container lifecycle using a ‘Exec’ action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a pre-stop that invokes the server pod using ExecAction to validate that the pre-stop is executed. */ - It("should execute prestop exec hook properly [NodeConformance]", func() { + framework.ConformanceIt("should execute prestop exec hook properly [NodeConformance]", func() { lifecycle := &v1.Lifecycle{ PreStop: &v1.Handler{ Exec: &v1.ExecAction{ @@ -121,7 +121,7 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() { Testname: Pod Lifecycle, post start http hook Description: When a post start handler is specified in the container lifecycle using a HttpGet action, then the handler MUST be invoked after the start of the container. A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a post start that invokes the server pod to validate that the post start is executed. */ - It("should execute poststart http hook properly [NodeConformance]", func() { + framework.ConformanceIt("should execute poststart http hook properly [NodeConformance]", func() { lifecycle := &v1.Lifecycle{ PostStart: &v1.Handler{ HTTPGet: &v1.HTTPGetAction{ @@ -139,7 +139,7 @@ var _ = framework.KubeDescribe("Container Lifecycle Hook", func() { Testname: Pod Lifecycle, prestop http hook Description: When a pre-stop handler is specified in the container lifecycle using a ‘HttpGet’ action, then the handler MUST be invoked before the container is terminated. A server pod is created that will serve http requests, create a second pod with a container lifecycle specifying a pre-stop that invokes the server pod to validate that the pre-stop is executed. */ - It("should execute prestop http hook properly [NodeConformance]", func() { + framework.ConformanceIt("should execute prestop http hook properly [NodeConformance]", func() { lifecycle := &v1.Lifecycle{ PreStop: &v1.Handler{ HTTPGet: &v1.HTTPGetAction{