MCPcopy Index your code
hub / github.com/docker/cli / SkipIfCgroupNamespacesNotSupported

Function SkipIfCgroupNamespacesNotSupported

internal/test/environment/testenv.go:93–100  ·  view source on GitHub ↗

SkipIfCgroupNamespacesNotSupported skips the test if the running docker daemon doesn't support cgroup namespaces

(t *testing.T)

Source from the content-addressed store, hash-verified

91
92// SkipIfCgroupNamespacesNotSupported skips the test if the running docker daemon doesn't support cgroup namespaces
93func SkipIfCgroupNamespacesNotSupported(t *testing.T) {
94 t.Helper()
95 result := icmd.RunCmd(icmd.Command("docker", "info", "--format", "{{.SecurityOptions}}"))
96 result.Assert(t, icmd.Expected{Err: icmd.None})
97 cgroupNsFound := strings.Contains(result.Stdout(), "name=cgroupns")
98
99 skip.If(t, !cgroupNsFound, fmt.Sprintf("running against a daemon that doesn't support cgroup namespaces (security options: %s)", result.Stdout()))
100}
101
102// SkipIfNotPlatform skips the test if the running docker daemon is not running on a specific platform.
103// platform should be in format os/arch (for example linux/arm64).

Callers

nothing calls this directly

Calls 2

ContainsMethod · 0.80
CommandMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…