Browse code

Merge pull request #18199 from aditirajagopal/16756-docker_cli_pull_local_test

Checkers on docker_cli_pull_local_test.go

Antonio Murdaca authored on 2015/11/28 01:04:28
Showing 1 changed files
... ...
@@ -5,6 +5,7 @@ import (
5 5
 	"os/exec"
6 6
 	"strings"
7 7
 
8
+	"github.com/docker/docker/pkg/integration/checker"
8 9
 	"github.com/go-check/check"
9 10
 )
10 11
 
... ...
@@ -35,7 +36,7 @@ func (s *DockerRegistrySuite) TestPullImageWithAliases(c *check.C) {
35 35
 	dockerCmd(c, "inspect", repos[0])
36 36
 	for _, repo := range repos[1:] {
37 37
 		_, _, err := dockerCmdWithError("inspect", repo)
38
-		c.Assert(err, check.NotNil, check.Commentf("Image %v shouldn't have been pulled down", repo))
38
+		c.Assert(err, checker.NotNil, check.Commentf("Image %v shouldn't have been pulled down", repo))
39 39
 	}
40 40
 }
41 41
 
... ...
@@ -53,7 +54,7 @@ func (s *DockerRegistrySuite) TestConcurrentPullWholeRepo(c *check.C) {
53 53
 		    ENV BAR bar
54 54
 		    CMD echo %s
55 55
 		`, repo), true)
56
-		c.Assert(err, check.IsNil)
56
+		c.Assert(err, checker.IsNil)
57 57
 		dockerCmd(c, "push", repo)
58 58
 		repos = append(repos, repo)
59 59
 	}
... ...
@@ -77,14 +78,14 @@ func (s *DockerRegistrySuite) TestConcurrentPullWholeRepo(c *check.C) {
77 77
 	// package is not goroutine-safe.
78 78
 	for i := 0; i != numPulls; i++ {
79 79
 		err := <-results
80
-		c.Assert(err, check.IsNil, check.Commentf("concurrent pull failed with error: %v", err))
80
+		c.Assert(err, checker.IsNil, check.Commentf("concurrent pull failed with error: %v", err))
81 81
 	}
82 82
 
83 83
 	// Ensure all tags were pulled successfully
84 84
 	for _, repo := range repos {
85 85
 		dockerCmd(c, "inspect", repo)
86 86
 		out, _ := dockerCmd(c, "run", "--rm", repo)
87
-		c.Assert(strings.TrimSpace(out), check.Equals, "/bin/sh -c echo "+repo, check.Commentf("CMD did not contain /bin/sh -c echo %s: %s", repo, out))
87
+		c.Assert(strings.TrimSpace(out), checker.Equals, "/bin/sh -c echo "+repo, check.Commentf("CMD did not contain /bin/sh -c echo %s: %s", repo, out))
88 88
 	}
89 89
 }
90 90
 
... ...
@@ -107,7 +108,7 @@ func (s *DockerRegistrySuite) TestConcurrentFailingPull(c *check.C) {
107 107
 	// package is not goroutine-safe.
108 108
 	for i := 0; i != numPulls; i++ {
109 109
 		err := <-results
110
-		c.Assert(err, check.NotNil, check.Commentf("expected pull to fail"))
110
+		c.Assert(err, checker.NotNil, check.Commentf("expected pull to fail"))
111 111
 	}
112 112
 }
113 113
 
... ...
@@ -126,7 +127,7 @@ func (s *DockerRegistrySuite) TestConcurrentPullMultipleTags(c *check.C) {
126 126
 		    ENV BAR bar
127 127
 		    CMD echo %s
128 128
 		`, repo), true)
129
-		c.Assert(err, check.IsNil)
129
+		c.Assert(err, checker.IsNil)
130 130
 		dockerCmd(c, "push", repo)
131 131
 		repos = append(repos, repo)
132 132
 	}
... ...
@@ -149,14 +150,14 @@ func (s *DockerRegistrySuite) TestConcurrentPullMultipleTags(c *check.C) {
149 149
 	// package is not goroutine-safe.
150 150
 	for range repos {
151 151
 		err := <-results
152
-		c.Assert(err, check.IsNil, check.Commentf("concurrent pull failed with error: %v", err))
152
+		c.Assert(err, checker.IsNil, check.Commentf("concurrent pull failed with error: %v", err))
153 153
 	}
154 154
 
155 155
 	// Ensure all tags were pulled successfully
156 156
 	for _, repo := range repos {
157 157
 		dockerCmd(c, "inspect", repo)
158 158
 		out, _ := dockerCmd(c, "run", "--rm", repo)
159
-		c.Assert(strings.TrimSpace(out), check.Equals, "/bin/sh -c echo "+repo, check.Commentf("CMD did not contain /bin/sh -c echo %s; %s", repo, out))
159
+		c.Assert(strings.TrimSpace(out), checker.Equals, "/bin/sh -c echo "+repo, check.Commentf("CMD did not contain /bin/sh -c echo %s; %s", repo, out))
160 160
 	}
161 161
 }
162 162