Browse code

rm-gocheck: Not(Contains) -> !strings.Contains

sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Not\(checker\.Contains\), (.*)\)$#assert.Assert(c, !eg_contains(\1, \2))#g' \
-- "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go" \
&& \
go get -d golang.org/x/tools/cmd/eg && dir=$(go env GOPATH)/src/golang.org/x/tools && git -C "$dir" fetch https://github.com/tiborvass/tools handle-variadic && git -C "$dir" checkout 61a94b82347c29b3289e83190aa3dda74d47abbb && go install golang.org/x/tools/cmd/eg \
&& \
/bin/echo -e 'package main\nvar eg_contains func(arg1, arg2 string, extra ...interface{}) bool' > ./integration-cli/eg_helper.go \
&& \
goimports -w ./integration-cli \
&& \
eg -w -t template.not_contains.go -- ./integration-cli \
&& \
rm -f ./integration-cli/eg_helper.go \
&& \
go run rm-gocheck.go redress '\bassert\.Assert\b.*(\(|,)\s*$' \
"integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go"

Signed-off-by: Tibor Vass <tibor@docker.com>

Tibor Vass authored on 2019/09/10 06:07:46
Showing 18 changed files
... ...
@@ -4657,7 +4657,7 @@ func (s *DockerSuite) TestBuildMultiStageArg(c *testing.T) {
4657 4657
 	assert.Assert(c, result.Stdout(), checker.Contains, "foo=abc")
4658 4658
 
4659 4659
 	result = cli.DockerCmd(c, "run", "--rm", imgName, "cat", "/out")
4660
-	assert.Assert(c, result.Stdout(), checker.Not(checker.Contains), "foo")
4660
+	assert.Assert(c, !strings.Contains(result.Stdout(), "foo"))
4661 4661
 	assert.Assert(c, result.Stdout(), checker.Contains, "bar=def")
4662 4662
 }
4663 4663
 
... ...
@@ -4680,8 +4680,7 @@ func (s *DockerSuite) TestBuildMultiStageGlobalArg(c *testing.T) {
4680 4680
 	parentID := strings.TrimSpace(result.Stdout())
4681 4681
 
4682 4682
 	result = cli.DockerCmd(c, "run", "--rm", parentID, "cat", "/out")
4683
-	assert.Assert(c, result.Stdout(), checker.Not(checker.Contains), "tag")
4684
-
4683
+	assert.Assert(c, !strings.Contains(result.Stdout(), "tag"))
4685 4684
 	result = cli.DockerCmd(c, "run", "--rm", imgName, "cat", "/out")
4686 4685
 	assert.Assert(c, result.Stdout(), checker.Contains, "tag=latest")
4687 4686
 }
... ...
@@ -4702,8 +4701,8 @@ func (s *DockerSuite) TestBuildMultiStageUnusedArg(c *testing.T) {
4702 4702
 	assert.Assert(c, result.Combined(), checker.Contains, "[baz] were not consumed")
4703 4703
 
4704 4704
 	result = cli.DockerCmd(c, "run", "--rm", imgName, "cat", "/out")
4705
-	assert.Assert(c, result.Stdout(), checker.Not(checker.Contains), "bar")
4706
-	assert.Assert(c, result.Stdout(), checker.Not(checker.Contains), "baz")
4705
+	assert.Assert(c, !strings.Contains(result.Stdout(), "bar"))
4706
+	assert.Assert(c, !strings.Contains(result.Stdout(), "baz"))
4707 4707
 }
4708 4708
 
4709 4709
 func (s *DockerSuite) TestBuildNoNamedVolume(c *testing.T) {
... ...
@@ -4816,8 +4815,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToFile(c *testing.T) {
4816 4816
 	assert.NilError(c, err)
4817 4817
 
4818 4818
 	result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
4819
-	assert.Assert(c, result.Combined(), checker.Not(checker.Contains), "Using cache")
4820
-
4819
+	assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
4821 4820
 	out = cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
4822 4821
 	assert.Assert(c, cmp.Regexp("^"+
4823 4822
 
... ...
@@ -4858,8 +4856,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
4858 4858
 	assert.NilError(c, err)
4859 4859
 
4860 4860
 	result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
4861
-	assert.Assert(c, result.Combined(), checker.Not(checker.Contains), "Using cache")
4862
-
4861
+	assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
4863 4862
 	out = cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
4864 4863
 	assert.Assert(c, cmp.Regexp("^"+
4865 4864
 
... ...
@@ -4919,7 +4916,7 @@ func (s *DockerSuite) TestBuildCacheRootSource(c *testing.T) {
4919 4919
 
4920 4920
 	result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
4921 4921
 
4922
-	assert.Assert(c, result.Combined(), checker.Not(checker.Contains), "Using cache")
4922
+	assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
4923 4923
 }
4924 4924
 
4925 4925
 // #19375
... ...
@@ -5073,8 +5070,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestBuildWithExternalAuth(c *testing.T
5073 5073
 
5074 5074
 	b, err := ioutil.ReadFile(configPath)
5075 5075
 	assert.NilError(c, err)
5076
-	assert.Assert(c, string(b), checker.Not(checker.Contains), "\"auth\":")
5077
-
5076
+	assert.Assert(c, !strings.Contains(string(b), "\"auth\":"))
5078 5077
 	dockerCmd(c, "--config", tmp, "tag", "busybox", repoName)
5079 5078
 	dockerCmd(c, "--config", tmp, "push", repoName)
5080 5079
 
... ...
@@ -5432,8 +5428,8 @@ func (s *DockerSuite) TestBuildWithFailure(c *testing.T) {
5432 5432
 	dockerfile = "FFOM nobody\nRUN nobody"
5433 5433
 	result = buildImage(name, build.WithDockerfile(dockerfile))
5434 5434
 	assert.Assert(c, result.Error != nil)
5435
-	assert.Assert(c, result.Stdout(), checker.Not(checker.Contains), "Step 1/2 : FROM busybox")
5436
-	assert.Assert(c, result.Stdout(), checker.Not(checker.Contains), "Step 2/2 : RUN nobody")
5435
+	assert.Assert(c, !strings.Contains(result.Stdout(), "Step 1/2 : FROM busybox"))
5436
+	assert.Assert(c, !strings.Contains(result.Stdout(), "Step 2/2 : RUN nobody"))
5437 5437
 }
5438 5438
 
5439 5439
 func (s *DockerSuite) TestBuildCacheFromEqualDiffIDsLength(c *testing.T) {
... ...
@@ -235,7 +235,7 @@ func (s *DockerRegistrySuite) TestListImagesWithoutDigests(c *testing.T) {
235 235
 	dockerCmd(c, "pull", imageReference)
236 236
 
237 237
 	out, _ := dockerCmd(c, "images")
238
-	assert.Assert(c, out, checker.Not(checker.Contains), "DIGEST", check.Commentf("list output should not have contained DIGEST header"))
238
+	assert.Assert(c, !strings.Contains(out, "DIGEST"), check.Commentf("list output should not have contained DIGEST header"))
239 239
 }
240 240
 
241 241
 func (s *DockerRegistrySuite) TestListImagesWithDigests(c *testing.T) {
... ...
@@ -322,7 +322,7 @@ func (s *DockerSuite) TestCreateWithInvalidLogOpts(c *testing.T) {
322 322
 	assert.Assert(c, is.Contains(out, "unknown log opt"))
323 323
 
324 324
 	out, _ = dockerCmd(c, "ps", "-a")
325
-	assert.Assert(c, out, checker.Not(checker.Contains), name)
325
+	assert.Assert(c, !strings.Contains(out, name))
326 326
 }
327 327
 
328 328
 // #20972
... ...
@@ -2113,12 +2113,11 @@ func (s *DockerDaemonSuite) TestRunLinksChanged(c *testing.T) {
2113 2113
 	assert.NilError(c, err, out)
2114 2114
 	out, err = s.d.Cmd("start", "-a", "test2")
2115 2115
 	assert.ErrorContains(c, err, "", out)
2116
-	assert.Assert(c, out, checker.Not(checker.Contains), "1 packets transmitted, 1 packets received")
2117
-
2116
+	assert.Assert(c, !strings.Contains(out, "1 packets transmitted, 1 packets received"))
2118 2117
 	s.d.Restart(c)
2119 2118
 	out, err = s.d.Cmd("start", "-a", "test2")
2120 2119
 	assert.ErrorContains(c, err, "", out)
2121
-	assert.Assert(c, out, checker.Not(checker.Contains), "1 packets transmitted, 1 packets received")
2120
+	assert.Assert(c, !strings.Contains(out, "1 packets transmitted, 1 packets received"))
2122 2121
 }
2123 2122
 
2124 2123
 func (s *DockerDaemonSuite) TestDaemonStartWithoutColors(c *testing.T) {
... ...
@@ -2168,7 +2167,7 @@ func (s *DockerDaemonSuite) TestDaemonStartWithoutColors(c *testing.T) {
2168 2168
 	// Wait for io.Copy() before checking output
2169 2169
 	<-done
2170 2170
 	assert.Assert(c, b.String() != "")
2171
-	assert.Assert(c, b.String(), checker.Not(checker.Contains), infoLog)
2171
+	assert.Assert(c, !strings.Contains(b.String(), infoLog))
2172 2172
 }
2173 2173
 
2174 2174
 func (s *DockerDaemonSuite) TestDaemonDebugLog(c *testing.T) {
... ...
@@ -2587,7 +2586,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithAutoRemoveContainer(c *testing.
2587 2587
 	out, err = s.d.Cmd("ps", "-a")
2588 2588
 	assert.NilError(c, err, "out: %v", out)
2589 2589
 	assert.Assert(c, out, checker.Contains, "top1", check.Commentf("top1 should exist after daemon restarts"))
2590
-	assert.Assert(c, out, checker.Not(checker.Contains), "top2", check.Commentf("top2 should be removed after daemon restarts"))
2590
+	assert.Assert(c, !strings.Contains(out, "top2"), check.Commentf("top2 should be removed after daemon restarts"))
2591 2591
 }
2592 2592
 
2593 2593
 func (s *DockerDaemonSuite) TestDaemonRestartSaveContainerExitCode(c *testing.T) {
... ...
@@ -34,9 +34,8 @@ func (s *DockerSuite) TestImagesEnsureImageWithTagIsListed(c *testing.T) {
34 34
 	imagesOut, _ := dockerCmd(c, "images", name+":v1")
35 35
 	assert.Assert(c, imagesOut, checker.Contains, name)
36 36
 	assert.Assert(c, imagesOut, checker.Contains, "v1")
37
-	assert.Assert(c, imagesOut, checker.Not(checker.Contains), "v2")
38
-	assert.Assert(c, imagesOut, checker.Not(checker.Contains), "v1v1")
39
-
37
+	assert.Assert(c, !strings.Contains(imagesOut, "v2"))
38
+	assert.Assert(c, !strings.Contains(imagesOut, "v1v1"))
40 39
 	imagesOut, _ = dockerCmd(c, "images", name)
41 40
 	assert.Assert(c, imagesOut, checker.Contains, name)
42 41
 	assert.Assert(c, imagesOut, checker.Contains, "v1")
... ...
@@ -46,7 +45,7 @@ func (s *DockerSuite) TestImagesEnsureImageWithTagIsListed(c *testing.T) {
46 46
 
47 47
 func (s *DockerSuite) TestImagesEnsureImageWithBadTagIsNotListed(c *testing.T) {
48 48
 	imagesOut, _ := dockerCmd(c, "images", "busybox:nonexistent")
49
-	assert.Assert(c, imagesOut, checker.Not(checker.Contains), "busybox")
49
+	assert.Assert(c, !strings.Contains(imagesOut, "busybox"))
50 50
 }
51 51
 
52 52
 func (s *DockerSuite) TestImagesOrderedByCreationDate(c *testing.T) {
... ...
@@ -256,8 +255,7 @@ func (s *DockerSuite) TestImagesEnsureDanglingImageOnlyListedOnce(c *testing.T)
256 256
 
257 257
 	out, _ = dockerCmd(c, "images", "-q", "-f", "dangling=false")
258 258
 	//dangling=false would not include dangling images
259
-	assert.Assert(c, out, checker.Not(checker.Contains), imageID)
260
-
259
+	assert.Assert(c, !strings.Contains(out, imageID))
261 260
 	out, _ = dockerCmd(c, "images")
262 261
 	//docker images still include dangling images
263 262
 	assert.Assert(c, out, checker.Contains, imageID)
... ...
@@ -289,7 +287,7 @@ func (s *DockerSuite) TestImagesEnsureOnlyHeadsImagesShown(c *testing.T) {
289 289
 
290 290
 	out, _ := dockerCmd(c, "images")
291 291
 	// images shouldn't show non-heads images
292
-	assert.Assert(c, out, checker.Not(checker.Contains), intermediate)
292
+	assert.Assert(c, !strings.Contains(out, intermediate))
293 293
 	// images should contain final built images
294 294
 	assert.Assert(c, out, checker.Contains, stringid.TruncateID(id))
295 295
 }
... ...
@@ -336,7 +334,7 @@ func (s *DockerSuite) TestImagesFilterNameWithPort(c *testing.T) {
336 336
 	assert.Assert(c, out, checker.Contains, tag)
337 337
 
338 338
 	out, _ = dockerCmd(c, "images", tag+":no-such-tag")
339
-	assert.Assert(c, out, checker.Not(checker.Contains), tag)
339
+	assert.Assert(c, !strings.Contains(out, tag))
340 340
 }
341 341
 
342 342
 func (s *DockerSuite) TestImagesFormat(c *testing.T) {
... ...
@@ -110,7 +110,7 @@ func (s *DockerSuite) TestInspectTypeFlagWithImage(c *testing.T) {
110 110
 
111 111
 	out, _ := dockerCmd(c, "inspect", "--type=image", "busybox")
112 112
 	// not an image JSON
113
-	assert.Assert(c, out, checker.Not(checker.Contains), "State")
113
+	assert.Assert(c, !strings.Contains(out, "State"))
114 114
 }
115 115
 
116 116
 func (s *DockerSuite) TestInspectTypeFlagWithInvalidValue(c *testing.T) {
... ...
@@ -1260,13 +1260,11 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectDisconnectToStoppedContaine
1260 1260
 	// Test disconnect
1261 1261
 	dockerCmd(c, "network", "disconnect", "test", "foo")
1262 1262
 	networks = inspectField(c, "foo", "NetworkSettings.Networks")
1263
-	assert.Assert(c, networks, checker.Not(checker.Contains), "test", check.Commentf("Should not contain 'test' network"))
1264
-
1263
+	assert.Assert(c, !strings.Contains(networks, "test"), check.Commentf("Should not contain 'test' network"))
1265 1264
 	// Restart docker daemon to test the config has persisted to disk
1266 1265
 	s.d.Restart(c)
1267 1266
 	networks = inspectField(c, "foo", "NetworkSettings.Networks")
1268
-	assert.Assert(c, networks, checker.Not(checker.Contains), "test", check.Commentf("Should not contain 'test' network"))
1269
-
1267
+	assert.Assert(c, !strings.Contains(networks, "test"), check.Commentf("Should not contain 'test' network"))
1270 1268
 }
1271 1269
 
1272 1270
 func (s *DockerNetworkSuite) TestDockerNetworkDisconnectContainerNonexistingNetwork(c *testing.T) {
... ...
@@ -1282,7 +1280,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkDisconnectContainerNonexistingNetw
1282 1282
 	// Test disconnecting stopped container from nonexisting network
1283 1283
 	dockerCmd(c, "network", "disconnect", "-f", "test", "foo")
1284 1284
 	networks = inspectField(c, "foo", "NetworkSettings.Networks")
1285
-	assert.Assert(c, networks, checker.Not(checker.Contains), "test", check.Commentf("Should not contain 'test' network"))
1285
+	assert.Assert(c, !strings.Contains(networks, "test"), check.Commentf("Should not contain 'test' network"))
1286 1286
 }
1287 1287
 
1288 1288
 func (s *DockerNetworkSuite) TestDockerNetworkConnectPreferredIP(c *testing.T) {
... ...
@@ -1497,7 +1495,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkDisconnectDefault(c *testing.T) {
1497 1497
 	networks := inspectField(c, containerName, "NetworkSettings.Networks")
1498 1498
 	assert.Assert(c, networks, checker.Contains, netWorkName1, check.Commentf(fmt.Sprintf("Should contain '%s' network", netWorkName1)))
1499 1499
 	assert.Assert(c, networks, checker.Contains, netWorkName2, check.Commentf(fmt.Sprintf("Should contain '%s' network", netWorkName2)))
1500
-	assert.Assert(c, networks, checker.Not(checker.Contains), "bridge", check.Commentf("Should not contain 'bridge' network"))
1500
+	assert.Assert(c, !strings.Contains(networks, "bridge"), check.Commentf("Should not contain 'bridge' network"))
1501 1501
 }
1502 1502
 
1503 1503
 func (s *DockerNetworkSuite) TestDockerNetworkConnectWithAliasOnDefaultNetworks(c *testing.T) {
... ...
@@ -407,7 +407,7 @@ func (ps *DockerPluginSuite) TestPluginIDPrefix(c *testing.T) {
407 407
 	// List returns none
408 408
 	out, _, err = dockerCmdWithError("plugin", "ls")
409 409
 	assert.NilError(c, err)
410
-	assert.Assert(c, out, checker.Not(checker.Contains), name)
410
+	assert.Assert(c, !strings.Contains(out, name))
411 411
 }
412 412
 
413 413
 func (ps *DockerPluginSuite) TestPluginListDefaultFormat(c *testing.T) {
... ...
@@ -97,8 +97,7 @@ func (s *DockerDaemonSuite) TestPruneImageDangling(c *testing.T) {
97 97
 
98 98
 	out, err = s.d.Cmd("image", "prune", "--force")
99 99
 	assert.NilError(c, err)
100
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id)
101
-
100
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id))
102 101
 	out, err = s.d.Cmd("images", "-q", "--no-trunc")
103 102
 	assert.NilError(c, err)
104 103
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id)
... ...
@@ -109,7 +108,7 @@ func (s *DockerDaemonSuite) TestPruneImageDangling(c *testing.T) {
109 109
 
110 110
 	out, err = s.d.Cmd("images", "-q", "--no-trunc")
111 111
 	assert.NilError(c, err)
112
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id)
112
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id))
113 113
 }
114 114
 
115 115
 func (s *DockerSuite) TestPruneContainerUntil(c *testing.T) {
... ...
@@ -125,10 +124,9 @@ func (s *DockerSuite) TestPruneContainerUntil(c *testing.T) {
125 125
 
126 126
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "until="+until).Combined()
127 127
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id1)
128
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
129
-
128
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
130 129
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
131
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id1)
130
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
132 131
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id2)
133 132
 }
134 133
 
... ...
@@ -159,35 +157,33 @@ func (s *DockerSuite) TestPruneContainerLabel(c *testing.T) {
159 159
 
160 160
 	// With config.json only, prune based on label=foobar
161 161
 	out = cli.DockerCmd(c, "--config", d, "container", "prune", "--force").Combined()
162
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id1)
163
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
164
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id3)
162
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
163
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
164
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
165 165
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id4)
166 166
 
167 167
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "label=foo").Combined()
168 168
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id1)
169
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
170
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id3)
171
-
169
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
170
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
172 171
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
173
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id1)
172
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
174 173
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id2)
175 174
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id3)
176 175
 
177 176
 	out = cli.DockerCmd(c, "container", "prune", "--force", "--filter", "label!=bar").Combined()
178
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
177
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
179 178
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id3)
180 179
 
181 180
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
182 181
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id2)
183
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id3)
184
-
182
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
185 183
 	// With config.json label=foobar and CLI label!=foobar, CLI label!=foobar supersede
186 184
 	out = cli.DockerCmd(c, "--config", d, "container", "prune", "--force", "--filter", "label!=foobar").Combined()
187 185
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id2)
188 186
 
189 187
 	out = cli.DockerCmd(c, "ps", "-a", "-q", "--no-trunc").Combined()
190
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
188
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
191 189
 }
192 190
 
193 191
 func (s *DockerSuite) TestPruneVolumeLabel(c *testing.T) {
... ...
@@ -217,35 +213,33 @@ func (s *DockerSuite) TestPruneVolumeLabel(c *testing.T) {
217 217
 
218 218
 	// With config.json only, prune based on label=foobar
219 219
 	out, _ = dockerCmd(c, "--config", d, "volume", "prune", "--force")
220
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id1)
221
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
222
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id3)
220
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
221
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
222
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
223 223
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id4)
224 224
 
225 225
 	out, _ = dockerCmd(c, "volume", "prune", "--force", "--filter", "label=foo")
226 226
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id1)
227
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
228
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id3)
229
-
227
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
228
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
230 229
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
231
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id1)
230
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
232 231
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id2)
233 232
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id3)
234 233
 
235 234
 	out, _ = dockerCmd(c, "volume", "prune", "--force", "--filter", "label!=bar")
236
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
235
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
237 236
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id3)
238 237
 
239 238
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
240 239
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id2)
241
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id3)
242
-
240
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id3))
243 241
 	// With config.json label=foobar and CLI label!=foobar, CLI label!=foobar supersede
244 242
 	out, _ = dockerCmd(c, "--config", d, "volume", "prune", "--force", "--filter", "label!=foobar")
245 243
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id2)
246 244
 
247 245
 	out, _ = dockerCmd(c, "volume", "ls", "--format", "{{.Name}}")
248
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
246
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
249 247
 }
250 248
 
251 249
 func (s *DockerSuite) TestPruneNetworkLabel(c *testing.T) {
... ...
@@ -255,18 +249,17 @@ func (s *DockerSuite) TestPruneNetworkLabel(c *testing.T) {
255 255
 
256 256
 	out, _ := dockerCmd(c, "network", "prune", "--force", "--filter", "label=foo")
257 257
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, "n1")
258
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), "n2")
259
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), "n3")
260
-
258
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n2"))
259
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n3"))
261 260
 	out, _ = dockerCmd(c, "network", "prune", "--force", "--filter", "label!=bar")
262
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), "n1")
263
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), "n2")
261
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n1"))
262
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n2"))
264 263
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, "n3")
265 264
 
266 265
 	out, _ = dockerCmd(c, "network", "prune", "--force")
267
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), "n1")
266
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n1"))
268 267
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, "n2")
269
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), "n3")
268
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), "n3"))
270 269
 }
271 270
 
272 271
 func (s *DockerDaemonSuite) TestPruneImageLabel(c *testing.T) {
... ...
@@ -297,15 +290,13 @@ func (s *DockerDaemonSuite) TestPruneImageLabel(c *testing.T) {
297 297
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label=foo=bar")
298 298
 	assert.NilError(c, err)
299 299
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id1)
300
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
301
-
300
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
302 301
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label!=bar=foo")
303 302
 	assert.NilError(c, err)
304
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id1)
305
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id2)
306
-
303
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
304
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id2))
307 305
 	out, err = s.d.Cmd("image", "prune", "--force", "--all", "--filter", "label=bar=foo")
308 306
 	assert.NilError(c, err)
309
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), id1)
307
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), id1))
310 308
 	assert.Assert(c, strings.TrimSpace(out), checker.Contains, id2)
311 309
 }
... ...
@@ -434,7 +434,7 @@ func (s *DockerSuite) TestPsListContainersFilterLabel(c *testing.T) {
434 434
 	containerOut = strings.TrimSpace(out)
435 435
 	assert.Assert(c, containerOut, checker.Contains, firstID)
436 436
 	assert.Assert(c, containerOut, checker.Contains, secondID)
437
-	assert.Assert(c, containerOut, checker.Not(checker.Contains), thirdID)
437
+	assert.Assert(c, !strings.Contains(containerOut, thirdID))
438 438
 }
439 439
 
440 440
 func (s *DockerSuite) TestPsListContainersFilterExited(c *testing.T) {
... ...
@@ -455,14 +455,13 @@ func (s *DockerSuite) TestPsListContainersFilterExited(c *testing.T) {
455 455
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=0")
456 456
 	assert.Assert(c, out, checker.Contains, strings.TrimSpace(firstZero))
457 457
 	assert.Assert(c, out, checker.Contains, strings.TrimSpace(secondZero))
458
-	assert.Assert(c, out, checker.Not(checker.Contains), strings.TrimSpace(firstNonZero))
459
-	assert.Assert(c, out, checker.Not(checker.Contains), strings.TrimSpace(secondNonZero))
460
-
458
+	assert.Assert(c, !strings.Contains(out, strings.TrimSpace(firstNonZero)))
459
+	assert.Assert(c, !strings.Contains(out, strings.TrimSpace(secondNonZero)))
461 460
 	out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=exited=1")
462 461
 	assert.Assert(c, out, checker.Contains, strings.TrimSpace(firstNonZero))
463 462
 	assert.Assert(c, out, checker.Contains, strings.TrimSpace(secondNonZero))
464
-	assert.Assert(c, out, checker.Not(checker.Contains), strings.TrimSpace(firstZero))
465
-	assert.Assert(c, out, checker.Not(checker.Contains), strings.TrimSpace(secondZero))
463
+	assert.Assert(c, !strings.Contains(out, strings.TrimSpace(firstZero)))
464
+	assert.Assert(c, !strings.Contains(out, strings.TrimSpace(secondZero)))
466 465
 }
467 466
 
468 467
 func (s *DockerSuite) TestPsRightTagName(c *testing.T) {
... ...
@@ -519,8 +518,7 @@ func (s *DockerSuite) TestPsListContainersFilterCreated(c *testing.T) {
519 519
 
520 520
 	// Make sure it DOESN'T show up w/o a '-a' for normal 'ps'
521 521
 	out, _ = dockerCmd(c, "ps", "-q")
522
-	assert.Assert(c, out, checker.Not(checker.Contains), shortCID, check.Commentf("Should have not seen '%s' in ps output:\n%s", shortCID, out))
523
-
522
+	assert.Assert(c, !strings.Contains(out, shortCID), check.Commentf("Should have not seen '%s' in ps output:\n%s", shortCID, out))
524 523
 	// Make sure it DOES show up as 'Created' for 'ps -a'
525 524
 	out, _ = dockerCmd(c, "ps", "-a")
526 525
 
... ...
@@ -396,8 +396,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuthLoginWithSchem
396 396
 
397 397
 	b, err := ioutil.ReadFile(configPath)
398 398
 	assert.NilError(c, err)
399
-	assert.Assert(c, string(b), checker.Not(checker.Contains), "\"auth\":")
400
-
399
+	assert.Assert(c, !strings.Contains(string(b), "\"auth\":"))
401 400
 	dockerCmd(c, "--config", tmp, "tag", "busybox", repoName)
402 401
 	dockerCmd(c, "--config", tmp, "push", repoName)
403 402
 
... ...
@@ -441,8 +440,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestPullWithExternalAuth(c *testing.T)
441 441
 
442 442
 	b, err := ioutil.ReadFile(configPath)
443 443
 	assert.NilError(c, err)
444
-	assert.Assert(c, string(b), checker.Not(checker.Contains), "\"auth\":")
445
-
444
+	assert.Assert(c, !strings.Contains(string(b), "\"auth\":"))
446 445
 	dockerCmd(c, "--config", tmp, "tag", "busybox", repoName)
447 446
 	dockerCmd(c, "--config", tmp, "push", repoName)
448 447
 
... ...
@@ -102,7 +102,7 @@ func (s *DockerSuite) TestRmiImgIDMultipleTag(c *testing.T) {
102 102
 
103 103
 	imagesAfter = cli.DockerCmd(c, "images", "-a").Combined()
104 104
 	// rmi -f failed, image still exists
105
-	assert.Assert(c, imagesAfter, checker.Not(checker.Contains), imgID[:12], check.Commentf("ImageID:%q; ImagesAfter: %q", imgID, imagesAfter))
105
+	assert.Assert(c, !strings.Contains(imagesAfter, imgID[:12]), check.Commentf("ImageID:%q; ImagesAfter: %q", imgID, imagesAfter))
106 106
 }
107 107
 
108 108
 func (s *DockerSuite) TestRmiImgIDForce(c *testing.T) {
... ...
@@ -138,7 +138,7 @@ func (s *DockerSuite) TestRmiImgIDForce(c *testing.T) {
138 138
 	{
139 139
 		imagesAfter := cli.DockerCmd(c, "images", "-a").Combined()
140 140
 		// rmi failed, image still exists
141
-		assert.Assert(c, imagesAfter, checker.Not(checker.Contains), imgID[:12])
141
+		assert.Assert(c, !strings.Contains(imagesAfter, imgID[:12]))
142 142
 	}
143 143
 }
144 144
 
... ...
@@ -209,8 +209,7 @@ func (s *DockerSuite) TestRmiForceWithMultipleRepositories(c *testing.T) {
209 209
 
210 210
 	out, _ := dockerCmd(c, "rmi", "-f", tag2)
211 211
 	assert.Assert(c, out, checker.Contains, "Untagged: "+tag2)
212
-	assert.Assert(c, out, checker.Not(checker.Contains), "Untagged: "+tag1)
213
-
212
+	assert.Assert(c, !strings.Contains(out, "Untagged: "+tag1))
214 213
 	// Check built image still exists
215 214
 	images, _ := dockerCmd(c, "images", "-a")
216 215
 	assert.Assert(c, images, checker.Contains, imageName, check.Commentf("Built image missing %q; Images: %q", imageName, images))
... ...
@@ -221,7 +220,7 @@ func (s *DockerSuite) TestRmiBlank(c *testing.T) {
221 221
 	// Should have failed to delete ' ' image
222 222
 	assert.ErrorContains(c, err, "")
223 223
 	// Wrong error message generated
224
-	assert.Assert(c, out, checker.Not(checker.Contains), "no such id", check.Commentf("out: %s", out))
224
+	assert.Assert(c, !strings.Contains(out, "no such id"), check.Commentf("out: %s", out))
225 225
 	// Expected error message not generated
226 226
 	assert.Assert(c, out, checker.Contains, "image name cannot be blank", check.Commentf("out: %s", out))
227 227
 }
... ...
@@ -3921,7 +3921,7 @@ func (s *DockerSuite) TestRunNamedVolumesFromNotRemoved(c *testing.T) {
3921 3921
 	dockerCmd(c, "volume", "inspect", "test")
3922 3922
 	out, _ := dockerCmd(c, "volume", "ls", "-q")
3923 3923
 	assert.Assert(c, strings.Contains(out, "test"))
3924
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), vname)
3924
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), vname))
3925 3925
 }
3926 3926
 
3927 3927
 func (s *DockerSuite) TestRunAttachFailedNoLeak(c *testing.T) {
... ...
@@ -4199,7 +4199,7 @@ func (s *DockerSuite) TestRunDuplicateMount(c *testing.T) {
4199 4199
 
4200 4200
 	name := "test"
4201 4201
 	out, _ := dockerCmd(c, "run", "--name", name, "-v", "/tmp:/tmp", "-v", "/tmp:/tmp", "busybox", "sh", "-c", "cat "+tmpFile.Name()+" && ls /")
4202
-	assert.Assert(c, out, checker.Not(checker.Contains), "tmp:")
4202
+	assert.Assert(c, !strings.Contains(out, "tmp:"))
4203 4203
 	assert.Assert(c, out, checker.Contains, data)
4204 4204
 
4205 4205
 	out = inspectFieldJSON(c, name, "Config.Volumes")
... ...
@@ -847,7 +847,7 @@ func (s *DockerSuite) TestRunTmpfsMountsOverrideImageVolumes(c *testing.T) {
847 847
     RUN touch /run/stuff
848 848
     `))
849 849
 	out, _ := dockerCmd(c, "run", "--tmpfs", "/run", name, "ls", "/run")
850
-	assert.Assert(c, out, checker.Not(checker.Contains), "stuff")
850
+	assert.Assert(c, !strings.Contains(out, "stuff"))
851 851
 }
852 852
 
853 853
 // Test case for #22420
... ...
@@ -859,15 +859,13 @@ func (s *DockerSuite) TestRunTmpfsMountsWithOptions(c *testing.T) {
859 859
 	for _, option := range expectedOptions {
860 860
 		assert.Assert(c, out, checker.Contains, option)
861 861
 	}
862
-	assert.Assert(c, out, checker.Not(checker.Contains), "size=")
863
-
862
+	assert.Assert(c, !strings.Contains(out, "size="))
864 863
 	expectedOptions = []string{"rw", "nosuid", "nodev", "noexec", "relatime"}
865 864
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
866 865
 	for _, option := range expectedOptions {
867 866
 		assert.Assert(c, out, checker.Contains, option)
868 867
 	}
869
-	assert.Assert(c, out, checker.Not(checker.Contains), "size=")
870
-
868
+	assert.Assert(c, !strings.Contains(out, "size="))
871 869
 	expectedOptions = []string{"rw", "nosuid", "nodev", "relatime", "size=8192k"}
872 870
 	out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:rw,exec,size=8192k", "busybox", "sh", "-c", "mount | grep 'tmpfs on /tmp'")
873 871
 	for _, option := range expectedOptions {
... ...
@@ -394,7 +394,7 @@ func (s *DockerSuite) TestSaveLoadNoTag(c *testing.T) {
394 394
 	assert.NilError(c, err, "failed to save and load repo: %s, %v", out, err)
395 395
 
396 396
 	// Should not show 'name' but should show the image ID during the load
397
-	assert.Assert(c, out, checker.Not(checker.Contains), "Loaded image: ")
397
+	assert.Assert(c, !strings.Contains(out, "Loaded image: "))
398 398
 	assert.Assert(c, out, checker.Contains, "Loaded image ID:")
399 399
 	assert.Assert(c, out, checker.Contains, id)
400 400
 
... ...
@@ -405,5 +405,5 @@ func (s *DockerSuite) TestSaveLoadNoTag(c *testing.T) {
405 405
 	assert.NilError(c, err, "failed to save and load repo: %s, %v", out, err)
406 406
 
407 407
 	assert.Assert(c, out, checker.Contains, "Loaded image: "+name+":latest")
408
-	assert.Assert(c, out, checker.Not(checker.Contains), "Loaded image ID:")
408
+	assert.Assert(c, !strings.Contains(out, "Loaded image ID:"))
409 409
 }
... ...
@@ -185,7 +185,7 @@ func (s *DockerSuite) TestStartAttachWithRename(c *testing.T) {
185 185
 	result := cli.Docker(cli.Args("start", "-a", "before")).Assert(c, icmd.Expected{
186 186
 		ExitCode: 137,
187 187
 	})
188
-	assert.Assert(c, result.Stderr(), checker.Not(checker.Contains), "No such container")
188
+	assert.Assert(c, !strings.Contains(result.Stderr(), "No such container"))
189 189
 }
190 190
 
191 191
 func (s *DockerSuite) TestStartReturnCorrectExitCode(c *testing.T) {
... ...
@@ -212,15 +212,13 @@ func (s *DockerSwarmSuite) TestSwarmServiceListFilter(c *testing.T) {
212 212
 	out, err = d.Cmd("service", "ls", "--filter", filter1)
213 213
 	assert.NilError(c, err, out)
214 214
 	assert.Assert(c, out, checker.Contains, name1+" ")
215
-	assert.Assert(c, out, checker.Not(checker.Contains), name2+" ")
216
-	assert.Assert(c, out, checker.Not(checker.Contains), name3+" ")
217
-
215
+	assert.Assert(c, !strings.Contains(out, name2+" "))
216
+	assert.Assert(c, !strings.Contains(out, name3+" "))
218 217
 	out, err = d.Cmd("service", "ls", "--filter", filter2)
219 218
 	assert.NilError(c, err, out)
220 219
 	assert.Assert(c, out, checker.Contains, name1+" ")
221 220
 	assert.Assert(c, out, checker.Contains, name2+" ")
222
-	assert.Assert(c, out, checker.Not(checker.Contains), name3+" ")
223
-
221
+	assert.Assert(c, !strings.Contains(out, name3+" "))
224 222
 	out, err = d.Cmd("service", "ls")
225 223
 	assert.NilError(c, err, out)
226 224
 	assert.Assert(c, out, checker.Contains, name1+" ")
... ...
@@ -244,7 +242,7 @@ func (s *DockerSwarmSuite) TestSwarmNodeListFilter(c *testing.T) {
244 244
 
245 245
 	out, err = d.Cmd("node", "ls", "--filter", "name=none")
246 246
 	assert.NilError(c, err, out)
247
-	assert.Assert(c, out, checker.Not(checker.Contains), name)
247
+	assert.Assert(c, !strings.Contains(out, name))
248 248
 }
249 249
 
250 250
 func (s *DockerSwarmSuite) TestSwarmNodeTaskListFilter(c *testing.T) {
... ...
@@ -268,9 +266,9 @@ func (s *DockerSwarmSuite) TestSwarmNodeTaskListFilter(c *testing.T) {
268 268
 
269 269
 	out, err = d.Cmd("node", "ps", "--filter", "name=none", "self")
270 270
 	assert.NilError(c, err, out)
271
-	assert.Assert(c, out, checker.Not(checker.Contains), name+".1")
272
-	assert.Assert(c, out, checker.Not(checker.Contains), name+".2")
273
-	assert.Assert(c, out, checker.Not(checker.Contains), name+".3")
271
+	assert.Assert(c, !strings.Contains(out, name+".1"))
272
+	assert.Assert(c, !strings.Contains(out, name+".2"))
273
+	assert.Assert(c, !strings.Contains(out, name+".3"))
274 274
 }
275 275
 
276 276
 // Test case for #25375
... ...
@@ -442,7 +440,7 @@ func (s *DockerSwarmSuite) TestOverlayAttachableOnSwarmLeave(c *testing.T) {
442 442
 	// Check the network is gone
443 443
 	out, err = d.Cmd("network", "ls", "--format", "{{.Name}}")
444 444
 	assert.NilError(c, err, out)
445
-	assert.Assert(c, out, checker.Not(checker.Contains), nwName)
445
+	assert.Assert(c, !strings.Contains(out, nwName))
446 446
 }
447 447
 
448 448
 func (s *DockerSwarmSuite) TestOverlayAttachableReleaseResourcesOnFailure(c *testing.T) {
... ...
@@ -570,15 +568,13 @@ func (s *DockerSwarmSuite) TestSwarmTaskListFilter(c *testing.T) {
570 570
 	out, err = d.Cmd("service", "ps", "--filter", "name="+name+".1", name)
571 571
 	assert.NilError(c, err, out)
572 572
 	assert.Assert(c, out, checker.Contains, name+".1")
573
-	assert.Assert(c, out, checker.Not(checker.Contains), name+".2")
574
-	assert.Assert(c, out, checker.Not(checker.Contains), name+".3")
575
-
573
+	assert.Assert(c, !strings.Contains(out, name+".2"))
574
+	assert.Assert(c, !strings.Contains(out, name+".3"))
576 575
 	out, err = d.Cmd("service", "ps", "--filter", "name=none", name)
577 576
 	assert.NilError(c, err, out)
578
-	assert.Assert(c, out, checker.Not(checker.Contains), name+".1")
579
-	assert.Assert(c, out, checker.Not(checker.Contains), name+".2")
580
-	assert.Assert(c, out, checker.Not(checker.Contains), name+".3")
581
-
577
+	assert.Assert(c, !strings.Contains(out, name+".1"))
578
+	assert.Assert(c, !strings.Contains(out, name+".2"))
579
+	assert.Assert(c, !strings.Contains(out, name+".3"))
582 580
 	name = "redis-cluster-sha1"
583 581
 	out, err = d.Cmd("service", "create", "--detach", "--no-resolve-image", "--name", name, "--mode=global", "busybox", "top")
584 582
 	assert.NilError(c, err, out)
... ...
@@ -597,7 +593,7 @@ func (s *DockerSwarmSuite) TestSwarmTaskListFilter(c *testing.T) {
597 597
 
598 598
 	out, err = d.Cmd("service", "ps", "--filter", "name=none", name)
599 599
 	assert.NilError(c, err, out)
600
-	assert.Assert(c, out, checker.Not(checker.Contains), name)
600
+	assert.Assert(c, !strings.Contains(out, name))
601 601
 }
602 602
 
603 603
 func (s *DockerSwarmSuite) TestPsListContainersFilterIsTask(c *testing.T) {
... ...
@@ -1041,8 +1037,7 @@ func (s *DockerSwarmSuite) TestUnlockEngineAndUnlockedSwarm(c *testing.T) {
1041 1041
 		ExitCode: 1,
1042 1042
 	})
1043 1043
 	assert.Assert(c, result.Combined(), checker.Contains, "Error: This node is not part of a swarm")
1044
-	assert.Assert(c, result.Combined(), checker.Not(checker.Contains), "Please enter unlock key")
1045
-
1044
+	assert.Assert(c, !strings.Contains(result.Combined(), "Please enter unlock key"))
1046 1045
 	out, err := d.Cmd("swarm", "init")
1047 1046
 	assert.NilError(c, err, out)
1048 1047
 
... ...
@@ -1053,7 +1048,7 @@ func (s *DockerSwarmSuite) TestUnlockEngineAndUnlockedSwarm(c *testing.T) {
1053 1053
 		ExitCode: 1,
1054 1054
 	})
1055 1055
 	assert.Assert(c, result.Combined(), checker.Contains, "Error: swarm is not locked")
1056
-	assert.Assert(c, result.Combined(), checker.Not(checker.Contains), "Please enter unlock key")
1056
+	assert.Assert(c, !strings.Contains(result.Combined(), "Please enter unlock key"))
1057 1057
 }
1058 1058
 
1059 1059
 func (s *DockerSwarmSuite) TestSwarmInitLocked(c *testing.T) {
... ...
@@ -1086,8 +1081,7 @@ func (s *DockerSwarmSuite) TestSwarmInitLocked(c *testing.T) {
1086 1086
 
1087 1087
 	outs, err = d.Cmd("node", "ls")
1088 1088
 	assert.Assert(c, err == nil, check.Commentf("%s", outs))
1089
-	assert.Assert(c, outs, checker.Not(checker.Contains), "Swarm is encrypted and needs to be unlocked")
1090
-
1089
+	assert.Assert(c, !strings.Contains(outs, "Swarm is encrypted and needs to be unlocked"))
1091 1090
 	outs, err = d.Cmd("swarm", "update", "--autolock=false")
1092 1091
 	assert.Assert(c, err == nil, check.Commentf("%s", outs))
1093 1092
 
... ...
@@ -1095,7 +1089,7 @@ func (s *DockerSwarmSuite) TestSwarmInitLocked(c *testing.T) {
1095 1095
 
1096 1096
 	outs, err = d.Cmd("node", "ls")
1097 1097
 	assert.Assert(c, err == nil, check.Commentf("%s", outs))
1098
-	assert.Assert(c, outs, checker.Not(checker.Contains), "Swarm is encrypted and needs to be unlocked")
1098
+	assert.Assert(c, !strings.Contains(outs, "Swarm is encrypted and needs to be unlocked"))
1099 1099
 }
1100 1100
 
1101 1101
 func (s *DockerSwarmSuite) TestSwarmLeaveLocked(c *testing.T) {
... ...
@@ -1320,7 +1314,7 @@ func (s *DockerSwarmSuite) TestSwarmRotateUnlockKey(c *testing.T) {
1320 1320
 				}
1321 1321
 			}
1322 1322
 			assert.NilError(c, err)
1323
-			assert.Assert(c, outs, checker.Not(checker.Contains), "Swarm is encrypted and needs to be unlocked")
1323
+			assert.Assert(c, !strings.Contains(outs, "Swarm is encrypted and needs to be unlocked"))
1324 1324
 			break
1325 1325
 		}
1326 1326
 
... ...
@@ -1412,7 +1406,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterRotateUnlockKey(c *testing.T) {
1412 1412
 					}
1413 1413
 				}
1414 1414
 				assert.Assert(c, err == nil, check.Commentf("%s", outs))
1415
-				assert.Assert(c, outs, checker.Not(checker.Contains), "Swarm is encrypted and needs to be unlocked")
1415
+				assert.Assert(c, !strings.Contains(outs, "Swarm is encrypted and needs to be unlocked"))
1416 1416
 				break
1417 1417
 			}
1418 1418
 		}
... ...
@@ -1584,8 +1578,7 @@ func (s *DockerSwarmSuite) TestSwarmJoinWithDrain(c *testing.T) {
1584 1584
 
1585 1585
 	out, err := d.Cmd("node", "ls")
1586 1586
 	assert.NilError(c, err)
1587
-	assert.Assert(c, out, checker.Not(checker.Contains), "Drain")
1588
-
1587
+	assert.Assert(c, !strings.Contains(out, "Drain"))
1589 1588
 	out, err = d.Cmd("swarm", "join-token", "-q", "manager")
1590 1589
 	assert.NilError(c, err)
1591 1590
 	assert.Assert(c, strings.TrimSpace(out) != "")
... ...
@@ -1750,17 +1743,16 @@ func (s *DockerSwarmSuite) TestSwarmServiceLsFilterMode(c *testing.T) {
1750 1750
 	assert.NilError(c, err, out)
1751 1751
 	assert.Assert(c, out, checker.Contains, "top1")
1752 1752
 	assert.Assert(c, out, checker.Contains, "top2")
1753
-	assert.Assert(c, out, checker.Not(checker.Contains), "localnet")
1754
-
1753
+	assert.Assert(c, !strings.Contains(out, "localnet"))
1755 1754
 	out, err = d.Cmd("service", "ls", "--filter", "mode=global")
1756
-	assert.Assert(c, out, checker.Not(checker.Contains), "top1")
1755
+	assert.Assert(c, !strings.Contains(out, "top1"))
1757 1756
 	assert.Assert(c, out, checker.Contains, "top2")
1758 1757
 	assert.NilError(c, err, out)
1759 1758
 
1760 1759
 	out, err = d.Cmd("service", "ls", "--filter", "mode=replicated")
1761 1760
 	assert.NilError(c, err, out)
1762 1761
 	assert.Assert(c, out, checker.Contains, "top1")
1763
-	assert.Assert(c, out, checker.Not(checker.Contains), "top2")
1762
+	assert.Assert(c, !strings.Contains(out, "top2"))
1764 1763
 }
1765 1764
 
1766 1765
 func (s *DockerSwarmSuite) TestSwarmInitUnspecifiedDataPathAddr(c *testing.T) {
... ...
@@ -1842,7 +1834,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsSource(c *testing.T) {
1842 1842
 
1843 1843
 	// d3 is a worker, not able to get cluster events
1844 1844
 	out = waitForEvent(c, d3, "0", "-f scope=swarm", "", 1)
1845
-	assert.Assert(c, out, checker.Not(checker.Contains), "network create ")
1845
+	assert.Assert(c, !strings.Contains(out, "network create "))
1846 1846
 }
1847 1847
 
1848 1848
 func (s *DockerSwarmSuite) TestSwarmClusterEventsScope(c *testing.T) {
... ...
@@ -1855,15 +1847,14 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsScope(c *testing.T) {
1855 1855
 
1856 1856
 	// scope swarm filters cluster events
1857 1857
 	out = waitForEvent(c, d, "0", "-f scope=swarm", "service create "+serviceID, defaultRetryCount)
1858
-	assert.Assert(c, out, checker.Not(checker.Contains), "container create ")
1859
-
1858
+	assert.Assert(c, !strings.Contains(out, "container create "))
1860 1859
 	// all events are returned if scope is not specified
1861 1860
 	waitForEvent(c, d, "0", "", "service create "+serviceID, 1)
1862 1861
 	waitForEvent(c, d, "0", "", "container create ", defaultRetryCount)
1863 1862
 
1864 1863
 	// scope local only shows non-cluster events
1865 1864
 	out = waitForEvent(c, d, "0", "-f scope=local", "container create ", 1)
1866
-	assert.Assert(c, out, checker.Not(checker.Contains), "service create ")
1865
+	assert.Assert(c, !strings.Contains(out, "service create "))
1867 1866
 }
1868 1867
 
1869 1868
 func (s *DockerSwarmSuite) TestSwarmClusterEventsType(c *testing.T) {
... ...
@@ -1882,11 +1873,10 @@ func (s *DockerSwarmSuite) TestSwarmClusterEventsType(c *testing.T) {
1882 1882
 
1883 1883
 	// filter by service
1884 1884
 	out = waitForEvent(c, d, "0", "-f type=service", "service create "+serviceID, defaultRetryCount)
1885
-	assert.Assert(c, out, checker.Not(checker.Contains), "network create")
1886
-
1885
+	assert.Assert(c, !strings.Contains(out, "network create"))
1887 1886
 	// filter by network
1888 1887
 	out = waitForEvent(c, d, "0", "-f type=network", "network create "+networkID, defaultRetryCount)
1889
-	assert.Assert(c, out, checker.Not(checker.Contains), "service create")
1888
+	assert.Assert(c, !strings.Contains(out, "service create"))
1890 1889
 }
1891 1890
 
1892 1891
 func (s *DockerSwarmSuite) TestSwarmClusterEventsService(c *testing.T) {
... ...
@@ -142,7 +142,7 @@ func (s *DockerSuite) TestVolumeCLILsFilterDangling(c *testing.T) {
142 142
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=false")
143 143
 
144 144
 	// Explicitly disabling dangling
145
-	assert.Assert(c, out, checker.Not(checker.Contains), "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
145
+	assert.Assert(c, !strings.Contains(out, "testnotinuse1\n"), check.Commentf("expected volume 'testnotinuse1' in output"))
146 146
 	assert.Assert(c, out, checker.Contains, "testisinuse1\n", check.Commentf("expected volume 'testisinuse1' in output"))
147 147
 	assert.Assert(c, out, checker.Contains, "testisinuse2\n", check.Commentf("expected volume 'testisinuse2' in output"))
148 148
 
... ...
@@ -150,23 +150,21 @@ func (s *DockerSuite) TestVolumeCLILsFilterDangling(c *testing.T) {
150 150
 
151 151
 	// Filter "dangling" volumes; only "dangling" (unused) volumes should be in the output
152 152
 	assert.Assert(c, out, checker.Contains, "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
153
-	assert.Assert(c, out, checker.Not(checker.Contains), "testisinuse1\n", check.Commentf("volume 'testisinuse1' in output, but not expected"))
154
-	assert.Assert(c, out, checker.Not(checker.Contains), "testisinuse2\n", check.Commentf("volume 'testisinuse2' in output, but not expected"))
155
-
153
+	assert.Assert(c, !strings.Contains(out, "testisinuse1\n"), check.Commentf("volume 'testisinuse1' in output, but not expected"))
154
+	assert.Assert(c, !strings.Contains(out, "testisinuse2\n"), check.Commentf("volume 'testisinuse2' in output, but not expected"))
156 155
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=1")
157 156
 	// Filter "dangling" volumes; only "dangling" (unused) volumes should be in the output, dangling also accept 1
158 157
 	assert.Assert(c, out, checker.Contains, "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
159
-	assert.Assert(c, out, checker.Not(checker.Contains), "testisinuse1\n", check.Commentf("volume 'testisinuse1' in output, but not expected"))
160
-	assert.Assert(c, out, checker.Not(checker.Contains), "testisinuse2\n", check.Commentf("volume 'testisinuse2' in output, but not expected"))
161
-
158
+	assert.Assert(c, !strings.Contains(out, "testisinuse1\n"), check.Commentf("volume 'testisinuse1' in output, but not expected"))
159
+	assert.Assert(c, !strings.Contains(out, "testisinuse2\n"), check.Commentf("volume 'testisinuse2' in output, but not expected"))
162 160
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "dangling=0")
163 161
 	// dangling=0 is same as dangling=false case
164
-	assert.Assert(c, out, checker.Not(checker.Contains), "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
162
+	assert.Assert(c, !strings.Contains(out, "testnotinuse1\n"), check.Commentf("expected volume 'testnotinuse1' in output"))
165 163
 	assert.Assert(c, out, checker.Contains, "testisinuse1\n", check.Commentf("expected volume 'testisinuse1' in output"))
166 164
 	assert.Assert(c, out, checker.Contains, "testisinuse2\n", check.Commentf("expected volume 'testisinuse2' in output"))
167 165
 
168 166
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "name=testisin")
169
-	assert.Assert(c, out, checker.Not(checker.Contains), "testnotinuse1\n", check.Commentf("expected volume 'testnotinuse1' in output"))
167
+	assert.Assert(c, !strings.Contains(out, "testnotinuse1\n"), check.Commentf("expected volume 'testnotinuse1' in output"))
170 168
 	assert.Assert(c, out, checker.Contains, "testisinuse1\n", check.Commentf("expected volume 'testisinuse1' in output"))
171 169
 	assert.Assert(c, out, checker.Contains, "testisinuse2\n", check.Commentf("expected volume 'testisinuse2' in output"))
172 170
 }
... ...
@@ -330,8 +328,7 @@ func (s *DockerSuite) TestVolumeCLILsFilterLabels(c *testing.T) {
330 330
 
331 331
 	// filter with label=key=value
332 332
 	assert.Assert(c, out, checker.Contains, "testvolcreatelabel-1\n", check.Commentf("expected volume 'testvolcreatelabel-1' in output"))
333
-	assert.Assert(c, out, checker.Not(checker.Contains), "testvolcreatelabel-2\n", check.Commentf("expected volume 'testvolcreatelabel-2 in output"))
334
-
333
+	assert.Assert(c, !strings.Contains(out, "testvolcreatelabel-2\n"), check.Commentf("expected volume 'testvolcreatelabel-2 in output"))
335 334
 	out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=non-exist")
336 335
 	outArr := strings.Split(strings.TrimSpace(out), "\n")
337 336
 	assert.Equal(c, len(outArr), 1, check.Commentf("\n%s", out))
... ...
@@ -396,7 +393,7 @@ func (s *DockerSuite) TestVolumeCLIRmForce(c *testing.T) {
396 396
 
397 397
 	dockerCmd(c, "volume", "rm", "-f", name)
398 398
 	out, _ = dockerCmd(c, "volume", "ls")
399
-	assert.Assert(c, out, checker.Not(checker.Contains), name)
399
+	assert.Assert(c, !strings.Contains(out, name))
400 400
 	dockerCmd(c, "volume", "create", name)
401 401
 	out, _ = dockerCmd(c, "volume", "ls")
402 402
 	assert.Assert(c, out, checker.Contains, name)
... ...
@@ -439,7 +436,7 @@ func (s *DockerSuite) TestVolumeCLIRmForceInUse(c *testing.T) {
439 439
 
440 440
 	out, e = dockerCmd(c, "volume", "ls")
441 441
 	assert.Equal(c, e, 0)
442
-	assert.Assert(c, out, checker.Not(checker.Contains), name)
442
+	assert.Assert(c, !strings.Contains(out, name))
443 443
 }
444 444
 
445 445
 func (s *DockerSuite) TestVolumeCliInspectWithVolumeOpts(c *testing.T) {
... ...
@@ -501,8 +498,8 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFrom(c *testing.T) {
501 501
 
502 502
 	// Both volume should not exist
503 503
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
504
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data1)
505
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data2)
504
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
505
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
506 506
 }
507 507
 
508 508
 // Test case (2) for 21845: duplicate targets for --volumes-from and -v (bind)
... ...
@@ -536,17 +533,16 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndBind(c *testing.T
536 536
 
537 537
 	// No volume will be referenced (mount is /tmp/data), this is backward compatible
538 538
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "app")
539
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data1)
540
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data2)
541
-
539
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
540
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
542 541
 	dockerCmd(c, "rm", "-f", "-v", "app")
543 542
 	dockerCmd(c, "rm", "-f", "-v", "data1")
544 543
 	dockerCmd(c, "rm", "-f", "-v", "data2")
545 544
 
546 545
 	// Both volume should not exist
547 546
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
548
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data1)
549
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data2)
547
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
548
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
550 549
 }
551 550
 
552 551
 // Test case (3) for 21845: duplicate targets for --volumes-from and `Mounts` (API only)
... ...
@@ -602,15 +598,14 @@ func (s *DockerSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c *testing
602 602
 
603 603
 	// No volume will be referenced (mount is /tmp/data), this is backward compatible
604 604
 	out, _ = dockerCmd(c, "inspect", "--format", "{{(index .Mounts 0).Name}}", "app")
605
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data1)
606
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data2)
607
-
605
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
606
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
608 607
 	dockerCmd(c, "rm", "-f", "-v", "app")
609 608
 	dockerCmd(c, "rm", "-f", "-v", "data1")
610 609
 	dockerCmd(c, "rm", "-f", "-v", "data2")
611 610
 
612 611
 	// Both volume should not exist
613 612
 	out, _ = dockerCmd(c, "volume", "ls", "-q")
614
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data1)
615
-	assert.Assert(c, strings.TrimSpace(out), checker.Not(checker.Contains), data2)
613
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data1))
614
+	assert.Assert(c, !strings.Contains(strings.TrimSpace(out), data2))
616 615
 }