(t *testing.T)
| 17 | ) |
| 18 | |
| 19 | func 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 | |
| 30 | func withStdinNewline(cmd *icmd.Cmd) { |
| 31 | cmd.Stdin = strings.NewReader("\n") |
nothing calls this directly
no test coverage detected
searching dependent graphs…