From 82822f10e1b073fca0556094b6a26da74bf0a293 Mon Sep 17 00:00:00 2001 From: Mayank Gaikwad <8110509+mgdevstack@users.noreply.github.com> Date: Thu, 28 Mar 2019 18:45:17 +0530 Subject: [PATCH] Promote container runtime e2e verifying termination message --- test/conformance/testdata/conformance.txt | 3 +++ test/e2e/common/runtime.go | 29 +++++++++++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/test/conformance/testdata/conformance.txt b/test/conformance/testdata/conformance.txt index afc7fc6b768..922671568de 100644 --- a/test/conformance/testdata/conformance.txt +++ b/test/conformance/testdata/conformance.txt @@ -151,6 +151,9 @@ test/e2e/common/projected_secret.go: "should be consumable in multiple volumes i test/e2e/common/projected_secret.go: "optional updates should be reflected in volume" test/e2e/common/runtime.go: "should run with the expected status" test/e2e/common/runtime.go: "should report termination message if TerminationMessagePath is set as non-root user and at a non-default path" +test/e2e/common/runtime.go: "should report termination message from log output if TerminationMessagePolicy FallbackToLogsOnError is set" +test/e2e/common/runtime.go: "should report termination message as empty when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set" +test/e2e/common/runtime.go: "should report termination message from file when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set" test/e2e/common/secrets.go: "should be consumable from pods in env vars" test/e2e/common/secrets.go: "should be consumable via the environment" test/e2e/common/secrets.go: "should fail to create secret due to empty secret key" diff --git a/test/e2e/common/runtime.go b/test/e2e/common/runtime.go index 831e913ca03..29da6d8a96a 100644 --- a/test/e2e/common/runtime.go +++ b/test/e2e/common/runtime.go @@ -193,8 +193,13 @@ while true; do sleep 1; done matchTerminationMessage(container, v1.PodSucceeded, Equal("DONE")) }) - It("should report termination message [LinuxOnly] from log output if TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { - // Cannot mount files in Windows Containers. + /* + Release: v1.15 + Name: Container Runtime, TerminationMessage, from container's log output of failing container + Description: Create a pod with an container. Container's output is recorded in log and container exits with an error. When container is terminated, termination message MUST match the expected output recorded from container's log. + [LinuxOnly]: Cannot mount files in Windows Containers. + */ + framework.ConformanceIt("should report termination message [LinuxOnly] from log output if TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { container := v1.Container{ Image: framework.BusyBoxImage, Command: []string{"/bin/sh", "-c"}, @@ -205,20 +210,30 @@ while true; do sleep 1; done matchTerminationMessage(container, v1.PodFailed, Equal("DONE")) }) - It("should report termination message [LinuxOnly] as empty when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { - // Cannot mount files in Windows Containers. + /* + Release: v1.15 + Name: Container Runtime, TerminationMessage, from log output of succeeding container + Description: Create a pod with an container. Container's output is recorded in log and container exits successfully without an error. When container is terminated, terminationMessage MUST have no content as container succeed. + [LinuxOnly]: Cannot mount files in Windows Containers. + */ + framework.ConformanceIt("should report termination message [LinuxOnly] as empty when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { container := v1.Container{ Image: framework.BusyBoxImage, Command: []string{"/bin/sh", "-c"}, - Args: []string{"/bin/echo DONE; /bin/true"}, + Args: []string{"/bin/echo -n DONE; /bin/true"}, TerminationMessagePath: "/dev/termination-log", TerminationMessagePolicy: v1.TerminationMessageFallbackToLogsOnError, } matchTerminationMessage(container, v1.PodSucceeded, Equal("")) }) - It("should report termination message [LinuxOnly] from file when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { - // Cannot mount files in Windows Containers. + /* + Release: v1.15 + Name: Container Runtime, TerminationMessage, from file of succeeding container + Description: Create a pod with an container. Container's output is recorded in a file and the container exits successfully without an error. When container is terminated, terminationMessage MUST match with the content from file. + [LinuxOnly]: Cannot mount files in Windows Containers. + */ + framework.ConformanceIt("should report termination message [LinuxOnly] from file when pod succeeds and TerminationMessagePolicy FallbackToLogsOnError is set [NodeConformance]", func() { container := v1.Container{ Image: framework.BusyBoxImage, Command: []string{"/bin/sh", "-c"},