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

Function TestAttachExitCode

e2e/container/attach_test.go:19–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17)
18
19func TestAttachExitCode(t *testing.T) {
20 const exitCode = 21
21 result := icmd.RunCommand("docker", "run", "-d", "-i", "--rm", fixtures.AlpineImage, "sh", "-c", fmt.Sprintf("read; exit %d", exitCode))
22 result.Assert(t, icmd.Success)
23
24 containerID := strings.TrimSpace(result.Stdout())
25
26 result = icmd.RunCmd(icmd.Command("docker", "attach", containerID), withStdinNewline)
27 result.Assert(t, icmd.Expected{ExitCode: exitCode})
28}
29
30func withStdinNewline(cmd *icmd.Cmd) {
31 cmd.Stdin = strings.NewReader("\n")

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…