mirror of https://github.com/k3s-io/k3s
Fix faulty assumptions in summary API testing
parent
223c721d6e
commit
5c8b957779
|
@ -108,12 +108,16 @@ func (e *E2EServices) startKubelet() (*server, error) {
|
|||
// sense to test it that way
|
||||
isSystemd = true
|
||||
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)
|
||||
restartCommand = exec.Command("systemctl", "restart", unitName)
|
||||
e.logFiles["kubelet.log"] = logFileData{
|
||||
journalctlCommand: []string{"-u", unitName},
|
||||
}
|
||||
cmdArgs = append(cmdArgs,
|
||||
"--kubelet-cgroups=/kubelet.slice",
|
||||
"--cgroup-root=/",
|
||||
)
|
||||
} else {
|
||||
cmdArgs = append(cmdArgs, builder.GetKubeletServerBin())
|
||||
cmdArgs = append(cmdArgs,
|
||||
|
|
|
@ -84,7 +84,14 @@ var _ = framework.KubeDescribe("Summary API", func() {
|
|||
"AvailableBytes": BeNil(),
|
||||
"UsageBytes": 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),
|
||||
"MajorPageFaults": bounded(0, 100000),
|
||||
}),
|
||||
|
@ -131,7 +138,7 @@ var _ = framework.KubeDescribe("Summary API", func() {
|
|||
"Time": recent(maxStatsAge),
|
||||
"AvailableBytes": bounded(1*mb, 10*mb),
|
||||
"UsageBytes": bounded(10*kb, 5*mb),
|
||||
"WorkingSetBytes": bounded(10*kb, mb),
|
||||
"WorkingSetBytes": bounded(10*kb, 2*mb),
|
||||
"RSSBytes": bounded(1*kb, mb),
|
||||
"PageFaults": bounded(100, 100000),
|
||||
"MajorPageFaults": bounded(0, 10),
|
||||
|
@ -194,7 +201,14 @@ var _ = framework.KubeDescribe("Summary API", func() {
|
|||
"AvailableBytes": bounded(100*mb, 100*gb),
|
||||
"UsageBytes": 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),
|
||||
"MajorPageFaults": bounded(0, 100000),
|
||||
}),
|
||||
|
@ -210,20 +224,22 @@ var _ = framework.KubeDescribe("Summary API", func() {
|
|||
"Time": recent(maxStatsAge),
|
||||
"AvailableBytes": fsCapacityBounds,
|
||||
"CapacityBytes": fsCapacityBounds,
|
||||
"UsedBytes": bounded(kb, 10*gb),
|
||||
"InodesFree": bounded(1E4, 1E8),
|
||||
"Inodes": bounded(1E4, 1E8),
|
||||
"InodesUsed": bounded(0, 1E8),
|
||||
// we assume we are not running tests on machines < 10tb of disk
|
||||
"UsedBytes": bounded(kb, 10*tb),
|
||||
"InodesFree": bounded(1E4, 1E8),
|
||||
"Inodes": bounded(1E4, 1E8),
|
||||
"InodesUsed": bounded(0, 1E8),
|
||||
}),
|
||||
"Runtime": ptrMatchAllFields(gstruct.Fields{
|
||||
"ImageFs": ptrMatchAllFields(gstruct.Fields{
|
||||
"Time": recent(maxStatsAge),
|
||||
"AvailableBytes": fsCapacityBounds,
|
||||
"CapacityBytes": fsCapacityBounds,
|
||||
"UsedBytes": bounded(kb, 10*gb),
|
||||
"InodesFree": bounded(1E4, 1E8),
|
||||
"Inodes": bounded(1E4, 1E8),
|
||||
"InodesUsed": bounded(0, 1E8),
|
||||
// we assume we are not running tests on machines < 10tb of disk
|
||||
"UsedBytes": bounded(kb, 10*tb),
|
||||
"InodesFree": bounded(1E4, 1E8),
|
||||
"Inodes": bounded(1E4, 1E8),
|
||||
"InodesUsed": bounded(0, 1E8),
|
||||
}),
|
||||
}),
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue