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

Function SkipIfDaemonNotLinux

internal/test/environment/testenv.go:84–90  ·  view source on GitHub ↗

SkipIfDaemonNotLinux skips the test unless the running docker daemon is on Linux

(t *testing.T)

Source from the content-addressed store, hash-verified

82
83// SkipIfDaemonNotLinux skips the test unless the running docker daemon is on Linux
84func SkipIfDaemonNotLinux(t *testing.T) {
85 t.Helper()
86 result := icmd.RunCmd(icmd.Command("docker", "info", "--format", "{{.OSType}}"))
87 result.Assert(t, icmd.Expected{Err: icmd.None})
88 isLinux := strings.TrimSpace(result.Stdout()) == "linux"
89 skip.If(t, !isLinux, "running against a Linux daemon")
90}
91
92// SkipIfCgroupNamespacesNotSupported skips the test if the running docker daemon doesn't support cgroup namespaces
93func SkipIfCgroupNamespacesNotSupported(t *testing.T) {

Callers

nothing calls this directly

Calls 1

CommandMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…