Skip to content

Commit 0541be1

Browse files
committed
Add a tcp probe e2e test
1 parent 944976d commit 0541be1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/e2e/common/container_probe.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,21 @@ var _ = framework.KubeDescribe("Probing container", func() {
158158
runLivenessTest(f, pod, 1, defaultObservationTimeout)
159159
})
160160

161+
/*
162+
Release : v1.15
163+
Testname: Pod liveness probe, using tcp socket, no restart
164+
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.
165+
*/
166+
It("should *not* be restarted with a tcp:8080 liveness probe [NodeConformance]", func() {
167+
livenessProbe := &v1.Probe{
168+
Handler: tcpSocketHandler(8080),
169+
InitialDelaySeconds: 15,
170+
FailureThreshold: 1,
171+
}
172+
pod := livenessPodSpec(nil, livenessProbe)
173+
runLivenessTest(f, pod, 0, defaultObservationTimeout)
174+
})
175+
161176
/*
162177
Release : v1.9
163178
Testname: Pod liveness probe, using http endpoint, multiple restarts (slow)
@@ -352,6 +367,14 @@ func httpGetHandler(path string, port int) v1.Handler {
352367
}
353368
}
354369

370+
func tcpSocketHandler(port int) v1.Handler {
371+
return v1.Handler{
372+
TCPSocket: &v1.TCPSocketAction{
373+
Port: intstr.FromInt(port),
374+
},
375+
}
376+
}
377+
355378
type webserverProbeBuilder struct {
356379
failing bool
357380
initialDelay bool

0 commit comments

Comments
 (0)