Created
December 24, 2015 13:58
-
-
Save duglin/723c76414ae11cab50ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *DockerDaemonSuite) TestDaemonNoColors(c *check.C) { | |
testRequires(c, SameHostDaemon, DaemonIsLinux) | |
pty, tty, err := pty.Open() | |
c.Assert(err, check.IsNil) | |
cmd := exec.Command(dockerBinary, "daemon", "--no-color") | |
cmd.Stdin = tty | |
cmd.Stdout = tty | |
cmd.Stderr = tty | |
c.Assert(cmd.Start(), check.IsNil) | |
defer cmd.Process.Kill() | |
time.Sleep( 5*time.Second ) | |
buf := make([]byte, 1024) | |
_, err = pty.Read(buf) | |
c.Assert(err, check.IsNil) //could not read tty output | |
c.Assert(string(buf), checker.Contains, "INFO[0000]", check.Commentf("Missing non-color output", buf)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment