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
5c8b9577
Commit
5c8b9577
authored
Mar 20, 2017
by
Derek Carr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix faulty assumptions in summary API testing
parent
223c721d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
12 deletions
+32
-12
kubelet.go
test/e2e_node/services/kubelet.go
+5
-1
summary_test.go
test/e2e_node/summary_test.go
+27
-11
No files found.
test/e2e_node/services/kubelet.go
View file @
5c8b9577
...
@@ -108,12 +108,16 @@ func (e *E2EServices) startKubelet() (*server, error) {
...
@@ -108,12 +108,16 @@ func (e *E2EServices) startKubelet() (*server, error) {
// sense to test it that way
// sense to test it that way
isSystemd
=
true
isSystemd
=
true
unitName
:=
fmt
.
Sprintf
(
"kubelet-%d.service"
,
rand
.
Int31
())
unitName
:=
fmt
.
Sprintf
(
"kubelet-%d.service"
,
rand
.
Int31
())
cmdArgs
=
append
(
cmdArgs
,
systemdRun
,
"--unit="
+
unitName
,
"--remain-after-exit"
,
builder
.
GetKubeletServerBin
())
cmdArgs
=
append
(
cmdArgs
,
systemdRun
,
"--unit="
+
unitName
,
"--
slice=runtime.slice"
,
"--
remain-after-exit"
,
builder
.
GetKubeletServerBin
())
killCommand
=
exec
.
Command
(
"systemctl"
,
"kill"
,
unitName
)
killCommand
=
exec
.
Command
(
"systemctl"
,
"kill"
,
unitName
)
restartCommand
=
exec
.
Command
(
"systemctl"
,
"restart"
,
unitName
)
restartCommand
=
exec
.
Command
(
"systemctl"
,
"restart"
,
unitName
)
e
.
logFiles
[
"kubelet.log"
]
=
logFileData
{
e
.
logFiles
[
"kubelet.log"
]
=
logFileData
{
journalctlCommand
:
[]
string
{
"-u"
,
unitName
},
journalctlCommand
:
[]
string
{
"-u"
,
unitName
},
}
}
cmdArgs
=
append
(
cmdArgs
,
"--kubelet-cgroups=/kubelet.slice"
,
"--cgroup-root=/"
,
)
}
else
{
}
else
{
cmdArgs
=
append
(
cmdArgs
,
builder
.
GetKubeletServerBin
())
cmdArgs
=
append
(
cmdArgs
,
builder
.
GetKubeletServerBin
())
cmdArgs
=
append
(
cmdArgs
,
cmdArgs
=
append
(
cmdArgs
,
...
...
test/e2e_node/summary_test.go
View file @
5c8b9577
...
@@ -84,7 +84,14 @@ var _ = framework.KubeDescribe("Summary API", func() {
...
@@ -84,7 +84,14 @@ var _ = framework.KubeDescribe("Summary API", func() {
"AvailableBytes"
:
BeNil
(),
"AvailableBytes"
:
BeNil
(),
"UsageBytes"
:
bounded
(
1
*
mb
,
10
*
gb
),
"UsageBytes"
:
bounded
(
1
*
mb
,
10
*
gb
),
"WorkingSetBytes"
:
bounded
(
1
*
mb
,
10
*
gb
),
"WorkingSetBytes"
:
bounded
(
1
*
mb
,
10
*
gb
),
"RSSBytes"
:
bounded
(
1
*
mb
,
1
*
gb
),
// today, this returns the value reported
// in /sys/fs/cgroup/memory.stat for rss
// this value should really return /sys/fs/cgroup/memory.stat total_rss
// as we really want the hierarchical value not the usage local to / cgroup.
// for now, i am updating the bounding box to the value as coded, but the
// value reported needs to change.
// rss only makes sense if you are leaf cgroup
"RSSBytes"
:
bounded
(
0
,
1
*
gb
),
"PageFaults"
:
bounded
(
1000
,
1E9
),
"PageFaults"
:
bounded
(
1000
,
1E9
),
"MajorPageFaults"
:
bounded
(
0
,
100000
),
"MajorPageFaults"
:
bounded
(
0
,
100000
),
}),
}),
...
@@ -131,7 +138,7 @@ var _ = framework.KubeDescribe("Summary API", func() {
...
@@ -131,7 +138,7 @@ var _ = framework.KubeDescribe("Summary API", func() {
"Time"
:
recent
(
maxStatsAge
),
"Time"
:
recent
(
maxStatsAge
),
"AvailableBytes"
:
bounded
(
1
*
mb
,
10
*
mb
),
"AvailableBytes"
:
bounded
(
1
*
mb
,
10
*
mb
),
"UsageBytes"
:
bounded
(
10
*
kb
,
5
*
mb
),
"UsageBytes"
:
bounded
(
10
*
kb
,
5
*
mb
),
"WorkingSetBytes"
:
bounded
(
10
*
kb
,
mb
),
"WorkingSetBytes"
:
bounded
(
10
*
kb
,
2
*
mb
),
"RSSBytes"
:
bounded
(
1
*
kb
,
mb
),
"RSSBytes"
:
bounded
(
1
*
kb
,
mb
),
"PageFaults"
:
bounded
(
100
,
100000
),
"PageFaults"
:
bounded
(
100
,
100000
),
"MajorPageFaults"
:
bounded
(
0
,
10
),
"MajorPageFaults"
:
bounded
(
0
,
10
),
...
@@ -194,7 +201,14 @@ var _ = framework.KubeDescribe("Summary API", func() {
...
@@ -194,7 +201,14 @@ var _ = framework.KubeDescribe("Summary API", func() {
"AvailableBytes"
:
bounded
(
100
*
mb
,
100
*
gb
),
"AvailableBytes"
:
bounded
(
100
*
mb
,
100
*
gb
),
"UsageBytes"
:
bounded
(
10
*
mb
,
10
*
gb
),
"UsageBytes"
:
bounded
(
10
*
mb
,
10
*
gb
),
"WorkingSetBytes"
:
bounded
(
10
*
mb
,
10
*
gb
),
"WorkingSetBytes"
:
bounded
(
10
*
mb
,
10
*
gb
),
"RSSBytes"
:
bounded
(
1
*
kb
,
1
*
gb
),
// today, this returns the value reported
// in /sys/fs/cgroup/memory.stat for rss
// this value should really return /sys/fs/cgroup/memory.stat total_rss
// as we really want the hierarchical value not the usage local to / cgroup.
// for now, i am updating the bounding box to the value as coded, but the
// value reported needs to change.
// rss only makes sense if you are leaf cgroup
"RSSBytes"
:
bounded
(
0
,
1
*
gb
),
"PageFaults"
:
bounded
(
1000
,
1E9
),
"PageFaults"
:
bounded
(
1000
,
1E9
),
"MajorPageFaults"
:
bounded
(
0
,
100000
),
"MajorPageFaults"
:
bounded
(
0
,
100000
),
}),
}),
...
@@ -210,20 +224,22 @@ var _ = framework.KubeDescribe("Summary API", func() {
...
@@ -210,20 +224,22 @@ var _ = framework.KubeDescribe("Summary API", func() {
"Time"
:
recent
(
maxStatsAge
),
"Time"
:
recent
(
maxStatsAge
),
"AvailableBytes"
:
fsCapacityBounds
,
"AvailableBytes"
:
fsCapacityBounds
,
"CapacityBytes"
:
fsCapacityBounds
,
"CapacityBytes"
:
fsCapacityBounds
,
"UsedBytes"
:
bounded
(
kb
,
10
*
gb
),
// we assume we are not running tests on machines < 10tb of disk
"InodesFree"
:
bounded
(
1E4
,
1E8
),
"UsedBytes"
:
bounded
(
kb
,
10
*
tb
),
"Inodes"
:
bounded
(
1E4
,
1E8
),
"InodesFree"
:
bounded
(
1E4
,
1E8
),
"InodesUsed"
:
bounded
(
0
,
1E8
),
"Inodes"
:
bounded
(
1E4
,
1E8
),
"InodesUsed"
:
bounded
(
0
,
1E8
),
}),
}),
"Runtime"
:
ptrMatchAllFields
(
gstruct
.
Fields
{
"Runtime"
:
ptrMatchAllFields
(
gstruct
.
Fields
{
"ImageFs"
:
ptrMatchAllFields
(
gstruct
.
Fields
{
"ImageFs"
:
ptrMatchAllFields
(
gstruct
.
Fields
{
"Time"
:
recent
(
maxStatsAge
),
"Time"
:
recent
(
maxStatsAge
),
"AvailableBytes"
:
fsCapacityBounds
,
"AvailableBytes"
:
fsCapacityBounds
,
"CapacityBytes"
:
fsCapacityBounds
,
"CapacityBytes"
:
fsCapacityBounds
,
"UsedBytes"
:
bounded
(
kb
,
10
*
gb
),
// we assume we are not running tests on machines < 10tb of disk
"InodesFree"
:
bounded
(
1E4
,
1E8
),
"UsedBytes"
:
bounded
(
kb
,
10
*
tb
),
"Inodes"
:
bounded
(
1E4
,
1E8
),
"InodesFree"
:
bounded
(
1E4
,
1E8
),
"InodesUsed"
:
bounded
(
0
,
1E8
),
"Inodes"
:
bounded
(
1E4
,
1E8
),
"InodesUsed"
:
bounded
(
0
,
1E8
),
}),
}),
}),
}),
}),
}),
...
...
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