From 366f084eb0864db6dcf5cc47e434b3c6f43500d7 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 27 Mar 2014 19:11:23 +0000 Subject: [PATCH] add test Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- integration/commands_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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) + } +}