diff --git a/test/conformance/testdata/conformance.txt b/test/conformance/testdata/conformance.txt index d8e87ce3d15..4fd04cd1530 100755 --- a/test/conformance/testdata/conformance.txt +++ b/test/conformance/testdata/conformance.txt @@ -93,6 +93,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" diff --git a/test/e2e/common/BUILD b/test/e2e/common/BUILD index 716e7e7a9d7..d21b44398e1 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 93% rename from test/e2e_node/lifecycle_hook_test.go rename to test/e2e/common/lifecycle_hook.go index 6e6aa4f147b..1790b236b37 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" @@ -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{ diff --git a/test/e2e_node/BUILD b/test/e2e_node/BUILD index 9bf6858061e..78b024e0656 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", @@ -137,7 +136,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",