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

Function SkipIfNotPlatform

internal/test/environment/testenv.go:104–110  ·  view source on GitHub ↗

SkipIfNotPlatform skips the test if the running docker daemon is not running on a specific platform. platform should be in format os/arch (for example linux/arm64).

(t *testing.T, platform string)

Source from the content-addressed store, hash-verified

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).
104func SkipIfNotPlatform(t *testing.T, platform string) {
105 t.Helper()
106 result := icmd.RunCmd(icmd.Command("docker", "version", "--format", "{{.Server.Os}}/{{.Server.Arch}}"))
107 result.Assert(t, icmd.Expected{Err: icmd.None})
108 daemonPlatform := strings.TrimSpace(result.Stdout())
109 skip.If(t, daemonPlatform != platform, "running against a non %s daemon", platform)
110}
111
112// DaemonAPIVersion returns the negotiated daemon API version.
113func DaemonAPIVersion(t *testing.T) string {

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…