From 696c9ea0b1c7235ab6127d978ffb080887329ff9 Mon Sep 17 00:00:00 2001 From: Mayank Gaikwad <8110509+mgdevstack@users.noreply.github.com> Date: Tue, 25 Sep 2018 08:54:01 +0530 Subject: [PATCH] Promote kubelet NodeConformance tests to Conformance --- test/conformance/testdata/conformance.txt | 5 ++++ test/e2e/common/kubelet.go | 32 ++++++++++++++++++----- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/test/conformance/testdata/conformance.txt b/test/conformance/testdata/conformance.txt index 4fd04cd1530..07397b87857 100755 --- a/test/conformance/testdata/conformance.txt +++ b/test/conformance/testdata/conformance.txt @@ -92,6 +92,11 @@ test/e2e/common/init_container.go: "should invoke init containers on a RestartNe test/e2e/common/init_container.go: "should invoke init containers on a RestartAlways pod" 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.go: "should print the output to logs" +test/e2e/common/kubelet.go: "should have an terminated reason" +test/e2e/common/kubelet.go: "should be possible to delete" +test/e2e/common/kubelet.go: "should write entries to /etc/hosts" +test/e2e/common/kubelet.go: "should not write to root filesystem" 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" diff --git a/test/e2e/common/kubelet.go b/test/e2e/common/kubelet.go index 09575cda512..8038d325aa4 100644 --- a/test/e2e/common/kubelet.go +++ b/test/e2e/common/kubelet.go @@ -41,11 +41,11 @@ var _ = framework.KubeDescribe("Kubelet", func() { podName := "busybox-scheduling-" + string(uuid.NewUUID()) /* - Release : v1.9 + Release : v1.13 Testname: Kubelet, log output, default Description: By default the stdout and stderr from the process being executed in a pod MUST be sent to the pod's logs. */ - It("should print the output to logs [NodeConformance]", func() { + framework.ConformanceIt("should print the output to logs [NodeConformance]", func() { podClient.CreateSync(&v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: podName, @@ -98,7 +98,12 @@ var _ = framework.KubeDescribe("Kubelet", func() { }) }) - It("should have an terminated reason [NodeConformance]", func() { + /* + Release : v1.13 + Testname: Kubelet, failed pod, terminated reason + Description: Create a Pod with terminated state. Pod MUST have only one container. Container MUST be in terminated state and MUST have an terminated reason. + */ + framework.ConformanceIt("should have an terminated reason [NodeConformance]", func() { Eventually(func() error { podData, err := podClient.Get(podName, metav1.GetOptions{}) if err != nil { @@ -118,7 +123,12 @@ var _ = framework.KubeDescribe("Kubelet", func() { }, time.Minute, time.Second*4).Should(BeNil()) }) - It("should be possible to delete [NodeConformance]", func() { + /* + Release : v1.13 + Testname: Kubelet, failed pod, delete + Description: Create a Pod with terminated state. This terminated pod MUST be able to be deleted. + */ + framework.ConformanceIt("should be possible to delete [NodeConformance]", func() { err := podClient.Delete(podName, &metav1.DeleteOptions{}) Expect(err).To(BeNil(), fmt.Sprintf("Error deleting Pod %v", err)) }) @@ -126,7 +136,12 @@ var _ = framework.KubeDescribe("Kubelet", func() { Context("when scheduling a busybox Pod with hostAliases", func() { podName := "busybox-host-aliases" + string(uuid.NewUUID()) - It("should write entries to /etc/hosts [NodeConformance]", func() { + /* + Release : v1.13 + Testname: Kubelet, hostAliases + Description: Create a Pod with hostAliases and a container with command to output /etc/hosts entries. Pod's logs MUST have matching entries of specified hostAliases to the output of /etc/hosts entries. + */ + framework.ConformanceIt("should write entries to /etc/hosts [NodeConformance]", func() { podClient.CreateSync(&v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: podName, @@ -171,7 +186,12 @@ var _ = framework.KubeDescribe("Kubelet", func() { Context("when scheduling a read only busybox container", func() { podName := "busybox-readonly-fs" + string(uuid.NewUUID()) - It("should not write to root filesystem [NodeConformance]", func() { + /* + Release : v1.13 + Testname: Kubelet, pod with read only root file system + Description: Create a Pod with security context set with ReadOnlyRootFileSystem set to true. The Pod then tries to write to the /file on the root, write operation to the root filesystem MUST fail as expected. + */ + framework.ConformanceIt("should not write to root filesystem [NodeConformance]", func() { isReadOnly := true podClient.CreateSync(&v1.Pod{ ObjectMeta: metav1.ObjectMeta{