diff --git a/integration/commands_test.go b/integration/commands_test.go index 5b967b68c..7164cc5af 100644 --- a/integration/commands_test.go +++ b/integration/commands_test.go @@ -1163,3 +1163,27 @@ func TestCmdKill(t *testing.T) { closeWrap(stdin, stdinPipe, stdout, stdoutPipe) } + +func TestRunTTYCommitRun(t *testing.T) { + cli := api.NewDockerCli(nil, ioutil.Discard, ioutil.Discard, testDaemonProto, testDaemonAddr, nil) + + defer cleanup(globalEngine, t) + + ch := make(chan struct{}) + go func() { + defer close(ch) + cli.CmdRun("-t", unitTestImageID, "/bin/ls") + }() + + container := waitContainerStart(t, 10*time.Second) + time.Sleep(500 * time.Millisecond) + setTimeout(t, "Waiting for container timedout", 5*time.Second, func() { + <-ch + }) + + cli.CmdCommit(container.ID, "ttytest") + + if err := cli.CmdRun("ttytest", "/bin/ls"); err != nil { + t.Fatal(err) + } +}