From eab6c90e20b2bb5608e1962a9c244e07d4bb451a Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 29 Nov 2013 07:42:26 -0800 Subject: [PATCH] Make the PTY in raw mode before assert test (TestAttachDetach) Upstream-commit: 67e9e0e11bb932ef9113ac91b2c1b0af6ee4db6d Component: engine --- components/engine/integration/commands_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/engine/integration/commands_test.go b/components/engine/integration/commands_test.go index 8bc1c99ec7..f2b14482b2 100644 --- a/components/engine/integration/commands_test.go +++ b/components/engine/integration/commands_test.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/dotcloud/docker" "github.com/dotcloud/docker/engine" + "github.com/dotcloud/docker/term" "github.com/dotcloud/docker/utils" "io" "io/ioutil" @@ -507,6 +508,17 @@ func TestAttachDetach(t *testing.T) { <-ch }) + pty, err := container.GetPtyMaster() + if err != nil { + t.Fatal(err) + } + + state, err := term.MakeRaw(pty.Fd()) + if err != nil { + t.Fatal(err) + } + defer term.RestoreTerminal(pty.Fd(), state) + stdin, stdinPipe = io.Pipe() stdout, stdoutPipe = io.Pipe() cli = docker.NewDockerCli(stdin, stdoutPipe, ioutil.Discard, testDaemonProto, testDaemonAddr)