Add a tcp probe e2e test

This commit is contained in:
Aaron Crickenberger 2019-05-15 15:06:02 -07:00
parent 944976d11f
commit 0541be1787

View File

@ -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