Browse code

delete "defer deleteContainer" on tests

Since docker test suite is now using gocheck, ``defer
deleteContainer(…)`` is not needed anymore.

Fixes #12705

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Vincent Demeester authored on 2015/04/24 05:27:46
Showing 8 changed files
... ...
@@ -140,7 +140,6 @@ func (s *DockerSuite) TestCreateByDigest(c *check.C) {
140 140
 	if err != nil {
141 141
 		c.Fatalf("error creating by digest: %s, %v", out, err)
142 142
 	}
143
-	defer deleteContainer(containerName)
144 143
 
145 144
 	res, err := inspectField(containerName, "Config.Image")
146 145
 	if err != nil {
... ...
@@ -168,7 +167,6 @@ func (s *DockerSuite) TestRunByDigest(c *check.C) {
168 168
 	if err != nil {
169 169
 		c.Fatalf("error run by digest: %s, %v", out, err)
170 170
 	}
171
-	defer deleteContainer(containerName)
172 171
 
173 172
 	foundRegex := regexp.MustCompile("found=([^\n]+)")
174 173
 	matches := foundRegex.FindStringSubmatch(out)
... ...
@@ -32,7 +32,6 @@ func (s *DockerSuite) TestCpGarbagePath(c *check.C) {
32 32
 	}
33 33
 
34 34
 	cleanedContainerID := strings.TrimSpace(out)
35
-	defer deleteContainer(cleanedContainerID)
36 35
 
37 36
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
38 37
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -90,7 +89,6 @@ func (s *DockerSuite) TestCpRelativePath(c *check.C) {
90 90
 	}
91 91
 
92 92
 	cleanedContainerID := strings.TrimSpace(out)
93
-	defer deleteContainer(cleanedContainerID)
94 93
 
95 94
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
96 95
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -156,7 +154,6 @@ func (s *DockerSuite) TestCpAbsolutePath(c *check.C) {
156 156
 	}
157 157
 
158 158
 	cleanedContainerID := strings.TrimSpace(out)
159
-	defer deleteContainer(cleanedContainerID)
160 159
 
161 160
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
162 161
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -216,7 +213,6 @@ func (s *DockerSuite) TestCpAbsoluteSymlink(c *check.C) {
216 216
 	}
217 217
 
218 218
 	cleanedContainerID := strings.TrimSpace(out)
219
-	defer deleteContainer(cleanedContainerID)
220 219
 
221 220
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
222 221
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -276,7 +272,6 @@ func (s *DockerSuite) TestCpSymlinkComponent(c *check.C) {
276 276
 	}
277 277
 
278 278
 	cleanedContainerID := strings.TrimSpace(out)
279
-	defer deleteContainer(cleanedContainerID)
280 279
 
281 280
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
282 281
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -337,7 +332,6 @@ func (s *DockerSuite) TestCpUnprivilegedUser(c *check.C) {
337 337
 	}
338 338
 
339 339
 	cleanedContainerID := strings.TrimSpace(out)
340
-	defer deleteContainer(cleanedContainerID)
341 340
 
342 341
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
343 342
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -379,7 +373,6 @@ func (s *DockerSuite) TestCpSpecialFiles(c *check.C) {
379 379
 	}
380 380
 
381 381
 	cleanedContainerID := strings.TrimSpace(out)
382
-	defer deleteContainer(cleanedContainerID)
383 382
 
384 383
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
385 384
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -525,7 +518,6 @@ func (s *DockerSuite) TestCpToDot(c *check.C) {
525 525
 	}
526 526
 
527 527
 	cleanedContainerID := strings.TrimSpace(out)
528
-	defer deleteContainer(cleanedContainerID)
529 528
 
530 529
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
531 530
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -559,7 +551,6 @@ func (s *DockerSuite) TestCpToStdout(c *check.C) {
559 559
 	}
560 560
 
561 561
 	cID := strings.TrimSpace(out)
562
-	defer deleteContainer(cID)
563 562
 
564 563
 	out, _ = dockerCmd(c, "wait", cID)
565 564
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -588,7 +579,6 @@ func (s *DockerSuite) TestCpNameHasColon(c *check.C) {
588 588
 	}
589 589
 
590 590
 	cleanedContainerID := strings.TrimSpace(out)
591
-	defer deleteContainer(cleanedContainerID)
592 591
 
593 592
 	out, _ = dockerCmd(c, "wait", cleanedContainerID)
594 593
 	if strings.TrimSpace(out) != "0" {
... ...
@@ -13,7 +13,6 @@ func (s *DockerSuite) TestExportContainerAndImportImage(c *check.C) {
13 13
 	containerID := "testexportcontainerandimportimage"
14 14
 
15 15
 	defer deleteImages("repo/testexp:v1")
16
-	defer deleteContainer(containerID)
17 16
 
18 17
 	runCmd := exec.Command(dockerBinary, "run", "-d", "--name", containerID, "busybox", "true")
19 18
 	out, _, err := runCommandWithOutput(runCmd)
... ...
@@ -53,7 +52,6 @@ func (s *DockerSuite) TestExportContainerWithOutputAndImportImage(c *check.C) {
53 53
 	containerID := "testexportcontainerwithoutputandimportimage"
54 54
 
55 55
 	defer deleteImages("repo/testexp:v1")
56
-	defer deleteContainer(containerID)
57 56
 
58 57
 	runCmd := exec.Command(dockerBinary, "run", "-d", "--name", containerID, "busybox", "true")
59 58
 	out, _, err := runCommandWithOutput(runCmd)
... ...
@@ -85,7 +85,6 @@ func (s *DockerSuite) TestHistoryNonExistentImage(c *check.C) {
85 85
 
86 86
 func (s *DockerSuite) TestHistoryImageWithComment(c *check.C) {
87 87
 	name := "testhistoryimagewithcomment"
88
-	defer deleteContainer(name)
89 88
 	defer deleteImages(name)
90 89
 
91 90
 	// make a image through docker commit <container id> [ -m messages ]
... ...
@@ -14,7 +14,6 @@ func (s *DockerSuite) TestImportDisplay(c *check.C) {
14 14
 		c.Fatal("failed to create a container", out, err)
15 15
 	}
16 16
 	cleanedContainerID := strings.TrimSpace(out)
17
-	defer deleteContainer(cleanedContainerID)
18 17
 
19 18
 	out, _, err = runCommandPipelineWithOutput(
20 19
 		exec.Command(dockerBinary, "export", cleanedContainerID),
... ...
@@ -287,7 +287,6 @@ func (s *DockerSuite) TestLogsFollowSlowStdoutConsumer(c *check.C) {
287 287
 	}
288 288
 
289 289
 	cleanedContainerID := strings.TrimSpace(out)
290
-	defer deleteContainer(cleanedContainerID)
291 290
 
292 291
 	stopSlowRead := make(chan bool)
293 292
 
... ...
@@ -216,7 +216,6 @@ func (s *DockerSuite) TestSaveAndLoadRepoFlags(c *check.C) {
216 216
 	}
217 217
 
218 218
 	cleanedContainerID := strings.TrimSpace(out)
219
-	defer deleteContainer(cleanedContainerID)
220 219
 
221 220
 	repoName := "foobar-save-load-test"
222 221
 
... ...
@@ -298,7 +297,6 @@ func (s *DockerSuite) TestSaveRepoWithMultipleImages(c *check.C) {
298 298
 			c.Fatalf("failed to create a container: %v %v", out, err)
299 299
 		}
300 300
 		cleanedContainerID := strings.TrimSpace(out)
301
-		defer deleteContainer(cleanedContainerID)
302 301
 
303 302
 		commitCmd := exec.Command(dockerBinary, "commit", cleanedContainerID, tag)
304 303
 		if out, _, err = runCommandWithOutput(commitCmd); err != nil {
... ...
@@ -15,7 +15,6 @@ func (s *DockerSuite) TestTopMultipleArgs(c *check.C) {
15 15
 	}
16 16
 
17 17
 	cleanedContainerID := strings.TrimSpace(out)
18
-	defer deleteContainer(cleanedContainerID)
19 18
 
20 19
 	topCmd := exec.Command(dockerBinary, "top", cleanedContainerID, "-o", "pid")
21 20
 	out, _, err = runCommandWithOutput(topCmd)