1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Make the PTY in raw mode before assert test (TestAttachDetach)

This commit is contained in:
Guillaume J. Charmes 2013-11-29 07:42:26 -08:00
parent fbebe20bc6
commit 67e9e0e11b
No known key found for this signature in database
GPG key ID: B33E4642CB6E3FF3

View file

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"github.com/dotcloud/docker" "github.com/dotcloud/docker"
"github.com/dotcloud/docker/engine" "github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/term"
"github.com/dotcloud/docker/utils" "github.com/dotcloud/docker/utils"
"io" "io"
"io/ioutil" "io/ioutil"
@ -507,6 +508,17 @@ func TestAttachDetach(t *testing.T) {
<-ch <-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() stdin, stdinPipe = io.Pipe()
stdout, stdoutPipe = io.Pipe() stdout, stdoutPipe = io.Pipe()
cli = docker.NewDockerCli(stdin, stdoutPipe, ioutil.Discard, testDaemonProto, testDaemonAddr) cli = docker.NewDockerCli(stdin, stdoutPipe, ioutil.Discard, testDaemonProto, testDaemonAddr)