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
bcf5e434
Unverified
Commit
bcf5e434
authored
Dec 01, 2016
by
Tim St. Clair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify misc container in summary test
parent
737edd02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
BUILD
test/e2e_node/BUILD
+1
-0
summary_test.go
test/e2e_node/summary_test.go
+13
-6
No files found.
test/e2e_node/BUILD
View file @
bcf5e434
...
@@ -103,6 +103,7 @@ go_test(
...
@@ -103,6 +103,7 @@ go_test(
"//test/e2e_node/services:go_default_library",
"//test/e2e_node/services:go_default_library",
"//test/e2e_node/system:go_default_library",
"//test/e2e_node/system:go_default_library",
"//test/utils:go_default_library",
"//test/utils:go_default_library",
"//vendor:github.com/coreos/go-systemd/util",
"//vendor:github.com/davecgh/go-spew/spew",
"//vendor:github.com/davecgh/go-spew/spew",
"//vendor:github.com/golang/glog",
"//vendor:github.com/golang/glog",
"//vendor:github.com/kardianos/osext",
"//vendor:github.com/kardianos/osext",
...
...
test/e2e_node/summary_test.go
View file @
bcf5e434
...
@@ -26,6 +26,7 @@ import (
...
@@ -26,6 +26,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/stats"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework"
systemdutil
"github.com/coreos/go-systemd/util"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/gomega"
.
"github.com/onsi/gomega"
"github.com/onsi/gomega/gstruct"
"github.com/onsi/gomega/gstruct"
...
@@ -83,6 +84,15 @@ var _ = framework.KubeDescribe("Summary API", func() {
...
@@ -83,6 +84,15 @@ var _ = framework.KubeDescribe("Summary API", func() {
"Logs"
:
BeNil
(),
"Logs"
:
BeNil
(),
"UserDefinedMetrics"
:
BeEmpty
(),
"UserDefinedMetrics"
:
BeEmpty
(),
})
})
systemContainers
:=
gstruct
.
Elements
{
"kubelet"
:
sysContExpectations
,
"runtime"
:
sysContExpectations
,
}
// The Kubelet only manages the 'misc' system container if the host is not running systemd.
if
!
systemdutil
.
IsRunningSystemd
()
{
framework
.
Logf
(
"Host not running systemd; expecting 'misc' system container."
)
systemContainers
[
"misc"
]
=
sysContExpectations
}
// Expectations for pods.
// Expectations for pods.
podExpectations
:=
gstruct
.
MatchAllFields
(
gstruct
.
Fields
{
podExpectations
:=
gstruct
.
MatchAllFields
(
gstruct
.
Fields
{
"PodRef"
:
gstruct
.
Ignore
(),
"PodRef"
:
gstruct
.
Ignore
(),
...
@@ -147,12 +157,9 @@ var _ = framework.KubeDescribe("Summary API", func() {
...
@@ -147,12 +157,9 @@ var _ = framework.KubeDescribe("Summary API", func() {
})
})
matchExpectations
:=
ptrMatchAllFields
(
gstruct
.
Fields
{
matchExpectations
:=
ptrMatchAllFields
(
gstruct
.
Fields
{
"Node"
:
gstruct
.
MatchAllFields
(
gstruct
.
Fields
{
"Node"
:
gstruct
.
MatchAllFields
(
gstruct
.
Fields
{
"NodeName"
:
Equal
(
framework
.
TestContext
.
NodeName
),
"NodeName"
:
Equal
(
framework
.
TestContext
.
NodeName
),
"StartTime"
:
recent
(
maxStartAge
),
"StartTime"
:
recent
(
maxStartAge
),
"SystemContainers"
:
gstruct
.
MatchElements
(
summaryObjectID
,
gstruct
.
IgnoreExtras
,
gstruct
.
Elements
{
"SystemContainers"
:
gstruct
.
MatchAllElements
(
summaryObjectID
,
systemContainers
),
"kubelet"
:
sysContExpectations
,
"runtime"
:
sysContExpectations
,
}),
"CPU"
:
ptrMatchAllFields
(
gstruct
.
Fields
{
"CPU"
:
ptrMatchAllFields
(
gstruct
.
Fields
{
"Time"
:
recent
(
maxStatsAge
),
"Time"
:
recent
(
maxStatsAge
),
"UsageNanoCores"
:
bounded
(
100E3
,
2E9
),
"UsageNanoCores"
:
bounded
(
100E3
,
2E9
),
...
...
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