Browse code

integration-cli: remove unused functions and enable disabled tests

```
14:26:43 integration-cli/docker_cli_pull_local_test.go:64:6: U1000: func `testConcurrentPullWholeRepo` is unused (unused)
14:26:43 func testConcurrentPullWholeRepo(c *check.C) {
14:26:43 ^
14:26:43 integration-cli/docker_cli_pull_local_test.go:111:31: U1000: func `(*DockerRegistrySuite).testConcurrentPullWholeRepo` is unused (unused)
14:26:43 func (s *DockerRegistrySuite) testConcurrentPullWholeRepo(c *check.C) {
14:26:43 ^
14:26:43 integration-cli/docker_cli_pull_local_test.go:115:38: U1000: func `(*DockerSchema1RegistrySuite).testConcurrentPullWholeRepo` is unused (unused)
14:26:43 func (s *DockerSchema1RegistrySuite) testConcurrentPullWholeRepo(c *check.C) {
14:26:43 ^
14:26:43 integration-cli/docker_cli_pull_local_test.go:120:6: U1000: func `testConcurrentFailingPull` is unused (unused)
14:26:43 func testConcurrentFailingPull(c *check.C) {
14:26:43 ^
14:26:43 integration-cli/docker_cli_pull_local_test.go:142:31: U1000: func `(*DockerRegistrySuite).testConcurrentFailingPull` is unused (unused)
14:26:43 func (s *DockerRegistrySuite) testConcurrentFailingPull(c *check.C) {
14:26:43 ^
14:26:43 integration-cli/docker_cli_pull_local_test.go:146:38: U1000: func `(*DockerSchema1RegistrySuite).testConcurrentFailingPull` is unused (unused)
14:26:43 func (s *DockerSchema1RegistrySuite) testConcurrentFailingPull(c *check.C) {

14:26:43 integration-cli/docker_utils_test.go:170:6: U1000: func `inspectImage` is unused (unused)
14:26:43 func inspectImage(c *check.C, name, filter string) string {
14:26:43 ^
14:26:43 integration-cli/events_utils_test.go:196:6: U1000: func `parseEventsWithID` is unused (unused)
14:26:43 func parseEventsWithID(c *check.C, out, match, id string) {
14:26:43 ^
14:26:43 integration-cli/fixtures_linux_daemon_test.go:17:6: U1000: type `testingT` is unused (unused)
14:26:43 type testingT interface {
14:26:43 ^
14:26:43 integration-cli/fixtures_linux_daemon_test.go:19:2: U1000: func `testingT.Fatalf` is unused (unused)
14:26:43 Fatalf(string, ...interface{})
14:26:43 ^
14:26:43 integration-cli/fixtures_linux_daemon_test.go:22:6: U1000: type `logT` is unused (unused)
14:26:43 type logT interface {
14:26:43 ^
14:26:43 integration-cli/fixtures_linux_daemon_test.go:23:2: U1000: func `logT.Logf` is unused (unused)
14:26:43 Logf(string, ...interface{})
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2019/08/05 23:58:46
Showing 5 changed files
... ...
@@ -6,7 +6,6 @@ import (
6 6
 	"strings"
7 7
 	"testing"
8 8
 
9
-	"github.com/docker/docker/pkg/mount"
10 9
 	"golang.org/x/sys/unix"
11 10
 	"gotest.tools/assert"
12 11
 	"gotest.tools/icmd"
... ...
@@ -259,19 +258,6 @@ func (s *DockerDaemonSuite) TestPluginVolumeRemoveOnRestart(c *testing.T) {
259 259
 	assert.NilError(c, err, out)
260 260
 }
261 261
 
262
-func existsMountpointWithPrefix(mountpointPrefix string) (bool, error) {
263
-	mounts, err := mount.GetMounts(nil)
264
-	if err != nil {
265
-		return false, err
266
-	}
267
-	for _, mnt := range mounts {
268
-		if strings.HasPrefix(mnt.Mountpoint, mountpointPrefix) {
269
-			return true, nil
270
-		}
271
-	}
272
-	return false, nil
273
-}
274
-
275 262
 func (s *DockerDaemonSuite) TestPluginListFilterEnabled(c *testing.T) {
276 263
 	testRequires(c, IsAmd64, Network)
277 264
 
... ...
@@ -107,11 +107,11 @@ func testConcurrentPullWholeRepo(c *testing.T) {
107 107
 	}
108 108
 }
109 109
 
110
-func (s *DockerRegistrySuite) testConcurrentPullWholeRepo(c *testing.T) {
110
+func (s *DockerRegistrySuite) TestConcurrentPullWholeRepo(c *testing.T) {
111 111
 	testConcurrentPullWholeRepo(c)
112 112
 }
113 113
 
114
-func (s *DockerSchema1RegistrySuite) testConcurrentPullWholeRepo(c *testing.T) {
114
+func (s *DockerSchema1RegistrySuite) TestConcurrentPullWholeRepo(c *testing.T) {
115 115
 	testConcurrentPullWholeRepo(c)
116 116
 }
117 117
 
... ...
@@ -138,11 +138,11 @@ func testConcurrentFailingPull(c *testing.T) {
138 138
 	}
139 139
 }
140 140
 
141
-func (s *DockerRegistrySuite) testConcurrentFailingPull(c *testing.T) {
141
+func (s *DockerRegistrySuite) TestConcurrentFailingPull(c *testing.T) {
142 142
 	testConcurrentFailingPull(c)
143 143
 }
144 144
 
145
-func (s *DockerSchema1RegistrySuite) testConcurrentFailingPull(c *testing.T) {
145
+func (s *DockerSchema1RegistrySuite) TestConcurrentFailingPull(c *testing.T) {
146 146
 	testConcurrentFailingPull(c)
147 147
 }
148 148
 
... ...
@@ -174,20 +174,6 @@ func inspectMountPointJSON(j, destination string) (types.MountPoint, error) {
174 174
 	return *m, nil
175 175
 }
176 176
 
177
-// Deprecated: use cli.Inspect
178
-func inspectImage(c *testing.T, name, filter string) string {
179
-	c.Helper()
180
-	args := []string{"inspect", "--type", "image"}
181
-	if filter != "" {
182
-		format := fmt.Sprintf("{{%s}}", filter)
183
-		args = append(args, "-f", format)
184
-	}
185
-	args = append(args, name)
186
-	result := icmd.RunCommand(dockerBinary, args...)
187
-	result.Assert(c, icmd.Success)
188
-	return strings.TrimSpace(result.Combined())
189
-}
190
-
191 177
 func getIDByName(c *testing.T, name string) string {
192 178
 	c.Helper()
193 179
 	id, err := inspectFieldWithError(name, "Id")
... ...
@@ -192,15 +192,3 @@ func parseEvents(c *testing.T, out, match string) {
192 192
 		assert.Assert(c, matched, "Matcher: %s did not match %s", match, matches["action"])
193 193
 	}
194 194
 }
195
-
196
-func parseEventsWithID(c *testing.T, out, match, id string) {
197
-	events := strings.Split(strings.TrimSpace(out), "\n")
198
-	for _, event := range events {
199
-		matches := eventstestutils.ScanMap(event)
200
-		assert.Assert(c, matchEventID(matches, id))
201
-
202
-		matched, err := regexp.MatchString(match, matches["action"])
203
-		assert.NilError(c, err)
204
-		assert.Assert(c, matched, "Matcher: %s did not match %s", match, matches["action"])
205
-	}
206
-}
... ...
@@ -14,15 +14,6 @@ import (
14 14
 	"gotest.tools/assert"
15 15
 )
16 16
 
17
-type testingT interface {
18
-	logT
19
-	Fatalf(string, ...interface{})
20
-}
21
-
22
-type logT interface {
23
-	Logf(string, ...interface{})
24
-}
25
-
26 17
 func ensureSyscallTest(c *testing.T) {
27 18
 	defer testEnv.ProtectImage(c, "syscall-test:latest")
28 19