Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 621b601

Browse files
committed
Removed unnecessary error output from dockerCmd
Changed method declaration. Fixed all calls to dockerCmd method to reflect the change. resolves moby#12355 Signed-off-by: bobby abbott <[email protected]>
1 parent 24af878 commit 621b601

16 files changed

Lines changed: 127 additions & 176 deletions

integration-cli/docker_api_containers_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ func TestContainerApiPause(t *testing.T) {
627627

628628
func TestContainerApiTop(t *testing.T) {
629629
defer deleteAllContainers()
630-
out, _, _ := dockerCmd(t, "run", "-d", "-i", "busybox", "/bin/sh", "-c", "cat")
630+
out, _ := dockerCmd(t, "run", "-d", "-i", "busybox", "/bin/sh", "-c", "cat")
631631
id := strings.TrimSpace(out)
632632
if err := waitRun(id); err != nil {
633633
t.Fatal(err)
@@ -667,7 +667,7 @@ func TestContainerApiTop(t *testing.T) {
667667
}
668668

669669
func TestContainerApiCommit(t *testing.T) {
670-
out, _, _ := dockerCmd(t, "run", "-d", "busybox", "/bin/sh", "-c", "touch /test")
670+
out, _ := dockerCmd(t, "run", "-d", "busybox", "/bin/sh", "-c", "touch /test")
671671
id := strings.TrimSpace(out)
672672

673673
name := "testcommit"
@@ -714,7 +714,7 @@ func TestContainerApiCreate(t *testing.T) {
714714
t.Fatal(err)
715715
}
716716

717-
out, _, _ := dockerCmd(t, "start", "-a", container.Id)
717+
out, _ := dockerCmd(t, "start", "-a", container.Id)
718718
if strings.TrimSpace(out) != "/test" {
719719
t.Fatalf("expected output `/test`, got %q", out)
720720
}

integration-cli/docker_api_images_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func TestApiImagesSaveAndLoad(t *testing.T) {
9191
}
9292
defer loadBody.Close()
9393

94-
out, _, _ = dockerCmd(t, "inspect", "--format='{{ .Id }}'", id)
94+
out, _ = dockerCmd(t, "inspect", "--format='{{ .Id }}'", id)
9595
if strings.TrimSpace(out) != id {
9696
t.Fatal("load did not work properly")
9797
}

integration-cli/docker_cli_attach_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func TestAttachTtyWithoutStdin(t *testing.T) {
138138

139139
func TestAttachDisconnect(t *testing.T) {
140140
defer deleteAllContainers()
141-
out, _, _ := dockerCmd(t, "run", "-di", "busybox", "/bin/cat")
141+
out, _ := dockerCmd(t, "run", "-di", "busybox", "/bin/cat")
142142
id := strings.TrimSpace(out)
143143

144144
cmd := exec.Command(dockerBinary, "attach", id)

integration-cli/docker_cli_attach_unix_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func TestAttachAfterDetach(t *testing.T) {
142142

143143
// TestAttachDetach checks that attach in tty mode can be detached using the long container ID
144144
func TestAttachDetach(t *testing.T) {
145-
out, _, _ := dockerCmd(t, "run", "-itd", "busybox", "cat")
145+
out, _ := dockerCmd(t, "run", "-itd", "busybox", "cat")
146146
id := strings.TrimSpace(out)
147147
if err := waitRun(id); err != nil {
148148
t.Fatal(err)
@@ -217,7 +217,7 @@ func TestAttachDetach(t *testing.T) {
217217

218218
// TestAttachDetachTruncatedID checks that attach in tty mode can be detached
219219
func TestAttachDetachTruncatedID(t *testing.T) {
220-
out, _, _ := dockerCmd(t, "run", "-itd", "busybox", "cat")
220+
out, _ := dockerCmd(t, "run", "-itd", "busybox", "cat")
221221
id := stringid.TruncateID(strings.TrimSpace(out))
222222
if err := waitRun(id); err != nil {
223223
t.Fatal(err)

integration-cli/docker_cli_build_test.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3294,7 +3294,7 @@ func TestBuildNoContext(t *testing.T) {
32943294
t.Fatalf("build failed to complete: %v %v", out, err)
32953295
}
32963296

3297-
if out, _, err := dockerCmd(t, "run", "--rm", "nocontext"); out != "ok\n" || err != nil {
3297+
if out, _ := dockerCmd(t, "run", "--rm", "nocontext"); out != "ok\n" {
32983298
t.Fatalf("run produced invalid output: %q, expected %q", out, "ok")
32993299
}
33003300

@@ -5562,10 +5562,7 @@ func TestBuildResourceConstraintsAreUsed(t *testing.T) {
55625562
if err != nil {
55635563
t.Fatal(err, out)
55645564
}
5565-
out, _, err = dockerCmd(t, "ps", "-lq")
5566-
if err != nil {
5567-
t.Fatal(err, out)
5568-
}
5565+
out, _ = dockerCmd(t, "ps", "-lq")
55695566

55705567
cID := strings.TrimSpace(out)
55715568

@@ -5593,10 +5590,8 @@ func TestBuildResourceConstraintsAreUsed(t *testing.T) {
55935590
}
55945591

55955592
// Make sure constraints aren't saved to image
5596-
_, _, err = dockerCmd(t, "run", "--name=test", name)
5597-
if err != nil {
5598-
t.Fatal(err)
5599-
}
5593+
_, _ = dockerCmd(t, "run", "--name=test", name)
5594+
56005595
cfg, err = inspectFieldJSON("test", "HostConfig")
56015596
if err != nil {
56025597
t.Fatal(err)

integration-cli/docker_cli_commit_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,13 @@ func TestCommitChange(t *testing.T) {
284284
func TestCommitMergeConfigRun(t *testing.T) {
285285
defer deleteAllContainers()
286286
name := "commit-test"
287-
out, _, _ := dockerCmd(t, "run", "-d", "-e=FOO=bar", "busybox", "/bin/sh", "-c", "echo testing > /tmp/foo")
287+
out, _ := dockerCmd(t, "run", "-d", "-e=FOO=bar", "busybox", "/bin/sh", "-c", "echo testing > /tmp/foo")
288288
id := strings.TrimSpace(out)
289289

290290
dockerCmd(t, "commit", `--run={"Cmd": ["cat", "/tmp/foo"]}`, id, "commit-test")
291291
defer deleteImages("commit-test")
292292

293-
out, _, _ = dockerCmd(t, "run", "--name", name, "commit-test")
293+
out, _ = dockerCmd(t, "run", "--name", name, "commit-test")
294294
if strings.TrimSpace(out) != "testing" {
295295
t.Fatal("run config in commited container was not merged")
296296
}

0 commit comments

Comments
 (0)