MCPcopy Create free account
hub / github.com/containerd/cgroups / TestSystemdCgroupCpuController

Function TestSystemdCgroupCpuController

cgroup2/cpuv2_test.go:59–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestSystemdCgroupCpuController(t *testing.T) {
60 checkCgroupMode(t)
61 group := fmt.Sprintf("testing-cpu-%d.scope", os.Getpid())
62 var weight uint64 = 100
63 c, err := NewSystemd("", group, os.Getpid(), &Resources{CPU: &CPU{Weight: &weight}})
64 require.NoError(t, err, "failed to init new cgroup systemd manager")
65
66 checkFileContent(t, c.path, "cpu.weight", strconv.FormatUint(weight, 10))
67}
68
69func TestSystemdCgroupCpuController_NilWeight(t *testing.T) {
70 checkCgroupMode(t)

Callers

nothing calls this directly

Calls 3

checkCgroupModeFunction · 0.85
checkFileContentFunction · 0.85
NewSystemdFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…