diff --git a/test/e2e/common/container_probe.go b/test/e2e/common/container_probe.go index 2412482a00f..10881e4844d 100644 --- a/test/e2e/common/container_probe.go +++ b/test/e2e/common/container_probe.go @@ -158,6 +158,21 @@ var _ = framework.KubeDescribe("Probing container", func() { runLivenessTest(f, pod, 1, defaultObservationTimeout) }) + /* + Release : v1.15 + Testname: Pod liveness probe, using tcp socket, no restart + Description: A Pod is created with liveness probe on tcp socket 8080. The http handler on port 8080 will return http errors after 10 seconds, but socket will remain open. Liveness probe MUST not fail to check health and the restart count should remain 0. + */ + It("should *not* be restarted with a tcp:8080 liveness probe [NodeConformance]", func() { + livenessProbe := &v1.Probe{ + Handler: tcpSocketHandler(8080), + InitialDelaySeconds: 15, + FailureThreshold: 1, + } + pod := livenessPodSpec(nil, livenessProbe) + runLivenessTest(f, pod, 0, defaultObservationTimeout) + }) + /* Release : v1.9 Testname: Pod liveness probe, using http endpoint, multiple restarts (slow) @@ -352,6 +367,14 @@ func httpGetHandler(path string, port int) v1.Handler { } } +func tcpSocketHandler(port int) v1.Handler { + return v1.Handler{ + TCPSocket: &v1.TCPSocketAction{ + Port: intstr.FromInt(port), + }, + } +} + type webserverProbeBuilder struct { failing bool initialDelay bool