kubelet summary api test updates

This commit is contained in:
Derek Carr 2017-11-17 22:30:49 -05:00
parent 3ec7487c0f
commit db89b46ce7

View File

@ -75,7 +75,11 @@ var _ = framework.KubeDescribe("Summary API", func() {
maxStartAge = time.Hour * 24 * 365 // 1 year
maxStatsAge = time.Minute
)
fsCapacityBounds := bounded(100*framework.Mb, 100*framework.Gb)
// fetch node so we can know proper node memory bounds for unconstrained cgroups
node := getLocalNode(f)
memoryCapacity := node.Status.Capacity["memory"]
memoryLimit := memoryCapacity.Value()
fsCapacityBounds := bounded(100*framework.Mb, 10*framework.Tb)
// Expectations for system containers.
sysContExpectations := func() types.GomegaMatcher {
return gstruct.MatchAllFields(gstruct.Fields{
@ -90,10 +94,10 @@ var _ = framework.KubeDescribe("Summary API", func() {
"Time": recent(maxStatsAge),
// We don't limit system container memory.
"AvailableBytes": BeNil(),
"UsageBytes": bounded(1*framework.Mb, 10*framework.Gb),
"WorkingSetBytes": bounded(1*framework.Mb, 10*framework.Gb),
"UsageBytes": bounded(1*framework.Mb, memoryLimit),
"WorkingSetBytes": bounded(1*framework.Mb, memoryLimit),
// this now returns /sys/fs/cgroup/memory.stat total_rss
"RSSBytes": bounded(1*framework.Mb, 1*framework.Gb),
"RSSBytes": bounded(1*framework.Mb, memoryLimit),
"PageFaults": bounded(1000, 1E9),
"MajorPageFaults": bounded(0, 100000),
}),
@ -116,9 +120,9 @@ var _ = framework.KubeDescribe("Summary API", func() {
"Time": recent(maxStatsAge),
// We don't limit system container memory.
"AvailableBytes": BeNil(),
"UsageBytes": bounded(100*framework.Kb, 10*framework.Gb),
"WorkingSetBytes": bounded(100*framework.Kb, 10*framework.Gb),
"RSSBytes": bounded(100*framework.Kb, 1*framework.Gb),
"UsageBytes": bounded(100*framework.Kb, memoryLimit),
"WorkingSetBytes": bounded(100*framework.Kb, memoryLimit),
"RSSBytes": bounded(100*framework.Kb, memoryLimit),
"PageFaults": bounded(1000, 1E9),
"MajorPageFaults": bounded(0, 100000),
})
@ -203,11 +207,11 @@ var _ = framework.KubeDescribe("Summary API", func() {
}),
"Memory": ptrMatchAllFields(gstruct.Fields{
"Time": recent(maxStatsAge),
"AvailableBytes": bounded(100*framework.Mb, 100*framework.Gb),
"UsageBytes": bounded(10*framework.Mb, 10*framework.Gb),
"WorkingSetBytes": bounded(10*framework.Mb, 10*framework.Gb),
"AvailableBytes": bounded(100*framework.Mb, memoryLimit),
"UsageBytes": bounded(10*framework.Mb, memoryLimit),
"WorkingSetBytes": bounded(10*framework.Mb, memoryLimit),
// this now returns /sys/fs/cgroup/memory.stat total_rss
"RSSBytes": bounded(1*framework.Kb, 1*framework.Gb),
"RSSBytes": bounded(1*framework.Kb, memoryLimit),
"PageFaults": bounded(1000, 1E9),
"MajorPageFaults": bounded(0, 100000),
}),