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

Function TestSystemdFullPath

cgroup2/manager_test.go:177–239  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

175}
176
177func TestSystemdFullPath(t *testing.T) {
178 tests := []struct {
179 inputSlice string
180 inputGroup string
181 expectedOut string
182 }{
183 {
184 inputSlice: "user.slice",
185 inputGroup: "myGroup.slice",
186 expectedOut: "/sys/fs/cgroup/user.slice/myGroup.slice",
187 },
188 {
189 inputSlice: "/",
190 inputGroup: "myGroup.slice",
191 expectedOut: "/sys/fs/cgroup/myGroup.slice",
192 },
193 {
194 inputSlice: "system.slice",
195 inputGroup: "myGroup.slice",
196 expectedOut: "/sys/fs/cgroup/system.slice/myGroup.slice",
197 },
198 {
199 inputSlice: "user.slice",
200 inputGroup: "my-group.slice",
201 expectedOut: "/sys/fs/cgroup/user.slice/my.slice/my-group.slice",
202 },
203 {
204 inputSlice: "user.slice",
205 inputGroup: "my-group-more-dashes.slice",
206 expectedOut: "/sys/fs/cgroup/user.slice/my.slice/my-group.slice/my-group-more.slice/my-group-more-dashes.slice",
207 },
208 {
209 inputSlice: "user.slice",
210 inputGroup: "my-group-dashes.slice",
211 expectedOut: "/sys/fs/cgroup/user.slice/my.slice/my-group.slice/my-group-dashes.slice",
212 },
213 {
214 inputSlice: "user.slice",
215 inputGroup: "myGroup.scope",
216 expectedOut: "/sys/fs/cgroup/user.slice/myGroup.scope",
217 },
218 {
219 inputSlice: "user.slice",
220 inputGroup: "my-group-dashes.scope",
221 expectedOut: "/sys/fs/cgroup/user.slice/my-group-dashes.scope",
222 },
223 {
224 inputSlice: "test-waldo.slice",
225 inputGroup: "my-group.slice",
226 expectedOut: "/sys/fs/cgroup/test.slice/test-waldo.slice/my.slice/my-group.slice",
227 },
228 {
229 inputSlice: "test-waldo.slice",
230 inputGroup: "my.service",
231 expectedOut: "/sys/fs/cgroup/test.slice/test-waldo.slice/my.service",
232 },
233 }
234

Callers

nothing calls this directly

Calls 1

getSystemdFullPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…