Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
33fc389a
Commit
33fc389a
authored
Aug 02, 2018
by
Mayank Gaikwad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new conforamnce test under NodeConformance verifying InitContainer PodSpec…
added new conforamnce test under NodeConformance verifying InitContainer PodSpec and improves api coverage
parent
a54c0974
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
conformance.txt
test/conformance/testdata/conformance.txt
+4
-0
init_container.go
test/e2e/common/init_container.go
+34
-4
No files found.
test/conformance/testdata/conformance.txt
View file @
33fc389a
...
@@ -82,6 +82,10 @@ test/e2e/common/expansion.go: "should allow composing env vars into new env vars
...
@@ -82,6 +82,10 @@ test/e2e/common/expansion.go: "should allow composing env vars into new env vars
test/e2e/common/expansion.go: "should allow substituting values in a container's command"
test/e2e/common/expansion.go: "should allow substituting values in a container's command"
test/e2e/common/expansion.go: "should allow substituting values in a container's args"
test/e2e/common/expansion.go: "should allow substituting values in a container's args"
test/e2e/common/host_path.go: "should give a volume the correct mode"
test/e2e/common/host_path.go: "should give a volume the correct mode"
test/e2e/common/init_container.go: "should invoke init containers on a RestartNever pod"
test/e2e/common/init_container.go: "should invoke init containers on a RestartAlways pod"
test/e2e/common/init_container.go: "should not start app containers if init containers fail on a RestartAlways pod"
test/e2e/common/init_container.go: "should not start app containers and fail the pod if init containers fail on a RestartNever pod"
test/e2e/common/kubelet_etc_hosts.go: "should test kubelet managed /etc/hosts file"
test/e2e/common/kubelet_etc_hosts.go: "should test kubelet managed /etc/hosts file"
test/e2e/common/networking.go: "should function for intra-pod communication: http"
test/e2e/common/networking.go: "should function for intra-pod communication: http"
test/e2e/common/networking.go: "should function for intra-pod communication: udp"
test/e2e/common/networking.go: "should function for intra-pod communication: udp"
...
...
test/e2e/common/init_container.go
View file @
33fc389a
...
@@ -42,7 +42,15 @@ var _ = framework.KubeDescribe("InitContainer [NodeConformance]", func() {
...
@@ -42,7 +42,15 @@ var _ = framework.KubeDescribe("InitContainer [NodeConformance]", func() {
podClient
=
f
.
PodClient
()
podClient
=
f
.
PodClient
()
})
})
It
(
"should invoke init containers on a RestartNever pod"
,
func
()
{
/*
Release: v1.12
Testname: init-container-starts-app-restartnever-pod
Description: Ensure that all InitContainers are started
and all containers in pod are voluntarily terminated with exit status 0,
and the system is not going to restart any of these containers
when Pod has restart policy as RestartNever.
*/
framework
.
ConformanceIt
(
"should invoke init containers on a RestartNever pod"
,
func
()
{
By
(
"creating the pod"
)
By
(
"creating the pod"
)
name
:=
"pod-init-"
+
string
(
uuid
.
NewUUID
())
name
:=
"pod-init-"
+
string
(
uuid
.
NewUUID
())
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
...
@@ -99,7 +107,15 @@ var _ = framework.KubeDescribe("InitContainer [NodeConformance]", func() {
...
@@ -99,7 +107,15 @@ var _ = framework.KubeDescribe("InitContainer [NodeConformance]", func() {
}
}
})
})
It
(
"should invoke init containers on a RestartAlways pod"
,
func
()
{
/*
Release: v1.12
Testname: init-container-starts-app-restartalways-pod
Description: Ensure that all InitContainers are started
and all containers in pod started
and at least one container is still running or is in the process of being restarted
when Pod has restart policy as RestartAlways.
*/
framework
.
ConformanceIt
(
"should invoke init containers on a RestartAlways pod"
,
func
()
{
By
(
"creating the pod"
)
By
(
"creating the pod"
)
name
:=
"pod-init-"
+
string
(
uuid
.
NewUUID
())
name
:=
"pod-init-"
+
string
(
uuid
.
NewUUID
())
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
...
@@ -160,7 +176,15 @@ var _ = framework.KubeDescribe("InitContainer [NodeConformance]", func() {
...
@@ -160,7 +176,15 @@ var _ = framework.KubeDescribe("InitContainer [NodeConformance]", func() {
}
}
})
})
It
(
"should not start app containers if init containers fail on a RestartAlways pod"
,
func
()
{
/*
Release: v1.12
Testname: init-container-fails-stops-app-restartalways-pod
Description: Ensure that app container is not started
when all InitContainers failed to start
and Pod has restarted for few occurrences
and pod has restart policy as RestartAlways.
*/
framework
.
ConformanceIt
(
"should not start app containers if init containers fail on a RestartAlways pod"
,
func
()
{
By
(
"creating the pod"
)
By
(
"creating the pod"
)
name
:=
"pod-init-"
+
string
(
uuid
.
NewUUID
())
name
:=
"pod-init-"
+
string
(
uuid
.
NewUUID
())
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
...
@@ -268,7 +292,13 @@ var _ = framework.KubeDescribe("InitContainer [NodeConformance]", func() {
...
@@ -268,7 +292,13 @@ var _ = framework.KubeDescribe("InitContainer [NodeConformance]", func() {
Expect
(
len
(
endPod
.
Status
.
InitContainerStatuses
))
.
To
(
Equal
(
2
))
Expect
(
len
(
endPod
.
Status
.
InitContainerStatuses
))
.
To
(
Equal
(
2
))
})
})
It
(
"should not start app containers and fail the pod if init containers fail on a RestartNever pod"
,
func
()
{
/*
Release: v1.12
Testname: init-container-fails-stops-app-restartnever-pod
Description: Ensure that app container is not started
when atleast one InitContainer fails to start and Pod has restart policy as RestartNever.
*/
framework
.
ConformanceIt
(
"should not start app containers and fail the pod if init containers fail on a RestartNever pod"
,
func
()
{
By
(
"creating the pod"
)
By
(
"creating the pod"
)
name
:=
"pod-init-"
+
string
(
uuid
.
NewUUID
())
name
:=
"pod-init-"
+
string
(
uuid
.
NewUUID
())
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment