Signed-off-by: Zachary Jaffee <zij@case.edu>
| ... | ... |
@@ -8,6 +8,7 @@ import ( |
| 8 | 8 |
"strings" |
| 9 | 9 |
"time" |
| 10 | 10 |
|
| 11 |
+ "github.com/docker/docker/pkg/integration/checker" |
|
| 11 | 12 |
"github.com/go-check/check" |
| 12 | 13 |
) |
| 13 | 14 |
|
| ... | ... |
@@ -15,7 +16,7 @@ func (s *DockerSuite) TestLogsApiWithStdout(c *check.C) {
|
| 15 | 15 |
testRequires(c, DaemonIsLinux) |
| 16 | 16 |
out, _ := dockerCmd(c, "run", "-d", "-t", "busybox", "/bin/sh", "-c", "while true; do echo hello; sleep 1; done") |
| 17 | 17 |
id := strings.TrimSpace(out) |
| 18 |
- c.Assert(waitRun(id), check.IsNil) |
|
| 18 |
+ c.Assert(waitRun(id), checker.IsNil) |
|
| 19 | 19 |
|
| 20 | 20 |
type logOut struct {
|
| 21 | 21 |
out string |
| ... | ... |
@@ -41,8 +42,8 @@ func (s *DockerSuite) TestLogsApiWithStdout(c *check.C) {
|
| 41 | 41 |
|
| 42 | 42 |
select {
|
| 43 | 43 |
case l := <-chLog: |
| 44 |
- c.Assert(l.err, check.IsNil) |
|
| 45 |
- c.Assert(l.res.StatusCode, check.Equals, http.StatusOK) |
|
| 44 |
+ c.Assert(l.err, checker.IsNil) |
|
| 45 |
+ c.Assert(l.res.StatusCode, checker.Equals, http.StatusOK) |
|
| 46 | 46 |
if !strings.HasSuffix(l.out, "hello") {
|
| 47 | 47 |
c.Fatalf("expected log output to container 'hello', but it does not")
|
| 48 | 48 |
} |
| ... | ... |
@@ -57,8 +58,8 @@ func (s *DockerSuite) TestLogsApiNoStdoutNorStderr(c *check.C) {
|
| 57 | 57 |
dockerCmd(c, "run", "-d", "-t", "--name", name, "busybox", "/bin/sh") |
| 58 | 58 |
|
| 59 | 59 |
status, body, err := sockRequest("GET", fmt.Sprintf("/containers/%s/logs", name), nil)
|
| 60 |
- c.Assert(status, check.Equals, http.StatusBadRequest) |
|
| 61 |
- c.Assert(err, check.IsNil) |
|
| 60 |
+ c.Assert(status, checker.Equals, http.StatusBadRequest) |
|
| 61 |
+ c.Assert(err, checker.IsNil) |
|
| 62 | 62 |
|
| 63 | 63 |
expected := "Bad parameters: you must choose at least one stream" |
| 64 | 64 |
if !bytes.Contains(body, []byte(expected)) {
|
| ... | ... |
@@ -75,7 +76,7 @@ func (s *DockerSuite) TestLogsApiFollowEmptyOutput(c *check.C) {
|
| 75 | 75 |
|
| 76 | 76 |
_, body, err := sockRequestRaw("GET", fmt.Sprintf("/containers/%s/logs?follow=1&stdout=1&stderr=1&tail=all", name), bytes.NewBuffer(nil), "")
|
| 77 | 77 |
t1 := time.Now() |
| 78 |
- c.Assert(err, check.IsNil) |
|
| 78 |
+ c.Assert(err, checker.IsNil) |
|
| 79 | 79 |
body.Close() |
| 80 | 80 |
elapsed := t1.Sub(t0).Seconds() |
| 81 | 81 |
if elapsed > 5.0 {
|
| ... | ... |
@@ -86,6 +87,6 @@ func (s *DockerSuite) TestLogsApiFollowEmptyOutput(c *check.C) {
|
| 86 | 86 |
func (s *DockerSuite) TestLogsAPIContainerNotFound(c *check.C) {
|
| 87 | 87 |
name := "nonExistentContainer" |
| 88 | 88 |
resp, _, err := sockRequestRaw("GET", fmt.Sprintf("/containers/%s/logs?follow=1&stdout=1&stderr=1&tail=all", name), bytes.NewBuffer(nil), "")
|
| 89 |
- c.Assert(err, check.IsNil) |
|
| 90 |
- c.Assert(resp.StatusCode, check.Equals, http.StatusNotFound) |
|
| 89 |
+ c.Assert(err, checker.IsNil) |
|
| 90 |
+ c.Assert(resp.StatusCode, checker.Equals, http.StatusNotFound) |
|
| 91 | 91 |
} |