Browse code

Delete "defer deleteAllContainers()" from integration-cli

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>

Zhang Wei authored on 2015/05/22 18:01:52
Showing 3 changed files
... ...
@@ -63,7 +63,6 @@ func (s *DockerSuite) TestLogsApiNoStdoutNorStderr(c *check.C) {
63 63
 
64 64
 // Regression test for #12704
65 65
 func (s *DockerSuite) TestLogsApiFollowEmptyOutput(c *check.C) {
66
-	defer deleteAllContainers()
67 66
 	name := "logs_test"
68 67
 	t0 := time.Now()
69 68
 	runCmd := exec.Command(dockerBinary, "run", "-d", "-t", "--name", name, "busybox", "sleep", "10")
... ...
@@ -60,7 +60,6 @@ func getContainerStatus(c *check.C, containerID string) string {
60 60
 
61 61
 func (s *DockerSuite) TestNetworkNat(c *check.C) {
62 62
 	testRequires(c, SameHostDaemon, NativeExecDriver)
63
-	defer deleteAllContainers()
64 63
 
65 64
 	srv := startServerContainer(c, "tcp", 8080)
66 65
 
... ...
@@ -86,7 +85,6 @@ func (s *DockerSuite) TestNetworkNat(c *check.C) {
86 86
 
87 87
 func (s *DockerSuite) TestNetworkLocalhostTCPNat(c *check.C) {
88 88
 	testRequires(c, SameHostDaemon, NativeExecDriver)
89
-	defer deleteAllContainers()
90 89
 
91 90
 	srv := startServerContainer(c, "tcp", 8081)
92 91
 
... ...
@@ -2732,7 +2732,6 @@ func (s *DockerSuite) TestRunModePidHost(c *check.C) {
2732 2732
 
2733 2733
 func (s *DockerSuite) TestRunModeUTSHost(c *check.C) {
2734 2734
 	testRequires(c, NativeExecDriver, SameHostDaemon)
2735
-	defer deleteAllContainers()
2736 2735
 
2737 2736
 	hostUTS, err := os.Readlink("/proc/1/ns/uts")
2738 2737
 	if err != nil {
... ...
@@ -3141,7 +3140,6 @@ func (s *DockerSuite) TestRunPidHostWithChildIsKillable(c *check.C) {
3141 3141
 }
3142 3142
 
3143 3143
 func (s *DockerSuite) TestRunWithTooSmallMemoryLimit(c *check.C) {
3144
-	defer deleteAllContainers()
3145 3144
 	// this memory limit is 1 byte less than the min, which is 4MB
3146 3145
 	// https://github.com/docker/docker/blob/v1.5.0/daemon/create.go#L22
3147 3146
 	out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-m", "4194303", "busybox"))
... ...
@@ -3151,7 +3149,6 @@ func (s *DockerSuite) TestRunWithTooSmallMemoryLimit(c *check.C) {
3151 3151
 }
3152 3152
 
3153 3153
 func (s *DockerSuite) TestRunWriteToProcAsound(c *check.C) {
3154
-	defer deleteAllContainers()
3155 3154
 	code, err := runCommand(exec.Command(dockerBinary, "run", "busybox", "sh", "-c", "echo 111 >> /proc/asound/version"))
3156 3155
 	if err == nil || code == 0 {
3157 3156
 		c.Fatal("standard container should not be able to write to /proc/asound")
... ...
@@ -3160,7 +3157,6 @@ func (s *DockerSuite) TestRunWriteToProcAsound(c *check.C) {
3160 3160
 
3161 3161
 func (s *DockerSuite) TestRunReadProcTimer(c *check.C) {
3162 3162
 	testRequires(c, NativeExecDriver)
3163
-	defer deleteAllContainers()
3164 3163
 	out, code, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "busybox", "cat", "/proc/timer_stats"))
3165 3164
 	if err != nil || code != 0 {
3166 3165
 		c.Fatal(err)
... ...
@@ -3178,7 +3174,6 @@ func (s *DockerSuite) TestRunReadProcLatency(c *check.C) {
3178 3178
 		c.Skip("kernel doesnt have latency_stats configured")
3179 3179
 		return
3180 3180
 	}
3181
-	defer deleteAllContainers()
3182 3181
 	out, code, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "busybox", "cat", "/proc/latency_stats"))
3183 3182
 	if err != nil || code != 0 {
3184 3183
 		c.Fatal(err)
... ...
@@ -3190,7 +3185,6 @@ func (s *DockerSuite) TestRunReadProcLatency(c *check.C) {
3190 3190
 
3191 3191
 func (s *DockerSuite) TestMountIntoProc(c *check.C) {
3192 3192
 	testRequires(c, NativeExecDriver)
3193
-	defer deleteAllContainers()
3194 3193
 	code, err := runCommand(exec.Command(dockerBinary, "run", "-v", "/proc//sys", "busybox", "true"))
3195 3194
 	if err == nil || code == 0 {
3196 3195
 		c.Fatal("container should not be able to mount into /proc")
... ...
@@ -3199,7 +3193,6 @@ func (s *DockerSuite) TestMountIntoProc(c *check.C) {
3199 3199
 
3200 3200
 func (s *DockerSuite) TestMountIntoSys(c *check.C) {
3201 3201
 	testRequires(c, NativeExecDriver)
3202
-	defer deleteAllContainers()
3203 3202
 	_, err := runCommand(exec.Command(dockerBinary, "run", "-v", "/sys/fs/cgroup", "busybox", "true"))
3204 3203
 	if err != nil {
3205 3204
 		c.Fatal("container should be able to mount into /sys/fs/cgroup")