This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / spindle / engines / microvm / cgroup_resources_test.go
487 B 20 lines
1//go:build linux 2 3package microvm 4 5import "testing" 6 7func TestCgroupResourcesCPUQuota(t *testing.T) { 8 r := cgroupResources(CgroupLimits{CPUQuotaPercent: 200}) 9 if r.CPU == nil { 10 t.Fatal("cpu quota should produce a cpu controller config") 11 } 12 if got := string(r.CPU.Max); got != "200000 100000" { 13 t.Errorf("cpu.max = %q, want %q", got, "200000 100000") 14 } 15 16 r = cgroupResources(CgroupLimits{}) 17 if r.CPU != nil { 18 t.Errorf("no quota should leave cpu unlimited, got %v", r.CPU) 19 } 20}