mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #54585 from bradtopol/addprobeprestopnetworkingconform
Automatic merge from submit-queue (batch tested with PRs 53730, 51608, 54459, 54534, 54585). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add probe, pre_stop, and networking related container annotations. Signed-off-by: Brad Topol <btopol@us.ibm.com> Add probe, pre_stop, and networking related container annotations. /sig testing /area conformance @sig-testing-pr-reviews This PR adds probe, pre_stop, and networking related conformance annotations to the e2e test suite. The PR fixes a portion of #53822. It focuses on adding conformance annotations as defined by the Kubernetes Conformance Workgroup for a subset of the pod based e2e conformance tests. Special notes for your reviewer: Please see https://docs.google.com/spreadsheets/d/1WWSOqFaG35VmmPOYbwetapj1VPOVMqjZfR9ih5To5gk/edit#gid=62929400 for the list of SIG Arch approved test names and descriptions that I am using. **Release note**: ```release-note NONE ```
This commit is contained in:
commit
7d34b7a5d4
@ -49,6 +49,11 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
|||||||
podClient = f.PodClient()
|
podClient = f.PodClient()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: pods-readiness-probe-initial-delay
|
||||||
|
Description: Make sure that pod with readiness probe should not be
|
||||||
|
ready before initial delay and never restart.
|
||||||
|
*/
|
||||||
It("with readiness probe should not be ready before initial delay and never restart [Conformance]", func() {
|
It("with readiness probe should not be ready before initial delay and never restart [Conformance]", func() {
|
||||||
p := podClient.Create(makePodSpec(probe.withInitialDelay().build(), nil))
|
p := podClient.Create(makePodSpec(probe.withInitialDelay().build(), nil))
|
||||||
f.WaitForPodReady(p.Name)
|
f.WaitForPodReady(p.Name)
|
||||||
@ -76,6 +81,11 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
|||||||
Expect(restartCount == 0).To(BeTrue(), "pod should have a restart count of 0 but got %v", restartCount)
|
Expect(restartCount == 0).To(BeTrue(), "pod should have a restart count of 0 but got %v", restartCount)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: pods-readiness-probe-failure
|
||||||
|
Description: Make sure that pod with readiness probe that fails should
|
||||||
|
never be ready and never restart.
|
||||||
|
*/
|
||||||
It("with readiness probe that fails should never be ready and never restart [Conformance]", func() {
|
It("with readiness probe that fails should never be ready and never restart [Conformance]", func() {
|
||||||
p := podClient.Create(makePodSpec(probe.withFailing().build(), nil))
|
p := podClient.Create(makePodSpec(probe.withFailing().build(), nil))
|
||||||
Consistently(func() (bool, error) {
|
Consistently(func() (bool, error) {
|
||||||
@ -96,6 +106,11 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
|||||||
Expect(restartCount == 0).To(BeTrue(), "pod should have a restart count of 0 but got %v", restartCount)
|
Expect(restartCount == 0).To(BeTrue(), "pod should have a restart count of 0 but got %v", restartCount)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: pods-cat-liveness-probe-restarted
|
||||||
|
Description: Make sure the pod is restarted with a cat /tmp/health
|
||||||
|
liveness probe.
|
||||||
|
*/
|
||||||
It("should be restarted with a exec \"cat /tmp/health\" liveness probe [Conformance]", func() {
|
It("should be restarted with a exec \"cat /tmp/health\" liveness probe [Conformance]", func() {
|
||||||
runLivenessTest(f, &v1.Pod{
|
runLivenessTest(f, &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -123,6 +138,11 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
|||||||
}, 1, defaultObservationTimeout)
|
}, 1, defaultObservationTimeout)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: pods-cat-liveness-probe-not-restarted
|
||||||
|
Description: Make sure the pod is not restarted with a cat /tmp/health
|
||||||
|
liveness probe.
|
||||||
|
*/
|
||||||
It("should *not* be restarted with a exec \"cat /tmp/health\" liveness probe [Conformance]", func() {
|
It("should *not* be restarted with a exec \"cat /tmp/health\" liveness probe [Conformance]", func() {
|
||||||
runLivenessTest(f, &v1.Pod{
|
runLivenessTest(f, &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -150,6 +170,11 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
|||||||
}, 0, defaultObservationTimeout)
|
}, 0, defaultObservationTimeout)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: pods-http-liveness-probe-restarted
|
||||||
|
Description: Make sure when http liveness probe fails, the pod should
|
||||||
|
be restarted.
|
||||||
|
*/
|
||||||
It("should be restarted with a /healthz http liveness probe [Conformance]", func() {
|
It("should be restarted with a /healthz http liveness probe [Conformance]", func() {
|
||||||
runLivenessTest(f, &v1.Pod{
|
runLivenessTest(f, &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -179,6 +204,11 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Slow by design (5 min)
|
// Slow by design (5 min)
|
||||||
|
/*
|
||||||
|
Testname: pods-restart-count
|
||||||
|
Description: Make sure when a pod gets restarted, its start count
|
||||||
|
should increase.
|
||||||
|
*/
|
||||||
It("should have monotonically increasing restart count [Conformance] [Slow]", func() {
|
It("should have monotonically increasing restart count [Conformance] [Slow]", func() {
|
||||||
runLivenessTest(f, &v1.Pod{
|
runLivenessTest(f, &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -207,6 +237,11 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
|||||||
}, 5, time.Minute*5)
|
}, 5, time.Minute*5)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: pods-http-liveness-probe-not-restarted
|
||||||
|
Description: Make sure when http liveness probe succeeds, the pod
|
||||||
|
should not be restarted.
|
||||||
|
*/
|
||||||
It("should *not* be restarted with a /healthz http liveness probe [Conformance]", func() {
|
It("should *not* be restarted with a /healthz http liveness probe [Conformance]", func() {
|
||||||
runLivenessTest(f, &v1.Pod{
|
runLivenessTest(f, &v1.Pod{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
@ -236,6 +271,11 @@ var _ = framework.KubeDescribe("Probing container", func() {
|
|||||||
}, 0, defaultObservationTimeout)
|
}, 0, defaultObservationTimeout)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: pods-docker-liveness-probe-timeout
|
||||||
|
Description: Make sure that the pod is restarted with a docker exec
|
||||||
|
liveness probe with timeout.
|
||||||
|
*/
|
||||||
It("should be restarted with a docker exec liveness probe with timeout [Conformance]", func() {
|
It("should be restarted with a docker exec liveness probe with timeout [Conformance]", func() {
|
||||||
// TODO: enable this test once the default exec handler supports timeout.
|
// TODO: enable this test once the default exec handler supports timeout.
|
||||||
framework.Skipf("The default exec handler, dockertools.NativeExecHandler, does not support timeouts due to a limitation in the Docker Remote API")
|
framework.Skipf("The default exec handler, dockertools.NativeExecHandler, does not support timeouts due to a limitation in the Docker Remote API")
|
||||||
|
@ -30,6 +30,11 @@ var _ = Describe("[sig-network] Networking", func() {
|
|||||||
// Try to hit all endpoints through a test container, retry 5 times,
|
// Try to hit all endpoints through a test container, retry 5 times,
|
||||||
// expect exactly one unique hostname. Each of these endpoints reports
|
// expect exactly one unique hostname. Each of these endpoints reports
|
||||||
// its own hostname.
|
// its own hostname.
|
||||||
|
/*
|
||||||
|
Testname: networking-intra-pod-http
|
||||||
|
Description: Try to hit test endpoints from a test container and make
|
||||||
|
sure each of them can report a unique hostname.
|
||||||
|
*/
|
||||||
It("should function for intra-pod communication: http [Conformance]", func() {
|
It("should function for intra-pod communication: http [Conformance]", func() {
|
||||||
config := framework.NewCoreNetworkingTestConfig(f)
|
config := framework.NewCoreNetworkingTestConfig(f)
|
||||||
for _, endpointPod := range config.EndpointPods {
|
for _, endpointPod := range config.EndpointPods {
|
||||||
@ -37,6 +42,11 @@ var _ = Describe("[sig-network] Networking", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: networking-intra-pod-udp
|
||||||
|
Description: Try to hit test endpoints from a test container using udp
|
||||||
|
and make sure each of them can report a unique hostname.
|
||||||
|
*/
|
||||||
It("should function for intra-pod communication: udp [Conformance]", func() {
|
It("should function for intra-pod communication: udp [Conformance]", func() {
|
||||||
config := framework.NewCoreNetworkingTestConfig(f)
|
config := framework.NewCoreNetworkingTestConfig(f)
|
||||||
for _, endpointPod := range config.EndpointPods {
|
for _, endpointPod := range config.EndpointPods {
|
||||||
@ -44,6 +54,11 @@ var _ = Describe("[sig-network] Networking", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: networking-node-pod-http
|
||||||
|
Description: Try to hit test endpoints from the pod and make sure each
|
||||||
|
of them can report a unique hostname.
|
||||||
|
*/
|
||||||
It("should function for node-pod communication: http [Conformance]", func() {
|
It("should function for node-pod communication: http [Conformance]", func() {
|
||||||
config := framework.NewCoreNetworkingTestConfig(f)
|
config := framework.NewCoreNetworkingTestConfig(f)
|
||||||
for _, endpointPod := range config.EndpointPods {
|
for _, endpointPod := range config.EndpointPods {
|
||||||
@ -51,6 +66,11 @@ var _ = Describe("[sig-network] Networking", func() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: networking-node-pod-udp
|
||||||
|
Description: Try to hit test endpoints from the pod using udp and make sure
|
||||||
|
each of them can report a unique hostname.
|
||||||
|
*/
|
||||||
It("should function for node-pod communication: udp [Conformance]", func() {
|
It("should function for node-pod communication: udp [Conformance]", func() {
|
||||||
config := framework.NewCoreNetworkingTestConfig(f)
|
config := framework.NewCoreNetworkingTestConfig(f)
|
||||||
for _, endpointPod := range config.EndpointPods {
|
for _, endpointPod := range config.EndpointPods {
|
||||||
|
@ -175,6 +175,11 @@ func testPreStop(c clientset.Interface, ns string) {
|
|||||||
var _ = framework.KubeDescribe("PreStop", func() {
|
var _ = framework.KubeDescribe("PreStop", func() {
|
||||||
f := framework.NewDefaultFramework("prestop")
|
f := framework.NewDefaultFramework("prestop")
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testname: pods-prestop-handler-invoked
|
||||||
|
Description: Makes sure a pod's preStop handler is successfully
|
||||||
|
invoked immediately before a container is terminated.
|
||||||
|
*/
|
||||||
It("should call prestop when killing a pod [Conformance]", func() {
|
It("should call prestop when killing a pod [Conformance]", func() {
|
||||||
testPreStop(f.ClientSet, f.Namespace.Name)
|
testPreStop(f.ClientSet, f.Namespace.Name)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user