sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Equals, (.*)#assert.Equal(c, \1, \2#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_api_swarm_node_test.go" "integration-cli/docker_cli_attach_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_commit_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_health_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_import_test.go" "integration-cli/docker_cli_info_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_ps_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_service_create_test.go" "integration-cli/docker_cli_service_health_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_userns_test.go" "integration-cli/docker_cli_volume_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/generator_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/nodes/nodes_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 6dc7f4c16785687139ad94dd23a4127a1359289d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
... | ... |
@@ -53,7 +53,7 @@ func (s *DockerSuite) TestContainerAPIGetAll(c *testing.T) { |
53 | 53 |
assert.NilError(c, err) |
54 | 54 |
assert.Equal(c, len(containers), startCount+1) |
55 | 55 |
actual := containers[0].Names[0] |
56 |
- assert.Assert(c, actual, checker.Equals, "/"+name) |
|
56 |
+ assert.Equal(c, actual, "/"+name) |
|
57 | 57 |
} |
58 | 58 |
|
59 | 59 |
// regression test for empty json field being omitted #13691 |
... | ... |
@@ -411,8 +411,8 @@ func (s *DockerSuite) TestContainerAPITop(c *testing.T) { |
411 | 411 |
c.Fatalf("expected `USER` at `Titles[0]` and `COMMAND` at Titles[10]: %v", top.Titles) |
412 | 412 |
} |
413 | 413 |
assert.Assert(c, top.Processes, checker.HasLen, 2, check.Commentf("expected 2 processes, found %d: %v", len(top.Processes), top.Processes)) |
414 |
- assert.Assert(c, top.Processes[0][10], checker.Equals, "/bin/sh -c top") |
|
415 |
- assert.Assert(c, top.Processes[1][10], checker.Equals, "top") |
|
414 |
+ assert.Equal(c, top.Processes[0][10], "/bin/sh -c top") |
|
415 |
+ assert.Equal(c, top.Processes[1][10], "top") |
|
416 | 416 |
} |
417 | 417 |
|
418 | 418 |
func (s *DockerSuite) TestContainerAPITopWindows(c *testing.T) { |
... | ... |
@@ -462,7 +462,7 @@ func (s *DockerSuite) TestContainerAPICommit(c *testing.T) { |
462 | 462 |
assert.NilError(c, err) |
463 | 463 |
|
464 | 464 |
cmd := inspectField(c, img.ID, "Config.Cmd") |
465 |
- assert.Assert(c, cmd, checker.Equals, "[/bin/sh -c touch /test]", check.Commentf("got wrong Cmd from commit: %q", cmd)) |
|
465 |
+ assert.Equal(c, cmd, "[/bin/sh -c touch /test]", check.Commentf("got wrong Cmd from commit: %q", cmd)) |
|
466 | 466 |
|
467 | 467 |
// sanity check, make sure the image is what we think it is |
468 | 468 |
dockerCmd(c, "run", img.ID, "ls", "/test") |
... | ... |
@@ -488,13 +488,13 @@ func (s *DockerSuite) TestContainerAPICommitWithLabelInConfig(c *testing.T) { |
488 | 488 |
assert.NilError(c, err) |
489 | 489 |
|
490 | 490 |
label1 := inspectFieldMap(c, img.ID, "Config.Labels", "key1") |
491 |
- assert.Assert(c, label1, checker.Equals, "value1") |
|
491 |
+ assert.Equal(c, label1, "value1") |
|
492 | 492 |
|
493 | 493 |
label2 := inspectFieldMap(c, img.ID, "Config.Labels", "key2") |
494 |
- assert.Assert(c, label2, checker.Equals, "value2") |
|
494 |
+ assert.Equal(c, label2, "value2") |
|
495 | 495 |
|
496 | 496 |
cmd := inspectField(c, img.ID, "Config.Cmd") |
497 |
- assert.Assert(c, cmd, checker.Equals, "[/bin/sh -c touch /test]", check.Commentf("got wrong Cmd from commit: %q", cmd)) |
|
497 |
+ assert.Equal(c, cmd, "[/bin/sh -c touch /test]", check.Commentf("got wrong Cmd from commit: %q", cmd)) |
|
498 | 498 |
|
499 | 499 |
// sanity check, make sure the image is what we think it is |
500 | 500 |
dockerCmd(c, "run", img.ID, "ls", "/test") |
... | ... |
@@ -615,7 +615,7 @@ func UtilCreateNetworkMode(c *testing.T, networkMode containertypes.NetworkMode) |
615 | 615 |
containerJSON, err := cli.ContainerInspect(context.Background(), container.ID) |
616 | 616 |
assert.NilError(c, err) |
617 | 617 |
|
618 |
- assert.Assert(c, containerJSON.HostConfig.NetworkMode, checker.Equals, containertypes.NetworkMode(networkMode), check.Commentf("Mismatched NetworkMode")) |
|
618 |
+ assert.Equal(c, containerJSON.HostConfig.NetworkMode, containertypes.NetworkMode(networkMode), check.Commentf("Mismatched NetworkMode")) |
|
619 | 619 |
} |
620 | 620 |
|
621 | 621 |
func (s *DockerSuite) TestContainerAPICreateWithCpuSharesCpuset(c *testing.T) { |
... | ... |
@@ -646,7 +646,7 @@ func (s *DockerSuite) TestContainerAPICreateWithCpuSharesCpuset(c *testing.T) { |
646 | 646 |
assert.Equal(c, out, "512") |
647 | 647 |
|
648 | 648 |
outCpuset := inspectField(c, containerJSON.ID, "HostConfig.CpusetCpus") |
649 |
- assert.Assert(c, outCpuset, checker.Equals, "0") |
|
649 |
+ assert.Equal(c, outCpuset, "0") |
|
650 | 650 |
} |
651 | 651 |
|
652 | 652 |
func (s *DockerSuite) TestContainerAPIVerifyHeader(c *testing.T) { |
... | ... |
@@ -845,9 +845,9 @@ func (s *DockerSuite) TestContainerAPIPostCreateNull(c *testing.T) { |
845 | 845 |
assert.Equal(c, out, "") |
846 | 846 |
|
847 | 847 |
outMemory := inspectField(c, container.ID, "HostConfig.Memory") |
848 |
- assert.Assert(c, outMemory, checker.Equals, "0") |
|
848 |
+ assert.Equal(c, outMemory, "0") |
|
849 | 849 |
outMemorySwap := inspectField(c, container.ID, "HostConfig.MemorySwap") |
850 |
- assert.Assert(c, outMemorySwap, checker.Equals, "0") |
|
850 |
+ assert.Equal(c, outMemorySwap, "0") |
|
851 | 851 |
} |
852 | 852 |
|
853 | 853 |
func (s *DockerSuite) TestCreateWithTooLowMemoryLimit(c *testing.T) { |
... | ... |
@@ -888,7 +888,7 @@ func (s *DockerSuite) TestContainerAPIRename(c *testing.T) { |
888 | 888 |
assert.NilError(c, err) |
889 | 889 |
|
890 | 890 |
name := inspectField(c, containerID, "Name") |
891 |
- assert.Assert(c, name, checker.Equals, "/"+newName, check.Commentf("Failed to rename container")) |
|
891 |
+ assert.Equal(c, name, "/"+newName, check.Commentf("Failed to rename container")) |
|
892 | 892 |
} |
893 | 893 |
|
894 | 894 |
func (s *DockerSuite) TestContainerAPIKill(c *testing.T) { |
... | ... |
@@ -903,7 +903,7 @@ func (s *DockerSuite) TestContainerAPIKill(c *testing.T) { |
903 | 903 |
assert.NilError(c, err) |
904 | 904 |
|
905 | 905 |
state := inspectField(c, name, "State.Running") |
906 |
- assert.Assert(c, state, checker.Equals, "false", check.Commentf("got wrong State from container %s: %q", name, state)) |
|
906 |
+ assert.Equal(c, state, "false", check.Commentf("got wrong State from container %s: %q", name, state)) |
|
907 | 907 |
} |
908 | 908 |
|
909 | 909 |
func (s *DockerSuite) TestContainerAPIRestart(c *testing.T) { |
... | ... |
@@ -1000,7 +1000,7 @@ func (s *DockerSuite) TestContainerAPIWait(c *testing.T) { |
1000 | 1000 |
case err = <-errC: |
1001 | 1001 |
assert.NilError(c, err) |
1002 | 1002 |
case waitres := <-waitresC: |
1003 |
- assert.Assert(c, waitres.StatusCode, checker.Equals, int64(0)) |
|
1003 |
+ assert.Equal(c, waitres.StatusCode, int64(0)) |
|
1004 | 1004 |
} |
1005 | 1005 |
} |
1006 | 1006 |
|
... | ... |
@@ -1156,7 +1156,7 @@ func (s *DockerSuite) TestContainerAPIDeleteRemoveLinks(c *testing.T) { |
1156 | 1156 |
assert.Assert(c, waitRun(id2), checker.IsNil) |
1157 | 1157 |
|
1158 | 1158 |
links := inspectFieldJSON(c, id2, "HostConfig.Links") |
1159 |
- assert.Assert(c, links, checker.Equals, "[\"/tlink1:/tlink2/tlink1\"]", check.Commentf("expected to have links between containers")) |
|
1159 |
+ assert.Equal(c, links, "[\"/tlink1:/tlink2/tlink1\"]", check.Commentf("expected to have links between containers")) |
|
1160 | 1160 |
|
1161 | 1161 |
removeOptions := types.ContainerRemoveOptions{ |
1162 | 1162 |
RemoveLinks: true, |
... | ... |
@@ -1170,7 +1170,7 @@ func (s *DockerSuite) TestContainerAPIDeleteRemoveLinks(c *testing.T) { |
1170 | 1170 |
assert.NilError(c, err) |
1171 | 1171 |
|
1172 | 1172 |
linksPostRm := inspectFieldJSON(c, id2, "HostConfig.Links") |
1173 |
- assert.Assert(c, linksPostRm, checker.Equals, "null", check.Commentf("call to api deleteContainer links should have removed the specified links")) |
|
1173 |
+ assert.Equal(c, linksPostRm, "null", check.Commentf("call to api deleteContainer links should have removed the specified links")) |
|
1174 | 1174 |
} |
1175 | 1175 |
|
1176 | 1176 |
func (s *DockerSuite) TestContainerAPIDeleteConflict(c *testing.T) { |
... | ... |
@@ -1457,7 +1457,7 @@ func (s *DockerSuite) TestPostContainersCreateShmSizeHostConfigOmitted(c *testin |
1457 | 1457 |
containerJSON, err := cli.ContainerInspect(context.Background(), container.ID) |
1458 | 1458 |
assert.NilError(c, err) |
1459 | 1459 |
|
1460 |
- assert.Assert(c, containerJSON.HostConfig.ShmSize, checker.Equals, defaultSHMSize) |
|
1460 |
+ assert.Equal(c, containerJSON.HostConfig.ShmSize, defaultSHMSize) |
|
1461 | 1461 |
|
1462 | 1462 |
out, _ := dockerCmd(c, "start", "-i", containerJSON.ID) |
1463 | 1463 |
shmRegexp := regexp.MustCompile(`shm on /dev/shm type tmpfs(.*)size=65536k`) |
... | ... |
@@ -1484,7 +1484,7 @@ func (s *DockerSuite) TestPostContainersCreateShmSizeOmitted(c *testing.T) { |
1484 | 1484 |
containerJSON, err := cli.ContainerInspect(context.Background(), container.ID) |
1485 | 1485 |
assert.NilError(c, err) |
1486 | 1486 |
|
1487 |
- assert.Assert(c, containerJSON.HostConfig.ShmSize, checker.Equals, int64(67108864)) |
|
1487 |
+ assert.Equal(c, containerJSON.HostConfig.ShmSize, int64(67108864)) |
|
1488 | 1488 |
|
1489 | 1489 |
out, _ := dockerCmd(c, "start", "-i", containerJSON.ID) |
1490 | 1490 |
shmRegexp := regexp.MustCompile(`shm on /dev/shm type tmpfs(.*)size=65536k`) |
... | ... |
@@ -1515,7 +1515,7 @@ func (s *DockerSuite) TestPostContainersCreateWithShmSize(c *testing.T) { |
1515 | 1515 |
containerJSON, err := cli.ContainerInspect(context.Background(), container.ID) |
1516 | 1516 |
assert.NilError(c, err) |
1517 | 1517 |
|
1518 |
- assert.Assert(c, containerJSON.HostConfig.ShmSize, checker.Equals, int64(1073741824)) |
|
1518 |
+ assert.Equal(c, containerJSON.HostConfig.ShmSize, int64(1073741824)) |
|
1519 | 1519 |
|
1520 | 1520 |
out, _ := dockerCmd(c, "start", "-i", containerJSON.ID) |
1521 | 1521 |
shmRegex := regexp.MustCompile(`shm on /dev/shm type tmpfs(.*)size=1048576k`) |
... | ... |
@@ -1542,7 +1542,7 @@ func (s *DockerSuite) TestPostContainersCreateMemorySwappinessHostConfigOmitted( |
1542 | 1542 |
assert.NilError(c, err) |
1543 | 1543 |
|
1544 | 1544 |
if versions.LessThan(testEnv.DaemonAPIVersion(), "1.31") { |
1545 |
- assert.Assert(c, *containerJSON.HostConfig.MemorySwappiness, checker.Equals, int64(-1)) |
|
1545 |
+ assert.Equal(c, *containerJSON.HostConfig.MemorySwappiness, int64(-1)) |
|
1546 | 1546 |
} else { |
1547 | 1547 |
assert.Assert(c, containerJSON.HostConfig.MemorySwappiness, checker.IsNil) |
1548 | 1548 |
} |
... | ... |
@@ -17,7 +17,7 @@ func (s *DockerSwarmSuite) TestAPISwarmListNodes(c *testing.T) { |
17 | 17 |
d3 := s.AddDaemon(c, true, false) |
18 | 18 |
|
19 | 19 |
nodes := d1.ListNodes(c) |
20 |
- assert.Assert(c, len(nodes), checker.Equals, 3, check.Commentf("nodes: %#v", nodes)) |
|
20 |
+ assert.Equal(c, len(nodes), 3, check.Commentf("nodes: %#v", nodes)) |
|
21 | 21 |
|
22 | 22 |
loop0: |
23 | 23 |
for _, n := range nodes { |
... | ... |
@@ -40,7 +40,7 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeUpdate(c *testing.T) { |
40 | 40 |
}) |
41 | 41 |
|
42 | 42 |
n := d.GetNode(c, nodes[0].ID) |
43 |
- assert.Assert(c, n.Spec.Availability, checker.Equals, swarm.NodeAvailabilityPause) |
|
43 |
+ assert.Equal(c, n.Spec.Availability, swarm.NodeAvailabilityPause) |
|
44 | 44 |
} |
45 | 45 |
|
46 | 46 |
func (s *DockerSwarmSuite) TestAPISwarmNodeRemove(c *testing.T) { |
... | ... |
@@ -50,7 +50,7 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeRemove(c *testing.T) { |
50 | 50 |
_ = s.AddDaemon(c, true, false) |
51 | 51 |
|
52 | 52 |
nodes := d1.ListNodes(c) |
53 |
- assert.Assert(c, len(nodes), checker.Equals, 3, check.Commentf("nodes: %#v", nodes)) |
|
53 |
+ assert.Equal(c, len(nodes), 3, check.Commentf("nodes: %#v", nodes)) |
|
54 | 54 |
|
55 | 55 |
// Getting the info so we can take the NodeID |
56 | 56 |
d2Info := d2.SwarmInfo(c) |
... | ... |
@@ -59,7 +59,7 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeRemove(c *testing.T) { |
59 | 59 |
d1.RemoveNode(c, d2Info.NodeID, true) |
60 | 60 |
|
61 | 61 |
nodes = d1.ListNodes(c) |
62 |
- assert.Assert(c, len(nodes), checker.Equals, 2, check.Commentf("nodes: %#v", nodes)) |
|
62 |
+ assert.Equal(c, len(nodes), 2, check.Commentf("nodes: %#v", nodes)) |
|
63 | 63 |
|
64 | 64 |
// Restart the node that was removed |
65 | 65 |
d2.RestartNode(c) |
... | ... |
@@ -69,7 +69,7 @@ func (s *DockerSwarmSuite) TestAPISwarmNodeRemove(c *testing.T) { |
69 | 69 |
|
70 | 70 |
// Make sure the node didn't rejoin |
71 | 71 |
nodes = d1.ListNodes(c) |
72 |
- assert.Assert(c, len(nodes), checker.Equals, 2, check.Commentf("nodes: %#v", nodes)) |
|
72 |
+ assert.Equal(c, len(nodes), 2, check.Commentf("nodes: %#v", nodes)) |
|
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
func (s *DockerSwarmSuite) TestAPISwarmNodeDrainPause(c *testing.T) { |
... | ... |
@@ -157,13 +157,13 @@ func (s *DockerSuite) TestAttachDisconnect(c *testing.T) { |
157 | 157 |
assert.NilError(c, err) |
158 | 158 |
out, err = bufio.NewReader(stdout).ReadString('\n') |
159 | 159 |
assert.NilError(c, err) |
160 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "hello") |
|
160 |
+ assert.Equal(c, strings.TrimSpace(out), "hello") |
|
161 | 161 |
|
162 | 162 |
assert.Assert(c, stdin.Close(), checker.IsNil) |
163 | 163 |
|
164 | 164 |
// Expect container to still be running after stdin is closed |
165 | 165 |
running := inspectField(c, id, "State.Running") |
166 |
- assert.Assert(c, running, checker.Equals, "true") |
|
166 |
+ assert.Equal(c, running, "true") |
|
167 | 167 |
} |
168 | 168 |
|
169 | 169 |
func (s *DockerSuite) TestAttachPausedContainer(c *testing.T) { |
... | ... |
@@ -2082,7 +2082,7 @@ CMD ["cat", "/foo"]`), |
2082 | 2082 |
}).Assert(c, icmd.Success) |
2083 | 2083 |
|
2084 | 2084 |
res := inspectField(c, name, "Config.Cmd") |
2085 |
- assert.Assert(c, strings.TrimSpace(string(res)), checker.Equals, `[cat /foo]`) |
|
2085 |
+ assert.Equal(c, strings.TrimSpace(string(res)), `[cat /foo]`) |
|
2086 | 2086 |
} |
2087 | 2087 |
|
2088 | 2088 |
// FIXME(vdemeester) migrate to docker/cli tests (unit or e2e) |
... | ... |
@@ -2142,9 +2142,9 @@ COPY . /baz`), |
2142 | 2142 |
|
2143 | 2143 |
result = cli.DockerCmd(c, "run", "--rm", name, "ls", "-A", "/baz") |
2144 | 2144 |
if hasDockerignore && !ignoreDockerignore { |
2145 |
- assert.Assert(c, result.Stdout(), checker.Equals, ".dockerignore\nfoo\n") |
|
2145 |
+ assert.Equal(c, result.Stdout(), ".dockerignore\nfoo\n") |
|
2146 | 2146 |
} else { |
2147 |
- assert.Assert(c, result.Stdout(), checker.Equals, "foo\n") |
|
2147 |
+ assert.Equal(c, result.Stdout(), "foo\n") |
|
2148 | 2148 |
} |
2149 | 2149 |
} |
2150 | 2150 |
|
... | ... |
@@ -4178,7 +4178,7 @@ func (s *DockerSuite) TestBuildTimeArgHistoryExclusions(c *testing.T) { |
4178 | 4178 |
result.Assert(c, icmd.Expected{Out: fmt.Sprintf("%s=%s", explicitProxyKey, explicitProxyVal)}) |
4179 | 4179 |
|
4180 | 4180 |
cacheID := buildImage(imgName + "-two") |
4181 |
- assert.Assert(c, origID, checker.Equals, cacheID) |
|
4181 |
+ assert.Equal(c, origID, cacheID) |
|
4182 | 4182 |
} |
4183 | 4183 |
|
4184 | 4184 |
func (s *DockerSuite) TestBuildBuildTimeArgCacheHit(c *testing.T) { |
... | ... |
@@ -4373,7 +4373,7 @@ func (s *DockerSuite) TestBuildBuildTimeArgExpansion(c *testing.T) { |
4373 | 4373 |
) |
4374 | 4374 |
|
4375 | 4375 |
res := inspectField(c, imgName, "Config.WorkingDir") |
4376 |
- assert.Assert(c, filepath.ToSlash(res), checker.Equals, filepath.ToSlash(wdVal)) |
|
4376 |
+ assert.Equal(c, filepath.ToSlash(res), filepath.ToSlash(wdVal)) |
|
4377 | 4377 |
|
4378 | 4378 |
var resArr []string |
4379 | 4379 |
inspectFieldAndUnmarshall(c, imgName, "Config.Env", &resArr) |
... | ... |
@@ -4754,7 +4754,7 @@ func (s *DockerSuite) TestBuildMultipleTags(c *testing.T) { |
4754 | 4754 |
|
4755 | 4755 |
id1 := getIDByName(c, "tag1") |
4756 | 4756 |
id2 := getIDByName(c, "tag2:v2") |
4757 |
- assert.Assert(c, id1, checker.Equals, id2) |
|
4757 |
+ assert.Equal(c, id1, id2) |
|
4758 | 4758 |
} |
4759 | 4759 |
|
4760 | 4760 |
// #17290 |
... | ... |
@@ -4949,7 +4949,7 @@ func (s *DockerSuite) TestBuildLabelOneNode(c *testing.T) { |
4949 | 4949 |
if !ok { |
4950 | 4950 |
c.Fatal("label `foo` not found in image") |
4951 | 4951 |
} |
4952 |
- assert.Assert(c, v, checker.Equals, "bar") |
|
4952 |
+ assert.Equal(c, v, "bar") |
|
4953 | 4953 |
} |
4954 | 4954 |
|
4955 | 4955 |
func (s *DockerSuite) TestBuildLabelCacheCommit(c *testing.T) { |
... | ... |
@@ -5425,8 +5425,8 @@ func (s *DockerSuite) TestBuildCacheFromEqualDiffIDsLength(c *testing.T) { |
5425 | 5425 |
// rebuild with cache-from |
5426 | 5426 |
result := cli.BuildCmd(c, "build2", cli.WithFlags("--cache-from=build1"), build.WithExternalBuildContext(ctx)) |
5427 | 5427 |
id2 := getIDByName(c, "build2") |
5428 |
- assert.Assert(c, id1, checker.Equals, id2) |
|
5429 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 2) |
|
5428 |
+ assert.Equal(c, id1, id2) |
|
5429 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 2) |
|
5430 | 5430 |
} |
5431 | 5431 |
|
5432 | 5432 |
func (s *DockerSuite) TestBuildCacheFrom(c *testing.T) { |
... | ... |
@@ -5450,15 +5450,15 @@ func (s *DockerSuite) TestBuildCacheFrom(c *testing.T) { |
5450 | 5450 |
// rebuild with cache-from |
5451 | 5451 |
result := cli.BuildCmd(c, "build2", cli.WithFlags("--cache-from=build1"), build.WithExternalBuildContext(ctx)) |
5452 | 5452 |
id2 := getIDByName(c, "build2") |
5453 |
- assert.Assert(c, id1, checker.Equals, id2) |
|
5454 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 3) |
|
5453 |
+ assert.Equal(c, id1, id2) |
|
5454 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 3) |
|
5455 | 5455 |
cli.DockerCmd(c, "rmi", "build2") |
5456 | 5456 |
|
5457 | 5457 |
// no cache match with unknown source |
5458 | 5458 |
result = cli.BuildCmd(c, "build2", cli.WithFlags("--cache-from=nosuchtag"), build.WithExternalBuildContext(ctx)) |
5459 | 5459 |
id2 = getIDByName(c, "build2") |
5460 | 5460 |
assert.Assert(c, id1 != id2) |
5461 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 0) |
|
5461 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 0) |
|
5462 | 5462 |
cli.DockerCmd(c, "rmi", "build2") |
5463 | 5463 |
|
5464 | 5464 |
// clear parent images |
... | ... |
@@ -5472,23 +5472,23 @@ func (s *DockerSuite) TestBuildCacheFrom(c *testing.T) { |
5472 | 5472 |
cli.DockerCmd(c, "rmi", "build1") |
5473 | 5473 |
cli.DockerCmd(c, "load", "-i", tempFile) |
5474 | 5474 |
parentID := cli.DockerCmd(c, "inspect", "-f", "{{.Parent}}", "build1").Combined() |
5475 |
- assert.Assert(c, strings.TrimSpace(parentID), checker.Equals, "") |
|
5475 |
+ assert.Equal(c, strings.TrimSpace(parentID), "") |
|
5476 | 5476 |
|
5477 | 5477 |
// cache still applies without parents |
5478 | 5478 |
result = cli.BuildCmd(c, "build2", cli.WithFlags("--cache-from=build1"), build.WithExternalBuildContext(ctx)) |
5479 | 5479 |
id2 = getIDByName(c, "build2") |
5480 |
- assert.Assert(c, id1, checker.Equals, id2) |
|
5481 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 3) |
|
5480 |
+ assert.Equal(c, id1, id2) |
|
5481 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 3) |
|
5482 | 5482 |
history1 := cli.DockerCmd(c, "history", "-q", "build2").Combined() |
5483 | 5483 |
|
5484 | 5484 |
// Retry, no new intermediate images |
5485 | 5485 |
result = cli.BuildCmd(c, "build3", cli.WithFlags("--cache-from=build1"), build.WithExternalBuildContext(ctx)) |
5486 | 5486 |
id3 := getIDByName(c, "build3") |
5487 |
- assert.Assert(c, id1, checker.Equals, id3) |
|
5488 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 3) |
|
5487 |
+ assert.Equal(c, id1, id3) |
|
5488 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 3) |
|
5489 | 5489 |
history2 := cli.DockerCmd(c, "history", "-q", "build3").Combined() |
5490 | 5490 |
|
5491 |
- assert.Assert(c, history1, checker.Equals, history2) |
|
5491 |
+ assert.Equal(c, history1, history2) |
|
5492 | 5492 |
cli.DockerCmd(c, "rmi", "build2") |
5493 | 5493 |
cli.DockerCmd(c, "rmi", "build3") |
5494 | 5494 |
cli.DockerCmd(c, "rmi", "build1") |
... | ... |
@@ -5506,7 +5506,7 @@ func (s *DockerSuite) TestBuildCacheFrom(c *testing.T) { |
5506 | 5506 |
result = cli.BuildCmd(c, "build2", cli.WithFlags("--cache-from=build1"), build.WithExternalBuildContext(ctx)) |
5507 | 5507 |
id2 = getIDByName(c, "build2") |
5508 | 5508 |
assert.Assert(c, id1 != id2) |
5509 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 2) |
|
5509 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 2) |
|
5510 | 5510 |
|
5511 | 5511 |
layers1Str := cli.DockerCmd(c, "inspect", "-f", "{{json .RootFS.Layers}}", "build1").Combined() |
5512 | 5512 |
layers2Str := cli.DockerCmd(c, "inspect", "-f", "{{json .RootFS.Layers}}", "build2").Combined() |
... | ... |
@@ -5516,9 +5516,9 @@ func (s *DockerSuite) TestBuildCacheFrom(c *testing.T) { |
5516 | 5516 |
assert.Assert(c, json.Unmarshal([]byte(layers1Str), &layers1), checker.IsNil) |
5517 | 5517 |
assert.Assert(c, json.Unmarshal([]byte(layers2Str), &layers2), checker.IsNil) |
5518 | 5518 |
|
5519 |
- assert.Assert(c, len(layers1), checker.Equals, len(layers2)) |
|
5519 |
+ assert.Equal(c, len(layers1), len(layers2)) |
|
5520 | 5520 |
for i := 0; i < len(layers1)-1; i++ { |
5521 |
- assert.Assert(c, layers1[i], checker.Equals, layers2[i]) |
|
5521 |
+ assert.Equal(c, layers1[i], layers2[i]) |
|
5522 | 5522 |
} |
5523 | 5523 |
assert.Assert(c, layers1[len(layers1)-1] != layers2[len(layers1)-1]) |
5524 | 5524 |
} |
... | ... |
@@ -5540,11 +5540,11 @@ func (s *DockerSuite) TestBuildMultiStageCache(c *testing.T) { |
5540 | 5540 |
|
5541 | 5541 |
result := cli.BuildCmd(c, "build1", build.WithExternalBuildContext(ctx)) |
5542 | 5542 |
// second part of dockerfile was a repeat of first so should be cached |
5543 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 1) |
|
5543 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 1) |
|
5544 | 5544 |
|
5545 | 5545 |
result = cli.BuildCmd(c, "build2", cli.WithFlags("--cache-from=build1"), build.WithExternalBuildContext(ctx)) |
5546 | 5546 |
// now both parts of dockerfile should be cached |
5547 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 2) |
|
5547 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 2) |
|
5548 | 5548 |
} |
5549 | 5549 |
|
5550 | 5550 |
func (s *DockerSuite) TestBuildNetNone(c *testing.T) { |
... | ... |
@@ -5572,7 +5572,7 @@ func (s *DockerSuite) TestBuildNetContainer(c *testing.T) { |
5572 | 5572 |
`)) |
5573 | 5573 |
|
5574 | 5574 |
host, _ := dockerCmd(c, "run", "testbuildnetcontainer", "cat", "/otherhost") |
5575 |
- assert.Assert(c, strings.TrimSpace(host), checker.Equals, "foobar") |
|
5575 |
+ assert.Equal(c, strings.TrimSpace(host), "foobar") |
|
5576 | 5576 |
} |
5577 | 5577 |
|
5578 | 5578 |
func (s *DockerSuite) TestBuildWithExtraHost(c *testing.T) { |
... | ... |
@@ -5681,22 +5681,22 @@ func (s *DockerSuite) TestBuildMultiStageCopyFromSyntax(c *testing.T) { |
5681 | 5681 |
result := cli.BuildCmd(c, "build2", build.WithExternalBuildContext(ctx)) |
5682 | 5682 |
|
5683 | 5683 |
// all commands should be cached |
5684 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 7) |
|
5685 |
- assert.Assert(c, getIDByName(c, "build1"), checker.Equals, getIDByName(c, "build2")) |
|
5684 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 7) |
|
5685 |
+ assert.Equal(c, getIDByName(c, "build1"), getIDByName(c, "build2")) |
|
5686 | 5686 |
|
5687 | 5687 |
err := ioutil.WriteFile(filepath.Join(ctx.Dir, "Dockerfile"), []byte(fmt.Sprintf(dockerfile, "COPY baz/aa foo")), 0644) |
5688 | 5688 |
assert.NilError(c, err) |
5689 | 5689 |
|
5690 | 5690 |
// changing file in parent block should not affect last block |
5691 | 5691 |
result = cli.BuildCmd(c, "build3", build.WithExternalBuildContext(ctx)) |
5692 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 5) |
|
5692 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 5) |
|
5693 | 5693 |
|
5694 | 5694 |
err = ioutil.WriteFile(filepath.Join(ctx.Dir, "foo"), []byte("pqr"), 0644) |
5695 | 5695 |
assert.NilError(c, err) |
5696 | 5696 |
|
5697 | 5697 |
// changing file in parent block should affect both first and last block |
5698 | 5698 |
result = cli.BuildCmd(c, "build4", build.WithExternalBuildContext(ctx)) |
5699 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 5) |
|
5699 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 5) |
|
5700 | 5700 |
|
5701 | 5701 |
cli.DockerCmd(c, "run", "build4", "cat", "bay").Assert(c, icmd.Expected{Out: "pqr"}) |
5702 | 5702 |
cli.DockerCmd(c, "run", "build4", "cat", "baz").Assert(c, icmd.Expected{Out: "pqr"}) |
... | ... |
@@ -5777,9 +5777,9 @@ func (s *DockerSuite) TestBuildMultiStageMultipleBuilds(c *testing.T) { |
5777 | 5777 |
cli.BuildCmd(c, "build2", build.WithExternalBuildContext(ctx)) |
5778 | 5778 |
|
5779 | 5779 |
out := cli.DockerCmd(c, "run", "build2", "cat", "bar").Combined() |
5780 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "abc") |
|
5780 |
+ assert.Equal(c, strings.TrimSpace(out), "abc") |
|
5781 | 5781 |
out = cli.DockerCmd(c, "run", "build2", "cat", "foo").Combined() |
5782 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "def") |
|
5782 |
+ assert.Equal(c, strings.TrimSpace(out), "def") |
|
5783 | 5783 |
} |
5784 | 5784 |
|
5785 | 5785 |
func (s *DockerSuite) TestBuildMultiStageImplicitFrom(c *testing.T) { |
... | ... |
@@ -5893,9 +5893,9 @@ func (s *DockerSuite) TestBuildMultiStageMultipleBuildsWindows(c *testing.T) { |
5893 | 5893 |
cli.BuildCmd(c, "build2", build.WithExternalBuildContext(ctx)) |
5894 | 5894 |
|
5895 | 5895 |
out := cli.DockerCmd(c, "run", "build2", "cmd.exe", "/s", "/c", "type", "c:\\bar").Combined() |
5896 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "abc") |
|
5896 |
+ assert.Equal(c, strings.TrimSpace(out), "abc") |
|
5897 | 5897 |
out = cli.DockerCmd(c, "run", "build2", "cmd.exe", "/s", "/c", "type", "c:\\foo").Combined() |
5898 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "def") |
|
5898 |
+ assert.Equal(c, strings.TrimSpace(out), "def") |
|
5899 | 5899 |
} |
5900 | 5900 |
|
5901 | 5901 |
func (s *DockerSuite) TestBuildCopyFromForbidWindowsSystemPaths(c *testing.T) { |
... | ... |
@@ -5969,7 +5969,7 @@ func (s *DockerSuite) TestBuildMultiStageResetScratch(c *testing.T) { |
5969 | 5969 |
cli.BuildCmd(c, "build1", build.WithExternalBuildContext(ctx)) |
5970 | 5970 |
|
5971 | 5971 |
res := cli.InspectCmd(c, "build1", cli.Format(".Config.WorkingDir")).Combined() |
5972 |
- assert.Assert(c, strings.TrimSpace(res), checker.Equals, "") |
|
5972 |
+ assert.Equal(c, strings.TrimSpace(res), "") |
|
5973 | 5973 |
} |
5974 | 5974 |
|
5975 | 5975 |
func (s *DockerSuite) TestBuildIntermediateTarget(c *testing.T) { |
... | ... |
@@ -5990,14 +5990,14 @@ func (s *DockerSuite) TestBuildIntermediateTarget(c *testing.T) { |
5990 | 5990 |
cli.WithFlags("--target", "build-env")) |
5991 | 5991 |
|
5992 | 5992 |
res := cli.InspectCmd(c, "build1", cli.Format("json .Config.Cmd")).Combined() |
5993 |
- assert.Assert(c, strings.TrimSpace(res), checker.Equals, `["/dev"]`) |
|
5993 |
+ assert.Equal(c, strings.TrimSpace(res), `["/dev"]`) |
|
5994 | 5994 |
|
5995 | 5995 |
// Stage name is case-insensitive by design |
5996 | 5996 |
cli.BuildCmd(c, "build1", build.WithExternalBuildContext(ctx), |
5997 | 5997 |
cli.WithFlags("--target", "BUIld-EnV")) |
5998 | 5998 |
|
5999 | 5999 |
res = cli.InspectCmd(c, "build1", cli.Format("json .Config.Cmd")).Combined() |
6000 |
- assert.Assert(c, strings.TrimSpace(res), checker.Equals, `["/dev"]`) |
|
6000 |
+ assert.Equal(c, strings.TrimSpace(res), `["/dev"]`) |
|
6001 | 6001 |
|
6002 | 6002 |
result := cli.Docker(cli.Build("build1"), build.WithExternalBuildContext(ctx), |
6003 | 6003 |
cli.WithFlags("--target", "nosuchtarget")) |
... | ... |
@@ -6100,7 +6100,7 @@ func (s *DockerSuite) TestBuildWorkdirCmd(c *testing.T) { |
6100 | 6100 |
buildImageSuccessfully(c, name, build.WithDockerfile(dockerFile)) |
6101 | 6101 |
result := buildImage(name, build.WithDockerfile(dockerFile)) |
6102 | 6102 |
result.Assert(c, icmd.Success) |
6103 |
- assert.Assert(c, strings.Count(result.Combined(), "Using cache"), checker.Equals, 1) |
|
6103 |
+ assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 1) |
|
6104 | 6104 |
} |
6105 | 6105 |
|
6106 | 6106 |
// FIXME(vdemeester) should be a unit test |
... | ... |
@@ -6200,7 +6200,7 @@ ENV BAR BAZ`), |
6200 | 6200 |
assert.NilError(c, err) |
6201 | 6201 |
d, err := digest.Parse(string(id)) |
6202 | 6202 |
assert.NilError(c, err) |
6203 |
- assert.Assert(c, d.String(), checker.Equals, getIDByName(c, name)) |
|
6203 |
+ assert.Equal(c, d.String(), getIDByName(c, name)) |
|
6204 | 6204 |
} |
6205 | 6205 |
|
6206 | 6206 |
// FIXME(vdemeester) should migrate to docker/cli tests |
... | ... |
@@ -6223,5 +6223,5 @@ func (s *DockerSuite) TestBuildIidFileCleanupOnFail(c *testing.T) { |
6223 | 6223 |
}) |
6224 | 6224 |
_, err = os.Stat(tmpIidFile) |
6225 | 6225 |
assert.ErrorContains(c, err, "") |
6226 |
- assert.Assert(c, os.IsNotExist(err), checker.Equals, true) |
|
6226 |
+ assert.Equal(c, os.IsNotExist(err), true) |
|
6227 | 6227 |
} |
... | ... |
@@ -58,14 +58,14 @@ func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *testing.T) { |
58 | 58 |
err := json.Unmarshal([]byte(cfg), &c1) |
59 | 59 |
assert.Assert(c, err, checker.IsNil, check.Commentf(cfg)) |
60 | 60 |
|
61 |
- assert.Assert(c, c1.Memory, checker.Equals, int64(64*1024*1024), check.Commentf("resource constraints not set properly for Memory")) |
|
62 |
- assert.Assert(c, c1.MemorySwap, checker.Equals, int64(-1), check.Commentf("resource constraints not set properly for MemorySwap")) |
|
63 |
- assert.Assert(c, c1.CpusetCpus, checker.Equals, "0", check.Commentf("resource constraints not set properly for CpusetCpus")) |
|
64 |
- assert.Assert(c, c1.CpusetMems, checker.Equals, "0", check.Commentf("resource constraints not set properly for CpusetMems")) |
|
65 |
- assert.Assert(c, c1.CPUShares, checker.Equals, int64(100), check.Commentf("resource constraints not set properly for CPUShares")) |
|
66 |
- assert.Assert(c, c1.CPUQuota, checker.Equals, int64(8000), check.Commentf("resource constraints not set properly for CPUQuota")) |
|
67 |
- assert.Assert(c, c1.Ulimits[0].Name, checker.Equals, "nofile", check.Commentf("resource constraints not set properly for Ulimits")) |
|
68 |
- assert.Assert(c, c1.Ulimits[0].Hard, checker.Equals, int64(42), check.Commentf("resource constraints not set properly for Ulimits")) |
|
61 |
+ assert.Equal(c, c1.Memory, int64(64*1024*1024), check.Commentf("resource constraints not set properly for Memory")) |
|
62 |
+ assert.Equal(c, c1.MemorySwap, int64(-1), check.Commentf("resource constraints not set properly for MemorySwap")) |
|
63 |
+ assert.Equal(c, c1.CpusetCpus, "0", check.Commentf("resource constraints not set properly for CpusetCpus")) |
|
64 |
+ assert.Equal(c, c1.CpusetMems, "0", check.Commentf("resource constraints not set properly for CpusetMems")) |
|
65 |
+ assert.Equal(c, c1.CPUShares, int64(100), check.Commentf("resource constraints not set properly for CPUShares")) |
|
66 |
+ assert.Equal(c, c1.CPUQuota, int64(8000), check.Commentf("resource constraints not set properly for CPUQuota")) |
|
67 |
+ assert.Equal(c, c1.Ulimits[0].Name, "nofile", check.Commentf("resource constraints not set properly for Ulimits")) |
|
68 |
+ assert.Equal(c, c1.Ulimits[0].Hard, int64(42), check.Commentf("resource constraints not set properly for Ulimits")) |
|
69 | 69 |
|
70 | 70 |
// Make sure constraints aren't saved to image |
71 | 71 |
cli.DockerCmd(c, "run", "--name=test", name) |
... | ... |
@@ -73,7 +73,7 @@ func testPullByTagDisplaysDigest(c *testing.T) { |
73 | 73 |
pullDigest := matches[1] |
74 | 74 |
|
75 | 75 |
// make sure the pushed and pull digests match |
76 |
- assert.Assert(c, pushDigest.String(), checker.Equals, pullDigest) |
|
76 |
+ assert.Equal(c, pushDigest.String(), pullDigest) |
|
77 | 77 |
} |
78 | 78 |
|
79 | 79 |
func (s *DockerRegistrySuite) TestPullByTagDisplaysDigest(c *testing.T) { |
... | ... |
@@ -99,7 +99,7 @@ func testPullByDigest(c *testing.T) { |
99 | 99 |
pullDigest := matches[1] |
100 | 100 |
|
101 | 101 |
// make sure the pushed and pull digests match |
102 |
- assert.Assert(c, pushDigest.String(), checker.Equals, pullDigest) |
|
102 |
+ assert.Equal(c, pushDigest.String(), pullDigest) |
|
103 | 103 |
} |
104 | 104 |
|
105 | 105 |
func (s *DockerRegistrySuite) TestPullByDigest(c *testing.T) { |
... | ... |
@@ -152,7 +152,7 @@ func (s *DockerRegistrySuite) TestRunByDigest(c *testing.T) { |
152 | 152 |
foundRegex := regexp.MustCompile("found=([^\n]+)") |
153 | 153 |
matches := foundRegex.FindStringSubmatch(out) |
154 | 154 |
assert.Assert(c, matches, checker.HasLen, 2, check.Commentf("unable to parse digest from pull output: %s", out)) |
155 |
- assert.Assert(c, matches[1], checker.Equals, "1", check.Commentf("Expected %q, got %q", "1", matches[1])) |
|
155 |
+ assert.Equal(c, matches[1], "1", check.Commentf("Expected %q, got %q", "1", matches[1])) |
|
156 | 156 |
|
157 | 157 |
res := inspectField(c, containerName, "Config.Image") |
158 | 158 |
assert.Equal(c, res, imageReference) |
... | ... |
@@ -61,7 +61,7 @@ func (s *DockerSuite) TestCommitNewFile(c *testing.T) { |
61 | 61 |
|
62 | 62 |
out, _ := dockerCmd(c, "run", imageID, "cat", "/foo") |
63 | 63 |
actual := strings.TrimSpace(out) |
64 |
- assert.Assert(c, actual, checker.Equals, "koye") |
|
64 |
+ assert.Equal(c, actual, "koye") |
|
65 | 65 |
} |
66 | 66 |
|
67 | 67 |
func (s *DockerSuite) TestCommitHardlink(c *testing.T) { |
... | ... |
@@ -161,7 +161,7 @@ func (s *DockerSuite) TestCommitChangeLabels(c *testing.T) { |
161 | 161 |
"test", "test-commit") |
162 | 162 |
imageID = strings.TrimSpace(imageID) |
163 | 163 |
|
164 |
- assert.Assert(c, inspectField(c, imageID, "Config.Labels"), checker.Equals, "map[some:label2]") |
|
164 |
+ assert.Equal(c, inspectField(c, imageID, "Config.Labels"), "map[some:label2]") |
|
165 | 165 |
// check that container labels didn't change |
166 |
- assert.Assert(c, inspectField(c, "test", "Config.Labels"), checker.Equals, "map[some:label]") |
|
166 |
+ assert.Equal(c, inspectField(c, "test", "Config.Labels"), "map[some:label]") |
|
167 | 167 |
} |
... | ... |
@@ -41,7 +41,7 @@ func (s *DockerSuite) TestCreateArgs(c *testing.T) { |
41 | 41 |
assert.Equal(c, len(containers), 1) |
42 | 42 |
|
43 | 43 |
cont := containers[0] |
44 |
- assert.Assert(c, string(cont.Path), checker.Equals, "command", check.Commentf("Unexpected container path. Expected command, received: %s", cont.Path)) |
|
44 |
+ assert.Equal(c, string(cont.Path), "command", check.Commentf("Unexpected container path. Expected command, received: %s", cont.Path)) |
|
45 | 45 |
|
46 | 46 |
b := false |
47 | 47 |
expected := []string{"arg1", "arg2", "arg with space", "-c", "flags"} |
... | ... |
@@ -68,7 +68,7 @@ func (s *DockerSuite) TestCreateGrowRootfs(c *testing.T) { |
68 | 68 |
cleanedContainerID := strings.TrimSpace(out) |
69 | 69 |
|
70 | 70 |
inspectOut := inspectField(c, cleanedContainerID, "HostConfig.StorageOpt") |
71 |
- assert.Assert(c, inspectOut, checker.Equals, "map[size:120G]") |
|
71 |
+ assert.Equal(c, inspectOut, "map[size:120G]") |
|
72 | 72 |
} |
73 | 73 |
|
74 | 74 |
// Make sure we cannot shrink the container's rootfs at creation time. |
... | ... |
@@ -127,7 +127,7 @@ func (s *DockerSuite) TestCreateWithPortRange(c *testing.T) { |
127 | 127 |
|
128 | 128 |
for k, v := range cont.HostConfig.PortBindings { |
129 | 129 |
assert.Assert(c, v, checker.HasLen, 1, check.Commentf("Expected 1 ports binding, for the port %s but found %s", k, v)) |
130 |
- assert.Assert(c, k.Port(), checker.Equals, v[0].HostPort, check.Commentf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort)) |
|
130 |
+ assert.Equal(c, k.Port(), v[0].HostPort, check.Commentf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort)) |
|
131 | 131 |
|
132 | 132 |
} |
133 | 133 |
|
... | ... |
@@ -156,7 +156,7 @@ func (s *DockerSuite) TestCreateWithLargePortRange(c *testing.T) { |
156 | 156 |
|
157 | 157 |
for k, v := range cont.HostConfig.PortBindings { |
158 | 158 |
assert.Assert(c, v, checker.HasLen, 1) |
159 |
- assert.Assert(c, k.Port(), checker.Equals, v[0].HostPort, check.Commentf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort)) |
|
159 |
+ assert.Equal(c, k.Port(), v[0].HostPort, check.Commentf("Expected host port %s to match published port %s", k.Port(), v[0].HostPort)) |
|
160 | 160 |
} |
161 | 161 |
|
162 | 162 |
} |
... | ... |
@@ -364,7 +364,7 @@ exec "$@"`, |
364 | 364 |
id := strings.TrimSpace(out) |
365 | 365 |
assert.Assert(c, id != "") |
366 | 366 |
out = cli.DockerCmd(c, "start", "-a", id).Combined() |
367 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "foo") |
|
367 |
+ assert.Equal(c, strings.TrimSpace(out), "foo") |
|
368 | 368 |
} |
369 | 369 |
|
370 | 370 |
// #22471 |
... | ... |
@@ -136,7 +136,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartUnlessStopped(c *testing.T) { |
136 | 136 |
} else { |
137 | 137 |
format = "%scontainer %q is running" |
138 | 138 |
} |
139 |
- assert.Assert(c, strings.Contains(out, name), checker.Equals, shouldRun, check.Commentf(format, prefix, name)) |
|
139 |
+ assert.Equal(c, strings.Contains(out, name), shouldRun, check.Commentf(format, prefix, name)) |
|
140 | 140 |
} |
141 | 141 |
} |
142 | 142 |
|
... | ... |
@@ -245,7 +245,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithIncreasedBasesize(c *testing.T) |
245 | 245 |
basesizeAfterRestart := getBaseDeviceSize(c, s.d) |
246 | 246 |
newBasesize, err := convertBasesize(newBasesizeBytes) |
247 | 247 |
assert.Assert(c, err, checker.IsNil, check.Commentf("Error in converting base device size: %v", err)) |
248 |
- assert.Assert(c, newBasesize, checker.Equals, basesizeAfterRestart, check.Commentf("Basesize passed is not equal to Basesize set")) |
|
248 |
+ assert.Equal(c, newBasesize, basesizeAfterRestart, check.Commentf("Basesize passed is not equal to Basesize set")) |
|
249 | 249 |
s.d.Stop(c) |
250 | 250 |
} |
251 | 251 |
|
... | ... |
@@ -439,7 +439,7 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDR(c *testing.T) { |
439 | 439 |
out, err = s.d.Cmd("inspect", "--format", "{{.NetworkSettings.Networks.bridge.IPv6Gateway}}", "ipv6test") |
440 | 440 |
assert.NilError(c, err, out) |
441 | 441 |
|
442 |
- assert.Assert(c, strings.Trim(out, " \r\n'"), checker.Equals, "2001:db8:2::100", check.Commentf("Container should have a global IPv6 gateway")) |
|
442 |
+ assert.Equal(c, strings.Trim(out, " \r\n'"), "2001:db8:2::100", check.Commentf("Container should have a global IPv6 gateway")) |
|
443 | 443 |
} |
444 | 444 |
|
445 | 445 |
// TestDaemonIPv6FixedCIDRAndMac checks that when the daemon is started with ipv6 fixed CIDR |
... | ... |
@@ -458,7 +458,7 @@ func (s *DockerDaemonSuite) TestDaemonIPv6FixedCIDRAndMac(c *testing.T) { |
458 | 458 |
|
459 | 459 |
out, err = s.d.Cmd("inspect", "--format", "{{.NetworkSettings.Networks.bridge.GlobalIPv6Address}}", "ipv6test") |
460 | 460 |
assert.NilError(c, err, out) |
461 |
- assert.Assert(c, strings.Trim(out, " \r\n'"), checker.Equals, "2001:db8:1::aabb:ccdd:eeff") |
|
461 |
+ assert.Equal(c, strings.Trim(out, " \r\n'"), "2001:db8:1::aabb:ccdd:eeff") |
|
462 | 462 |
} |
463 | 463 |
|
464 | 464 |
// TestDaemonIPv6HostMode checks that when the running a container with |
... | ... |
@@ -679,7 +679,7 @@ func (s *DockerDaemonSuite) TestDaemonBridgeIP(c *testing.T) { |
679 | 679 |
|
680 | 680 |
containerIP := d.FindContainerIP(c, "test") |
681 | 681 |
ip = net.ParseIP(containerIP) |
682 |
- assert.Assert(c, bridgeIPNet.Contains(ip), checker.Equals, true, check.Commentf("Container IP-Address must be in the same subnet range : %s", containerIP)) |
|
682 |
+ assert.Equal(c, bridgeIPNet.Contains(ip), true, check.Commentf("Container IP-Address must be in the same subnet range : %s", containerIP)) |
|
683 | 683 |
deleteInterface(c, defaultNetworkBridge) |
684 | 684 |
} |
685 | 685 |
|
... | ... |
@@ -783,7 +783,7 @@ func (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4Implicit(c *testing.T) { |
783 | 783 |
expectedMessage := fmt.Sprintf("default via %s dev", bridgeIP) |
784 | 784 |
out, err := d.Cmd("run", "busybox", "ip", "-4", "route", "list", "0/0") |
785 | 785 |
assert.NilError(c, err, out) |
786 |
- assert.Assert(c, strings.Contains(out, expectedMessage), checker.Equals, true, check.Commentf("Implicit default gateway should be bridge IP %s, but default route was '%s'", bridgeIP, strings.TrimSpace(out))) |
|
786 |
+ assert.Equal(c, strings.Contains(out, expectedMessage), true, check.Commentf("Implicit default gateway should be bridge IP %s, but default route was '%s'", bridgeIP, strings.TrimSpace(out))) |
|
787 | 787 |
deleteInterface(c, defaultNetworkBridge) |
788 | 788 |
} |
789 | 789 |
|
... | ... |
@@ -803,7 +803,7 @@ func (s *DockerDaemonSuite) TestDaemonDefaultGatewayIPv4Explicit(c *testing.T) { |
803 | 803 |
expectedMessage := fmt.Sprintf("default via %s dev", gatewayIP) |
804 | 804 |
out, err := d.Cmd("run", "busybox", "ip", "-4", "route", "list", "0/0") |
805 | 805 |
assert.NilError(c, err, out) |
806 |
- assert.Assert(c, strings.Contains(out, expectedMessage), checker.Equals, true, check.Commentf("Explicit default gateway should be %s, but default route was '%s'", gatewayIP, strings.TrimSpace(out))) |
|
806 |
+ assert.Equal(c, strings.Contains(out, expectedMessage), true, check.Commentf("Explicit default gateway should be %s, but default route was '%s'", gatewayIP, strings.TrimSpace(out))) |
|
807 | 807 |
deleteInterface(c, defaultNetworkBridge) |
808 | 808 |
} |
809 | 809 |
|
... | ... |
@@ -845,7 +845,7 @@ func (s *DockerDaemonSuite) TestDaemonIP(c *testing.T) { |
845 | 845 |
|
846 | 846 |
out, err := d.Cmd("run", "-d", "-p", "8000:8000", "busybox", "top") |
847 | 847 |
assert.Assert(c, err, checker.NotNil, check.Commentf("Running a container must fail with an invalid --ip option")) |
848 |
- assert.Assert(c, strings.Contains(out, "Error starting userland proxy"), checker.Equals, true) |
|
848 |
+ assert.Equal(c, strings.Contains(out, "Error starting userland proxy"), true) |
|
849 | 849 |
|
850 | 850 |
ifName := "dummy" |
851 | 851 |
createInterface(c, "dummy", ifName, ipStr) |
... | ... |
@@ -858,7 +858,7 @@ func (s *DockerDaemonSuite) TestDaemonIP(c *testing.T) { |
858 | 858 |
result.Assert(c, icmd.Success) |
859 | 859 |
regex := fmt.Sprintf("DNAT.*%s.*dpt:8000", ip.String()) |
860 | 860 |
matched, _ := regexp.MatchString(regex, result.Combined()) |
861 |
- assert.Assert(c, matched, checker.Equals, true, check.Commentf("iptables output should have contained %q, but was %q", regex, result.Combined())) |
|
861 |
+ assert.Equal(c, matched, true, check.Commentf("iptables output should have contained %q, but was %q", regex, result.Combined())) |
|
862 | 862 |
} |
863 | 863 |
|
864 | 864 |
func (s *DockerDaemonSuite) TestDaemonICCPing(c *testing.T) { |
... | ... |
@@ -878,7 +878,7 @@ func (s *DockerDaemonSuite) TestDaemonICCPing(c *testing.T) { |
878 | 878 |
result.Assert(c, icmd.Success) |
879 | 879 |
regex := fmt.Sprintf("DROP.*all.*%s.*%s", bridgeName, bridgeName) |
880 | 880 |
matched, _ := regexp.MatchString(regex, result.Combined()) |
881 |
- assert.Assert(c, matched, checker.Equals, true, check.Commentf("iptables output should have contained %q, but was %q", regex, result.Combined())) |
|
881 |
+ assert.Equal(c, matched, true, check.Commentf("iptables output should have contained %q, but was %q", regex, result.Combined())) |
|
882 | 882 |
// Pinging another container must fail with --icc=false |
883 | 883 |
pingContainers(c, d, true) |
884 | 884 |
|
... | ... |
@@ -911,7 +911,7 @@ func (s *DockerDaemonSuite) TestDaemonICCLinkExpose(c *testing.T) { |
911 | 911 |
result.Assert(c, icmd.Success) |
912 | 912 |
regex := fmt.Sprintf("DROP.*all.*%s.*%s", bridgeName, bridgeName) |
913 | 913 |
matched, _ := regexp.MatchString(regex, result.Combined()) |
914 |
- assert.Assert(c, matched, checker.Equals, true, check.Commentf("iptables output should have contained %q, but was %q", regex, result.Combined())) |
|
914 |
+ assert.Equal(c, matched, true, check.Commentf("iptables output should have contained %q, but was %q", regex, result.Combined())) |
|
915 | 915 |
out, err := d.Cmd("run", "-d", "--expose", "4567", "--name", "icc1", "busybox", "nc", "-l", "-p", "4567") |
916 | 916 |
assert.NilError(c, err, out) |
917 | 917 |
|
... | ... |
@@ -1152,7 +1152,7 @@ func (s *DockerDaemonSuite) TestDaemonLoggingDriverShouldBeIgnoredForBuild(c *te |
1152 | 1152 |
) |
1153 | 1153 |
comment := check.Commentf("Failed to build image. output %s, exitCode %d, err %v", result.Combined(), result.ExitCode, result.Error) |
1154 | 1154 |
assert.Assert(c, result.Error, checker.IsNil, comment) |
1155 |
- assert.Assert(c, result.ExitCode, checker.Equals, 0, comment) |
|
1155 |
+ assert.Equal(c, result.ExitCode, 0, comment) |
|
1156 | 1156 |
assert.Assert(c, result.Combined(), checker.Contains, "foo", comment) |
1157 | 1157 |
} |
1158 | 1158 |
|
... | ... |
@@ -1569,7 +1569,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithContainerWithRestartPolicyAlway |
1569 | 1569 |
|
1570 | 1570 |
out, err = s.d.Cmd("ps", "-q") |
1571 | 1571 |
assert.NilError(c, err, out) |
1572 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, id[:12]) |
|
1572 |
+ assert.Equal(c, strings.TrimSpace(out), id[:12]) |
|
1573 | 1573 |
} |
1574 | 1574 |
|
1575 | 1575 |
func (s *DockerDaemonSuite) TestDaemonWideLogConfig(c *testing.T) { |
... | ... |
@@ -1889,7 +1889,7 @@ func (s *DockerDaemonSuite) TestDaemonRestartWithLinks(c *testing.T) { |
1889 | 1889 |
assert.NilError(c, err, out) |
1890 | 1890 |
out, err = s.d.Cmd("start", "-a", "test2") |
1891 | 1891 |
assert.NilError(c, err, out) |
1892 |
- assert.Assert(c, strings.Contains(out, "1 packets transmitted, 1 packets received"), checker.Equals, true, check.Commentf("%s", out)) |
|
1892 |
+ assert.Equal(c, strings.Contains(out, "1 packets transmitted, 1 packets received"), true, check.Commentf("%s", out)) |
|
1893 | 1893 |
} |
1894 | 1894 |
|
1895 | 1895 |
func (s *DockerDaemonSuite) TestDaemonRestartWithNames(c *testing.T) { |
... | ... |
@@ -2033,7 +2033,7 @@ func (s *DockerDaemonSuite) TestCleanupMountsAfterDaemonCrash(c *testing.T) { |
2033 | 2033 |
mountOut, err = ioutil.ReadFile("/proc/self/mountinfo") |
2034 | 2034 |
assert.Assert(c, err, checker.IsNil, check.Commentf("Output: %s", mountOut)) |
2035 | 2035 |
comment := check.Commentf("%s is still mounted from older daemon start:\nDaemon root repository %s\n%s", id, s.d.Root, mountOut) |
2036 |
- assert.Assert(c, strings.Contains(string(mountOut), id), checker.Equals, false, comment) |
|
2036 |
+ assert.Equal(c, strings.Contains(string(mountOut), id), false, comment) |
|
2037 | 2037 |
} |
2038 | 2038 |
|
2039 | 2039 |
// TestDaemonRestartWithUnpausedRunningContainer requires live restore of running containers. |
... | ... |
@@ -2370,7 +2370,7 @@ func (s *DockerDaemonSuite) TestBuildOnDisabledBridgeNetworkDaemon(c *testing.T) |
2370 | 2370 |
) |
2371 | 2371 |
comment := check.Commentf("Failed to build image. output %s, exitCode %d, err %v", result.Combined(), result.ExitCode, result.Error) |
2372 | 2372 |
assert.Assert(c, result.Error, checker.IsNil, comment) |
2373 |
- assert.Assert(c, result.ExitCode, checker.Equals, 0, comment) |
|
2373 |
+ assert.Equal(c, result.ExitCode, 0, comment) |
|
2374 | 2374 |
} |
2375 | 2375 |
|
2376 | 2376 |
// Test case for #21976 |
... | ... |
@@ -2738,7 +2738,7 @@ func (s *DockerDaemonSuite) TestExecWithUserAfterLiveRestore(c *testing.T) { |
2738 | 2738 |
|
2739 | 2739 |
out2, err := s.d.Cmd("exec", "-u", "test", "top", "id") |
2740 | 2740 |
assert.Assert(c, err, checker.IsNil, check.Commentf("Output: %s", out2)) |
2741 |
- assert.Assert(c, out2, checker.Equals, out1, check.Commentf("Output: before restart '%s', after restart '%s'", out1, out2)) |
|
2741 |
+ assert.Equal(c, out2, out1, check.Commentf("Output: before restart '%s', after restart '%s'", out1, out2)) |
|
2742 | 2742 |
|
2743 | 2743 |
out, err = s.d.Cmd("stop", "top") |
2744 | 2744 |
assert.NilError(c, err, "Output: %s", out) |
... | ... |
@@ -2848,7 +2848,7 @@ func (s *DockerDaemonSuite) TestShmSize(c *testing.T) { |
2848 | 2848 |
assert.Assert(c, pattern.MatchString(out), checker.True) |
2849 | 2849 |
out, err = s.d.Cmd("inspect", "--format", "{{.HostConfig.ShmSize}}", name) |
2850 | 2850 |
assert.NilError(c, err, "Output: %s", out) |
2851 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, fmt.Sprintf("%v", size)) |
|
2851 |
+ assert.Equal(c, strings.TrimSpace(out), fmt.Sprintf("%v", size)) |
|
2852 | 2852 |
} |
2853 | 2853 |
|
2854 | 2854 |
func (s *DockerDaemonSuite) TestShmSizeReload(c *testing.T) { |
... | ... |
@@ -2872,7 +2872,7 @@ func (s *DockerDaemonSuite) TestShmSizeReload(c *testing.T) { |
2872 | 2872 |
assert.Assert(c, pattern.MatchString(out), checker.True) |
2873 | 2873 |
out, err = s.d.Cmd("inspect", "--format", "{{.HostConfig.ShmSize}}", name) |
2874 | 2874 |
assert.NilError(c, err, "Output: %s", out) |
2875 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, fmt.Sprintf("%v", size)) |
|
2875 |
+ assert.Equal(c, strings.TrimSpace(out), fmt.Sprintf("%v", size)) |
|
2876 | 2876 |
|
2877 | 2877 |
size = 67108864 * 3 |
2878 | 2878 |
configData = []byte(fmt.Sprintf(`{"default-shm-size": "%dM"}`, size/1024/1024)) |
... | ... |
@@ -2888,7 +2888,7 @@ func (s *DockerDaemonSuite) TestShmSizeReload(c *testing.T) { |
2888 | 2888 |
assert.Assert(c, pattern.MatchString(out), checker.True) |
2889 | 2889 |
out, err = s.d.Cmd("inspect", "--format", "{{.HostConfig.ShmSize}}", name) |
2890 | 2890 |
assert.NilError(c, err, "Output: %s", out) |
2891 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, fmt.Sprintf("%v", size)) |
|
2891 |
+ assert.Equal(c, strings.TrimSpace(out), fmt.Sprintf("%v", size)) |
|
2892 | 2892 |
} |
2893 | 2893 |
|
2894 | 2894 |
func testDaemonStartIpcMode(c *testing.T, from, mode string, valid bool) { |
... | ... |
@@ -310,11 +310,11 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverNamed(c *testing.T) |
310 | 310 |
assert.ErrorContains(c, err, "") |
311 | 311 |
assert.Assert(c, os.IsNotExist(err), checker.True, check.Commentf("Expected volume path in host to not exist: %s, %v\n", p, err)) |
312 | 312 |
|
313 |
- assert.Assert(c, s.ec.activations, checker.Equals, 1) |
|
314 |
- assert.Assert(c, s.ec.creations, checker.Equals, 1) |
|
315 |
- assert.Assert(c, s.ec.removals, checker.Equals, 1) |
|
316 |
- assert.Assert(c, s.ec.mounts, checker.Equals, 1) |
|
317 |
- assert.Assert(c, s.ec.unmounts, checker.Equals, 1) |
|
313 |
+ assert.Equal(c, s.ec.activations, 1) |
|
314 |
+ assert.Equal(c, s.ec.creations, 1) |
|
315 |
+ assert.Equal(c, s.ec.removals, 1) |
|
316 |
+ assert.Equal(c, s.ec.mounts, 1) |
|
317 |
+ assert.Equal(c, s.ec.unmounts, 1) |
|
318 | 318 |
} |
319 | 319 |
|
320 | 320 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnnamed(c *testing.T) { |
... | ... |
@@ -324,11 +324,11 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnnamed(c *testing.T |
324 | 324 |
assert.NilError(c, err, out) |
325 | 325 |
assert.Assert(c, out, checker.Contains, s.Server.URL) |
326 | 326 |
|
327 |
- assert.Assert(c, s.ec.activations, checker.Equals, 1) |
|
328 |
- assert.Assert(c, s.ec.creations, checker.Equals, 1) |
|
329 |
- assert.Assert(c, s.ec.removals, checker.Equals, 1) |
|
330 |
- assert.Assert(c, s.ec.mounts, checker.Equals, 1) |
|
331 |
- assert.Assert(c, s.ec.unmounts, checker.Equals, 1) |
|
327 |
+ assert.Equal(c, s.ec.activations, 1) |
|
328 |
+ assert.Equal(c, s.ec.creations, 1) |
|
329 |
+ assert.Equal(c, s.ec.removals, 1) |
|
330 |
+ assert.Equal(c, s.ec.mounts, 1) |
|
331 |
+ assert.Equal(c, s.ec.unmounts, 1) |
|
332 | 332 |
} |
333 | 333 |
|
334 | 334 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverVolumesFrom(c *testing.T) { |
... | ... |
@@ -343,11 +343,11 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverVolumesFrom(c *testi |
343 | 343 |
out, err = s.d.Cmd("rm", "-fv", "vol-test1") |
344 | 344 |
assert.NilError(c, err, out) |
345 | 345 |
|
346 |
- assert.Assert(c, s.ec.activations, checker.Equals, 1) |
|
347 |
- assert.Assert(c, s.ec.creations, checker.Equals, 1) |
|
348 |
- assert.Assert(c, s.ec.removals, checker.Equals, 1) |
|
349 |
- assert.Assert(c, s.ec.mounts, checker.Equals, 2) |
|
350 |
- assert.Assert(c, s.ec.unmounts, checker.Equals, 2) |
|
346 |
+ assert.Equal(c, s.ec.activations, 1) |
|
347 |
+ assert.Equal(c, s.ec.creations, 1) |
|
348 |
+ assert.Equal(c, s.ec.removals, 1) |
|
349 |
+ assert.Equal(c, s.ec.mounts, 2) |
|
350 |
+ assert.Equal(c, s.ec.unmounts, 2) |
|
351 | 351 |
} |
352 | 352 |
|
353 | 353 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverDeleteContainer(c *testing.T) { |
... | ... |
@@ -359,11 +359,11 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverDeleteContainer(c *t |
359 | 359 |
out, err = s.d.Cmd("rm", "-fv", "vol-test1") |
360 | 360 |
assert.NilError(c, err, out) |
361 | 361 |
|
362 |
- assert.Assert(c, s.ec.activations, checker.Equals, 1) |
|
363 |
- assert.Assert(c, s.ec.creations, checker.Equals, 1) |
|
364 |
- assert.Assert(c, s.ec.removals, checker.Equals, 1) |
|
365 |
- assert.Assert(c, s.ec.mounts, checker.Equals, 1) |
|
366 |
- assert.Assert(c, s.ec.unmounts, checker.Equals, 1) |
|
362 |
+ assert.Equal(c, s.ec.activations, 1) |
|
363 |
+ assert.Equal(c, s.ec.creations, 1) |
|
364 |
+ assert.Equal(c, s.ec.removals, 1) |
|
365 |
+ assert.Equal(c, s.ec.mounts, 1) |
|
366 |
+ assert.Equal(c, s.ec.unmounts, 1) |
|
367 | 367 |
} |
368 | 368 |
|
369 | 369 |
func hostVolumePath(name string) string { |
... | ... |
@@ -437,11 +437,11 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverRetryNotImmediatelyE |
437 | 437 |
_, err := s.d.Cmd("volume", "rm", "external-volume-test") |
438 | 438 |
assert.NilError(c, err) |
439 | 439 |
|
440 |
- assert.Assert(c, p.ec.activations, checker.Equals, 1) |
|
441 |
- assert.Assert(c, p.ec.creations, checker.Equals, 1) |
|
442 |
- assert.Assert(c, p.ec.removals, checker.Equals, 1) |
|
443 |
- assert.Assert(c, p.ec.mounts, checker.Equals, 1) |
|
444 |
- assert.Assert(c, p.ec.unmounts, checker.Equals, 1) |
|
440 |
+ assert.Equal(c, p.ec.activations, 1) |
|
441 |
+ assert.Equal(c, p.ec.creations, 1) |
|
442 |
+ assert.Equal(c, p.ec.removals, 1) |
|
443 |
+ assert.Equal(c, p.ec.mounts, 1) |
|
444 |
+ assert.Equal(c, p.ec.unmounts, 1) |
|
445 | 445 |
} |
446 | 446 |
|
447 | 447 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverBindExternalVolume(c *testing.T) { |
... | ... |
@@ -454,30 +454,30 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverBindExternalVolume(c |
454 | 454 |
} |
455 | 455 |
out := inspectFieldJSON(c, "testing", "Mounts") |
456 | 456 |
assert.Assert(c, json.NewDecoder(strings.NewReader(out)).Decode(&mounts), checker.IsNil) |
457 |
- assert.Assert(c, len(mounts), checker.Equals, 1, check.Commentf("%s", out)) |
|
458 |
- assert.Assert(c, mounts[0].Name, checker.Equals, "foo") |
|
459 |
- assert.Assert(c, mounts[0].Driver, checker.Equals, volumePluginName) |
|
457 |
+ assert.Equal(c, len(mounts), 1, check.Commentf("%s", out)) |
|
458 |
+ assert.Equal(c, mounts[0].Name, "foo") |
|
459 |
+ assert.Equal(c, mounts[0].Driver, volumePluginName) |
|
460 | 460 |
} |
461 | 461 |
|
462 | 462 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverList(c *testing.T) { |
463 | 463 |
dockerCmd(c, "volume", "create", "-d", volumePluginName, "abc3") |
464 | 464 |
out, _ := dockerCmd(c, "volume", "ls") |
465 | 465 |
ls := strings.Split(strings.TrimSpace(out), "\n") |
466 |
- assert.Assert(c, len(ls), checker.Equals, 2, check.Commentf("\n%s", out)) |
|
466 |
+ assert.Equal(c, len(ls), 2, check.Commentf("\n%s", out)) |
|
467 | 467 |
|
468 | 468 |
vol := strings.Fields(ls[len(ls)-1]) |
469 |
- assert.Assert(c, len(vol), checker.Equals, 2, check.Commentf("%v", vol)) |
|
470 |
- assert.Assert(c, vol[0], checker.Equals, volumePluginName) |
|
471 |
- assert.Assert(c, vol[1], checker.Equals, "abc3") |
|
469 |
+ assert.Equal(c, len(vol), 2, check.Commentf("%v", vol)) |
|
470 |
+ assert.Equal(c, vol[0], volumePluginName) |
|
471 |
+ assert.Equal(c, vol[1], "abc3") |
|
472 | 472 |
|
473 |
- assert.Assert(c, s.ec.lists, checker.Equals, 1) |
|
473 |
+ assert.Equal(c, s.ec.lists, 1) |
|
474 | 474 |
} |
475 | 475 |
|
476 | 476 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGet(c *testing.T) { |
477 | 477 |
out, _, err := dockerCmdWithError("volume", "inspect", "dummy") |
478 | 478 |
assert.ErrorContains(c, err, "", out) |
479 | 479 |
assert.Assert(c, out, checker.Contains, "No such volume") |
480 |
- assert.Assert(c, s.ec.gets, checker.Equals, 1) |
|
480 |
+ assert.Equal(c, s.ec.gets, 1) |
|
481 | 481 |
|
482 | 482 |
dockerCmd(c, "volume", "create", "test", "-d", volumePluginName) |
483 | 483 |
out, _ = dockerCmd(c, "volume", "inspect", "test") |
... | ... |
@@ -490,7 +490,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGet(c *testing.T) { |
490 | 490 |
assert.Assert(c, json.Unmarshal([]byte(out), &st), checker.IsNil) |
491 | 491 |
assert.Assert(c, st, checker.HasLen, 1) |
492 | 492 |
assert.Assert(c, st[0].Status, checker.HasLen, 1, check.Commentf("%v", st[0])) |
493 |
- assert.Assert(c, st[0].Status["Hello"], checker.Equals, "world", check.Commentf("%v", st[0].Status)) |
|
493 |
+ assert.Equal(c, st[0].Status["Hello"], "world", check.Commentf("%v", st[0].Status)) |
|
494 | 494 |
} |
495 | 495 |
|
496 | 496 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverWithDaemonRestart(c *testing.T) { |
... | ... |
@@ -501,7 +501,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverWithDaemonRestart(c |
501 | 501 |
var mounts []types.MountPoint |
502 | 502 |
inspectFieldAndUnmarshall(c, "test", "Mounts", &mounts) |
503 | 503 |
assert.Assert(c, mounts, checker.HasLen, 1) |
504 |
- assert.Assert(c, mounts[0].Driver, checker.Equals, volumePluginName) |
|
504 |
+ assert.Equal(c, mounts[0].Driver, volumePluginName) |
|
505 | 505 |
} |
506 | 506 |
|
507 | 507 |
// Ensures that the daemon handles when the plugin responds to a `Get` request with a null volume and a null error. |
... | ... |
@@ -523,15 +523,15 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGetEmptyResponse(c * |
523 | 523 |
// available because the volume is not even mounted. Consider removing this test. |
524 | 524 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverPathCalls(c *testing.T) { |
525 | 525 |
s.d.Start(c) |
526 |
- assert.Assert(c, s.ec.paths, checker.Equals, 0) |
|
526 |
+ assert.Equal(c, s.ec.paths, 0) |
|
527 | 527 |
|
528 | 528 |
out, err := s.d.Cmd("volume", "create", "test", "--driver=test-external-volume-driver") |
529 | 529 |
assert.NilError(c, err, out) |
530 |
- assert.Assert(c, s.ec.paths, checker.Equals, 0) |
|
530 |
+ assert.Equal(c, s.ec.paths, 0) |
|
531 | 531 |
|
532 | 532 |
out, err = s.d.Cmd("volume", "ls") |
533 | 533 |
assert.NilError(c, err, out) |
534 |
- assert.Assert(c, s.ec.paths, checker.Equals, 0) |
|
534 |
+ assert.Equal(c, s.ec.paths, 0) |
|
535 | 535 |
} |
536 | 536 |
|
537 | 537 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverMountID(c *testing.T) { |
... | ... |
@@ -545,12 +545,12 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverMountID(c *testing.T |
545 | 545 |
// Check that VolumeDriver.Capabilities gets called, and only called once |
546 | 546 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverCapabilities(c *testing.T) { |
547 | 547 |
s.d.Start(c) |
548 |
- assert.Assert(c, s.ec.caps, checker.Equals, 0) |
|
548 |
+ assert.Equal(c, s.ec.caps, 0) |
|
549 | 549 |
|
550 | 550 |
for i := 0; i < 3; i++ { |
551 | 551 |
out, err := s.d.Cmd("volume", "create", "-d", volumePluginName, fmt.Sprintf("test%d", i)) |
552 | 552 |
assert.NilError(c, err, out) |
553 |
- assert.Assert(c, s.ec.caps, checker.Equals, 1) |
|
553 |
+ assert.Equal(c, s.ec.caps, 1) |
|
554 | 554 |
out, err = s.d.Cmd("volume", "inspect", "--format={{.Scope}}", fmt.Sprintf("test%d", i)) |
555 | 555 |
assert.NilError(c, err) |
556 | 556 |
assert.Equal(c, strings.TrimSpace(out), volume.GlobalScope) |
... | ... |
@@ -584,10 +584,10 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *t |
584 | 584 |
err = json.Unmarshal([]byte(out), &vs) |
585 | 585 |
assert.NilError(c, err) |
586 | 586 |
assert.Assert(c, vs, checker.HasLen, 1) |
587 |
- assert.Assert(c, vs[0].Driver, checker.Equals, driverName) |
|
587 |
+ assert.Equal(c, vs[0].Driver, driverName) |
|
588 | 588 |
assert.Assert(c, vs[0].Options, checker.NotNil) |
589 |
- assert.Assert(c, vs[0].Options["foo"], checker.Equals, "bar") |
|
590 |
- assert.Assert(c, vs[0].Driver, checker.Equals, driverName) |
|
589 |
+ assert.Equal(c, vs[0].Options["foo"], "bar") |
|
590 |
+ assert.Equal(c, vs[0].Driver, driverName) |
|
591 | 591 |
|
592 | 592 |
// simulate out of band volume deletion on plugin level |
593 | 593 |
delete(p.vols, "test") |
... | ... |
@@ -603,7 +603,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverOutOfBandDelete(c *t |
603 | 603 |
assert.NilError(c, err) |
604 | 604 |
assert.Assert(c, vs, checker.HasLen, 1) |
605 | 605 |
assert.Assert(c, vs[0].Options, checker.HasLen, 0) |
606 |
- assert.Assert(c, vs[0].Driver, checker.Equals, "local") |
|
606 |
+ assert.Equal(c, vs[0].Driver, "local") |
|
607 | 607 |
} |
608 | 608 |
|
609 | 609 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnMountFail(c *testing.T) { |
... | ... |
@@ -611,9 +611,9 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnMountFail(c |
611 | 611 |
s.d.Cmd("volume", "create", "-d", "test-external-volume-driver", "--opt=invalidOption=1", "--name=testumount") |
612 | 612 |
|
613 | 613 |
out, _ := s.d.Cmd("run", "-v", "testumount:/foo", "busybox", "true") |
614 |
- assert.Assert(c, s.ec.unmounts, checker.Equals, 0, check.Commentf("%s", out)) |
|
614 |
+ assert.Equal(c, s.ec.unmounts, 0, check.Commentf("%s", out)) |
|
615 | 615 |
out, _ = s.d.Cmd("run", "-w", "/foo", "-v", "testumount:/foo", "busybox", "true") |
616 |
- assert.Assert(c, s.ec.unmounts, checker.Equals, 0, check.Commentf("%s", out)) |
|
616 |
+ assert.Equal(c, s.ec.unmounts, 0, check.Commentf("%s", out)) |
|
617 | 617 |
} |
618 | 618 |
|
619 | 619 |
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnCp(c *testing.T) { |
... | ... |
@@ -621,12 +621,12 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverUnmountOnCp(c *testi |
621 | 621 |
s.d.Cmd("volume", "create", "-d", "test-external-volume-driver", "--name=test") |
622 | 622 |
|
623 | 623 |
out, _ := s.d.Cmd("run", "-d", "--name=test", "-v", "test:/foo", "busybox", "/bin/sh", "-c", "touch /test && top") |
624 |
- assert.Assert(c, s.ec.mounts, checker.Equals, 1, check.Commentf("%s", out)) |
|
624 |
+ assert.Equal(c, s.ec.mounts, 1, check.Commentf("%s", out)) |
|
625 | 625 |
|
626 | 626 |
out, _ = s.d.Cmd("cp", "test:/test", "/tmp/test") |
627 |
- assert.Assert(c, s.ec.mounts, checker.Equals, 2, check.Commentf("%s", out)) |
|
628 |
- assert.Assert(c, s.ec.unmounts, checker.Equals, 1, check.Commentf("%s", out)) |
|
627 |
+ assert.Equal(c, s.ec.mounts, 2, check.Commentf("%s", out)) |
|
628 |
+ assert.Equal(c, s.ec.unmounts, 1, check.Commentf("%s", out)) |
|
629 | 629 |
|
630 | 630 |
out, _ = s.d.Cmd("kill", "test") |
631 |
- assert.Assert(c, s.ec.unmounts, checker.Equals, 2, check.Commentf("%s", out)) |
|
631 |
+ assert.Equal(c, s.ec.unmounts, 2, check.Commentf("%s", out)) |
|
632 | 632 |
} |
... | ... |
@@ -20,7 +20,7 @@ func waitForHealthStatus(c *testing.T, name string, prev string, expected string |
20 | 20 |
if out == expected { |
21 | 21 |
return |
22 | 22 |
} |
23 |
- assert.Assert(c, out, checker.Equals, prev) |
|
23 |
+ assert.Equal(c, out, prev) |
|
24 | 24 |
if out != prev { |
25 | 25 |
return |
26 | 26 |
} |
... | ... |
@@ -32,7 +32,7 @@ func getHealth(c *testing.T, name string) *types.Health { |
32 | 32 |
out, _ := dockerCmd(c, "inspect", "--format={{json .State.Health}}", name) |
33 | 33 |
var health types.Health |
34 | 34 |
err := json.Unmarshal([]byte(out), &health) |
35 |
- assert.Assert(c, err, checker.Equals, nil) |
|
35 |
+ assert.Equal(c, err, nil) |
|
36 | 36 |
return &health |
37 | 37 |
} |
38 | 38 |
|
... | ... |
@@ -54,12 +54,12 @@ func (s *DockerSuite) TestHealth(c *testing.T) { |
54 | 54 |
cid, _ := dockerCmd(c, "create", "--name", name, imageName) |
55 | 55 |
out, _ := dockerCmd(c, "ps", "-a", "--format={{.ID}} {{.Status}}") |
56 | 56 |
out = RemoveOutputForExistingElements(out, existingContainers) |
57 |
- assert.Assert(c, out, checker.Equals, cid[:12]+" Created\n") |
|
57 |
+ assert.Equal(c, out, cid[:12]+" Created\n") |
|
58 | 58 |
|
59 | 59 |
// Inspect the options |
60 | 60 |
out, _ = dockerCmd(c, "inspect", |
61 | 61 |
"--format=timeout={{.Config.Healthcheck.Timeout}} interval={{.Config.Healthcheck.Interval}} retries={{.Config.Healthcheck.Retries}} test={{.Config.Healthcheck.Test}}", name) |
62 |
- assert.Assert(c, out, checker.Equals, "timeout=30s interval=1s retries=0 test=[CMD-SHELL cat /status]\n") |
|
62 |
+ assert.Equal(c, out, "timeout=30s interval=1s retries=0 test=[CMD-SHELL cat /status]\n") |
|
63 | 63 |
|
64 | 64 |
// Start |
65 | 65 |
dockerCmd(c, "start", name) |
... | ... |
@@ -71,7 +71,7 @@ func (s *DockerSuite) TestHealth(c *testing.T) { |
71 | 71 |
|
72 | 72 |
// Inspect the status |
73 | 73 |
out, _ = dockerCmd(c, "inspect", "--format={{.State.Health.Status}}", name) |
74 |
- assert.Assert(c, out, checker.Equals, "unhealthy\n") |
|
74 |
+ assert.Equal(c, out, "unhealthy\n") |
|
75 | 75 |
|
76 | 76 |
// Make it healthy again |
77 | 77 |
dockerCmd(c, "exec", name, "touch", "/status") |
... | ... |
@@ -83,7 +83,7 @@ func (s *DockerSuite) TestHealth(c *testing.T) { |
83 | 83 |
// Disable the check from the CLI |
84 | 84 |
dockerCmd(c, "create", "--name=noh", "--no-healthcheck", imageName) |
85 | 85 |
out, _ = dockerCmd(c, "inspect", "--format={{.Config.Healthcheck.Test}}", "noh") |
86 |
- assert.Assert(c, out, checker.Equals, "[NONE]\n") |
|
86 |
+ assert.Equal(c, out, "[NONE]\n") |
|
87 | 87 |
dockerCmd(c, "rm", "noh") |
88 | 88 |
|
89 | 89 |
// Disable the check with a new build |
... | ... |
@@ -91,7 +91,7 @@ func (s *DockerSuite) TestHealth(c *testing.T) { |
91 | 91 |
HEALTHCHECK NONE`)) |
92 | 92 |
|
93 | 93 |
out, _ = dockerCmd(c, "inspect", "--format={{.Config.Healthcheck.Test}}", "no_healthcheck") |
94 |
- assert.Assert(c, out, checker.Equals, "[NONE]\n") |
|
94 |
+ assert.Equal(c, out, "[NONE]\n") |
|
95 | 95 |
|
96 | 96 |
// Enable the checks from the CLI |
97 | 97 |
_, _ = dockerCmd(c, "run", "-d", "--name=fatal_healthcheck", |
... | ... |
@@ -101,11 +101,11 @@ func (s *DockerSuite) TestHealth(c *testing.T) { |
101 | 101 |
"no_healthcheck") |
102 | 102 |
waitForHealthStatus(c, "fatal_healthcheck", "starting", "healthy") |
103 | 103 |
health := getHealth(c, "fatal_healthcheck") |
104 |
- assert.Assert(c, health.Status, checker.Equals, "healthy") |
|
105 |
- assert.Assert(c, health.FailingStreak, checker.Equals, 0) |
|
104 |
+ assert.Equal(c, health.Status, "healthy") |
|
105 |
+ assert.Equal(c, health.FailingStreak, 0) |
|
106 | 106 |
last := health.Log[len(health.Log)-1] |
107 |
- assert.Assert(c, last.ExitCode, checker.Equals, 0) |
|
108 |
- assert.Assert(c, last.Output, checker.Equals, "OK\n") |
|
107 |
+ assert.Equal(c, last.ExitCode, 0) |
|
108 |
+ assert.Equal(c, last.Output, "OK\n") |
|
109 | 109 |
|
110 | 110 |
// Fail the check |
111 | 111 |
dockerCmd(c, "exec", "fatal_healthcheck", "rm", "/status") |
... | ... |
@@ -114,7 +114,7 @@ func (s *DockerSuite) TestHealth(c *testing.T) { |
114 | 114 |
failsStr, _ := dockerCmd(c, "inspect", "--format={{.State.Health.FailingStreak}}", "fatal_healthcheck") |
115 | 115 |
fails, err := strconv.Atoi(strings.TrimSpace(failsStr)) |
116 | 116 |
assert.Assert(c, err, checker.IsNil) |
117 |
- assert.Assert(c, fails >= 3, checker.Equals, true) |
|
117 |
+ assert.Equal(c, fails >= 3, true) |
|
118 | 118 |
dockerCmd(c, "rm", "-f", "fatal_healthcheck") |
119 | 119 |
|
120 | 120 |
// Check timeout |
... | ... |
@@ -125,9 +125,9 @@ func (s *DockerSuite) TestHealth(c *testing.T) { |
125 | 125 |
waitForHealthStatus(c, "test", "starting", "unhealthy") |
126 | 126 |
health = getHealth(c, "test") |
127 | 127 |
last = health.Log[len(health.Log)-1] |
128 |
- assert.Assert(c, health.Status, checker.Equals, "unhealthy") |
|
129 |
- assert.Assert(c, last.ExitCode, checker.Equals, -1) |
|
130 |
- assert.Assert(c, last.Output, checker.Equals, "Health check exceeded timeout (1s)") |
|
128 |
+ assert.Equal(c, health.Status, "unhealthy") |
|
129 |
+ assert.Equal(c, last.ExitCode, -1) |
|
130 |
+ assert.Equal(c, last.Output, "Health check exceeded timeout (1s)") |
|
131 | 131 |
dockerCmd(c, "rm", "-f", "test") |
132 | 132 |
|
133 | 133 |
// Check JSON-format |
... | ... |
@@ -139,7 +139,7 @@ func (s *DockerSuite) TestHealth(c *testing.T) { |
139 | 139 |
CMD ["cat", "/my status"]`)) |
140 | 140 |
out, _ = dockerCmd(c, "inspect", |
141 | 141 |
"--format={{.Config.Healthcheck.Test}}", imageName) |
142 |
- assert.Assert(c, out, checker.Equals, "[CMD cat /my status]\n") |
|
142 |
+ assert.Equal(c, out, "[CMD cat /my status]\n") |
|
143 | 143 |
|
144 | 144 |
} |
145 | 145 |
|
... | ... |
@@ -63,9 +63,9 @@ func (s *DockerSuite) TestImagesOrderedByCreationDate(c *testing.T) { |
63 | 63 |
|
64 | 64 |
out, _ := dockerCmd(c, "images", "-q", "--no-trunc") |
65 | 65 |
imgs := strings.Split(out, "\n") |
66 |
- assert.Assert(c, imgs[0], checker.Equals, id3, check.Commentf("First image must be %s, got %s", id3, imgs[0])) |
|
67 |
- assert.Assert(c, imgs[1], checker.Equals, id2, check.Commentf("First image must be %s, got %s", id2, imgs[1])) |
|
68 |
- assert.Assert(c, imgs[2], checker.Equals, id1, check.Commentf("First image must be %s, got %s", id1, imgs[2])) |
|
66 |
+ assert.Equal(c, imgs[0], id3, check.Commentf("First image must be %s, got %s", id3, imgs[0])) |
|
67 |
+ assert.Equal(c, imgs[1], id2, check.Commentf("First image must be %s, got %s", id2, imgs[1])) |
|
68 |
+ assert.Equal(c, imgs[2], id1, check.Commentf("First image must be %s, got %s", id1, imgs[2])) |
|
69 | 69 |
} |
70 | 70 |
|
71 | 71 |
func (s *DockerSuite) TestImagesErrorWithInvalidFilterNameTest(c *testing.T) { |
... | ... |
@@ -128,34 +128,34 @@ LABEL number=3`)) |
128 | 128 |
expected := []string{imageID3, imageID2} |
129 | 129 |
|
130 | 130 |
out, _ := dockerCmd(c, "images", "-f", "since=image:1", "image") |
131 |
- assert.Assert(c, assertImageList(out, expected), checker.Equals, true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
131 |
+ assert.Equal(c, assertImageList(out, expected), true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
132 | 132 |
|
133 | 133 |
out, _ = dockerCmd(c, "images", "-f", "since="+imageID1, "image") |
134 |
- assert.Assert(c, assertImageList(out, expected), checker.Equals, true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
134 |
+ assert.Equal(c, assertImageList(out, expected), true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
135 | 135 |
|
136 | 136 |
expected = []string{imageID3} |
137 | 137 |
|
138 | 138 |
out, _ = dockerCmd(c, "images", "-f", "since=image:2", "image") |
139 |
- assert.Assert(c, assertImageList(out, expected), checker.Equals, true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
139 |
+ assert.Equal(c, assertImageList(out, expected), true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
140 | 140 |
|
141 | 141 |
out, _ = dockerCmd(c, "images", "-f", "since="+imageID2, "image") |
142 |
- assert.Assert(c, assertImageList(out, expected), checker.Equals, true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
142 |
+ assert.Equal(c, assertImageList(out, expected), true, check.Commentf("SINCE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
143 | 143 |
|
144 | 144 |
expected = []string{imageID2, imageID1} |
145 | 145 |
|
146 | 146 |
out, _ = dockerCmd(c, "images", "-f", "before=image:3", "image") |
147 |
- assert.Assert(c, assertImageList(out, expected), checker.Equals, true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
147 |
+ assert.Equal(c, assertImageList(out, expected), true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
148 | 148 |
|
149 | 149 |
out, _ = dockerCmd(c, "images", "-f", "before="+imageID3, "image") |
150 |
- assert.Assert(c, assertImageList(out, expected), checker.Equals, true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
150 |
+ assert.Equal(c, assertImageList(out, expected), true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
151 | 151 |
|
152 | 152 |
expected = []string{imageID1} |
153 | 153 |
|
154 | 154 |
out, _ = dockerCmd(c, "images", "-f", "before=image:2", "image") |
155 |
- assert.Assert(c, assertImageList(out, expected), checker.Equals, true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
155 |
+ assert.Equal(c, assertImageList(out, expected), true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
156 | 156 |
|
157 | 157 |
out, _ = dockerCmd(c, "images", "-f", "before="+imageID2, "image") |
158 |
- assert.Assert(c, assertImageList(out, expected), checker.Equals, true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
158 |
+ assert.Equal(c, assertImageList(out, expected), true, check.Commentf("BEFORE filter: Image list is not in the correct order: %v\n%s", expected, out)) |
|
159 | 159 |
} |
160 | 160 |
|
161 | 161 |
func assertImageList(out string, expected []string) bool { |
... | ... |
@@ -239,7 +239,7 @@ func (s *DockerSuite) TestImagesEnsureDanglingImageOnlyListedOnce(c *testing.T) |
239 | 239 |
|
240 | 240 |
out, _ = dockerCmd(c, "images", "-q", "-f", "dangling=true") |
241 | 241 |
// Expect one dangling image |
242 |
- assert.Assert(c, strings.Count(out, imageID), checker.Equals, 1) |
|
242 |
+ assert.Equal(c, strings.Count(out, imageID), 1) |
|
243 | 243 |
|
244 | 244 |
out, _ = dockerCmd(c, "images", "-q", "-f", "dangling=false") |
245 | 245 |
//dangling=false would not include dangling images |
... | ... |
@@ -114,7 +114,7 @@ func (s *DockerSuite) TestImportFileWithMessage(c *testing.T) { |
114 | 114 |
r := regexp.MustCompile("[\\s]{2,}") |
115 | 115 |
split = r.Split(split[1], -1) |
116 | 116 |
|
117 |
- assert.Assert(c, message, checker.Equals, split[3], check.Commentf("didn't get expected value in commit message")) |
|
117 |
+ assert.Equal(c, message, split[3], check.Commentf("didn't get expected value in commit message")) |
|
118 | 118 |
|
119 | 119 |
out, _ = dockerCmd(c, "run", "--rm", image, "true") |
120 | 120 |
assert.Equal(c, out, "", "command output should've been nothing") |
... | ... |
@@ -60,7 +60,7 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *testing.T) { |
60 | 60 |
// TestInfoFormat tests `docker info --format` |
61 | 61 |
func (s *DockerSuite) TestInfoFormat(c *testing.T) { |
62 | 62 |
out, status := dockerCmd(c, "info", "--format", "{{json .}}") |
63 |
- assert.Assert(c, status, checker.Equals, 0) |
|
63 |
+ assert.Equal(c, status, 0) |
|
64 | 64 |
var m map[string]interface{} |
65 | 65 |
err := json.Unmarshal([]byte(out), &m) |
66 | 66 |
assert.NilError(c, err) |
... | ... |
@@ -33,13 +33,13 @@ func (s *DockerSuite) TestInspectImage(c *testing.T) { |
33 | 33 |
imageTestID := "sha256:11f64303f0f7ffdc71f001788132bca5346831939a956e3e975c93267d89a16d" |
34 | 34 |
id := inspectField(c, imageTest, "Id") |
35 | 35 |
|
36 |
- assert.Assert(c, id, checker.Equals, imageTestID) |
|
36 |
+ assert.Equal(c, id, imageTestID) |
|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
func (s *DockerSuite) TestInspectInt64(c *testing.T) { |
40 | 40 |
dockerCmd(c, "run", "-d", "-m=300M", "--name", "inspectTest", "busybox", "true") |
41 | 41 |
inspectOut := inspectField(c, "inspectTest", "HostConfig.Memory") |
42 |
- assert.Assert(c, inspectOut, checker.Equals, "314572800") |
|
42 |
+ assert.Equal(c, inspectOut, "314572800") |
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
func (s *DockerSuite) TestInspectDefault(c *testing.T) { |
... | ... |
@@ -50,7 +50,7 @@ func (s *DockerSuite) TestInspectDefault(c *testing.T) { |
50 | 50 |
containerID := strings.TrimSpace(out) |
51 | 51 |
|
52 | 52 |
inspectOut := inspectField(c, "busybox", "Id") |
53 |
- assert.Assert(c, strings.TrimSpace(inspectOut), checker.Equals, containerID) |
|
53 |
+ assert.Equal(c, strings.TrimSpace(inspectOut), containerID) |
|
54 | 54 |
} |
55 | 55 |
|
56 | 56 |
func (s *DockerSuite) TestInspectStatus(c *testing.T) { |
... | ... |
@@ -58,23 +58,23 @@ func (s *DockerSuite) TestInspectStatus(c *testing.T) { |
58 | 58 |
out = strings.TrimSpace(out) |
59 | 59 |
|
60 | 60 |
inspectOut := inspectField(c, out, "State.Status") |
61 |
- assert.Assert(c, inspectOut, checker.Equals, "running") |
|
61 |
+ assert.Equal(c, inspectOut, "running") |
|
62 | 62 |
|
63 | 63 |
// Windows does not support pause/unpause on Windows Server Containers. |
64 | 64 |
// (RS1 does for Hyper-V Containers, but production CI is not setup for that) |
65 | 65 |
if testEnv.OSType != "windows" { |
66 | 66 |
dockerCmd(c, "pause", out) |
67 | 67 |
inspectOut = inspectField(c, out, "State.Status") |
68 |
- assert.Assert(c, inspectOut, checker.Equals, "paused") |
|
68 |
+ assert.Equal(c, inspectOut, "paused") |
|
69 | 69 |
|
70 | 70 |
dockerCmd(c, "unpause", out) |
71 | 71 |
inspectOut = inspectField(c, out, "State.Status") |
72 |
- assert.Assert(c, inspectOut, checker.Equals, "running") |
|
72 |
+ assert.Equal(c, inspectOut, "running") |
|
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
dockerCmd(c, "stop", out) |
76 | 76 |
inspectOut = inspectField(c, out, "State.Status") |
77 |
- assert.Assert(c, inspectOut, checker.Equals, "exited") |
|
77 |
+ assert.Equal(c, inspectOut, "exited") |
|
78 | 78 |
|
79 | 79 |
} |
80 | 80 |
|
... | ... |
@@ -120,7 +120,7 @@ func (s *DockerSuite) TestInspectTypeFlagWithInvalidValue(c *testing.T) { |
120 | 120 |
|
121 | 121 |
out, exitCode, err := dockerCmdWithError("inspect", "--type=foobar", "busybox") |
122 | 122 |
assert.Assert(c, err, checker.NotNil, check.Commentf("%d", exitCode)) |
123 |
- assert.Assert(c, exitCode, checker.Equals, 1, check.Commentf("%s", err)) |
|
123 |
+ assert.Equal(c, exitCode, 1, check.Commentf("%s", err)) |
|
124 | 124 |
assert.Assert(c, out, checker.Contains, "not a valid value for --type") |
125 | 125 |
} |
126 | 126 |
|
... | ... |
@@ -137,7 +137,7 @@ func (s *DockerSuite) TestInspectImageFilterInt(c *testing.T) { |
137 | 137 |
out, _ = dockerCmd(c, "inspect", formatStr, imageTest) |
138 | 138 |
result, err := strconv.ParseBool(strings.TrimSuffix(out, "\n")) |
139 | 139 |
assert.NilError(c, err) |
140 |
- assert.Assert(c, result, checker.Equals, true) |
|
140 |
+ assert.Equal(c, result, true) |
|
141 | 141 |
} |
142 | 142 |
|
143 | 143 |
func (s *DockerSuite) TestInspectContainerFilterInt(c *testing.T) { |
... | ... |
@@ -159,7 +159,7 @@ func (s *DockerSuite) TestInspectContainerFilterInt(c *testing.T) { |
159 | 159 |
out, _ = dockerCmd(c, "inspect", formatStr, id) |
160 | 160 |
inspectResult, err := strconv.ParseBool(strings.TrimSuffix(out, "\n")) |
161 | 161 |
assert.NilError(c, err) |
162 |
- assert.Assert(c, inspectResult, checker.Equals, true) |
|
162 |
+ assert.Equal(c, inspectResult, true) |
|
163 | 163 |
} |
164 | 164 |
|
165 | 165 |
func (s *DockerSuite) TestInspectImageGraphDriver(c *testing.T) { |
... | ... |
@@ -227,14 +227,14 @@ func (s *DockerSuite) TestInspectBindMountPoint(c *testing.T) { |
227 | 227 |
|
228 | 228 |
m := mp[0] |
229 | 229 |
|
230 |
- assert.Assert(c, m.Name, checker.Equals, "") |
|
231 |
- assert.Assert(c, m.Driver, checker.Equals, "") |
|
232 |
- assert.Assert(c, m.Source, checker.Equals, prefix+slash+"data") |
|
233 |
- assert.Assert(c, m.Destination, checker.Equals, prefix+slash+"data") |
|
230 |
+ assert.Equal(c, m.Name, "") |
|
231 |
+ assert.Equal(c, m.Driver, "") |
|
232 |
+ assert.Equal(c, m.Source, prefix+slash+"data") |
|
233 |
+ assert.Equal(c, m.Destination, prefix+slash+"data") |
|
234 | 234 |
if testEnv.OSType != "windows" { // Windows does not set mode |
235 |
- assert.Assert(c, m.Mode, checker.Equals, "ro"+modifier) |
|
235 |
+ assert.Equal(c, m.Mode, "ro"+modifier) |
|
236 | 236 |
} |
237 |
- assert.Assert(c, m.RW, checker.Equals, false) |
|
237 |
+ assert.Equal(c, m.RW, false) |
|
238 | 238 |
} |
239 | 239 |
|
240 | 240 |
func (s *DockerSuite) TestInspectNamedMountPoint(c *testing.T) { |
... | ... |
@@ -253,11 +253,11 @@ func (s *DockerSuite) TestInspectNamedMountPoint(c *testing.T) { |
253 | 253 |
|
254 | 254 |
m := mp[0] |
255 | 255 |
|
256 |
- assert.Assert(c, m.Name, checker.Equals, "data") |
|
257 |
- assert.Assert(c, m.Driver, checker.Equals, "local") |
|
256 |
+ assert.Equal(c, m.Name, "data") |
|
257 |
+ assert.Equal(c, m.Driver, "local") |
|
258 | 258 |
assert.Assert(c, m.Source != "") |
259 |
- assert.Assert(c, m.Destination, checker.Equals, prefix+slash+"data") |
|
260 |
- assert.Assert(c, m.RW, checker.Equals, true) |
|
259 |
+ assert.Equal(c, m.Destination, prefix+slash+"data") |
|
260 |
+ assert.Equal(c, m.RW, true) |
|
261 | 261 |
} |
262 | 262 |
|
263 | 263 |
// #14947 |
... | ... |
@@ -291,8 +291,8 @@ func (s *DockerSuite) TestInspectLogConfigNoType(c *testing.T) { |
291 | 291 |
err := json.NewDecoder(strings.NewReader(out)).Decode(&logConfig) |
292 | 292 |
assert.Assert(c, err, checker.IsNil, check.Commentf("%v", out)) |
293 | 293 |
|
294 |
- assert.Assert(c, logConfig.Type, checker.Equals, "json-file") |
|
295 |
- assert.Assert(c, logConfig.Config["max-file"], checker.Equals, "42", check.Commentf("%v", logConfig)) |
|
294 |
+ assert.Equal(c, logConfig.Type, "json-file") |
|
295 |
+ assert.Equal(c, logConfig.Config["max-file"], "42", check.Commentf("%v", logConfig)) |
|
296 | 296 |
} |
297 | 297 |
|
298 | 298 |
func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *testing.T) { |
... | ... |
@@ -304,7 +304,7 @@ func (s *DockerSuite) TestInspectNoSizeFlagContainer(c *testing.T) { |
304 | 304 |
|
305 | 305 |
formatStr := "--format={{.SizeRw}},{{.SizeRootFs}}" |
306 | 306 |
out, _ := dockerCmd(c, "inspect", "--type=container", formatStr, "busybox") |
307 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "<nil>,<nil>", check.Commentf("Expected not to display size info: %s", out)) |
|
307 |
+ assert.Equal(c, strings.TrimSpace(out), "<nil>,<nil>", check.Commentf("Expected not to display size info: %s", out)) |
|
308 | 308 |
} |
309 | 309 |
|
310 | 310 |
func (s *DockerSuite) TestInspectSizeFlagContainer(c *testing.T) { |
... | ... |
@@ -345,10 +345,10 @@ func (s *DockerSuite) TestInspectByPrefix(c *testing.T) { |
345 | 345 |
assert.Assert(c, strings.HasPrefix(id, "sha256:")) |
346 | 346 |
|
347 | 347 |
id2 := inspectField(c, id[:12], "Id") |
348 |
- assert.Assert(c, id, checker.Equals, id2) |
|
348 |
+ assert.Equal(c, id, id2) |
|
349 | 349 |
|
350 | 350 |
id3 := inspectField(c, strings.TrimPrefix(id, "sha256:")[:12], "Id") |
351 |
- assert.Assert(c, id, checker.Equals, id3) |
|
351 |
+ assert.Equal(c, id, id3) |
|
352 | 352 |
} |
353 | 353 |
|
354 | 354 |
func (s *DockerSuite) TestInspectStopWhenNotFound(c *testing.T) { |
... | ... |
@@ -18,7 +18,7 @@ func (s *DockerSuite) TestLinksPingUnlinkedContainers(c *testing.T) { |
18 | 18 |
_, exitCode, err := dockerCmdWithError("run", "--rm", "busybox", "sh", "-c", "ping -c 1 alias1 -W 1 && ping -c 1 alias2 -W 1") |
19 | 19 |
|
20 | 20 |
// run ping failed with error |
21 |
- assert.Assert(c, exitCode, checker.Equals, 1, check.Commentf("error: %v", err)) |
|
21 |
+ assert.Equal(c, exitCode, 1, check.Commentf("error: %v", err)) |
|
22 | 22 |
} |
23 | 23 |
|
24 | 24 |
// Test for appropriate error when calling --link with an invalid target container |
... | ... |
@@ -173,20 +173,20 @@ func (s *DockerSuite) TestLinksUpdateOnRestart(c *testing.T) { |
173 | 173 |
return string(matches[1]) |
174 | 174 |
} |
175 | 175 |
ip := getIP(content, "one") |
176 |
- assert.Assert(c, ip, checker.Equals, realIP) |
|
176 |
+ assert.Equal(c, ip, realIP) |
|
177 | 177 |
|
178 | 178 |
ip = getIP(content, "onetwo") |
179 |
- assert.Assert(c, ip, checker.Equals, realIP) |
|
179 |
+ assert.Equal(c, ip, realIP) |
|
180 | 180 |
|
181 | 181 |
dockerCmd(c, "restart", "one") |
182 | 182 |
realIP = inspectField(c, "one", "NetworkSettings.Networks.bridge.IPAddress") |
183 | 183 |
|
184 | 184 |
content = readContainerFileWithExec(c, id, "/etc/hosts") |
185 | 185 |
ip = getIP(content, "one") |
186 |
- assert.Assert(c, ip, checker.Equals, realIP) |
|
186 |
+ assert.Equal(c, ip, realIP) |
|
187 | 187 |
|
188 | 188 |
ip = getIP(content, "onetwo") |
189 |
- assert.Assert(c, ip, checker.Equals, realIP) |
|
189 |
+ assert.Equal(c, ip, realIP) |
|
190 | 190 |
} |
191 | 191 |
|
192 | 192 |
func (s *DockerSuite) TestLinksEnvs(c *testing.T) { |
... | ... |
@@ -211,7 +211,7 @@ func (s *DockerSuite) TestLinkShortDefinition(c *testing.T) { |
211 | 211 |
assert.Assert(c, waitRun(cid2), checker.IsNil) |
212 | 212 |
|
213 | 213 |
links := inspectFieldJSON(c, cid2, "HostConfig.Links") |
214 |
- assert.Assert(c, links, checker.Equals, "[\"/shortlinkdef:/link2/shortlinkdef\"]") |
|
214 |
+ assert.Equal(c, links, "[\"/shortlinkdef:/link2/shortlinkdef\"]") |
|
215 | 215 |
} |
216 | 216 |
|
217 | 217 |
func (s *DockerSuite) TestLinksNetworkHostContainer(c *testing.T) { |
... | ... |
@@ -360,7 +360,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkLsFilter(c *testing.T) { |
360 | 360 |
|
361 | 361 |
out, _ = dockerCmd(c, "network", "ls", "-f", "label=nonexistent") |
362 | 362 |
outArr := strings.Split(strings.TrimSpace(out), "\n") |
363 |
- assert.Assert(c, len(outArr), checker.Equals, 1, check.Commentf("%s\n", out)) |
|
363 |
+ assert.Equal(c, len(outArr), 1, check.Commentf("%s\n", out)) |
|
364 | 364 |
|
365 | 365 |
out, _ = dockerCmd(c, "network", "ls", "-f", "driver=null") |
366 | 366 |
assertNwList(c, out, []string{"none"}) |
... | ... |
@@ -390,7 +390,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkCreateLabel(c *testing.T) { |
390 | 390 |
|
391 | 391 |
out, _, err := dockerCmdWithError("network", "inspect", "--format={{ .Labels."+testLabel+" }}", testNet) |
392 | 392 |
assert.NilError(c, err) |
393 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, testValue) |
|
393 |
+ assert.Equal(c, strings.TrimSpace(out), testValue) |
|
394 | 394 |
|
395 | 395 |
dockerCmd(c, "network", "rm", testNet) |
396 | 396 |
assertNwNotAvailable(c, testNet) |
... | ... |
@@ -433,7 +433,7 @@ func (s *DockerSuite) TestDockerNetworkInspect(c *testing.T) { |
433 | 433 |
assert.Equal(c, len(networkResources), 1) |
434 | 434 |
|
435 | 435 |
out, _ = dockerCmd(c, "network", "inspect", "--format={{ .Name }}", "host") |
436 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "host") |
|
436 |
+ assert.Equal(c, strings.TrimSpace(out), "host") |
|
437 | 437 |
} |
438 | 438 |
|
439 | 439 |
func (s *DockerSuite) TestDockerNetworkInspectWithID(c *testing.T) { |
... | ... |
@@ -441,10 +441,10 @@ func (s *DockerSuite) TestDockerNetworkInspectWithID(c *testing.T) { |
441 | 441 |
networkID := strings.TrimSpace(out) |
442 | 442 |
assertNwIsAvailable(c, "test2") |
443 | 443 |
out, _ = dockerCmd(c, "network", "inspect", "--format={{ .Id }}", "test2") |
444 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, networkID) |
|
444 |
+ assert.Equal(c, strings.TrimSpace(out), networkID) |
|
445 | 445 |
|
446 | 446 |
out, _ = dockerCmd(c, "network", "inspect", "--format={{ .ID }}", "test2") |
447 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, networkID) |
|
447 |
+ assert.Equal(c, strings.TrimSpace(out), networkID) |
|
448 | 448 |
} |
449 | 449 |
|
450 | 450 |
func (s *DockerSuite) TestDockerInspectMultipleNetwork(c *testing.T) { |
... | ... |
@@ -541,8 +541,8 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectDisconnect(c *testing.T) { |
541 | 541 |
assertNwIsAvailable(c, "test") |
542 | 542 |
nr := getNwResource(c, "test") |
543 | 543 |
|
544 |
- assert.Assert(c, nr.Name, checker.Equals, "test") |
|
545 |
- assert.Assert(c, len(nr.Containers), checker.Equals, 0) |
|
544 |
+ assert.Equal(c, nr.Name, "test") |
|
545 |
+ assert.Equal(c, len(nr.Containers), 0) |
|
546 | 546 |
|
547 | 547 |
// run a container |
548 | 548 |
out, _ := dockerCmd(c, "run", "-d", "--name", "test", "busybox", "top") |
... | ... |
@@ -554,19 +554,19 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectDisconnect(c *testing.T) { |
554 | 554 |
|
555 | 555 |
// inspect the network to make sure container is connected |
556 | 556 |
nr = getNetworkResource(c, nr.ID) |
557 |
- assert.Assert(c, len(nr.Containers), checker.Equals, 1) |
|
557 |
+ assert.Equal(c, len(nr.Containers), 1) |
|
558 | 558 |
|
559 | 559 |
// check if container IP matches network inspect |
560 | 560 |
ip, _, err := net.ParseCIDR(nr.Containers[containerID].IPv4Address) |
561 | 561 |
assert.NilError(c, err) |
562 | 562 |
containerIP := findContainerIP(c, "test", "test") |
563 |
- assert.Assert(c, ip.String(), checker.Equals, containerIP) |
|
563 |
+ assert.Equal(c, ip.String(), containerIP) |
|
564 | 564 |
|
565 | 565 |
// disconnect container from the network |
566 | 566 |
dockerCmd(c, "network", "disconnect", "test", containerID) |
567 | 567 |
nr = getNwResource(c, "test") |
568 |
- assert.Assert(c, nr.Name, checker.Equals, "test") |
|
569 |
- assert.Assert(c, len(nr.Containers), checker.Equals, 0) |
|
568 |
+ assert.Equal(c, nr.Name, "test") |
|
569 |
+ assert.Equal(c, len(nr.Containers), 0) |
|
570 | 570 |
|
571 | 571 |
// run another container |
572 | 572 |
out, _ = dockerCmd(c, "run", "-d", "--net", "test", "--name", "test2", "busybox", "top") |
... | ... |
@@ -574,15 +574,15 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectDisconnect(c *testing.T) { |
574 | 574 |
containerID = strings.TrimSpace(out) |
575 | 575 |
|
576 | 576 |
nr = getNwResource(c, "test") |
577 |
- assert.Assert(c, nr.Name, checker.Equals, "test") |
|
578 |
- assert.Assert(c, len(nr.Containers), checker.Equals, 1) |
|
577 |
+ assert.Equal(c, nr.Name, "test") |
|
578 |
+ assert.Equal(c, len(nr.Containers), 1) |
|
579 | 579 |
|
580 | 580 |
// force disconnect the container to the test network |
581 | 581 |
dockerCmd(c, "network", "disconnect", "-f", "test", containerID) |
582 | 582 |
|
583 | 583 |
nr = getNwResource(c, "test") |
584 |
- assert.Assert(c, nr.Name, checker.Equals, "test") |
|
585 |
- assert.Assert(c, len(nr.Containers), checker.Equals, 0) |
|
584 |
+ assert.Equal(c, nr.Name, "test") |
|
585 |
+ assert.Equal(c, len(nr.Containers), 0) |
|
586 | 586 |
|
587 | 587 |
dockerCmd(c, "network", "rm", "test") |
588 | 588 |
assertNwNotAvailable(c, "test") |
... | ... |
@@ -637,8 +637,8 @@ func (s *DockerNetworkSuite) TestDockerNetworkCustomIPAM(c *testing.T) { |
637 | 637 |
|
638 | 638 |
// Verify expected network ipam fields are there |
639 | 639 |
nr := getNetworkResource(c, "br0") |
640 |
- assert.Assert(c, nr.Driver, checker.Equals, "bridge") |
|
641 |
- assert.Assert(c, nr.IPAM.Driver, checker.Equals, dummyIPAMDriver) |
|
640 |
+ assert.Equal(c, nr.Driver, "bridge") |
|
641 |
+ assert.Equal(c, nr.IPAM.Driver, dummyIPAMDriver) |
|
642 | 642 |
|
643 | 643 |
// remove network and exercise remote ipam driver |
644 | 644 |
dockerCmd(c, "network", "rm", "br0") |
... | ... |
@@ -654,8 +654,8 @@ func (s *DockerNetworkSuite) TestDockerNetworkIPAMOptions(c *testing.T) { |
654 | 654 |
// Verify expected network ipam options |
655 | 655 |
nr := getNetworkResource(c, "br0") |
656 | 656 |
opts := nr.IPAM.Options |
657 |
- assert.Assert(c, opts["opt1"], checker.Equals, "drv1") |
|
658 |
- assert.Assert(c, opts["opt2"], checker.Equals, "drv2") |
|
657 |
+ assert.Equal(c, opts["opt1"], "drv1") |
|
658 |
+ assert.Equal(c, opts["opt2"], "drv2") |
|
659 | 659 |
} |
660 | 660 |
|
661 | 661 |
func (s *DockerNetworkSuite) TestDockerNetworkNullIPAMDriver(c *testing.T) { |
... | ... |
@@ -668,36 +668,36 @@ func (s *DockerNetworkSuite) TestDockerNetworkNullIPAMDriver(c *testing.T) { |
668 | 668 |
// Verify the inspect data contains the default subnet provided by the null |
669 | 669 |
// ipam driver and no gateway, as the null ipam driver does not provide one |
670 | 670 |
nr := getNetworkResource(c, "test000") |
671 |
- assert.Assert(c, nr.IPAM.Driver, checker.Equals, "null") |
|
672 |
- assert.Assert(c, len(nr.IPAM.Config), checker.Equals, 1) |
|
673 |
- assert.Assert(c, nr.IPAM.Config[0].Subnet, checker.Equals, "0.0.0.0/0") |
|
674 |
- assert.Assert(c, nr.IPAM.Config[0].Gateway, checker.Equals, "") |
|
671 |
+ assert.Equal(c, nr.IPAM.Driver, "null") |
|
672 |
+ assert.Equal(c, len(nr.IPAM.Config), 1) |
|
673 |
+ assert.Equal(c, nr.IPAM.Config[0].Subnet, "0.0.0.0/0") |
|
674 |
+ assert.Equal(c, nr.IPAM.Config[0].Gateway, "") |
|
675 | 675 |
} |
676 | 676 |
|
677 | 677 |
func (s *DockerNetworkSuite) TestDockerNetworkInspectDefault(c *testing.T) { |
678 | 678 |
nr := getNetworkResource(c, "none") |
679 |
- assert.Assert(c, nr.Driver, checker.Equals, "null") |
|
680 |
- assert.Assert(c, nr.Scope, checker.Equals, "local") |
|
681 |
- assert.Assert(c, nr.Internal, checker.Equals, false) |
|
682 |
- assert.Assert(c, nr.EnableIPv6, checker.Equals, false) |
|
683 |
- assert.Assert(c, nr.IPAM.Driver, checker.Equals, "default") |
|
684 |
- assert.Assert(c, len(nr.IPAM.Config), checker.Equals, 0) |
|
679 |
+ assert.Equal(c, nr.Driver, "null") |
|
680 |
+ assert.Equal(c, nr.Scope, "local") |
|
681 |
+ assert.Equal(c, nr.Internal, false) |
|
682 |
+ assert.Equal(c, nr.EnableIPv6, false) |
|
683 |
+ assert.Equal(c, nr.IPAM.Driver, "default") |
|
684 |
+ assert.Equal(c, len(nr.IPAM.Config), 0) |
|
685 | 685 |
|
686 | 686 |
nr = getNetworkResource(c, "host") |
687 |
- assert.Assert(c, nr.Driver, checker.Equals, "host") |
|
688 |
- assert.Assert(c, nr.Scope, checker.Equals, "local") |
|
689 |
- assert.Assert(c, nr.Internal, checker.Equals, false) |
|
690 |
- assert.Assert(c, nr.EnableIPv6, checker.Equals, false) |
|
691 |
- assert.Assert(c, nr.IPAM.Driver, checker.Equals, "default") |
|
692 |
- assert.Assert(c, len(nr.IPAM.Config), checker.Equals, 0) |
|
687 |
+ assert.Equal(c, nr.Driver, "host") |
|
688 |
+ assert.Equal(c, nr.Scope, "local") |
|
689 |
+ assert.Equal(c, nr.Internal, false) |
|
690 |
+ assert.Equal(c, nr.EnableIPv6, false) |
|
691 |
+ assert.Equal(c, nr.IPAM.Driver, "default") |
|
692 |
+ assert.Equal(c, len(nr.IPAM.Config), 0) |
|
693 | 693 |
|
694 | 694 |
nr = getNetworkResource(c, "bridge") |
695 |
- assert.Assert(c, nr.Driver, checker.Equals, "bridge") |
|
696 |
- assert.Assert(c, nr.Scope, checker.Equals, "local") |
|
697 |
- assert.Assert(c, nr.Internal, checker.Equals, false) |
|
698 |
- assert.Assert(c, nr.EnableIPv6, checker.Equals, false) |
|
699 |
- assert.Assert(c, nr.IPAM.Driver, checker.Equals, "default") |
|
700 |
- assert.Assert(c, len(nr.IPAM.Config), checker.Equals, 1) |
|
695 |
+ assert.Equal(c, nr.Driver, "bridge") |
|
696 |
+ assert.Equal(c, nr.Scope, "local") |
|
697 |
+ assert.Equal(c, nr.Internal, false) |
|
698 |
+ assert.Equal(c, nr.EnableIPv6, false) |
|
699 |
+ assert.Equal(c, nr.IPAM.Driver, "default") |
|
700 |
+ assert.Equal(c, len(nr.IPAM.Config), 1) |
|
701 | 701 |
} |
702 | 702 |
|
703 | 703 |
func (s *DockerNetworkSuite) TestDockerNetworkInspectCustomUnspecified(c *testing.T) { |
... | ... |
@@ -706,12 +706,12 @@ func (s *DockerNetworkSuite) TestDockerNetworkInspectCustomUnspecified(c *testin |
706 | 706 |
assertNwIsAvailable(c, "test01") |
707 | 707 |
|
708 | 708 |
nr := getNetworkResource(c, "test01") |
709 |
- assert.Assert(c, nr.Driver, checker.Equals, "bridge") |
|
710 |
- assert.Assert(c, nr.Scope, checker.Equals, "local") |
|
711 |
- assert.Assert(c, nr.Internal, checker.Equals, false) |
|
712 |
- assert.Assert(c, nr.EnableIPv6, checker.Equals, false) |
|
713 |
- assert.Assert(c, nr.IPAM.Driver, checker.Equals, "default") |
|
714 |
- assert.Assert(c, len(nr.IPAM.Config), checker.Equals, 1) |
|
709 |
+ assert.Equal(c, nr.Driver, "bridge") |
|
710 |
+ assert.Equal(c, nr.Scope, "local") |
|
711 |
+ assert.Equal(c, nr.Internal, false) |
|
712 |
+ assert.Equal(c, nr.EnableIPv6, false) |
|
713 |
+ assert.Equal(c, nr.IPAM.Driver, "default") |
|
714 |
+ assert.Equal(c, len(nr.IPAM.Config), 1) |
|
715 | 715 |
|
716 | 716 |
dockerCmd(c, "network", "rm", "test01") |
717 | 717 |
assertNwNotAvailable(c, "test01") |
... | ... |
@@ -722,15 +722,15 @@ func (s *DockerNetworkSuite) TestDockerNetworkInspectCustomSpecified(c *testing. |
722 | 722 |
assertNwIsAvailable(c, "br0") |
723 | 723 |
|
724 | 724 |
nr := getNetworkResource(c, "br0") |
725 |
- assert.Assert(c, nr.Driver, checker.Equals, "bridge") |
|
726 |
- assert.Assert(c, nr.Scope, checker.Equals, "local") |
|
727 |
- assert.Assert(c, nr.Internal, checker.Equals, false) |
|
728 |
- assert.Assert(c, nr.EnableIPv6, checker.Equals, true) |
|
729 |
- assert.Assert(c, nr.IPAM.Driver, checker.Equals, "default") |
|
730 |
- assert.Assert(c, len(nr.IPAM.Config), checker.Equals, 2) |
|
731 |
- assert.Assert(c, nr.IPAM.Config[0].Subnet, checker.Equals, "172.28.0.0/16") |
|
732 |
- assert.Assert(c, nr.IPAM.Config[0].IPRange, checker.Equals, "172.28.5.0/24") |
|
733 |
- assert.Assert(c, nr.IPAM.Config[0].Gateway, checker.Equals, "172.28.5.254") |
|
725 |
+ assert.Equal(c, nr.Driver, "bridge") |
|
726 |
+ assert.Equal(c, nr.Scope, "local") |
|
727 |
+ assert.Equal(c, nr.Internal, false) |
|
728 |
+ assert.Equal(c, nr.EnableIPv6, true) |
|
729 |
+ assert.Equal(c, nr.IPAM.Driver, "default") |
|
730 |
+ assert.Equal(c, len(nr.IPAM.Config), 2) |
|
731 |
+ assert.Equal(c, nr.IPAM.Config[0].Subnet, "172.28.0.0/16") |
|
732 |
+ assert.Equal(c, nr.IPAM.Config[0].IPRange, "172.28.5.0/24") |
|
733 |
+ assert.Equal(c, nr.IPAM.Config[0].Gateway, "172.28.5.254") |
|
734 | 734 |
assert.Equal(c, nr.Internal, false) |
735 | 735 |
dockerCmd(c, "network", "rm", "br0") |
736 | 736 |
assertNwNotAvailable(c, "br0") |
... | ... |
@@ -767,9 +767,9 @@ func (s *DockerNetworkSuite) TestDockerNetworkDriverOptions(c *testing.T) { |
767 | 767 |
gopts := remoteDriverNetworkRequest.Options[netlabel.GenericData] |
768 | 768 |
assert.Assert(c, gopts, checker.NotNil) |
769 | 769 |
opts, ok := gopts.(map[string]interface{}) |
770 |
- assert.Assert(c, ok, checker.Equals, true) |
|
771 |
- assert.Assert(c, opts["opt1"], checker.Equals, "drv1") |
|
772 |
- assert.Assert(c, opts["opt2"], checker.Equals, "drv2") |
|
770 |
+ assert.Equal(c, ok, true) |
|
771 |
+ assert.Equal(c, opts["opt1"], "drv1") |
|
772 |
+ assert.Equal(c, opts["opt2"], "drv2") |
|
773 | 773 |
dockerCmd(c, "network", "rm", "testopt") |
774 | 774 |
assertNwNotAvailable(c, "testopt") |
775 | 775 |
|
... | ... |
@@ -826,14 +826,14 @@ func (s *DockerDaemonSuite) TestDockerNetworkNoDiscoveryDefaultBridgeNetwork(c * |
826 | 826 |
// verify first container's etc/hosts file has not changed after spawning the second named container |
827 | 827 |
hostsPost, err := s.d.Cmd("exec", cid1, "cat", hostsFile) |
828 | 828 |
assert.NilError(c, err) |
829 |
- assert.Assert(c, string(hosts), checker.Equals, string(hostsPost), check.Commentf("Unexpected %s change on second container creation", hostsFile)) |
|
829 |
+ assert.Equal(c, string(hosts), string(hostsPost), check.Commentf("Unexpected %s change on second container creation", hostsFile)) |
|
830 | 830 |
// stop container 2 and verify first container's etc/hosts has not changed |
831 | 831 |
_, err = s.d.Cmd("stop", cid2) |
832 | 832 |
assert.NilError(c, err) |
833 | 833 |
|
834 | 834 |
hostsPost, err = s.d.Cmd("exec", cid1, "cat", hostsFile) |
835 | 835 |
assert.NilError(c, err) |
836 |
- assert.Assert(c, string(hosts), checker.Equals, string(hostsPost), check.Commentf("Unexpected %s change on second container creation", hostsFile)) |
|
836 |
+ assert.Equal(c, string(hosts), string(hostsPost), check.Commentf("Unexpected %s change on second container creation", hostsFile)) |
|
837 | 837 |
// but discovery is on when connecting to non default bridge network |
838 | 838 |
network := "anotherbridge" |
839 | 839 |
out, err = s.d.Cmd("network", "create", network) |
... | ... |
@@ -848,7 +848,7 @@ func (s *DockerDaemonSuite) TestDockerNetworkNoDiscoveryDefaultBridgeNetwork(c * |
848 | 848 |
|
849 | 849 |
hostsPost, err = s.d.Cmd("exec", cid1, "cat", hostsFile) |
850 | 850 |
assert.NilError(c, err) |
851 |
- assert.Assert(c, string(hosts), checker.Equals, string(hostsPost), check.Commentf("Unexpected %s change on second network connection", hostsFile)) |
|
851 |
+ assert.Equal(c, string(hosts), string(hostsPost), check.Commentf("Unexpected %s change on second network connection", hostsFile)) |
|
852 | 852 |
} |
853 | 853 |
|
854 | 854 |
func (s *DockerNetworkSuite) TestDockerNetworkAnonymousEndpoint(c *testing.T) { |
... | ... |
@@ -871,7 +871,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkAnonymousEndpoint(c *testing.T) { |
871 | 871 |
|
872 | 872 |
// verify first container etc/hosts file has not changed |
873 | 873 |
hosts1post := readContainerFileWithExec(c, cid1, hostsFile) |
874 |
- assert.Assert(c, string(hosts1), checker.Equals, string(hosts1post), check.Commentf("Unexpected %s change on anonymous container creation", hostsFile)) |
|
874 |
+ assert.Equal(c, string(hosts1), string(hosts1post), check.Commentf("Unexpected %s change on anonymous container creation", hostsFile)) |
|
875 | 875 |
// Connect the 2nd container to a new network and verify the |
876 | 876 |
// first container /etc/hosts file still hasn't changed. |
877 | 877 |
dockerCmd(c, "network", "create", "-d", "bridge", cstmBridgeNw1) |
... | ... |
@@ -881,7 +881,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkAnonymousEndpoint(c *testing.T) { |
881 | 881 |
|
882 | 882 |
hosts2 := readContainerFileWithExec(c, cid2, hostsFile) |
883 | 883 |
hosts1post = readContainerFileWithExec(c, cid1, hostsFile) |
884 |
- assert.Assert(c, string(hosts1), checker.Equals, string(hosts1post), check.Commentf("Unexpected %s change on container connect", hostsFile)) |
|
884 |
+ assert.Equal(c, string(hosts1), string(hosts1post), check.Commentf("Unexpected %s change on container connect", hostsFile)) |
|
885 | 885 |
// start a named container |
886 | 886 |
cName := "AnyName" |
887 | 887 |
out, _ = dockerCmd(c, "run", "-d", "--net", cstmBridgeNw, "--name", cName, "busybox", "top") |
... | ... |
@@ -894,9 +894,9 @@ func (s *DockerNetworkSuite) TestDockerNetworkAnonymousEndpoint(c *testing.T) { |
894 | 894 |
// Stop named container and verify first two containers' etc/hosts file hasn't changed |
895 | 895 |
dockerCmd(c, "stop", cid3) |
896 | 896 |
hosts1post = readContainerFileWithExec(c, cid1, hostsFile) |
897 |
- assert.Assert(c, string(hosts1), checker.Equals, string(hosts1post), check.Commentf("Unexpected %s change on name container creation", hostsFile)) |
|
897 |
+ assert.Equal(c, string(hosts1), string(hosts1post), check.Commentf("Unexpected %s change on name container creation", hostsFile)) |
|
898 | 898 |
hosts2post := readContainerFileWithExec(c, cid2, hostsFile) |
899 |
- assert.Assert(c, string(hosts2), checker.Equals, string(hosts2post), check.Commentf("Unexpected %s change on name container creation", hostsFile)) |
|
899 |
+ assert.Equal(c, string(hosts2), string(hosts2post), check.Commentf("Unexpected %s change on name container creation", hostsFile)) |
|
900 | 900 |
// verify that container 1 and 2 can't ping the named container now |
901 | 901 |
_, _, err := dockerCmdWithError("exec", cid1, "ping", "-c", "1", cName) |
902 | 902 |
assert.ErrorContains(c, err, "") |
... | ... |
@@ -1010,7 +1010,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkMacInspect(c *testing.T) { |
1010 | 1010 |
dockerCmd(c, "run", "-d", "--net", nwn, "--name", ctn, "busybox", "top") |
1011 | 1011 |
|
1012 | 1012 |
mac := inspectField(c, ctn, "NetworkSettings.Networks."+nwn+".MacAddress") |
1013 |
- assert.Assert(c, mac, checker.Equals, "a0:b1:c2:d3:e4:f5") |
|
1013 |
+ assert.Equal(c, mac, "a0:b1:c2:d3:e4:f5") |
|
1014 | 1014 |
} |
1015 | 1015 |
|
1016 | 1016 |
func (s *DockerSuite) TestInspectAPIMultipleNetworks(c *testing.T) { |
... | ... |
@@ -1037,8 +1037,8 @@ func (s *DockerSuite) TestInspectAPIMultipleNetworks(c *testing.T) { |
1037 | 1037 |
assert.Assert(c, inspect121.NetworkSettings.Networks, checker.HasLen, 3) |
1038 | 1038 |
|
1039 | 1039 |
bridge := inspect121.NetworkSettings.Networks["bridge"] |
1040 |
- assert.Assert(c, bridge.IPAddress, checker.Equals, versionedIP) |
|
1041 |
- assert.Assert(c, bridge.IPAddress, checker.Equals, inspect121.NetworkSettings.IPAddress) |
|
1040 |
+ assert.Equal(c, bridge.IPAddress, versionedIP) |
|
1041 |
+ assert.Equal(c, bridge.IPAddress, inspect121.NetworkSettings.IPAddress) |
|
1042 | 1042 |
} |
1043 | 1043 |
|
1044 | 1044 |
func connectContainerToNetworks(c *testing.T, d *daemon.Daemon, cName string, nws []string) { |
... | ... |
@@ -1164,7 +1164,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectWithPortMapping(c *testing. |
1164 | 1164 |
func verifyPortMap(c *testing.T, container, port, originalMapping string, mustBeEqual bool) { |
1165 | 1165 |
currentMapping, _ := dockerCmd(c, "port", container, port) |
1166 | 1166 |
if mustBeEqual { |
1167 |
- assert.Assert(c, currentMapping, checker.Equals, originalMapping) |
|
1167 |
+ assert.Equal(c, currentMapping, originalMapping) |
|
1168 | 1168 |
} else { |
1169 | 1169 |
assert.Assert(c, currentMapping != originalMapping) |
1170 | 1170 |
} |
... | ... |
@@ -1213,7 +1213,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkConnectWithMac(c *testing.T) { |
1213 | 1213 |
dockerCmd(c, "run", "--name=test", "-d", "--mac-address", macAddress, "busybox", "top") |
1214 | 1214 |
assert.Assert(c, waitRun("test"), checker.IsNil) |
1215 | 1215 |
mac1 := inspectField(c, "test", "NetworkSettings.Networks.bridge.MacAddress") |
1216 |
- assert.Assert(c, strings.TrimSpace(mac1), checker.Equals, macAddress) |
|
1216 |
+ assert.Equal(c, strings.TrimSpace(mac1), macAddress) |
|
1217 | 1217 |
dockerCmd(c, "network", "connect", "mynetwork", "test") |
1218 | 1218 |
mac2 := inspectField(c, "test", "NetworkSettings.Networks.mynetwork.MacAddress") |
1219 | 1219 |
assert.Assert(c, strings.TrimSpace(mac2) != strings.TrimSpace(mac1)) |
... | ... |
@@ -1376,21 +1376,21 @@ func checkUnsupportedNetworkAndIP(c *testing.T, nwMode string) { |
1376 | 1376 |
func verifyIPAddressConfig(c *testing.T, cName, nwname, ipv4, ipv6 string) { |
1377 | 1377 |
if ipv4 != "" { |
1378 | 1378 |
out := inspectField(c, cName, fmt.Sprintf("NetworkSettings.Networks.%s.IPAMConfig.IPv4Address", nwname)) |
1379 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, ipv4) |
|
1379 |
+ assert.Equal(c, strings.TrimSpace(out), ipv4) |
|
1380 | 1380 |
} |
1381 | 1381 |
|
1382 | 1382 |
if ipv6 != "" { |
1383 | 1383 |
out := inspectField(c, cName, fmt.Sprintf("NetworkSettings.Networks.%s.IPAMConfig.IPv6Address", nwname)) |
1384 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, ipv6) |
|
1384 |
+ assert.Equal(c, strings.TrimSpace(out), ipv6) |
|
1385 | 1385 |
} |
1386 | 1386 |
} |
1387 | 1387 |
|
1388 | 1388 |
func verifyIPAddresses(c *testing.T, cName, nwname, ipv4, ipv6 string) { |
1389 | 1389 |
out := inspectField(c, cName, fmt.Sprintf("NetworkSettings.Networks.%s.IPAddress", nwname)) |
1390 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, ipv4) |
|
1390 |
+ assert.Equal(c, strings.TrimSpace(out), ipv4) |
|
1391 | 1391 |
|
1392 | 1392 |
out = inspectField(c, cName, fmt.Sprintf("NetworkSettings.Networks.%s.GlobalIPv6Address", nwname)) |
1393 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, ipv6) |
|
1393 |
+ assert.Equal(c, strings.TrimSpace(out), ipv6) |
|
1394 | 1394 |
} |
1395 | 1395 |
|
1396 | 1396 |
func (s *DockerNetworkSuite) TestDockerNetworkConnectLinkLocalIP(c *testing.T) { |
... | ... |
@@ -1612,7 +1612,7 @@ func (s *DockerSuite) TestDockerNetworkConnectFailsNoInspectChange(c *testing.T) |
1612 | 1612 |
assert.ErrorContains(c, err, "") |
1613 | 1613 |
|
1614 | 1614 |
ns1 := inspectField(c, "bb", "NetworkSettings.Networks.bridge") |
1615 |
- assert.Assert(c, ns1, checker.Equals, ns0) |
|
1615 |
+ assert.Equal(c, ns1, ns0) |
|
1616 | 1616 |
} |
1617 | 1617 |
|
1618 | 1618 |
func (s *DockerSuite) TestDockerNetworkInternalMode(c *testing.T) { |
... | ... |
@@ -1717,13 +1717,13 @@ func (s *DockerDaemonSuite) TestDaemonRestartRestoreBridgeNetwork(t *testing.T) |
1717 | 1717 |
func (s *DockerNetworkSuite) TestDockerNetworkFlagAlias(c *testing.T) { |
1718 | 1718 |
dockerCmd(c, "network", "create", "user") |
1719 | 1719 |
output, status := dockerCmd(c, "run", "--rm", "--network=user", "--network-alias=foo", "busybox", "true") |
1720 |
- assert.Assert(c, status, checker.Equals, 0, check.Commentf("unexpected status code %d (%s)", status, output)) |
|
1720 |
+ assert.Equal(c, status, 0, check.Commentf("unexpected status code %d (%s)", status, output)) |
|
1721 | 1721 |
|
1722 | 1722 |
output, status, _ = dockerCmdWithError("run", "--rm", "--net=user", "--network=user", "busybox", "true") |
1723 |
- assert.Assert(c, status, checker.Equals, 0, check.Commentf("unexpected status code %d (%s)", status, output)) |
|
1723 |
+ assert.Equal(c, status, 0, check.Commentf("unexpected status code %d (%s)", status, output)) |
|
1724 | 1724 |
|
1725 | 1725 |
output, status, _ = dockerCmdWithError("run", "--rm", "--network=user", "--net-alias=foo", "--network-alias=bar", "busybox", "true") |
1726 |
- assert.Assert(c, status, checker.Equals, 0, check.Commentf("unexpected status code %d (%s)", status, output)) |
|
1726 |
+ assert.Equal(c, status, 0, check.Commentf("unexpected status code %d (%s)", status, output)) |
|
1727 | 1727 |
} |
1728 | 1728 |
|
1729 | 1729 |
func (s *DockerNetworkSuite) TestDockerNetworkValidateIP(c *testing.T) { |
... | ... |
@@ -183,12 +183,12 @@ func (ps *DockerPluginSuite) TestPluginSet(c *testing.T) { |
183 | 183 |
assert.Assert(c, err, checker.IsNil, check.Commentf("failed to create test plugin")) |
184 | 184 |
|
185 | 185 |
env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", name) |
186 |
- assert.Assert(c, strings.TrimSpace(env), checker.Equals, "[DEBUG=0]") |
|
186 |
+ assert.Equal(c, strings.TrimSpace(env), "[DEBUG=0]") |
|
187 | 187 |
|
188 | 188 |
dockerCmd(c, "plugin", "set", name, "DEBUG=1") |
189 | 189 |
|
190 | 190 |
env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", name) |
191 |
- assert.Assert(c, strings.TrimSpace(env), checker.Equals, "[DEBUG=1]") |
|
191 |
+ assert.Equal(c, strings.TrimSpace(env), "[DEBUG=1]") |
|
192 | 192 |
|
193 | 193 |
env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}", name) |
194 | 194 |
assert.Assert(c, strings.TrimSpace(env), checker.Contains, mntSrc) |
... | ... |
@@ -221,7 +221,7 @@ func (ps *DockerPluginSuite) TestPluginInstallArgs(c *testing.T) { |
221 | 221 |
assert.Assert(c, strings.TrimSpace(out), checker.Contains, pName) |
222 | 222 |
|
223 | 223 |
env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", pName) |
224 |
- assert.Assert(c, strings.TrimSpace(env), checker.Equals, "[DEBUG=1]") |
|
224 |
+ assert.Equal(c, strings.TrimSpace(env), "[DEBUG=1]") |
|
225 | 225 |
} |
226 | 226 |
|
227 | 227 |
func (ps *DockerPluginSuite) TestPluginInstallImage(c *testing.T) { |
... | ... |
@@ -289,7 +289,7 @@ func (ps *DockerPluginSuite) TestPluginCreate(c *testing.T) { |
289 | 289 |
assert.NilError(c, err) |
290 | 290 |
assert.Assert(c, out, checker.Contains, name) |
291 | 291 |
// The output will consists of one HEADER line and one line of foo/bar-driver |
292 |
- assert.Assert(c, len(strings.Split(strings.TrimSpace(out), "\n")), checker.Equals, 2) |
|
292 |
+ assert.Equal(c, len(strings.Split(strings.TrimSpace(out), "\n")), 2) |
|
293 | 293 |
} |
294 | 294 |
|
295 | 295 |
func (ps *DockerPluginSuite) TestPluginInspect(c *testing.T) { |
... | ... |
@@ -377,12 +377,12 @@ func (ps *DockerPluginSuite) TestPluginIDPrefix(c *testing.T) { |
377 | 377 |
assert.Assert(c, out, checker.Contains, "false") |
378 | 378 |
|
379 | 379 |
env, _ := dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", id[:5]) |
380 |
- assert.Assert(c, strings.TrimSpace(env), checker.Equals, "[DEBUG=0]") |
|
380 |
+ assert.Equal(c, strings.TrimSpace(env), "[DEBUG=0]") |
|
381 | 381 |
|
382 | 382 |
dockerCmd(c, "plugin", "set", id[:5], "DEBUG=1") |
383 | 383 |
|
384 | 384 |
env, _ = dockerCmd(c, "plugin", "inspect", "-f", "{{.Settings.Env}}", id[:5]) |
385 |
- assert.Assert(c, strings.TrimSpace(env), checker.Equals, "[DEBUG=1]") |
|
385 |
+ assert.Equal(c, strings.TrimSpace(env), "[DEBUG=1]") |
|
386 | 386 |
|
387 | 387 |
// Enable |
388 | 388 |
_, _, err = dockerCmdWithError("plugin", "enable", id[:5]) |
... | ... |
@@ -236,9 +236,9 @@ func (s *DockerSuite) TestUnpublishedPortsInPsOutput(c *testing.T) { |
236 | 236 |
expBndRegx2 := regexp.MustCompile(`0.0.0.0:\d\d\d\d\d->` + unpPort2) |
237 | 237 |
out, _ = dockerCmd(c, "ps", "-n=1") |
238 | 238 |
// Cannot find expected port binding port (0.0.0.0:xxxxx->unpPort1) in docker ps output |
239 |
- assert.Assert(c, expBndRegx1.MatchString(out), checker.Equals, true, check.Commentf("out: %s; unpPort1: %s", out, unpPort1)) |
|
239 |
+ assert.Equal(c, expBndRegx1.MatchString(out), true, check.Commentf("out: %s; unpPort1: %s", out, unpPort1)) |
|
240 | 240 |
// Cannot find expected port binding port (0.0.0.0:xxxxx->unpPort2) in docker ps output |
241 |
- assert.Assert(c, expBndRegx2.MatchString(out), checker.Equals, true, check.Commentf("out: %s; unpPort2: %s", out, unpPort2)) |
|
241 |
+ assert.Equal(c, expBndRegx2.MatchString(out), true, check.Commentf("out: %s; unpPort2: %s", out, unpPort2)) |
|
242 | 242 |
|
243 | 243 |
// Run the container specifying explicit port bindings for the exposed ports |
244 | 244 |
offset := 10000 |
... | ... |
@@ -331,7 +331,7 @@ func (s *DockerSuite) TestPortBindingOnSandbox(c *testing.T) { |
331 | 331 |
testRequires(c, DaemonIsLinux, NotUserNamespace) |
332 | 332 |
dockerCmd(c, "network", "create", "--internal", "-d", "bridge", "internal-net") |
333 | 333 |
nr := getNetworkResource(c, "internal-net") |
334 |
- assert.Assert(c, nr.Internal, checker.Equals, true) |
|
334 |
+ assert.Equal(c, nr.Internal, true) |
|
335 | 335 |
|
336 | 336 |
dockerCmd(c, "run", "--net", "internal-net", "-d", "--name", "c1", |
337 | 337 |
"-p", "8080:8080", "busybox", "nc", "-l", "-p", "8080") |
... | ... |
@@ -45,79 +45,79 @@ func (s *DockerSuite) TestPsListContainersBase(c *testing.T) { |
45 | 45 |
|
46 | 46 |
// all |
47 | 47 |
out, _ = dockerCmd(c, "ps", "-a") |
48 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), []string{fourthID, thirdID, secondID, firstID}), checker.Equals, true, check.Commentf("ALL: Container list is not in the correct order: \n%s", out)) |
|
48 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), []string{fourthID, thirdID, secondID, firstID}), true, check.Commentf("ALL: Container list is not in the correct order: \n%s", out)) |
|
49 | 49 |
|
50 | 50 |
// running |
51 | 51 |
out, _ = dockerCmd(c, "ps") |
52 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), []string{fourthID, secondID, firstID}), checker.Equals, true, check.Commentf("RUNNING: Container list is not in the correct order: \n%s", out)) |
|
52 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), []string{fourthID, secondID, firstID}), true, check.Commentf("RUNNING: Container list is not in the correct order: \n%s", out)) |
|
53 | 53 |
|
54 | 54 |
// limit |
55 | 55 |
out, _ = dockerCmd(c, "ps", "-n=2", "-a") |
56 | 56 |
expected := []string{fourthID, thirdID} |
57 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("LIMIT & ALL: Container list is not in the correct order: \n%s", out)) |
|
57 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("LIMIT & ALL: Container list is not in the correct order: \n%s", out)) |
|
58 | 58 |
|
59 | 59 |
out, _ = dockerCmd(c, "ps", "-n=2") |
60 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("LIMIT: Container list is not in the correct order: \n%s", out)) |
|
60 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("LIMIT: Container list is not in the correct order: \n%s", out)) |
|
61 | 61 |
|
62 | 62 |
// filter since |
63 | 63 |
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-a") |
64 | 64 |
expected = []string{fourthID, thirdID, secondID} |
65 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter & ALL: Container list is not in the correct order: \n%s", out)) |
|
65 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter & ALL: Container list is not in the correct order: \n%s", out)) |
|
66 | 66 |
|
67 | 67 |
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID) |
68 | 68 |
expected = []string{fourthID, secondID} |
69 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out)) |
|
69 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out)) |
|
70 | 70 |
|
71 | 71 |
out, _ = dockerCmd(c, "ps", "-f", "since="+thirdID) |
72 | 72 |
expected = []string{fourthID} |
73 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out)) |
|
73 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out)) |
|
74 | 74 |
|
75 | 75 |
// filter before |
76 | 76 |
out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-a") |
77 | 77 |
expected = []string{thirdID, secondID, firstID} |
78 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("BEFORE filter & ALL: Container list is not in the correct order: \n%s", out)) |
|
78 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("BEFORE filter & ALL: Container list is not in the correct order: \n%s", out)) |
|
79 | 79 |
|
80 | 80 |
out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID) |
81 | 81 |
expected = []string{secondID, firstID} |
82 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("BEFORE filter: Container list is not in the correct order: \n%s", out)) |
|
82 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("BEFORE filter: Container list is not in the correct order: \n%s", out)) |
|
83 | 83 |
|
84 | 84 |
out, _ = dockerCmd(c, "ps", "-f", "before="+thirdID) |
85 | 85 |
expected = []string{secondID, firstID} |
86 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out)) |
|
86 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter: Container list is not in the correct order: \n%s", out)) |
|
87 | 87 |
|
88 | 88 |
// filter since & before |
89 | 89 |
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-a") |
90 | 90 |
expected = []string{thirdID, secondID} |
91 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, BEFORE filter & ALL: Container list is not in the correct order: \n%s", out)) |
|
91 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter, BEFORE filter & ALL: Container list is not in the correct order: \n%s", out)) |
|
92 | 92 |
|
93 | 93 |
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID) |
94 | 94 |
expected = []string{secondID} |
95 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, BEFORE filter: Container list is not in the correct order: \n%s", out)) |
|
95 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter, BEFORE filter: Container list is not in the correct order: \n%s", out)) |
|
96 | 96 |
|
97 | 97 |
// filter since & limit |
98 | 98 |
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-n=2", "-a") |
99 | 99 |
expected = []string{fourthID, thirdID} |
100 | 100 |
|
101 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) |
|
101 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) |
|
102 | 102 |
|
103 | 103 |
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-n=2") |
104 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, LIMIT: Container list is not in the correct order: \n%s", out)) |
|
104 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter, LIMIT: Container list is not in the correct order: \n%s", out)) |
|
105 | 105 |
|
106 | 106 |
// filter before & limit |
107 | 107 |
out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-n=1", "-a") |
108 | 108 |
expected = []string{thirdID} |
109 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("BEFORE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) |
|
109 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("BEFORE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) |
|
110 | 110 |
|
111 | 111 |
out, _ = dockerCmd(c, "ps", "-f", "before="+fourthID, "-n=1") |
112 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out)) |
|
112 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out)) |
|
113 | 113 |
|
114 | 114 |
// filter since & filter before & limit |
115 | 115 |
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-n=1", "-a") |
116 | 116 |
expected = []string{thirdID} |
117 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, BEFORE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) |
|
117 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter, BEFORE filter, LIMIT & ALL: Container list is not in the correct order: \n%s", out)) |
|
118 | 118 |
|
119 | 119 |
out, _ = dockerCmd(c, "ps", "-f", "since="+firstID, "-f", "before="+fourthID, "-n=1") |
120 |
- assert.Assert(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), checker.Equals, true, check.Commentf("SINCE filter, BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out)) |
|
120 |
+ assert.Equal(c, assertContainerList(RemoveOutputForExistingElements(out, existingContainers), expected), true, check.Commentf("SINCE filter, BEFORE filter, LIMIT: Container list is not in the correct order: \n%s", out)) |
|
121 | 121 |
|
122 | 122 |
} |
123 | 123 |
|
... | ... |
@@ -173,7 +173,7 @@ func (s *DockerSuite) TestPsListContainersSize(c *testing.T) { |
173 | 173 |
sizeIndex := strings.Index(lines[0], "SIZE") |
174 | 174 |
idIndex := strings.Index(lines[0], "CONTAINER ID") |
175 | 175 |
foundID := lines[1][idIndex : idIndex+12] |
176 |
- assert.Assert(c, foundID, checker.Equals, id[:12], check.Commentf("Expected id %s, got %s", id[:12], foundID)) |
|
176 |
+ assert.Equal(c, foundID, id[:12], check.Commentf("Expected id %s, got %s", id[:12], foundID)) |
|
177 | 177 |
expectedSize := fmt.Sprintf("%dB", 2+baseBytes) |
178 | 178 |
foundSize := lines[1][sizeIndex:] |
179 | 179 |
assert.Assert(c, foundSize, checker.Contains, expectedSize, check.Commentf("Expected size %q, got %q", expectedSize, foundSize)) |
... | ... |
@@ -196,11 +196,11 @@ func (s *DockerSuite) TestPsListContainersFilterStatus(c *testing.T) { |
196 | 196 |
// filter containers by exited |
197 | 197 |
out = cli.DockerCmd(c, "ps", "--no-trunc", "-q", "--filter=status=exited").Combined() |
198 | 198 |
containerOut := strings.TrimSpace(out) |
199 |
- assert.Assert(c, RemoveOutputForExistingElements(containerOut, existingContainers), checker.Equals, firstID) |
|
199 |
+ assert.Equal(c, RemoveOutputForExistingElements(containerOut, existingContainers), firstID) |
|
200 | 200 |
|
201 | 201 |
out = cli.DockerCmd(c, "ps", "-a", "--no-trunc", "-q", "--filter=status=running").Combined() |
202 | 202 |
containerOut = strings.TrimSpace(out) |
203 |
- assert.Assert(c, RemoveOutputForExistingElements(containerOut, existingContainers), checker.Equals, secondID) |
|
203 |
+ assert.Equal(c, RemoveOutputForExistingElements(containerOut, existingContainers), secondID) |
|
204 | 204 |
|
205 | 205 |
result := cli.Docker(cli.Args("ps", "-a", "-q", "--filter=status=rubbish"), cli.WithTimeout(time.Second*60)) |
206 | 206 |
err := "Invalid filter 'status=rubbish'" |
... | ... |
@@ -222,7 +222,7 @@ func (s *DockerSuite) TestPsListContainersFilterStatus(c *testing.T) { |
222 | 222 |
|
223 | 223 |
out = cli.DockerCmd(c, "ps", "--no-trunc", "-q", "--filter=status=paused").Combined() |
224 | 224 |
containerOut = strings.TrimSpace(out) |
225 |
- assert.Assert(c, RemoveOutputForExistingElements(containerOut, existingContainers), checker.Equals, pausedID) |
|
225 |
+ assert.Equal(c, RemoveOutputForExistingElements(containerOut, existingContainers), pausedID) |
|
226 | 226 |
} |
227 | 227 |
} |
228 | 228 |
|
... | ... |
@@ -236,7 +236,7 @@ func (s *DockerSuite) TestPsListContainersFilterHealth(c *testing.T) { |
236 | 236 |
|
237 | 237 |
out = cli.DockerCmd(c, "ps", "-q", "-l", "--no-trunc", "--filter=health=none").Combined() |
238 | 238 |
containerOut := strings.TrimSpace(out) |
239 |
- assert.Assert(c, containerOut, checker.Equals, containerID, check.Commentf("Expected id %s, got %s for legacy none filter, output: %q", containerID, containerOut, out)) |
|
239 |
+ assert.Equal(c, containerOut, containerID, check.Commentf("Expected id %s, got %s for legacy none filter, output: %q", containerID, containerOut, out)) |
|
240 | 240 |
|
241 | 241 |
// Test no health check specified explicitly |
242 | 242 |
out = runSleepingContainer(c, "--name=none", "--no-healthcheck") |
... | ... |
@@ -246,7 +246,7 @@ func (s *DockerSuite) TestPsListContainersFilterHealth(c *testing.T) { |
246 | 246 |
|
247 | 247 |
out = cli.DockerCmd(c, "ps", "-q", "-l", "--no-trunc", "--filter=health=none").Combined() |
248 | 248 |
containerOut = strings.TrimSpace(out) |
249 |
- assert.Assert(c, containerOut, checker.Equals, containerID, check.Commentf("Expected id %s, got %s for none filter, output: %q", containerID, containerOut, out)) |
|
249 |
+ assert.Equal(c, containerOut, containerID, check.Commentf("Expected id %s, got %s for none filter, output: %q", containerID, containerOut, out)) |
|
250 | 250 |
|
251 | 251 |
// Test failing health check |
252 | 252 |
out = runSleepingContainer(c, "--name=failing_container", "--health-cmd=exit 1", "--health-interval=1s") |
... | ... |
@@ -256,7 +256,7 @@ func (s *DockerSuite) TestPsListContainersFilterHealth(c *testing.T) { |
256 | 256 |
|
257 | 257 |
out = cli.DockerCmd(c, "ps", "-q", "--no-trunc", "--filter=health=unhealthy").Combined() |
258 | 258 |
containerOut = strings.TrimSpace(out) |
259 |
- assert.Assert(c, containerOut, checker.Equals, containerID, check.Commentf("Expected containerID %s, got %s for unhealthy filter, output: %q", containerID, containerOut, out)) |
|
259 |
+ assert.Equal(c, containerOut, containerID, check.Commentf("Expected containerID %s, got %s for unhealthy filter, output: %q", containerID, containerOut, out)) |
|
260 | 260 |
|
261 | 261 |
// Check passing healthcheck |
262 | 262 |
out = runSleepingContainer(c, "--name=passing_container", "--health-cmd=exit 0", "--health-interval=1s") |
... | ... |
@@ -266,7 +266,7 @@ func (s *DockerSuite) TestPsListContainersFilterHealth(c *testing.T) { |
266 | 266 |
|
267 | 267 |
out = cli.DockerCmd(c, "ps", "-q", "--no-trunc", "--filter=health=healthy").Combined() |
268 | 268 |
containerOut = strings.TrimSpace(RemoveOutputForExistingElements(out, existingContainers)) |
269 |
- assert.Assert(c, containerOut, checker.Equals, containerID, check.Commentf("Expected containerID %s, got %s for healthy filter, output: %q", containerID, containerOut, out)) |
|
269 |
+ assert.Equal(c, containerOut, containerID, check.Commentf("Expected containerID %s, got %s for healthy filter, output: %q", containerID, containerOut, out)) |
|
270 | 270 |
} |
271 | 271 |
|
272 | 272 |
func (s *DockerSuite) TestPsListContainersFilterID(c *testing.T) { |
... | ... |
@@ -280,7 +280,7 @@ func (s *DockerSuite) TestPsListContainersFilterID(c *testing.T) { |
280 | 280 |
// filter containers by id |
281 | 281 |
out, _ = dockerCmd(c, "ps", "-a", "-q", "--filter=id="+firstID) |
282 | 282 |
containerOut := strings.TrimSpace(out) |
283 |
- assert.Assert(c, containerOut, checker.Equals, firstID[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out)) |
|
283 |
+ assert.Equal(c, containerOut, firstID[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID[:12], containerOut, out)) |
|
284 | 284 |
} |
285 | 285 |
|
286 | 286 |
func (s *DockerSuite) TestPsListContainersFilterName(c *testing.T) { |
... | ... |
@@ -294,7 +294,7 @@ func (s *DockerSuite) TestPsListContainersFilterName(c *testing.T) { |
294 | 294 |
// filter containers by name |
295 | 295 |
out, _ := dockerCmd(c, "ps", "-a", "-q", "--filter=name=a_name_to_match") |
296 | 296 |
containerOut := strings.TrimSpace(out) |
297 |
- assert.Assert(c, containerOut, checker.Equals, id[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", id[:12], containerOut, out)) |
|
297 |
+ assert.Equal(c, containerOut, id[:12], check.Commentf("Expected id %s, got %s for exited filter, output: %q", id[:12], containerOut, out)) |
|
298 | 298 |
} |
299 | 299 |
|
300 | 300 |
// Test for the ancestor filter for ps. |
... | ... |
@@ -396,7 +396,7 @@ func checkPsAncestorFilterOutput(c *testing.T, out string, filterName string, ex |
396 | 396 |
break |
397 | 397 |
} |
398 | 398 |
} |
399 |
- assert.Assert(c, same, checker.Equals, true, check.Commentf("Expected filtered container(s) for %s ancestor filter to be %v, got %v", filterName, expectedIDs, actualIDs)) |
|
399 |
+ assert.Equal(c, same, true, check.Commentf("Expected filtered container(s) for %s ancestor filter to be %v, got %v", filterName, expectedIDs, actualIDs)) |
|
400 | 400 |
} |
401 | 401 |
} |
402 | 402 |
|
... | ... |
@@ -416,17 +416,17 @@ func (s *DockerSuite) TestPsListContainersFilterLabel(c *testing.T) { |
416 | 416 |
// filter containers by exact match |
417 | 417 |
out, _ := dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me") |
418 | 418 |
containerOut := strings.TrimSpace(out) |
419 |
- assert.Assert(c, containerOut, checker.Equals, firstID, check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out)) |
|
419 |
+ assert.Equal(c, containerOut, firstID, check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out)) |
|
420 | 420 |
|
421 | 421 |
// filter containers by two labels |
422 | 422 |
out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me", "--filter=label=second=tag") |
423 | 423 |
containerOut = strings.TrimSpace(out) |
424 |
- assert.Assert(c, containerOut, checker.Equals, firstID, check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out)) |
|
424 |
+ assert.Equal(c, containerOut, firstID, check.Commentf("Expected id %s, got %s for exited filter, output: %q", firstID, containerOut, out)) |
|
425 | 425 |
|
426 | 426 |
// filter containers by two labels, but expect not found because of AND behavior |
427 | 427 |
out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match=me", "--filter=label=second=tag-no") |
428 | 428 |
containerOut = strings.TrimSpace(out) |
429 |
- assert.Assert(c, containerOut, checker.Equals, "", check.Commentf("Expected nothing, got %s for exited filter, output: %q", containerOut, out)) |
|
429 |
+ assert.Equal(c, containerOut, "", check.Commentf("Expected nothing, got %s for exited filter, output: %q", containerOut, out)) |
|
430 | 430 |
|
431 | 431 |
// filter containers by exact key |
432 | 432 |
out, _ = dockerCmd(c, "ps", "-a", "-q", "--no-trunc", "--filter=label=match") |
... | ... |
@@ -499,11 +499,11 @@ func (s *DockerSuite) TestPsRightTagName(c *testing.T) { |
499 | 499 |
f := strings.Fields(line) |
500 | 500 |
switch f[0] { |
501 | 501 |
case id1: |
502 |
- assert.Assert(c, f[1], checker.Equals, "busybox", check.Commentf("Expected %s tag for id %s, got %s", "busybox", id1, f[1])) |
|
502 |
+ assert.Equal(c, f[1], "busybox", check.Commentf("Expected %s tag for id %s, got %s", "busybox", id1, f[1])) |
|
503 | 503 |
case id2: |
504 |
- assert.Assert(c, f[1], checker.Equals, tag, check.Commentf("Expected %s tag for id %s, got %s", tag, id2, f[1])) |
|
504 |
+ assert.Equal(c, f[1], tag, check.Commentf("Expected %s tag for id %s, got %s", tag, id2, f[1])) |
|
505 | 505 |
case id3: |
506 |
- assert.Assert(c, f[1], checker.Equals, imageID, check.Commentf("Expected %s imageID for id %s, got %s", tag, id3, f[1])) |
|
506 |
+ assert.Equal(c, f[1], imageID, check.Commentf("Expected %s imageID for id %s, got %s", tag, id3, f[1])) |
|
507 | 507 |
default: |
508 | 508 |
c.Fatalf("Unexpected id %s, expected %s and %s and %s", f[0], id1, id2, id3) |
509 | 509 |
} |
... | ... |
@@ -532,7 +532,7 @@ func (s *DockerSuite) TestPsListContainersFilterCreated(c *testing.T) { |
532 | 532 |
assert.Assert(c, line, checker.Contains, "Created", check.Commentf("Missing 'Created' on '%s'", line)) |
533 | 533 |
} |
534 | 534 |
|
535 |
- assert.Assert(c, hits, checker.Equals, 1, check.Commentf("Should have seen '%s' in ps -a output once:%d\n%s", shortCID, hits, out)) |
|
535 |
+ assert.Equal(c, hits, 1, check.Commentf("Should have seen '%s' in ps -a output once:%d\n%s", shortCID, hits, out)) |
|
536 | 536 |
|
537 | 537 |
// filter containers by 'create' - note, no -a needed |
538 | 538 |
out, _ = dockerCmd(c, "ps", "-q", "-f", "status=created") |
... | ... |
@@ -564,11 +564,11 @@ func (s *DockerSuite) TestPsImageIDAfterUpdate(c *testing.T) { |
564 | 564 |
lines = RemoveLinesForExistingElements(lines, existingContainers) |
565 | 565 |
// skip header |
566 | 566 |
lines = lines[1:] |
567 |
- assert.Assert(c, len(lines), checker.Equals, 1) |
|
567 |
+ assert.Equal(c, len(lines), 1) |
|
568 | 568 |
|
569 | 569 |
for _, line := range lines { |
570 | 570 |
f := strings.Fields(line) |
571 |
- assert.Assert(c, f[1], checker.Equals, originalImageName) |
|
571 |
+ assert.Equal(c, f[1], originalImageName) |
|
572 | 572 |
} |
573 | 573 |
|
574 | 574 |
icmd.RunCommand(dockerBinary, "commit", containerID, updatedImageName).Assert(c, icmd.Success) |
... | ... |
@@ -581,11 +581,11 @@ func (s *DockerSuite) TestPsImageIDAfterUpdate(c *testing.T) { |
581 | 581 |
lines = RemoveLinesForExistingElements(lines, existingContainers) |
582 | 582 |
// skip header |
583 | 583 |
lines = lines[1:] |
584 |
- assert.Assert(c, len(lines), checker.Equals, 1) |
|
584 |
+ assert.Equal(c, len(lines), 1) |
|
585 | 585 |
|
586 | 586 |
for _, line := range lines { |
587 | 587 |
f := strings.Fields(line) |
588 |
- assert.Assert(c, f[1], checker.Equals, originalImageID) |
|
588 |
+ assert.Equal(c, f[1], originalImageID) |
|
589 | 589 |
} |
590 | 590 |
|
591 | 591 |
} |
... | ... |
@@ -598,7 +598,7 @@ func (s *DockerSuite) TestPsNotShowPortsOfStoppedContainer(c *testing.T) { |
598 | 598 |
lines := strings.Split(strings.TrimSpace(string(out)), "\n") |
599 | 599 |
expected := "0.0.0.0:5000->5000/tcp" |
600 | 600 |
fields := strings.Fields(lines[1]) |
601 |
- assert.Assert(c, fields[len(fields)-2], checker.Equals, expected, check.Commentf("Expected: %v, got: %v", expected, fields[len(fields)-2])) |
|
601 |
+ assert.Equal(c, fields[len(fields)-2], expected, check.Commentf("Expected: %v, got: %v", expected, fields[len(fields)-2])) |
|
602 | 602 |
|
603 | 603 |
dockerCmd(c, "kill", "foo") |
604 | 604 |
dockerCmd(c, "wait", "foo") |
... | ... |
@@ -642,8 +642,8 @@ func (s *DockerSuite) TestPsShowMounts(c *testing.T) { |
642 | 642 |
|
643 | 643 |
fields := strings.Fields(lines[0]) |
644 | 644 |
assert.Equal(c, len(fields), 2) |
645 |
- assert.Assert(c, fields[0], checker.Equals, "bind-mount-test") |
|
646 |
- assert.Assert(c, fields[1], checker.Equals, bindMountSource) |
|
645 |
+ assert.Equal(c, fields[0], "bind-mount-test") |
|
646 |
+ assert.Equal(c, fields[1], bindMountSource) |
|
647 | 647 |
|
648 | 648 |
fields = strings.Fields(lines[1]) |
649 | 649 |
assert.Equal(c, len(fields), 2) |
... | ... |
@@ -651,7 +651,7 @@ func (s *DockerSuite) TestPsShowMounts(c *testing.T) { |
651 | 651 |
anonymousVolumeID := fields[1] |
652 | 652 |
|
653 | 653 |
fields = strings.Fields(lines[2]) |
654 |
- assert.Assert(c, fields[1], checker.Equals, "ps-volume-test") |
|
654 |
+ assert.Equal(c, fields[1], "ps-volume-test") |
|
655 | 655 |
|
656 | 656 |
// filter by volume name |
657 | 657 |
out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume=ps-volume-test") |
... | ... |
@@ -661,7 +661,7 @@ func (s *DockerSuite) TestPsShowMounts(c *testing.T) { |
661 | 661 |
assert.Equal(c, len(lines), 1) |
662 | 662 |
|
663 | 663 |
fields = strings.Fields(lines[0]) |
664 |
- assert.Assert(c, fields[1], checker.Equals, "ps-volume-test") |
|
664 |
+ assert.Equal(c, fields[1], "ps-volume-test") |
|
665 | 665 |
|
666 | 666 |
// empty results filtering by unknown volume |
667 | 667 |
out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume=this-volume-should-not-exist") |
... | ... |
@@ -675,9 +675,9 @@ func (s *DockerSuite) TestPsShowMounts(c *testing.T) { |
675 | 675 |
assert.Equal(c, len(lines), 2) |
676 | 676 |
|
677 | 677 |
fields = strings.Fields(lines[0]) |
678 |
- assert.Assert(c, fields[1], checker.Equals, anonymousVolumeID) |
|
678 |
+ assert.Equal(c, fields[1], anonymousVolumeID) |
|
679 | 679 |
fields = strings.Fields(lines[1]) |
680 |
- assert.Assert(c, fields[1], checker.Equals, "ps-volume-test") |
|
680 |
+ assert.Equal(c, fields[1], "ps-volume-test") |
|
681 | 681 |
|
682 | 682 |
// filter by bind mount source |
683 | 683 |
out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+bindMountSource) |
... | ... |
@@ -688,8 +688,8 @@ func (s *DockerSuite) TestPsShowMounts(c *testing.T) { |
688 | 688 |
|
689 | 689 |
fields = strings.Fields(lines[0]) |
690 | 690 |
assert.Equal(c, len(fields), 2) |
691 |
- assert.Assert(c, fields[0], checker.Equals, "bind-mount-test") |
|
692 |
- assert.Assert(c, fields[1], checker.Equals, bindMountSource) |
|
691 |
+ assert.Equal(c, fields[0], "bind-mount-test") |
|
692 |
+ assert.Equal(c, fields[1], bindMountSource) |
|
693 | 693 |
|
694 | 694 |
// filter by bind mount destination |
695 | 695 |
out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+bindMountDestination) |
... | ... |
@@ -700,8 +700,8 @@ func (s *DockerSuite) TestPsShowMounts(c *testing.T) { |
700 | 700 |
|
701 | 701 |
fields = strings.Fields(lines[0]) |
702 | 702 |
assert.Equal(c, len(fields), 2) |
703 |
- assert.Assert(c, fields[0], checker.Equals, "bind-mount-test") |
|
704 |
- assert.Assert(c, fields[1], checker.Equals, bindMountSource) |
|
703 |
+ assert.Equal(c, fields[0], "bind-mount-test") |
|
704 |
+ assert.Equal(c, fields[1], bindMountSource) |
|
705 | 705 |
|
706 | 706 |
// empty results filtering by unknown mount point |
707 | 707 |
out, _ = dockerCmd(c, "ps", "--format", "{{.Names}} {{.Mounts}}", "--filter", "volume="+prefix+slash+"this-path-was-never-mounted") |
... | ... |
@@ -42,23 +42,23 @@ func (s *DockerSuite) TestRmiTag(c *testing.T) { |
42 | 42 |
dockerCmd(c, "tag", "busybox", "utest:5000/docker:tag3") |
43 | 43 |
{ |
44 | 44 |
imagesAfter, _ := dockerCmd(c, "images", "-a") |
45 |
- assert.Assert(c, strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+3, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
45 |
+ assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+3, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
46 | 46 |
} |
47 | 47 |
dockerCmd(c, "rmi", "utest/docker:tag2") |
48 | 48 |
{ |
49 | 49 |
imagesAfter, _ := dockerCmd(c, "images", "-a") |
50 |
- assert.Assert(c, strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+2, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
50 |
+ assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+2, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
51 | 51 |
} |
52 | 52 |
dockerCmd(c, "rmi", "utest:5000/docker:tag3") |
53 | 53 |
{ |
54 | 54 |
imagesAfter, _ := dockerCmd(c, "images", "-a") |
55 |
- assert.Assert(c, strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+1, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
55 |
+ assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+1, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
56 | 56 |
|
57 | 57 |
} |
58 | 58 |
dockerCmd(c, "rmi", "utest:tag1") |
59 | 59 |
{ |
60 | 60 |
imagesAfter, _ := dockerCmd(c, "images", "-a") |
61 |
- assert.Assert(c, strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n"), check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
61 |
+ assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n"), check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
62 | 62 |
|
63 | 63 |
} |
64 | 64 |
} |
... | ... |
@@ -81,7 +81,7 @@ func (s *DockerSuite) TestRmiImgIDMultipleTag(c *testing.T) { |
81 | 81 |
|
82 | 82 |
imagesAfter := cli.DockerCmd(c, "images", "-a").Combined() |
83 | 83 |
// tag busybox to create 2 more images with same imageID |
84 |
- assert.Assert(c, strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+2, check.Commentf("docker images shows: %q\n", imagesAfter)) |
|
84 |
+ assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+2, check.Commentf("docker images shows: %q\n", imagesAfter)) |
|
85 | 85 |
|
86 | 86 |
imgID := inspectField(c, "busybox-one:tag1", "Id") |
87 | 87 |
|
... | ... |
@@ -123,7 +123,7 @@ func (s *DockerSuite) TestRmiImgIDForce(c *testing.T) { |
123 | 123 |
cli.DockerCmd(c, "tag", "busybox-test", "utest:5000/docker:tag4") |
124 | 124 |
{ |
125 | 125 |
imagesAfter := cli.DockerCmd(c, "images", "-a").Combined() |
126 |
- assert.Assert(c, strings.Count(imagesAfter, "\n"), checker.Equals, strings.Count(imagesBefore, "\n")+4, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
126 |
+ assert.Equal(c, strings.Count(imagesAfter, "\n"), strings.Count(imagesBefore, "\n")+4, check.Commentf("before: %q\n\nafter: %q\n", imagesBefore, imagesAfter)) |
|
127 | 127 |
} |
128 | 128 |
imgID := inspectField(c, "busybox-test", "Id") |
129 | 129 |
|
... | ... |
@@ -166,7 +166,7 @@ func (s *DockerSuite) TestRmiTagWithExistingContainers(c *testing.T) { |
166 | 166 |
dockerCmd(c, "run", "--name", container, bb, "/bin/true") |
167 | 167 |
|
168 | 168 |
out, _ := dockerCmd(c, "rmi", newtag) |
169 |
- assert.Assert(c, strings.Count(out, "Untagged: "), checker.Equals, 1) |
|
169 |
+ assert.Equal(c, strings.Count(out, "Untagged: "), 1) |
|
170 | 170 |
} |
171 | 171 |
|
172 | 172 |
func (s *DockerSuite) TestRmiForceWithExistingContainers(c *testing.T) { |
... | ... |
@@ -274,7 +274,7 @@ RUN echo 2 #layer2 |
274 | 274 |
// See if the "tmp2" can be untagged. |
275 | 275 |
out, _ = dockerCmd(c, "rmi", newTag) |
276 | 276 |
// Expected 1 untagged entry |
277 |
- assert.Assert(c, strings.Count(out, "Untagged: "), checker.Equals, 1, check.Commentf("out: %s", out)) |
|
277 |
+ assert.Equal(c, strings.Count(out, "Untagged: "), 1, check.Commentf("out: %s", out)) |
|
278 | 278 |
|
279 | 279 |
// Now let's add the tag again and create a container based on it. |
280 | 280 |
dockerCmd(c, "tag", idToTag, newTag) |
... | ... |
@@ -335,5 +335,5 @@ func (s *DockerSuite) TestRmiByIDHardConflict(c *testing.T) { |
335 | 335 |
|
336 | 336 |
// check that tag was not removed |
337 | 337 |
imgID2 := inspectField(c, "busybox:latest", "Id") |
338 |
- assert.Assert(c, imgID, checker.Equals, imgID2) |
|
338 |
+ assert.Equal(c, imgID, imgID2) |
|
339 | 339 |
} |
... | ... |
@@ -3212,7 +3212,7 @@ func (s *DockerSuite) TestRunCreateContainerFailedCleanUp(c *testing.T) { |
3212 | 3212 |
|
3213 | 3213 |
containerID, err := inspectFieldWithError(name, "Id") |
3214 | 3214 |
assert.Assert(c, err, checker.NotNil, check.Commentf("Expected not to have this container: %s!", containerID)) |
3215 |
- assert.Assert(c, containerID, checker.Equals, "", check.Commentf("Expected not to have this container: %s!", containerID)) |
|
3215 |
+ assert.Equal(c, containerID, "", check.Commentf("Expected not to have this container: %s!", containerID)) |
|
3216 | 3216 |
} |
3217 | 3217 |
|
3218 | 3218 |
func (s *DockerSuite) TestRunNamedVolume(c *testing.T) { |
... | ... |
@@ -3221,10 +3221,10 @@ func (s *DockerSuite) TestRunNamedVolume(c *testing.T) { |
3221 | 3221 |
dockerCmd(c, "run", "--name=test", "-v", "testing:"+prefix+"/foo", "busybox", "sh", "-c", "echo hello > "+prefix+"/foo/bar") |
3222 | 3222 |
|
3223 | 3223 |
out, _ := dockerCmd(c, "run", "--volumes-from", "test", "busybox", "sh", "-c", "cat "+prefix+"/foo/bar") |
3224 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "hello") |
|
3224 |
+ assert.Equal(c, strings.TrimSpace(out), "hello") |
|
3225 | 3225 |
|
3226 | 3226 |
out, _ = dockerCmd(c, "run", "-v", "testing:"+prefix+"/foo", "busybox", "sh", "-c", "cat "+prefix+"/foo/bar") |
3227 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "hello") |
|
3227 |
+ assert.Equal(c, strings.TrimSpace(out), "hello") |
|
3228 | 3228 |
} |
3229 | 3229 |
|
3230 | 3230 |
func (s *DockerSuite) TestRunWithUlimits(c *testing.T) { |
... | ... |
@@ -3870,7 +3870,7 @@ func (s *DockerSuite) TestRunNamedVolumeCopyImageData(c *testing.T) { |
3870 | 3870 |
|
3871 | 3871 |
dockerCmd(c, "run", "-v", "foo:/foo", testImg) |
3872 | 3872 |
out, _ := dockerCmd(c, "run", "-v", "foo:/foo", "busybox", "cat", "/foo/hello") |
3873 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "hello") |
|
3873 |
+ assert.Equal(c, strings.TrimSpace(out), "hello") |
|
3874 | 3874 |
} |
3875 | 3875 |
|
3876 | 3876 |
func (s *DockerSuite) TestRunNamedVolumeNotRemoved(c *testing.T) { |
... | ... |
@@ -4054,7 +4054,7 @@ func (s *DockerSuite) TestRunRmAndWait(c *testing.T) { |
4054 | 4054 |
out, code, err := dockerCmdWithError("wait", "test") |
4055 | 4055 |
assert.Assert(c, err, checker.IsNil, check.Commentf("out: %s; exit code: %d", out, code)) |
4056 | 4056 |
assert.Equal(c, out, "2\n", "exit code: %d", code) |
4057 |
- assert.Assert(c, code, checker.Equals, 0) |
|
4057 |
+ assert.Equal(c, code, 0) |
|
4058 | 4058 |
} |
4059 | 4059 |
|
4060 | 4060 |
// Test that auto-remove is performed by the daemon (API 1.25 and above) |
... | ... |
@@ -4102,7 +4102,7 @@ exec "$@"`, |
4102 | 4102 |
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
4103 | 4103 |
|
4104 | 4104 |
out := cli.DockerCmd(c, "run", "--entrypoint=", "-t", name, "echo", "foo").Combined() |
4105 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "foo") |
|
4105 |
+ assert.Equal(c, strings.TrimSpace(out), "foo") |
|
4106 | 4106 |
|
4107 | 4107 |
// CMD will be reset as well (the same as setting a custom entrypoint) |
4108 | 4108 |
cli.Docker(cli.Args("run", "--entrypoint=", "-t", name)).Assert(c, icmd.Expected{ |
... | ... |
@@ -137,7 +137,7 @@ func (s *DockerSuite) TestRunAttachDetach(c *testing.T) { |
137 | 137 |
} |
138 | 138 |
|
139 | 139 |
running := inspectField(c, name, "State.Running") |
140 |
- assert.Assert(c, running, checker.Equals, "true", check.Commentf("expected container to still be running")) |
|
140 |
+ assert.Equal(c, running, "true", check.Commentf("expected container to still be running")) |
|
141 | 141 |
|
142 | 142 |
out, _ = dockerCmd(c, "events", "--since=0", "--until", daemonUnixTime(c), "-f", "container="+name) |
143 | 143 |
// attach and detach event should be monitored |
... | ... |
@@ -203,7 +203,7 @@ func (s *DockerSuite) TestRunAttachDetachFromFlag(c *testing.T) { |
203 | 203 |
} |
204 | 204 |
|
205 | 205 |
running := inspectField(c, name, "State.Running") |
206 |
- assert.Assert(c, running, checker.Equals, "true", check.Commentf("expected container to still be running")) |
|
206 |
+ assert.Equal(c, running, "true", check.Commentf("expected container to still be running")) |
|
207 | 207 |
} |
208 | 208 |
|
209 | 209 |
// TestRunAttachDetachFromInvalidFlag checks attaching and detaching with the escape sequence specified via flags. |
... | ... |
@@ -319,7 +319,7 @@ func (s *DockerSuite) TestRunAttachDetachFromConfig(c *testing.T) { |
319 | 319 |
} |
320 | 320 |
|
321 | 321 |
running := inspectField(c, name, "State.Running") |
322 |
- assert.Assert(c, running, checker.Equals, "true", check.Commentf("expected container to still be running")) |
|
322 |
+ assert.Equal(c, running, "true", check.Commentf("expected container to still be running")) |
|
323 | 323 |
} |
324 | 324 |
|
325 | 325 |
// TestRunAttachDetachKeysOverrideConfig checks attaching and detaching with the detach flags, making sure it overrides config file |
... | ... |
@@ -402,7 +402,7 @@ func (s *DockerSuite) TestRunAttachDetachKeysOverrideConfig(c *testing.T) { |
402 | 402 |
} |
403 | 403 |
|
404 | 404 |
running := inspectField(c, name, "State.Running") |
405 |
- assert.Assert(c, running, checker.Equals, "true", check.Commentf("expected container to still be running")) |
|
405 |
+ assert.Equal(c, running, "true", check.Commentf("expected container to still be running")) |
|
406 | 406 |
} |
407 | 407 |
|
408 | 408 |
func (s *DockerSuite) TestRunAttachInvalidDetachKeySequencePreserved(c *testing.T) { |
... | ... |
@@ -793,7 +793,7 @@ func (s *DockerSuite) TestRunWithDefaultShmSize(c *testing.T) { |
793 | 793 |
c.Fatalf("Expected shm of 64MB in mount command, got %v", out) |
794 | 794 |
} |
795 | 795 |
shmSize := inspectField(c, name, "HostConfig.ShmSize") |
796 |
- assert.Assert(c, shmSize, checker.Equals, "67108864") |
|
796 |
+ assert.Equal(c, shmSize, "67108864") |
|
797 | 797 |
} |
798 | 798 |
|
799 | 799 |
func (s *DockerSuite) TestRunWithShmSize(c *testing.T) { |
... | ... |
@@ -806,7 +806,7 @@ func (s *DockerSuite) TestRunWithShmSize(c *testing.T) { |
806 | 806 |
c.Fatalf("Expected shm of 1GB in mount command, got %v", out) |
807 | 807 |
} |
808 | 808 |
shmSize := inspectField(c, name, "HostConfig.ShmSize") |
809 |
- assert.Assert(c, shmSize, checker.Equals, "1073741824") |
|
809 |
+ assert.Equal(c, shmSize, "1073741824") |
|
810 | 810 |
} |
811 | 811 |
|
812 | 812 |
func (s *DockerSuite) TestRunTmpfsMountsEnsureOrdered(c *testing.T) { |
... | ... |
@@ -895,23 +895,23 @@ func (s *DockerSuite) TestRunSysctls(c *testing.T) { |
895 | 895 |
var err error |
896 | 896 |
|
897 | 897 |
out, _ := dockerCmd(c, "run", "--sysctl", "net.ipv4.ip_forward=1", "--name", "test", "busybox", "cat", "/proc/sys/net/ipv4/ip_forward") |
898 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "1") |
|
898 |
+ assert.Equal(c, strings.TrimSpace(out), "1") |
|
899 | 899 |
|
900 | 900 |
out = inspectFieldJSON(c, "test", "HostConfig.Sysctls") |
901 | 901 |
|
902 | 902 |
sysctls := make(map[string]string) |
903 | 903 |
err = json.Unmarshal([]byte(out), &sysctls) |
904 | 904 |
assert.NilError(c, err) |
905 |
- assert.Assert(c, sysctls["net.ipv4.ip_forward"], checker.Equals, "1") |
|
905 |
+ assert.Equal(c, sysctls["net.ipv4.ip_forward"], "1") |
|
906 | 906 |
|
907 | 907 |
out, _ = dockerCmd(c, "run", "--sysctl", "net.ipv4.ip_forward=0", "--name", "test1", "busybox", "cat", "/proc/sys/net/ipv4/ip_forward") |
908 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "0") |
|
908 |
+ assert.Equal(c, strings.TrimSpace(out), "0") |
|
909 | 909 |
|
910 | 910 |
out = inspectFieldJSON(c, "test1", "HostConfig.Sysctls") |
911 | 911 |
|
912 | 912 |
err = json.Unmarshal([]byte(out), &sysctls) |
913 | 913 |
assert.NilError(c, err) |
914 |
- assert.Assert(c, sysctls["net.ipv4.ip_forward"], checker.Equals, "0") |
|
914 |
+ assert.Equal(c, sysctls["net.ipv4.ip_forward"], "0") |
|
915 | 915 |
|
916 | 916 |
icmd.RunCommand(dockerBinary, "run", "--sysctl", "kernel.foobar=1", "--name", "test2", |
917 | 917 |
"busybox", "cat", "/proc/sys/kernel/foobar").Assert(c, icmd.Expected{ |
... | ... |
@@ -1577,7 +1577,7 @@ func (s *DockerSuite) TestRunWithNanoCPUs(c *testing.T) { |
1577 | 1577 |
assert.NilError(c, err) |
1578 | 1578 |
inspect, err := clt.ContainerInspect(context.Background(), "test") |
1579 | 1579 |
assert.NilError(c, err) |
1580 |
- assert.Assert(c, inspect.HostConfig.NanoCPUs, checker.Equals, int64(500000000)) |
|
1580 |
+ assert.Equal(c, inspect.HostConfig.NanoCPUs, int64(500000000)) |
|
1581 | 1581 |
|
1582 | 1582 |
out = inspectField(c, "test", "HostConfig.CpuQuota") |
1583 | 1583 |
assert.Equal(c, out, "0", "CPU CFS quota should be 0") |
... | ... |
@@ -44,9 +44,9 @@ func (s *DockerSwarmSuite) TestServiceCreateMountVolume(c *testing.T) { |
44 | 44 |
assert.Assert(c, json.Unmarshal([]byte(out), &mountConfig), checker.IsNil) |
45 | 45 |
assert.Assert(c, mountConfig, checker.HasLen, 1) |
46 | 46 |
|
47 |
- assert.Assert(c, mountConfig[0].Source, checker.Equals, "foo") |
|
48 |
- assert.Assert(c, mountConfig[0].Target, checker.Equals, "/foo") |
|
49 |
- assert.Assert(c, mountConfig[0].Type, checker.Equals, mount.TypeVolume) |
|
47 |
+ assert.Equal(c, mountConfig[0].Source, "foo") |
|
48 |
+ assert.Equal(c, mountConfig[0].Target, "/foo") |
|
49 |
+ assert.Equal(c, mountConfig[0].Type, mount.TypeVolume) |
|
50 | 50 |
assert.Assert(c, mountConfig[0].VolumeOptions, checker.NotNil) |
51 | 51 |
assert.Assert(c, mountConfig[0].VolumeOptions.NoCopy, checker.True) |
52 | 52 |
|
... | ... |
@@ -58,10 +58,10 @@ func (s *DockerSwarmSuite) TestServiceCreateMountVolume(c *testing.T) { |
58 | 58 |
assert.Assert(c, json.Unmarshal([]byte(out), &mounts), checker.IsNil) |
59 | 59 |
assert.Assert(c, mounts, checker.HasLen, 1) |
60 | 60 |
|
61 |
- assert.Assert(c, mounts[0].Type, checker.Equals, mount.TypeVolume) |
|
62 |
- assert.Assert(c, mounts[0].Name, checker.Equals, "foo") |
|
63 |
- assert.Assert(c, mounts[0].Destination, checker.Equals, "/foo") |
|
64 |
- assert.Assert(c, mounts[0].RW, checker.Equals, true) |
|
61 |
+ assert.Equal(c, mounts[0].Type, mount.TypeVolume) |
|
62 |
+ assert.Equal(c, mounts[0].Name, "foo") |
|
63 |
+ assert.Equal(c, mounts[0].Destination, "/foo") |
|
64 |
+ assert.Equal(c, mounts[0].RW, true) |
|
65 | 65 |
} |
66 | 66 |
|
67 | 67 |
func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *testing.T) { |
... | ... |
@@ -87,11 +87,11 @@ func (s *DockerSwarmSuite) TestServiceCreateWithSecretSimple(c *testing.T) { |
87 | 87 |
assert.Assert(c, json.Unmarshal([]byte(out), &refs), checker.IsNil) |
88 | 88 |
assert.Equal(c, len(refs), 1) |
89 | 89 |
|
90 |
- assert.Assert(c, refs[0].SecretName, checker.Equals, testName) |
|
90 |
+ assert.Equal(c, refs[0].SecretName, testName) |
|
91 | 91 |
assert.Assert(c, refs[0].File != nil) |
92 |
- assert.Assert(c, refs[0].File.Name, checker.Equals, testName) |
|
93 |
- assert.Assert(c, refs[0].File.UID, checker.Equals, "0") |
|
94 |
- assert.Assert(c, refs[0].File.GID, checker.Equals, "0") |
|
92 |
+ assert.Equal(c, refs[0].File.Name, testName) |
|
93 |
+ assert.Equal(c, refs[0].File.UID, "0") |
|
94 |
+ assert.Equal(c, refs[0].File.GID, "0") |
|
95 | 95 |
|
96 | 96 |
out, err = d.Cmd("service", "rm", serviceName) |
97 | 97 |
assert.NilError(c, err, out) |
... | ... |
@@ -235,11 +235,11 @@ func (s *DockerSwarmSuite) TestServiceCreateWithConfigSimple(c *testing.T) { |
235 | 235 |
assert.Assert(c, json.Unmarshal([]byte(out), &refs), checker.IsNil) |
236 | 236 |
assert.Equal(c, len(refs), 1) |
237 | 237 |
|
238 |
- assert.Assert(c, refs[0].ConfigName, checker.Equals, testName) |
|
238 |
+ assert.Equal(c, refs[0].ConfigName, testName) |
|
239 | 239 |
assert.Assert(c, refs[0].File != nil) |
240 |
- assert.Assert(c, refs[0].File.Name, checker.Equals, testName) |
|
241 |
- assert.Assert(c, refs[0].File.UID, checker.Equals, "0") |
|
242 |
- assert.Assert(c, refs[0].File.GID, checker.Equals, "0") |
|
240 |
+ assert.Equal(c, refs[0].File.Name, testName) |
|
241 |
+ assert.Equal(c, refs[0].File.UID, "0") |
|
242 |
+ assert.Equal(c, refs[0].File.GID, "0") |
|
243 | 243 |
|
244 | 244 |
out, err = d.Cmd("service", "rm", serviceName) |
245 | 245 |
assert.NilError(c, err, out) |
... | ... |
@@ -387,11 +387,11 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *testing.T) { |
387 | 387 |
assert.Assert(c, json.Unmarshal([]byte(out), &mountConfig), checker.IsNil) |
388 | 388 |
assert.Assert(c, mountConfig, checker.HasLen, 1) |
389 | 389 |
|
390 |
- assert.Assert(c, mountConfig[0].Source, checker.Equals, "") |
|
391 |
- assert.Assert(c, mountConfig[0].Target, checker.Equals, "/foo") |
|
392 |
- assert.Assert(c, mountConfig[0].Type, checker.Equals, mount.TypeTmpfs) |
|
390 |
+ assert.Equal(c, mountConfig[0].Source, "") |
|
391 |
+ assert.Equal(c, mountConfig[0].Target, "/foo") |
|
392 |
+ assert.Equal(c, mountConfig[0].Type, mount.TypeTmpfs) |
|
393 | 393 |
assert.Assert(c, mountConfig[0].TmpfsOptions, checker.NotNil) |
394 |
- assert.Assert(c, mountConfig[0].TmpfsOptions.SizeBytes, checker.Equals, int64(1048576)) |
|
394 |
+ assert.Equal(c, mountConfig[0].TmpfsOptions.SizeBytes, int64(1048576)) |
|
395 | 395 |
|
396 | 396 |
// check container mounts actual |
397 | 397 |
out, err = s.nodeCmd(c, task.NodeID, "inspect", "--format", "{{json .Mounts}}", task.Status.ContainerStatus.ContainerID) |
... | ... |
@@ -401,10 +401,10 @@ func (s *DockerSwarmSuite) TestServiceCreateMountTmpfs(c *testing.T) { |
401 | 401 |
assert.Assert(c, json.Unmarshal([]byte(out), &mounts), checker.IsNil) |
402 | 402 |
assert.Assert(c, mounts, checker.HasLen, 1) |
403 | 403 |
|
404 |
- assert.Assert(c, mounts[0].Type, checker.Equals, mount.TypeTmpfs) |
|
405 |
- assert.Assert(c, mounts[0].Name, checker.Equals, "") |
|
406 |
- assert.Assert(c, mounts[0].Destination, checker.Equals, "/foo") |
|
407 |
- assert.Assert(c, mounts[0].RW, checker.Equals, true) |
|
404 |
+ assert.Equal(c, mounts[0].Type, mount.TypeTmpfs) |
|
405 |
+ assert.Equal(c, mounts[0].Name, "") |
|
406 |
+ assert.Equal(c, mounts[0].Destination, "/foo") |
|
407 |
+ assert.Equal(c, mounts[0].RW, true) |
|
408 | 408 |
|
409 | 409 |
out, err = s.nodeCmd(c, task.NodeID, "logs", task.Status.ContainerStatus.ContainerID) |
410 | 410 |
assert.NilError(c, err, out) |
... | ... |
@@ -124,7 +124,7 @@ func (s *DockerSwarmSuite) TestServiceHealthStart(c *testing.T) { |
124 | 124 |
|
125 | 125 |
// task should be blocked at starting status |
126 | 126 |
task = d.GetTask(c, task.ID) |
127 |
- assert.Assert(c, task.Status.State, checker.Equals, swarm.TaskStateStarting) |
|
127 |
+ assert.Equal(c, task.Status.State, swarm.TaskStateStarting) |
|
128 | 128 |
|
129 | 129 |
// make it healthy |
130 | 130 |
d.Cmd("exec", containerID, "touch", "/status") |
... | ... |
@@ -64,7 +64,7 @@ func (s *DockerSuite) TestStartAttachSilent(c *testing.T) { |
64 | 64 |
|
65 | 65 |
startOut, _ := dockerCmd(c, "start", "-a", name) |
66 | 66 |
// start -a produced unexpected output |
67 |
- assert.Assert(c, startOut, checker.Equals, "test\n") |
|
67 |
+ assert.Equal(c, startOut, "test\n") |
|
68 | 68 |
} |
69 | 69 |
|
70 | 70 |
func (s *DockerSuite) TestStartRecordError(c *testing.T) { |
... | ... |
@@ -74,7 +74,7 @@ func (s *DockerSuite) TestStartRecordError(c *testing.T) { |
74 | 74 |
dockerCmd(c, "run", "-d", "-p", "9999:9999", "--name", "test", "busybox", "top") |
75 | 75 |
stateErr := inspectField(c, "test", "State.Error") |
76 | 76 |
// Expected to not have state error |
77 |
- assert.Assert(c, stateErr, checker.Equals, "") |
|
77 |
+ assert.Equal(c, stateErr, "") |
|
78 | 78 |
|
79 | 79 |
// Expect this to fail and records error because of ports conflict |
80 | 80 |
out, _, err := dockerCmdWithError("run", "-d", "--name", "test2", "-p", "9999:9999", "busybox", "top") |
... | ... |
@@ -89,7 +89,7 @@ func (s *DockerSuite) TestStartRecordError(c *testing.T) { |
89 | 89 |
dockerCmd(c, "start", "test2") |
90 | 90 |
stateErr = inspectField(c, "test2", "State.Error") |
91 | 91 |
// Expected to not have state error but got one |
92 |
- assert.Assert(c, stateErr, checker.Equals, "") |
|
92 |
+ assert.Equal(c, stateErr, "") |
|
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
func (s *DockerSuite) TestStartPausedContainer(c *testing.T) { |
... | ... |
@@ -193,9 +193,9 @@ func (s *DockerSuite) TestStartReturnCorrectExitCode(c *testing.T) { |
193 | 193 |
|
194 | 194 |
out, exitCode, err := dockerCmdWithError("start", "-a", "withRestart") |
195 | 195 |
assert.ErrorContains(c, err, "") |
196 |
- assert.Assert(c, exitCode, checker.Equals, 11, check.Commentf("out: %s", out)) |
|
196 |
+ assert.Equal(c, exitCode, 11, check.Commentf("out: %s", out)) |
|
197 | 197 |
|
198 | 198 |
out, exitCode, err = dockerCmdWithError("start", "-a", "withRm") |
199 | 199 |
assert.ErrorContains(c, err, "") |
200 |
- assert.Assert(c, exitCode, checker.Equals, 12, check.Commentf("out: %s", out)) |
|
200 |
+ assert.Equal(c, exitCode, 12, check.Commentf("out: %s", out)) |
|
201 | 201 |
} |
... | ... |
@@ -46,15 +46,15 @@ func (s *DockerSwarmSuite) TestSwarmUpdate(c *testing.T) { |
46 | 46 |
assert.NilError(c, err, out) |
47 | 47 |
|
48 | 48 |
spec := getSpec() |
49 |
- assert.Assert(c, spec.CAConfig.NodeCertExpiry, checker.Equals, 30*time.Hour) |
|
50 |
- assert.Assert(c, spec.Dispatcher.HeartbeatPeriod, checker.Equals, 11*time.Second) |
|
49 |
+ assert.Equal(c, spec.CAConfig.NodeCertExpiry, 30*time.Hour) |
|
50 |
+ assert.Equal(c, spec.Dispatcher.HeartbeatPeriod, 11*time.Second) |
|
51 | 51 |
|
52 | 52 |
// setting anything under 30m for cert-expiry is not allowed |
53 | 53 |
out, err = d.Cmd("swarm", "update", "--cert-expiry", "15m") |
54 | 54 |
assert.ErrorContains(c, err, "") |
55 | 55 |
assert.Assert(c, out, checker.Contains, "minimum certificate expiry time") |
56 | 56 |
spec = getSpec() |
57 |
- assert.Assert(c, spec.CAConfig.NodeCertExpiry, checker.Equals, 30*time.Hour) |
|
57 |
+ assert.Equal(c, spec.CAConfig.NodeCertExpiry, 30*time.Hour) |
|
58 | 58 |
|
59 | 59 |
// passing an external CA (this is without starting a root rotation) does not fail |
60 | 60 |
cli.Docker(cli.Args("swarm", "update", "--external-ca", "protocol=cfssl,url=https://something.org", |
... | ... |
@@ -66,8 +66,8 @@ func (s *DockerSwarmSuite) TestSwarmUpdate(c *testing.T) { |
66 | 66 |
|
67 | 67 |
spec = getSpec() |
68 | 68 |
assert.Assert(c, spec.CAConfig.ExternalCAs, checker.HasLen, 2) |
69 |
- assert.Assert(c, spec.CAConfig.ExternalCAs[0].CACert, checker.Equals, "") |
|
70 |
- assert.Assert(c, spec.CAConfig.ExternalCAs[1].CACert, checker.Equals, string(expected)) |
|
69 |
+ assert.Equal(c, spec.CAConfig.ExternalCAs[0].CACert, "") |
|
70 |
+ assert.Equal(c, spec.CAConfig.ExternalCAs[1].CACert, string(expected)) |
|
71 | 71 |
|
72 | 72 |
// passing an invalid external CA fails |
73 | 73 |
tempFile := fs.NewFile(c, "testfile", fs.WithContent("fakecert")) |
... | ... |
@@ -111,18 +111,18 @@ func (s *DockerSwarmSuite) TestSwarmInit(c *testing.T) { |
111 | 111 |
assert.NilError(c, err) |
112 | 112 |
|
113 | 113 |
spec := getSpec() |
114 |
- assert.Assert(c, spec.CAConfig.NodeCertExpiry, checker.Equals, 30*time.Hour) |
|
115 |
- assert.Assert(c, spec.Dispatcher.HeartbeatPeriod, checker.Equals, 11*time.Second) |
|
114 |
+ assert.Equal(c, spec.CAConfig.NodeCertExpiry, 30*time.Hour) |
|
115 |
+ assert.Equal(c, spec.Dispatcher.HeartbeatPeriod, 11*time.Second) |
|
116 | 116 |
assert.Assert(c, spec.CAConfig.ExternalCAs, checker.HasLen, 2) |
117 |
- assert.Assert(c, spec.CAConfig.ExternalCAs[0].CACert, checker.Equals, "") |
|
118 |
- assert.Assert(c, spec.CAConfig.ExternalCAs[1].CACert, checker.Equals, string(expected)) |
|
117 |
+ assert.Equal(c, spec.CAConfig.ExternalCAs[0].CACert, "") |
|
118 |
+ assert.Equal(c, spec.CAConfig.ExternalCAs[1].CACert, string(expected)) |
|
119 | 119 |
|
120 | 120 |
assert.Assert(c, d.SwarmLeave(c, true), checker.IsNil) |
121 | 121 |
cli.Docker(cli.Args("swarm", "init"), cli.Daemon(d)).Assert(c, icmd.Success) |
122 | 122 |
|
123 | 123 |
spec = getSpec() |
124 |
- assert.Assert(c, spec.CAConfig.NodeCertExpiry, checker.Equals, 90*24*time.Hour) |
|
125 |
- assert.Assert(c, spec.Dispatcher.HeartbeatPeriod, checker.Equals, 5*time.Second) |
|
124 |
+ assert.Equal(c, spec.CAConfig.NodeCertExpiry, 90*24*time.Hour) |
|
125 |
+ assert.Equal(c, spec.Dispatcher.HeartbeatPeriod, 5*time.Second) |
|
126 | 126 |
} |
127 | 127 |
|
128 | 128 |
func (s *DockerSwarmSuite) TestSwarmInitIPv6(c *testing.T) { |
... | ... |
@@ -182,7 +182,7 @@ func (s *DockerSwarmSuite) TestSwarmServiceTemplatingHostname(c *testing.T) { |
182 | 182 |
containers := d.ActiveContainers(c) |
183 | 183 |
out, err = d.Cmd("inspect", "--type", "container", "--format", "{{.Config.Hostname}}", containers[0]) |
184 | 184 |
assert.NilError(c, err, out) |
185 |
- assert.Assert(c, strings.Split(out, "\n")[0], checker.Equals, "test-1-"+strings.Split(hostname, "\n")[0], check.Commentf("hostname with templating invalid")) |
|
185 |
+ assert.Equal(c, strings.Split(out, "\n")[0], "test-1-"+strings.Split(hostname, "\n")[0], check.Commentf("hostname with templating invalid")) |
|
186 | 186 |
} |
187 | 187 |
|
188 | 188 |
// Test case for #24270 |
... | ... |
@@ -619,7 +619,7 @@ func (s *DockerSwarmSuite) TestPsListContainersFilterIsTask(c *testing.T) { |
619 | 619 |
out, err = d.Cmd("ps", "-a", "-q", "--filter=is-task=false") |
620 | 620 |
assert.NilError(c, err, out) |
621 | 621 |
psOut := strings.TrimSpace(out) |
622 |
- assert.Assert(c, psOut, checker.Equals, bareID, check.Commentf("Expected id %s, got %s for is-task label, output %q", bareID, psOut, out)) |
|
622 |
+ assert.Equal(c, psOut, bareID, check.Commentf("Expected id %s, got %s for is-task label, output %q", bareID, psOut, out)) |
|
623 | 623 |
|
624 | 624 |
// Filter tasks |
625 | 625 |
out, err = d.Cmd("ps", "-a", "-q", "--filter=is-task=true") |
... | ... |
@@ -1062,11 +1062,11 @@ func (s *DockerSwarmSuite) TestSwarmInitLocked(c *testing.T) { |
1062 | 1062 |
assert.Assert(c, err, checker.IsNil, check.Commentf("%s", outs)) |
1063 | 1063 |
unlockKey := getUnlockKey(d, c, outs) |
1064 | 1064 |
|
1065 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateActive) |
|
1065 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateActive) |
|
1066 | 1066 |
|
1067 | 1067 |
// It starts off locked |
1068 | 1068 |
d.RestartNode(c) |
1069 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateLocked) |
|
1069 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateLocked) |
|
1070 | 1070 |
|
1071 | 1071 |
cmd := d.Command("swarm", "unlock") |
1072 | 1072 |
cmd.Stdin = bytes.NewBufferString("wrong-secret-key") |
... | ... |
@@ -1075,13 +1075,13 @@ func (s *DockerSwarmSuite) TestSwarmInitLocked(c *testing.T) { |
1075 | 1075 |
Err: "invalid key", |
1076 | 1076 |
}) |
1077 | 1077 |
|
1078 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateLocked) |
|
1078 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateLocked) |
|
1079 | 1079 |
|
1080 | 1080 |
cmd = d.Command("swarm", "unlock") |
1081 | 1081 |
cmd.Stdin = bytes.NewBufferString(unlockKey) |
1082 | 1082 |
icmd.RunCmd(cmd).Assert(c, icmd.Success) |
1083 | 1083 |
|
1084 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateActive) |
|
1084 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateActive) |
|
1085 | 1085 |
|
1086 | 1086 |
outs, err = d.Cmd("node", "ls") |
1087 | 1087 |
assert.Assert(c, err, checker.IsNil, check.Commentf("%s", outs)) |
... | ... |
@@ -1137,7 +1137,7 @@ func (s *DockerSwarmSuite) TestSwarmLockUnlockCluster(c *testing.T) { |
1137 | 1137 |
|
1138 | 1138 |
// they start off unlocked |
1139 | 1139 |
d2.RestartNode(c) |
1140 |
- assert.Assert(c, getNodeStatus(c, d2), checker.Equals, swarm.LocalNodeStateActive) |
|
1140 |
+ assert.Equal(c, getNodeStatus(c, d2), swarm.LocalNodeStateActive) |
|
1141 | 1141 |
|
1142 | 1142 |
// stop this one so it does not get autolock info |
1143 | 1143 |
d2.Stop(c) |
... | ... |
@@ -1154,12 +1154,12 @@ func (s *DockerSwarmSuite) TestSwarmLockUnlockCluster(c *testing.T) { |
1154 | 1154 |
cmd := d.Command("swarm", "unlock") |
1155 | 1155 |
cmd.Stdin = bytes.NewBufferString(unlockKey) |
1156 | 1156 |
icmd.RunCmd(cmd).Assert(c, icmd.Success) |
1157 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateActive) |
|
1157 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateActive) |
|
1158 | 1158 |
} |
1159 | 1159 |
|
1160 | 1160 |
// d2 never got the cluster update, so it is still set to unlocked |
1161 | 1161 |
d2.StartNode(c) |
1162 |
- assert.Assert(c, getNodeStatus(c, d2), checker.Equals, swarm.LocalNodeStateActive) |
|
1162 |
+ assert.Equal(c, getNodeStatus(c, d2), swarm.LocalNodeStateActive) |
|
1163 | 1163 |
|
1164 | 1164 |
// d2 is now set to lock |
1165 | 1165 |
checkSwarmUnlockedToLocked(c, d2) |
... | ... |
@@ -1174,13 +1174,13 @@ func (s *DockerSwarmSuite) TestSwarmLockUnlockCluster(c *testing.T) { |
1174 | 1174 |
} |
1175 | 1175 |
|
1176 | 1176 |
// d2 still locked |
1177 |
- assert.Assert(c, getNodeStatus(c, d2), checker.Equals, swarm.LocalNodeStateLocked) |
|
1177 |
+ assert.Equal(c, getNodeStatus(c, d2), swarm.LocalNodeStateLocked) |
|
1178 | 1178 |
|
1179 | 1179 |
// unlock it |
1180 | 1180 |
cmd := d2.Command("swarm", "unlock") |
1181 | 1181 |
cmd.Stdin = bytes.NewBufferString(unlockKey) |
1182 | 1182 |
icmd.RunCmd(cmd).Assert(c, icmd.Success) |
1183 |
- assert.Assert(c, getNodeStatus(c, d2), checker.Equals, swarm.LocalNodeStateActive) |
|
1183 |
+ assert.Equal(c, getNodeStatus(c, d2), swarm.LocalNodeStateActive) |
|
1184 | 1184 |
|
1185 | 1185 |
// once it's caught up, d2 is set to not be locked |
1186 | 1186 |
checkSwarmLockedToUnlocked(c, d2) |
... | ... |
@@ -1188,7 +1188,7 @@ func (s *DockerSwarmSuite) TestSwarmLockUnlockCluster(c *testing.T) { |
1188 | 1188 |
// managers who join now are never set to locked in the first place |
1189 | 1189 |
d4 := s.AddDaemon(c, true, true) |
1190 | 1190 |
d4.RestartNode(c) |
1191 |
- assert.Assert(c, getNodeStatus(c, d4), checker.Equals, swarm.LocalNodeStateActive) |
|
1191 |
+ assert.Equal(c, getNodeStatus(c, d4), swarm.LocalNodeStateActive) |
|
1192 | 1192 |
} |
1193 | 1193 |
|
1194 | 1194 |
func (s *DockerSwarmSuite) TestSwarmJoinPromoteLocked(c *testing.T) { |
... | ... |
@@ -1219,7 +1219,7 @@ func (s *DockerSwarmSuite) TestSwarmJoinPromoteLocked(c *testing.T) { |
1219 | 1219 |
cmd := d.Command("swarm", "unlock") |
1220 | 1220 |
cmd.Stdin = bytes.NewBufferString(unlockKey) |
1221 | 1221 |
icmd.RunCmd(cmd).Assert(c, icmd.Success) |
1222 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateActive) |
|
1222 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateActive) |
|
1223 | 1223 |
} |
1224 | 1224 |
|
1225 | 1225 |
// demote manager back to worker - workers are not locked |
... | ... |
@@ -1267,7 +1267,7 @@ func (s *DockerSwarmSuite) TestSwarmRotateUnlockKey(c *testing.T) { |
1267 | 1267 |
assert.Assert(c, newUnlockKey != unlockKey) |
1268 | 1268 |
|
1269 | 1269 |
d.RestartNode(c) |
1270 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateLocked) |
|
1270 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateLocked) |
|
1271 | 1271 |
|
1272 | 1272 |
outs, _ = d.Cmd("node", "ls") |
1273 | 1273 |
assert.Assert(c, outs, checker.Contains, "Swarm is encrypted and needs to be unlocked") |
... | ... |
@@ -1305,7 +1305,7 @@ func (s *DockerSwarmSuite) TestSwarmRotateUnlockKey(c *testing.T) { |
1305 | 1305 |
cmd.Stdin = bytes.NewBufferString(newUnlockKey) |
1306 | 1306 |
icmd.RunCmd(cmd).Assert(c, icmd.Success) |
1307 | 1307 |
|
1308 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateActive) |
|
1308 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateActive) |
|
1309 | 1309 |
|
1310 | 1310 |
retry := 0 |
1311 | 1311 |
for { |
... | ... |
@@ -1359,7 +1359,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterRotateUnlockKey(c *testing.T) { |
1359 | 1359 |
d3.RestartNode(c) |
1360 | 1360 |
|
1361 | 1361 |
for _, d := range []*daemon.Daemon{d2, d3} { |
1362 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateLocked) |
|
1362 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateLocked) |
|
1363 | 1363 |
|
1364 | 1364 |
outs, _ := d.Cmd("node", "ls") |
1365 | 1365 |
assert.Assert(c, outs, checker.Contains, "Swarm is encrypted and needs to be unlocked") |
... | ... |
@@ -1397,7 +1397,7 @@ func (s *DockerSwarmSuite) TestSwarmClusterRotateUnlockKey(c *testing.T) { |
1397 | 1397 |
cmd.Stdin = bytes.NewBufferString(newUnlockKey) |
1398 | 1398 |
icmd.RunCmd(cmd).Assert(c, icmd.Success) |
1399 | 1399 |
|
1400 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateActive) |
|
1400 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateActive) |
|
1401 | 1401 |
|
1402 | 1402 |
retry := 0 |
1403 | 1403 |
for { |
... | ... |
@@ -1436,7 +1436,7 @@ func (s *DockerSwarmSuite) TestSwarmAlternateLockUnlock(c *testing.T) { |
1436 | 1436 |
cmd.Stdin = bytes.NewBufferString(unlockKey) |
1437 | 1437 |
icmd.RunCmd(cmd).Assert(c, icmd.Success) |
1438 | 1438 |
|
1439 |
- assert.Assert(c, getNodeStatus(c, d), checker.Equals, swarm.LocalNodeStateActive) |
|
1439 |
+ assert.Equal(c, getNodeStatus(c, d), swarm.LocalNodeStateActive) |
|
1440 | 1440 |
|
1441 | 1441 |
outs, err = d.Cmd("swarm", "update", "--autolock=false") |
1442 | 1442 |
assert.Assert(c, err, checker.IsNil, check.Commentf("out: %v", outs)) |
... | ... |
@@ -51,13 +51,13 @@ func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *testing.T) { |
51 | 51 |
assert.NilError(c, err, "Output: %s", out) |
52 | 52 |
|
53 | 53 |
user := s.findUser(c, "userns") |
54 |
- assert.Assert(c, uidgid[0], checker.Equals, user) |
|
54 |
+ assert.Equal(c, uidgid[0], user) |
|
55 | 55 |
|
56 | 56 |
// check that the created directory is owned by remapped uid:gid |
57 | 57 |
statNotExists, err := system.Stat(tmpDirNotExists) |
58 | 58 |
assert.NilError(c, err) |
59 |
- assert.Assert(c, statNotExists.UID(), checker.Equals, uint32(uid), check.Commentf("Created directory not owned by remapped root UID")) |
|
60 |
- assert.Assert(c, statNotExists.GID(), checker.Equals, uint32(gid), check.Commentf("Created directory not owned by remapped root GID")) |
|
59 |
+ assert.Equal(c, statNotExists.UID(), uint32(uid), check.Commentf("Created directory not owned by remapped root UID")) |
|
60 |
+ assert.Equal(c, statNotExists.GID(), uint32(gid), check.Commentf("Created directory not owned by remapped root GID")) |
|
61 | 61 |
|
62 | 62 |
pid, err := s.d.Cmd("inspect", "--format={{.State.Pid}}", "userns") |
63 | 63 |
assert.Assert(c, err, checker.IsNil, check.Commentf("Could not inspect running container: out: %q", pid)) |
... | ... |
@@ -76,15 +76,15 @@ func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *testing.T) { |
76 | 76 |
// check that the touched file is owned by remapped uid:gid |
77 | 77 |
stat, err := system.Stat(filepath.Join(tmpDir, "testfile")) |
78 | 78 |
assert.NilError(c, err) |
79 |
- assert.Assert(c, stat.UID(), checker.Equals, uint32(uid), check.Commentf("Touched file not owned by remapped root UID")) |
|
80 |
- assert.Assert(c, stat.GID(), checker.Equals, uint32(gid), check.Commentf("Touched file not owned by remapped root GID")) |
|
79 |
+ assert.Equal(c, stat.UID(), uint32(uid), check.Commentf("Touched file not owned by remapped root UID")) |
|
80 |
+ assert.Equal(c, stat.GID(), uint32(gid), check.Commentf("Touched file not owned by remapped root GID")) |
|
81 | 81 |
|
82 | 82 |
// use host usernamespace |
83 | 83 |
out, err = s.d.Cmd("run", "-d", "--name", "userns_skip", "--userns", "host", "busybox", "sh", "-c", "touch /goofy/testfile; top") |
84 | 84 |
assert.Assert(c, err, checker.IsNil, check.Commentf("Output: %s", out)) |
85 | 85 |
user = s.findUser(c, "userns_skip") |
86 | 86 |
// userns are skipped, user is root |
87 |
- assert.Assert(c, user, checker.Equals, "root") |
|
87 |
+ assert.Equal(c, user, "root") |
|
88 | 88 |
} |
89 | 89 |
|
90 | 90 |
// findUser finds the uid or name of the user of the first process that runs in a container |
... | ... |
@@ -29,11 +29,11 @@ func (s *DockerSuite) TestVolumeCLICreate(c *testing.T) { |
29 | 29 |
// test using hidden --name option |
30 | 30 |
out, _ := dockerCmd(c, "volume", "create", "--name=test") |
31 | 31 |
name := strings.TrimSpace(out) |
32 |
- assert.Assert(c, name, checker.Equals, "test") |
|
32 |
+ assert.Equal(c, name, "test") |
|
33 | 33 |
|
34 | 34 |
out, _ = dockerCmd(c, "volume", "create", "test2") |
35 | 35 |
name = strings.TrimSpace(out) |
36 |
- assert.Assert(c, name, checker.Equals, "test2") |
|
36 |
+ assert.Equal(c, name, "test2") |
|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
func (s *DockerSuite) TestVolumeCLIInspect(c *testing.T) { |
... | ... |
@@ -41,11 +41,11 @@ func (s *DockerSuite) TestVolumeCLIInspect(c *testing.T) { |
41 | 41 |
out, _ := dockerCmd(c, "volume", "create") |
42 | 42 |
name := strings.TrimSpace(out) |
43 | 43 |
out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Name }}", name) |
44 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, name) |
|
44 |
+ assert.Equal(c, strings.TrimSpace(out), name) |
|
45 | 45 |
|
46 | 46 |
dockerCmd(c, "volume", "create", "test") |
47 | 47 |
out, _ = dockerCmd(c, "volume", "inspect", "--format={{ .Name }}", "test") |
48 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "test") |
|
48 |
+ assert.Equal(c, strings.TrimSpace(out), "test") |
|
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
func (s *DockerSuite) TestVolumeCLIInspectMulti(c *testing.T) { |
... | ... |
@@ -200,13 +200,13 @@ func (s *DockerSuite) TestVolumeCLIRm(c *testing.T) { |
200 | 200 |
}) |
201 | 201 |
|
202 | 202 |
out, _ = dockerCmd(c, "run", "--volumes-from=test", "--name=test2", "busybox", "sh", "-c", "cat /foo/bar") |
203 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "hello") |
|
203 |
+ assert.Equal(c, strings.TrimSpace(out), "hello") |
|
204 | 204 |
dockerCmd(c, "rm", "-fv", "test2") |
205 | 205 |
dockerCmd(c, "volume", "inspect", volumeID) |
206 | 206 |
dockerCmd(c, "rm", "-f", "test") |
207 | 207 |
|
208 | 208 |
out, _ = dockerCmd(c, "run", "--name=test2", "-v", volumeID+":"+prefix+"/foo", "busybox", "sh", "-c", "cat /foo/bar") |
209 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, "hello", check.Commentf("volume data was removed")) |
|
209 |
+ assert.Equal(c, strings.TrimSpace(out), "hello", check.Commentf("volume data was removed")) |
|
210 | 210 |
dockerCmd(c, "rm", "test2") |
211 | 211 |
|
212 | 212 |
dockerCmd(c, "volume", "rm", volumeID) |
... | ... |
@@ -243,7 +243,7 @@ func (s *DockerSuite) TestVolumeCLIInspectTmplError(c *testing.T) { |
243 | 243 |
|
244 | 244 |
out, exitCode, err := dockerCmdWithError("volume", "inspect", "--format='{{ .FooBar }}'", name) |
245 | 245 |
assert.Assert(c, err, checker.NotNil, check.Commentf("Output: %s", out)) |
246 |
- assert.Assert(c, exitCode, checker.Equals, 1, check.Commentf("Output: %s", out)) |
|
246 |
+ assert.Equal(c, exitCode, 1, check.Commentf("Output: %s", out)) |
|
247 | 247 |
assert.Assert(c, out, checker.Contains, "Template parsing error") |
248 | 248 |
} |
249 | 249 |
|
... | ... |
@@ -260,15 +260,15 @@ func (s *DockerSuite) TestVolumeCLICreateWithOpts(c *testing.T) { |
260 | 260 |
found = true |
261 | 261 |
info := strings.Fields(m) |
262 | 262 |
// tmpfs on <path> type tmpfs (rw,relatime,size=1024k,uid=1000) |
263 |
- assert.Assert(c, info[0], checker.Equals, "tmpfs") |
|
264 |
- assert.Assert(c, info[2], checker.Equals, "/foo") |
|
265 |
- assert.Assert(c, info[4], checker.Equals, "tmpfs") |
|
263 |
+ assert.Equal(c, info[0], "tmpfs") |
|
264 |
+ assert.Equal(c, info[2], "/foo") |
|
265 |
+ assert.Equal(c, info[4], "tmpfs") |
|
266 | 266 |
assert.Assert(c, info[5], checker.Contains, "uid=1000") |
267 | 267 |
assert.Assert(c, info[5], checker.Contains, "size=1024k") |
268 | 268 |
break |
269 | 269 |
} |
270 | 270 |
} |
271 |
- assert.Assert(c, found, checker.Equals, true) |
|
271 |
+ assert.Equal(c, found, true) |
|
272 | 272 |
} |
273 | 273 |
|
274 | 274 |
func (s *DockerSuite) TestVolumeCLICreateLabel(c *testing.T) { |
... | ... |
@@ -280,7 +280,7 @@ func (s *DockerSuite) TestVolumeCLICreateLabel(c *testing.T) { |
280 | 280 |
assert.NilError(c, err) |
281 | 281 |
|
282 | 282 |
out, _ := dockerCmd(c, "volume", "inspect", "--format={{ .Labels."+testLabel+" }}", testVol) |
283 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, testValue) |
|
283 |
+ assert.Equal(c, strings.TrimSpace(out), testValue) |
|
284 | 284 |
} |
285 | 285 |
|
286 | 286 |
func (s *DockerSuite) TestVolumeCLICreateLabelMultiple(c *testing.T) { |
... | ... |
@@ -306,7 +306,7 @@ func (s *DockerSuite) TestVolumeCLICreateLabelMultiple(c *testing.T) { |
306 | 306 |
|
307 | 307 |
for k, v := range testLabels { |
308 | 308 |
out, _ := dockerCmd(c, "volume", "inspect", "--format={{ .Labels."+k+" }}", testVol) |
309 |
- assert.Assert(c, strings.TrimSpace(out), checker.Equals, v) |
|
309 |
+ assert.Equal(c, strings.TrimSpace(out), v) |
|
310 | 310 |
} |
311 | 311 |
} |
312 | 312 |
|
... | ... |
@@ -333,11 +333,11 @@ func (s *DockerSuite) TestVolumeCLILsFilterLabels(c *testing.T) { |
333 | 333 |
|
334 | 334 |
out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=non-exist") |
335 | 335 |
outArr := strings.Split(strings.TrimSpace(out), "\n") |
336 |
- assert.Assert(c, len(outArr), checker.Equals, 1, check.Commentf("\n%s", out)) |
|
336 |
+ assert.Equal(c, len(outArr), 1, check.Commentf("\n%s", out)) |
|
337 | 337 |
|
338 | 338 |
out, _ = dockerCmd(c, "volume", "ls", "--filter", "label=foo=non-exist") |
339 | 339 |
outArr = strings.Split(strings.TrimSpace(out), "\n") |
340 |
- assert.Assert(c, len(outArr), checker.Equals, 1, check.Commentf("\n%s", out)) |
|
340 |
+ assert.Equal(c, len(outArr), 1, check.Commentf("\n%s", out)) |
|
341 | 341 |
} |
342 | 342 |
|
343 | 343 |
func (s *DockerSuite) TestVolumeCLILsFilterDrivers(c *testing.T) { |
... | ... |
@@ -358,17 +358,17 @@ func (s *DockerSuite) TestVolumeCLILsFilterDrivers(c *testing.T) { |
358 | 358 |
// filter with driver=invaliddriver |
359 | 359 |
out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=invaliddriver") |
360 | 360 |
outArr := strings.Split(strings.TrimSpace(out), "\n") |
361 |
- assert.Assert(c, len(outArr), checker.Equals, 1, check.Commentf("\n%s", out)) |
|
361 |
+ assert.Equal(c, len(outArr), 1, check.Commentf("\n%s", out)) |
|
362 | 362 |
|
363 | 363 |
// filter with driver=loca |
364 | 364 |
out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=loca") |
365 | 365 |
outArr = strings.Split(strings.TrimSpace(out), "\n") |
366 |
- assert.Assert(c, len(outArr), checker.Equals, 1, check.Commentf("\n%s", out)) |
|
366 |
+ assert.Equal(c, len(outArr), 1, check.Commentf("\n%s", out)) |
|
367 | 367 |
|
368 | 368 |
// filter with driver= |
369 | 369 |
out, _ = dockerCmd(c, "volume", "ls", "--filter", "driver=") |
370 | 370 |
outArr = strings.Split(strings.TrimSpace(out), "\n") |
371 |
- assert.Assert(c, len(outArr), checker.Equals, 1, check.Commentf("\n%s", out)) |
|
371 |
+ assert.Equal(c, len(outArr), 1, check.Commentf("\n%s", out)) |
|
372 | 372 |
} |
373 | 373 |
|
374 | 374 |
func (s *DockerSuite) TestVolumeCLIRmForceUsage(c *testing.T) { |
... | ... |
@@ -385,7 +385,7 @@ func (s *DockerSuite) TestVolumeCLIRmForce(c *testing.T) { |
385 | 385 |
name := "test" |
386 | 386 |
out, _ := dockerCmd(c, "volume", "create", name) |
387 | 387 |
id := strings.TrimSpace(out) |
388 |
- assert.Assert(c, id, checker.Equals, name) |
|
388 |
+ assert.Equal(c, id, name) |
|
389 | 389 |
|
390 | 390 |
out, _ = dockerCmd(c, "volume", "inspect", "--format", "{{.Mountpoint}}", name) |
391 | 391 |
assert.Assert(c, strings.TrimSpace(out) != "") |
... | ... |
@@ -407,7 +407,7 @@ func (s *DockerSuite) TestVolumeCLIRmForceInUse(c *testing.T) { |
407 | 407 |
name := "testvolume" |
408 | 408 |
out, _ := dockerCmd(c, "volume", "create", name) |
409 | 409 |
id := strings.TrimSpace(out) |
410 |
- assert.Assert(c, id, checker.Equals, name) |
|
410 |
+ assert.Equal(c, id, name) |
|
411 | 411 |
|
412 | 412 |
prefix, slash := getPrefixAndSlashFromDaemonPlatform() |
413 | 413 |
out, _ = dockerCmd(c, "create", "-v", "testvolume:"+prefix+slash+"foo", "busybox") |
... | ... |
@@ -431,13 +431,13 @@ func (s *DockerSuite) TestVolumeCLIRmForceInUse(c *testing.T) { |
431 | 431 |
|
432 | 432 |
// Verify removing the volume after the container is removed works |
433 | 433 |
_, e := dockerCmd(c, "rm", cid) |
434 |
- assert.Assert(c, e, checker.Equals, 0) |
|
434 |
+ assert.Equal(c, e, 0) |
|
435 | 435 |
|
436 | 436 |
_, e = dockerCmd(c, "volume", "rm", "-f", name) |
437 |
- assert.Assert(c, e, checker.Equals, 0) |
|
437 |
+ assert.Equal(c, e, 0) |
|
438 | 438 |
|
439 | 439 |
out, e = dockerCmd(c, "volume", "ls") |
440 |
- assert.Assert(c, e, checker.Equals, 0) |
|
440 |
+ assert.Equal(c, e, 0) |
|
441 | 441 |
assert.Assert(c, out, checker.Not(checker.Contains), name) |
442 | 442 |
} |
443 | 443 |
|
... | ... |
@@ -16,13 +16,13 @@ var _ = check.Suite(&DiscoverySuite{}) |
16 | 16 |
func (s *DiscoverySuite) TestNewEntry(c *testing.T) { |
17 | 17 |
entry, err := NewEntry("127.0.0.1:2375") |
18 | 18 |
assert.Assert(c, err, checker.IsNil) |
19 |
- assert.Assert(c, entry.Equals(&Entry{Host: "127.0.0.1", Port: "2375"}), checker.Equals, true) |
|
20 |
- assert.Assert(c, entry.String(), checker.Equals, "127.0.0.1:2375") |
|
19 |
+ assert.Equal(c, entry.Equals(&Entry{Host: "127.0.0.1", Port: "2375"}), true) |
|
20 |
+ assert.Equal(c, entry.String(), "127.0.0.1:2375") |
|
21 | 21 |
|
22 | 22 |
entry, err = NewEntry("[2001:db8:0:f101::2]:2375") |
23 | 23 |
assert.Assert(c, err, checker.IsNil) |
24 |
- assert.Assert(c, entry.Equals(&Entry{Host: "2001:db8:0:f101::2", Port: "2375"}), checker.Equals, true) |
|
25 |
- assert.Assert(c, entry.String(), checker.Equals, "[2001:db8:0:f101::2]:2375") |
|
24 |
+ assert.Equal(c, entry.Equals(&Entry{Host: "2001:db8:0:f101::2", Port: "2375"}), true) |
|
25 |
+ assert.Equal(c, entry.String(), "[2001:db8:0:f101::2]:2375") |
|
26 | 26 |
|
27 | 27 |
_, err = NewEntry("127.0.0.1") |
28 | 28 |
assert.Assert(c, err, checker.NotNil) |
... | ... |
@@ -30,24 +30,24 @@ func (s *DiscoverySuite) TestNewEntry(c *testing.T) { |
30 | 30 |
|
31 | 31 |
func (s *DiscoverySuite) TestParse(c *testing.T) { |
32 | 32 |
scheme, uri := parse("127.0.0.1:2375") |
33 |
- assert.Assert(c, scheme, checker.Equals, "nodes") |
|
34 |
- assert.Assert(c, uri, checker.Equals, "127.0.0.1:2375") |
|
33 |
+ assert.Equal(c, scheme, "nodes") |
|
34 |
+ assert.Equal(c, uri, "127.0.0.1:2375") |
|
35 | 35 |
|
36 | 36 |
scheme, uri = parse("localhost:2375") |
37 |
- assert.Assert(c, scheme, checker.Equals, "nodes") |
|
38 |
- assert.Assert(c, uri, checker.Equals, "localhost:2375") |
|
37 |
+ assert.Equal(c, scheme, "nodes") |
|
38 |
+ assert.Equal(c, uri, "localhost:2375") |
|
39 | 39 |
|
40 | 40 |
scheme, uri = parse("scheme://127.0.0.1:2375") |
41 |
- assert.Assert(c, scheme, checker.Equals, "scheme") |
|
42 |
- assert.Assert(c, uri, checker.Equals, "127.0.0.1:2375") |
|
41 |
+ assert.Equal(c, scheme, "scheme") |
|
42 |
+ assert.Equal(c, uri, "127.0.0.1:2375") |
|
43 | 43 |
|
44 | 44 |
scheme, uri = parse("scheme://localhost:2375") |
45 |
- assert.Assert(c, scheme, checker.Equals, "scheme") |
|
46 |
- assert.Assert(c, uri, checker.Equals, "localhost:2375") |
|
45 |
+ assert.Equal(c, scheme, "scheme") |
|
46 |
+ assert.Equal(c, uri, "localhost:2375") |
|
47 | 47 |
|
48 | 48 |
scheme, uri = parse("") |
49 |
- assert.Assert(c, scheme, checker.Equals, "nodes") |
|
50 |
- assert.Assert(c, uri, checker.Equals, "") |
|
49 |
+ assert.Equal(c, scheme, "nodes") |
|
50 |
+ assert.Equal(c, uri, "") |
|
51 | 51 |
} |
52 | 52 |
|
53 | 53 |
func (s *DiscoverySuite) TestCreateEntries(c *testing.T) { |
... | ... |
@@ -62,7 +62,7 @@ func (s *DiscoverySuite) TestCreateEntries(c *testing.T) { |
62 | 62 |
&Entry{Host: "127.0.0.2", Port: "2375"}, |
63 | 63 |
&Entry{Host: "2001:db8:0:f101::2", Port: "2375"}, |
64 | 64 |
} |
65 |
- assert.Assert(c, entries.Equals(expected), checker.Equals, true) |
|
65 |
+ assert.Equal(c, entries.Equals(expected), true) |
|
66 | 66 |
|
67 | 67 |
_, err = CreateEntries([]string{"127.0.0.1", "127.0.0.2"}) |
68 | 68 |
assert.Assert(c, err, checker.NotNil) |
... | ... |
@@ -71,8 +71,8 @@ func (s *DiscoverySuite) TestCreateEntries(c *testing.T) { |
71 | 71 |
func (s *DiscoverySuite) TestContainsEntry(c *testing.T) { |
72 | 72 |
entries, err := CreateEntries([]string{"127.0.0.1:2375", "127.0.0.2:2375", ""}) |
73 | 73 |
assert.Assert(c, err, checker.IsNil) |
74 |
- assert.Assert(c, entries.Contains(&Entry{Host: "127.0.0.1", Port: "2375"}), checker.Equals, true) |
|
75 |
- assert.Assert(c, entries.Contains(&Entry{Host: "127.0.0.3", Port: "2375"}), checker.Equals, false) |
|
74 |
+ assert.Equal(c, entries.Contains(&Entry{Host: "127.0.0.1", Port: "2375"}), true) |
|
75 |
+ assert.Equal(c, entries.Contains(&Entry{Host: "127.0.0.3", Port: "2375"}), false) |
|
76 | 76 |
} |
77 | 77 |
|
78 | 78 |
func (s *DiscoverySuite) TestEntriesEquality(c *testing.T) { |
... | ... |
@@ -116,19 +116,19 @@ func (s *DiscoverySuite) TestEntriesDiff(c *testing.T) { |
116 | 116 |
// Add |
117 | 117 |
added, removed = entries.Diff(Entries{entry2, entry3, entry1}) |
118 | 118 |
assert.Assert(c, added, checker.HasLen, 1) |
119 |
- assert.Assert(c, added.Contains(entry3), checker.Equals, true) |
|
119 |
+ assert.Equal(c, added.Contains(entry3), true) |
|
120 | 120 |
assert.Assert(c, removed, checker.HasLen, 0) |
121 | 121 |
|
122 | 122 |
// Remove |
123 | 123 |
added, removed = entries.Diff(Entries{entry2}) |
124 | 124 |
assert.Assert(c, added, checker.HasLen, 0) |
125 | 125 |
assert.Assert(c, removed, checker.HasLen, 1) |
126 |
- assert.Assert(c, removed.Contains(entry1), checker.Equals, true) |
|
126 |
+ assert.Equal(c, removed.Contains(entry1), true) |
|
127 | 127 |
|
128 | 128 |
// Add and remove |
129 | 129 |
added, removed = entries.Diff(Entries{entry1, entry3}) |
130 | 130 |
assert.Assert(c, added, checker.HasLen, 1) |
131 |
- assert.Assert(c, added.Contains(entry3), checker.Equals, true) |
|
131 |
+ assert.Equal(c, added.Contains(entry3), true) |
|
132 | 132 |
assert.Assert(c, removed, checker.HasLen, 1) |
133 |
- assert.Assert(c, removed.Contains(entry2), checker.Equals, true) |
|
133 |
+ assert.Equal(c, removed.Contains(entry2), true) |
|
134 | 134 |
} |
... | ... |
@@ -20,13 +20,13 @@ var _ = check.Suite(&DiscoverySuite{}) |
20 | 20 |
func (s *DiscoverySuite) TestInitialize(c *testing.T) { |
21 | 21 |
d := &Discovery{} |
22 | 22 |
d.Initialize("/path/to/file", 1000, 0, nil) |
23 |
- assert.Assert(c, d.path, checker.Equals, "/path/to/file") |
|
23 |
+ assert.Equal(c, d.path, "/path/to/file") |
|
24 | 24 |
} |
25 | 25 |
|
26 | 26 |
func (s *DiscoverySuite) TestNew(c *testing.T) { |
27 | 27 |
d, err := discovery.New("file:///path/to/file", 0, 0, nil) |
28 | 28 |
assert.Assert(c, err, checker.IsNil) |
29 |
- assert.Assert(c, d.(*Discovery).path, checker.Equals, "/path/to/file") |
|
29 |
+ assert.Equal(c, d.(*Discovery).path, "/path/to/file") |
|
30 | 30 |
} |
31 | 31 |
|
32 | 32 |
func (s *DiscoverySuite) TestContent(c *testing.T) { |
... | ... |
@@ -36,11 +36,11 @@ func (s *DiscoverySuite) TestContent(c *testing.T) { |
36 | 36 |
` |
37 | 37 |
ips := parseFileContent([]byte(data)) |
38 | 38 |
assert.Assert(c, ips, checker.HasLen, 5) |
39 |
- assert.Assert(c, ips[0], checker.Equals, "1.1.1.1:1111") |
|
40 |
- assert.Assert(c, ips[1], checker.Equals, "1.1.1.2:1111") |
|
41 |
- assert.Assert(c, ips[2], checker.Equals, "2.2.2.2:2222") |
|
42 |
- assert.Assert(c, ips[3], checker.Equals, "2.2.2.3:2222") |
|
43 |
- assert.Assert(c, ips[4], checker.Equals, "2.2.2.4:2222") |
|
39 |
+ assert.Equal(c, ips[0], "1.1.1.1:1111") |
|
40 |
+ assert.Equal(c, ips[1], "1.1.1.2:1111") |
|
41 |
+ assert.Equal(c, ips[2], "2.2.2.2:2222") |
|
42 |
+ assert.Equal(c, ips[3], "2.2.2.3:2222") |
|
43 |
+ assert.Equal(c, ips[4], "2.2.2.4:2222") |
|
44 | 44 |
} |
45 | 45 |
|
46 | 46 |
func (s *DiscoverySuite) TestRegister(c *testing.T) { |
... | ... |
@@ -59,8 +59,8 @@ func (s *DiscoverySuite) TestParsingContentsWithComments(c *testing.T) { |
59 | 59 |
` |
60 | 60 |
ips := parseFileContent([]byte(data)) |
61 | 61 |
assert.Assert(c, ips, checker.HasLen, 2) |
62 |
- assert.Assert(c, "1.1.1.1:1111", checker.Equals, ips[0]) |
|
63 |
- assert.Assert(c, "3.3.3.3:3333", checker.Equals, ips[1]) |
|
62 |
+ assert.Equal(c, "1.1.1.1:1111", ips[0]) |
|
63 |
+ assert.Equal(c, "3.3.3.3:3333", ips[1]) |
|
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
func (s *DiscoverySuite) TestWatch(c *testing.T) { |
... | ... |
@@ -6,48 +6,48 @@ import ( |
6 | 6 |
|
7 | 7 |
func (s *DiscoverySuite) TestGeneratorNotGenerate(c *testing.T) { |
8 | 8 |
ips := Generate("127.0.0.1") |
9 |
- assert.Assert(c, len(ips), checker.Equals, 1) |
|
10 |
- assert.Assert(c, ips[0], checker.Equals, "127.0.0.1") |
|
9 |
+ assert.Equal(c, len(ips), 1) |
|
10 |
+ assert.Equal(c, ips[0], "127.0.0.1") |
|
11 | 11 |
} |
12 | 12 |
|
13 | 13 |
func (s *DiscoverySuite) TestGeneratorWithPortNotGenerate(c *testing.T) { |
14 | 14 |
ips := Generate("127.0.0.1:8080") |
15 |
- assert.Assert(c, len(ips), checker.Equals, 1) |
|
16 |
- assert.Assert(c, ips[0], checker.Equals, "127.0.0.1:8080") |
|
15 |
+ assert.Equal(c, len(ips), 1) |
|
16 |
+ assert.Equal(c, ips[0], "127.0.0.1:8080") |
|
17 | 17 |
} |
18 | 18 |
|
19 | 19 |
func (s *DiscoverySuite) TestGeneratorMatchFailedNotGenerate(c *testing.T) { |
20 | 20 |
ips := Generate("127.0.0.[1]") |
21 |
- assert.Assert(c, len(ips), checker.Equals, 1) |
|
22 |
- assert.Assert(c, ips[0], checker.Equals, "127.0.0.[1]") |
|
21 |
+ assert.Equal(c, len(ips), 1) |
|
22 |
+ assert.Equal(c, ips[0], "127.0.0.[1]") |
|
23 | 23 |
} |
24 | 24 |
|
25 | 25 |
func (s *DiscoverySuite) TestGeneratorWithPort(c *testing.T) { |
26 | 26 |
ips := Generate("127.0.0.[1:11]:2375") |
27 |
- assert.Assert(c, len(ips), checker.Equals, 11) |
|
28 |
- assert.Assert(c, ips[0], checker.Equals, "127.0.0.1:2375") |
|
29 |
- assert.Assert(c, ips[1], checker.Equals, "127.0.0.2:2375") |
|
30 |
- assert.Assert(c, ips[2], checker.Equals, "127.0.0.3:2375") |
|
31 |
- assert.Assert(c, ips[3], checker.Equals, "127.0.0.4:2375") |
|
32 |
- assert.Assert(c, ips[4], checker.Equals, "127.0.0.5:2375") |
|
33 |
- assert.Assert(c, ips[5], checker.Equals, "127.0.0.6:2375") |
|
34 |
- assert.Assert(c, ips[6], checker.Equals, "127.0.0.7:2375") |
|
35 |
- assert.Assert(c, ips[7], checker.Equals, "127.0.0.8:2375") |
|
36 |
- assert.Assert(c, ips[8], checker.Equals, "127.0.0.9:2375") |
|
37 |
- assert.Assert(c, ips[9], checker.Equals, "127.0.0.10:2375") |
|
38 |
- assert.Assert(c, ips[10], checker.Equals, "127.0.0.11:2375") |
|
27 |
+ assert.Equal(c, len(ips), 11) |
|
28 |
+ assert.Equal(c, ips[0], "127.0.0.1:2375") |
|
29 |
+ assert.Equal(c, ips[1], "127.0.0.2:2375") |
|
30 |
+ assert.Equal(c, ips[2], "127.0.0.3:2375") |
|
31 |
+ assert.Equal(c, ips[3], "127.0.0.4:2375") |
|
32 |
+ assert.Equal(c, ips[4], "127.0.0.5:2375") |
|
33 |
+ assert.Equal(c, ips[5], "127.0.0.6:2375") |
|
34 |
+ assert.Equal(c, ips[6], "127.0.0.7:2375") |
|
35 |
+ assert.Equal(c, ips[7], "127.0.0.8:2375") |
|
36 |
+ assert.Equal(c, ips[8], "127.0.0.9:2375") |
|
37 |
+ assert.Equal(c, ips[9], "127.0.0.10:2375") |
|
38 |
+ assert.Equal(c, ips[10], "127.0.0.11:2375") |
|
39 | 39 |
} |
40 | 40 |
|
41 | 41 |
func (s *DiscoverySuite) TestGenerateWithMalformedInputAtRangeStart(c *testing.T) { |
42 | 42 |
malformedInput := "127.0.0.[x:11]:2375" |
43 | 43 |
ips := Generate(malformedInput) |
44 |
- assert.Assert(c, len(ips), checker.Equals, 1) |
|
45 |
- assert.Assert(c, ips[0], checker.Equals, malformedInput) |
|
44 |
+ assert.Equal(c, len(ips), 1) |
|
45 |
+ assert.Equal(c, ips[0], malformedInput) |
|
46 | 46 |
} |
47 | 47 |
|
48 | 48 |
func (s *DiscoverySuite) TestGenerateWithMalformedInputAtRangeEnd(c *testing.T) { |
49 | 49 |
malformedInput := "127.0.0.[1:x]:2375" |
50 | 50 |
ips := Generate(malformedInput) |
51 |
- assert.Assert(c, len(ips), checker.Equals, 1) |
|
52 |
- assert.Assert(c, ips[0], checker.Equals, malformedInput) |
|
51 |
+ assert.Equal(c, len(ips), 1) |
|
52 |
+ assert.Equal(c, ips[0], malformedInput) |
|
53 | 53 |
} |
... | ... |
@@ -31,8 +31,8 @@ func (ds *DiscoverySuite) TestInitialize(c *testing.T) { |
31 | 31 |
|
32 | 32 |
s := d.store.(*FakeStore) |
33 | 33 |
assert.Assert(c, s.Endpoints, checker.HasLen, 1) |
34 |
- assert.Assert(c, s.Endpoints[0], checker.Equals, "127.0.0.1") |
|
35 |
- assert.Assert(c, d.path, checker.Equals, defaultDiscoveryPath) |
|
34 |
+ assert.Equal(c, s.Endpoints[0], "127.0.0.1") |
|
35 |
+ assert.Equal(c, d.path, defaultDiscoveryPath) |
|
36 | 36 |
|
37 | 37 |
storeMock = &FakeStore{ |
38 | 38 |
Endpoints: []string{"127.0.0.1:1234"}, |
... | ... |
@@ -43,8 +43,8 @@ func (ds *DiscoverySuite) TestInitialize(c *testing.T) { |
43 | 43 |
|
44 | 44 |
s = d.store.(*FakeStore) |
45 | 45 |
assert.Assert(c, s.Endpoints, checker.HasLen, 1) |
46 |
- assert.Assert(c, s.Endpoints[0], checker.Equals, "127.0.0.1:1234") |
|
47 |
- assert.Assert(c, d.path, checker.Equals, "path/"+defaultDiscoveryPath) |
|
46 |
+ assert.Equal(c, s.Endpoints[0], "127.0.0.1:1234") |
|
47 |
+ assert.Equal(c, d.path, "path/"+defaultDiscoveryPath) |
|
48 | 48 |
|
49 | 49 |
storeMock = &FakeStore{ |
50 | 50 |
Endpoints: []string{"127.0.0.1:1234", "127.0.0.2:1234", "127.0.0.3:1234"}, |
... | ... |
@@ -55,11 +55,11 @@ func (ds *DiscoverySuite) TestInitialize(c *testing.T) { |
55 | 55 |
|
56 | 56 |
s = d.store.(*FakeStore) |
57 | 57 |
assert.Assert(c, s.Endpoints, checker.HasLen, 3) |
58 |
- assert.Assert(c, s.Endpoints[0], checker.Equals, "127.0.0.1:1234") |
|
59 |
- assert.Assert(c, s.Endpoints[1], checker.Equals, "127.0.0.2:1234") |
|
60 |
- assert.Assert(c, s.Endpoints[2], checker.Equals, "127.0.0.3:1234") |
|
58 |
+ assert.Equal(c, s.Endpoints[0], "127.0.0.1:1234") |
|
59 |
+ assert.Equal(c, s.Endpoints[1], "127.0.0.2:1234") |
|
60 |
+ assert.Equal(c, s.Endpoints[2], "127.0.0.3:1234") |
|
61 | 61 |
|
62 |
- assert.Assert(c, d.path, checker.Equals, "path/"+defaultDiscoveryPath) |
|
62 |
+ assert.Equal(c, d.path, "path/"+defaultDiscoveryPath) |
|
63 | 63 |
} |
64 | 64 |
|
65 | 65 |
// Extremely limited mock store so we can test initialization |
... | ... |
@@ -18,20 +18,20 @@ var _ = check.Suite(&DiscoverySuite{}) |
18 | 18 |
func (s *DiscoverySuite) TestInitialize(c *testing.T) { |
19 | 19 |
d := &Discovery{} |
20 | 20 |
d.Initialize("1.1.1.1:1111,2.2.2.2:2222", 0, 0, nil) |
21 |
- assert.Assert(c, len(d.entries), checker.Equals, 2) |
|
22 |
- assert.Assert(c, d.entries[0].String(), checker.Equals, "1.1.1.1:1111") |
|
23 |
- assert.Assert(c, d.entries[1].String(), checker.Equals, "2.2.2.2:2222") |
|
21 |
+ assert.Equal(c, len(d.entries), 2) |
|
22 |
+ assert.Equal(c, d.entries[0].String(), "1.1.1.1:1111") |
|
23 |
+ assert.Equal(c, d.entries[1].String(), "2.2.2.2:2222") |
|
24 | 24 |
} |
25 | 25 |
|
26 | 26 |
func (s *DiscoverySuite) TestInitializeWithPattern(c *testing.T) { |
27 | 27 |
d := &Discovery{} |
28 | 28 |
d.Initialize("1.1.1.[1:2]:1111,2.2.2.[2:4]:2222", 0, 0, nil) |
29 |
- assert.Assert(c, len(d.entries), checker.Equals, 5) |
|
30 |
- assert.Assert(c, d.entries[0].String(), checker.Equals, "1.1.1.1:1111") |
|
31 |
- assert.Assert(c, d.entries[1].String(), checker.Equals, "1.1.1.2:1111") |
|
32 |
- assert.Assert(c, d.entries[2].String(), checker.Equals, "2.2.2.2:2222") |
|
33 |
- assert.Assert(c, d.entries[3].String(), checker.Equals, "2.2.2.3:2222") |
|
34 |
- assert.Assert(c, d.entries[4].String(), checker.Equals, "2.2.2.4:2222") |
|
29 |
+ assert.Equal(c, len(d.entries), 5) |
|
30 |
+ assert.Equal(c, d.entries[0].String(), "1.1.1.1:1111") |
|
31 |
+ assert.Equal(c, d.entries[1].String(), "1.1.1.2:1111") |
|
32 |
+ assert.Equal(c, d.entries[2].String(), "2.2.2.2:2222") |
|
33 |
+ assert.Equal(c, d.entries[3].String(), "2.2.2.3:2222") |
|
34 |
+ assert.Equal(c, d.entries[4].String(), "2.2.2.4:2222") |
|
35 | 35 |
} |
36 | 36 |
|
37 | 37 |
func (s *DiscoverySuite) TestWatch(c *testing.T) { |
... | ... |
@@ -42,7 +42,7 @@ func (s *DiscoverySuite) TestWatch(c *testing.T) { |
42 | 42 |
&discovery.Entry{Host: "2.2.2.2", Port: "2222"}, |
43 | 43 |
} |
44 | 44 |
ch, _ := d.Watch(nil) |
45 |
- assert.Assert(c, expected.Equals(<-ch), checker.Equals, true) |
|
45 |
+ assert.Equal(c, expected.Equals(<-ch), true) |
|
46 | 46 |
} |
47 | 47 |
|
48 | 48 |
func (s *DiscoverySuite) TestRegister(c *testing.T) { |