Skip to content

Commit 8588fa2

Browse files
committed
Clarify startupProbe e2e tests
1 parent ea4570a commit 8588fa2

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

test/e2e_node/startup_probe_test.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package e2e_node
1919
import (
2020
"time"
2121

22-
"k8s.io/api/core/v1"
22+
v1 "k8s.io/api/core/v1"
2323
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424
"k8s.io/apimachinery/pkg/util/uuid"
2525
"k8s.io/kubernetes/pkg/features"
@@ -58,15 +58,15 @@ var _ = framework.KubeDescribe("StartupProbe [Serial] [Disruptive] [NodeAlphaFea
5858

5959
/*
6060
Release : v1.16
61-
Testname: Pod liveness probe, using local file, delayed by startup probe
62-
Description: A Pod is created with liveness probe that uses ‘exec’ command to cat the non-existent /tmp/health file. Liveness probe MUST NOT fail until startup probe expires.
61+
Testname: Pod startup probe restart
62+
Description: A Pod is created with a failing startup probe. The Pod MUST be killed and restarted incrementing restart count to 1, even if liveness would succeed.
6363
*/
64-
framework.ConformanceIt("should *not* be restarted with a exec \"cat /tmp/health\" because startup probe delays it [NodeConformance]", func() {
64+
framework.ConformanceIt("should be restarted startup probe fails [NodeConformance]", func() {
6565
cmd := []string{"/bin/sh", "-c", "sleep 600"}
6666
livenessProbe := &v1.Probe{
6767
Handler: v1.Handler{
6868
Exec: &v1.ExecAction{
69-
Command: []string{"cat", "/tmp/health"},
69+
Command: []string{"/bin/true"},
7070
},
7171
},
7272
InitialDelaySeconds: 15,
@@ -75,27 +75,27 @@ var _ = framework.KubeDescribe("StartupProbe [Serial] [Disruptive] [NodeAlphaFea
7575
startupProbe := &v1.Probe{
7676
Handler: v1.Handler{
7777
Exec: &v1.ExecAction{
78-
Command: []string{"cat", "/tmp/health"},
78+
Command: []string{"/bin/false"},
7979
},
8080
},
8181
InitialDelaySeconds: 15,
82-
FailureThreshold: 60,
82+
FailureThreshold: 3,
8383
}
8484
pod := startupPodSpec(startupProbe, nil, livenessProbe, cmd)
85-
common.RunLivenessTest(f, pod, 0, defaultObservationTimeout)
85+
common.RunLivenessTest(f, pod, 1, defaultObservationTimeout)
8686
})
8787

8888
/*
8989
Release : v1.16
90-
Testname: Pod liveness probe, using local file, delayed by startup probe
91-
Description: A Pod is created with liveness probe that uses ‘exec’ command to cat the non-existent /tmp/health file. Liveness probe MUST fail after startup probe expires. The Pod MUST now be killed and restarted incrementing restart count to 1.
90+
Testname: Pod liveness probe delayed (long) by startup probe
91+
Description: A Pod is created with failing liveness and startup probes. Liveness probe MUST NOT fail until startup probe expires.
9292
*/
93-
framework.ConformanceIt("should be restarted with a exec \"cat /tmp/health\" because startup probe does not delay it long enough [NodeConformance]", func() {
93+
framework.ConformanceIt("should *not* be restarted by liveness probe because startup probe delays it [NodeConformance]", func() {
9494
cmd := []string{"/bin/sh", "-c", "sleep 600"}
9595
livenessProbe := &v1.Probe{
9696
Handler: v1.Handler{
9797
Exec: &v1.ExecAction{
98-
Command: []string{"cat", "/tmp/health"},
98+
Command: []string{"/bin/false"},
9999
},
100100
},
101101
InitialDelaySeconds: 15,
@@ -104,27 +104,27 @@ var _ = framework.KubeDescribe("StartupProbe [Serial] [Disruptive] [NodeAlphaFea
104104
startupProbe := &v1.Probe{
105105
Handler: v1.Handler{
106106
Exec: &v1.ExecAction{
107-
Command: []string{"cat", "/tmp/health"},
107+
Command: []string{"/bin/false"},
108108
},
109109
},
110110
InitialDelaySeconds: 15,
111-
FailureThreshold: 3,
111+
FailureThreshold: 60,
112112
}
113113
pod := startupPodSpec(startupProbe, nil, livenessProbe, cmd)
114-
common.RunLivenessTest(f, pod, 1, defaultObservationTimeout)
114+
common.RunLivenessTest(f, pod, 0, defaultObservationTimeout)
115115
})
116116

117117
/*
118118
Release : v1.16
119-
Testname: Pod liveness probe, using local file, startup finished restart
120-
Description: A Pod is created with liveness probe that uses ‘exec’ command to cat /temp/health file. The Container is started by creating /tmp/startup after 10 seconds, triggering liveness probe to fail. The Pod MUST now be killed and restarted incrementing restart count to 1.
119+
Testname: Pod liveness probe fails after startup success
120+
Description: A Pod is created with failing liveness probe and delayed startup probe that uses ‘exec’ command to cat /temp/health file. The Container is started by creating /tmp/startup after 10 seconds, triggering liveness probe to fail. The Pod MUST now be killed and restarted incrementing restart count to 1.
121121
*/
122-
framework.ConformanceIt("should be restarted with a exec \"cat /tmp/health\" after startup probe succeeds it [NodeConformance]", func() {
122+
framework.ConformanceIt("should be restarted by liveness probe after startup probe enables it [NodeConformance]", func() {
123123
cmd := []string{"/bin/sh", "-c", "sleep 10; echo ok >/tmp/startup; sleep 600"}
124124
livenessProbe := &v1.Probe{
125125
Handler: v1.Handler{
126126
Exec: &v1.ExecAction{
127-
Command: []string{"cat", "/tmp/health"},
127+
Command: []string{"/bin/false"},
128128
},
129129
},
130130
InitialDelaySeconds: 15,

0 commit comments

Comments
 (0)