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
a6ad6521
Commit
a6ad6521
authored
Jun 05, 2016
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shorten e2e_node test, fix pod ready test issue
parent
015bc3d6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
container.go
test/e2e_node/container.go
+22
-7
runtime_conformance_test.go
test/e2e_node/runtime_conformance_test.go
+0
-0
No files found.
test/e2e_node/container.go
View file @
a6ad6521
...
@@ -110,17 +110,32 @@ func (cc *ConformanceContainer) Get() (ConformanceContainer, error) {
...
@@ -110,17 +110,32 @@ func (cc *ConformanceContainer) Get() (ConformanceContainer, error) {
return
ConformanceContainer
{
containers
[
0
],
cc
.
Client
,
pod
.
Spec
.
RestartPolicy
,
pod
.
Spec
.
Volumes
,
pod
.
Spec
.
NodeName
,
cc
.
Namespace
,
cc
.
podName
},
nil
return
ConformanceContainer
{
containers
[
0
],
cc
.
Client
,
pod
.
Spec
.
RestartPolicy
,
pod
.
Spec
.
Volumes
,
pod
.
Spec
.
NodeName
,
cc
.
Namespace
,
cc
.
podName
},
nil
}
}
func
(
cc
*
ConformanceContainer
)
GetStatus
()
(
api
.
ContainerStatus
,
api
.
PodPhase
,
error
)
{
func
(
cc
*
ConformanceContainer
)
IsReady
()
(
bool
,
error
)
{
pod
,
err
:=
cc
.
Client
.
Pods
(
cc
.
Namespace
)
.
Get
(
cc
.
podName
)
pod
,
err
:=
cc
.
Client
.
Pods
(
cc
.
Namespace
)
.
Get
(
cc
.
podName
)
if
err
!=
nil
{
if
err
!=
nil
{
return
api
.
ContainerStatus
{},
api
.
PodUnknown
,
err
return
false
,
err
}
return
api
.
IsPodReady
(
pod
),
nil
}
func
(
cc
*
ConformanceContainer
)
GetPhase
()
(
api
.
PodPhase
,
error
)
{
pod
,
err
:=
cc
.
Client
.
Pods
(
cc
.
Namespace
)
.
Get
(
cc
.
podName
)
if
err
!=
nil
{
return
api
.
PodUnknown
,
err
}
}
return
pod
.
Status
.
Phase
,
nil
}
func
(
cc
*
ConformanceContainer
)
GetStatus
()
(
api
.
ContainerStatus
,
error
)
{
pod
,
err
:=
cc
.
Client
.
Pods
(
cc
.
Namespace
)
.
Get
(
cc
.
podName
)
if
err
!=
nil
{
return
api
.
ContainerStatus
{},
err
}
statuses
:=
pod
.
Status
.
ContainerStatuses
statuses
:=
pod
.
Status
.
ContainerStatuses
if
len
(
statuses
)
!=
1
{
if
len
(
statuses
)
!=
1
||
statuses
[
0
]
.
Name
!=
cc
.
Container
.
Name
{
return
api
.
ContainerStatus
{},
api
.
PodUnknown
,
errors
.
New
(
"Failed to get container status"
)
return
api
.
ContainerStatus
{},
fmt
.
Errorf
(
"unexpected container statuses %v"
,
statuses
)
}
}
return
statuses
[
0
],
pod
.
Status
.
Phase
,
nil
return
statuses
[
0
],
nil
}
}
func
(
cc
*
ConformanceContainer
)
Present
()
(
bool
,
error
)
{
func
(
cc
*
ConformanceContainer
)
Present
()
(
bool
,
error
)
{
...
@@ -134,10 +149,10 @@ func (cc *ConformanceContainer) Present() (bool, error) {
...
@@ -134,10 +149,10 @@ func (cc *ConformanceContainer) Present() (bool, error) {
return
false
,
err
return
false
,
err
}
}
type
ContainerState
uint32
type
ContainerState
int
const
(
const
(
ContainerStateWaiting
ContainerState
=
1
<<
iota
ContainerStateWaiting
ContainerState
=
iota
ContainerStateRunning
ContainerStateRunning
ContainerStateTerminated
ContainerStateTerminated
ContainerStateUnknown
ContainerStateUnknown
...
...
test/e2e_node/runtime_conformance_test.go
View file @
a6ad6521
This diff is collapsed.
Click to expand it.
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