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>
This commit is contained in:
Sebastiaan van Stijn 2019-08-05 16:58:46 +02:00
parent a0d58b2248
commit 67e4d36e46
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
5 changed files with 4 additions and 53 deletions

View File

@ -6,7 +6,6 @@ import (
"strings"
"testing"
"github.com/docker/docker/pkg/mount"
"golang.org/x/sys/unix"
"gotest.tools/assert"
"gotest.tools/icmd"
@ -259,19 +258,6 @@ func (s *DockerDaemonSuite) TestPluginVolumeRemoveOnRestart(c *testing.T) {
assert.NilError(c, err, out)
}
func existsMountpointWithPrefix(mountpointPrefix string) (bool, error) {
mounts, err := mount.GetMounts(nil)
if err != nil {
return false, err
}
for _, mnt := range mounts {
if strings.HasPrefix(mnt.Mountpoint, mountpointPrefix) {
return true, nil
}
}
return false, nil
}
func (s *DockerDaemonSuite) TestPluginListFilterEnabled(c *testing.T) {
testRequires(c, IsAmd64, Network)

View File

@ -107,11 +107,11 @@ func testConcurrentPullWholeRepo(c *testing.T) {
}
}
func (s *DockerRegistrySuite) testConcurrentPullWholeRepo(c *testing.T) {
func (s *DockerRegistrySuite) TestConcurrentPullWholeRepo(c *testing.T) {
testConcurrentPullWholeRepo(c)
}
func (s *DockerSchema1RegistrySuite) testConcurrentPullWholeRepo(c *testing.T) {
func (s *DockerSchema1RegistrySuite) TestConcurrentPullWholeRepo(c *testing.T) {
testConcurrentPullWholeRepo(c)
}
@ -138,11 +138,11 @@ func testConcurrentFailingPull(c *testing.T) {
}
}
func (s *DockerRegistrySuite) testConcurrentFailingPull(c *testing.T) {
func (s *DockerRegistrySuite) TestConcurrentFailingPull(c *testing.T) {
testConcurrentFailingPull(c)
}
func (s *DockerSchema1RegistrySuite) testConcurrentFailingPull(c *testing.T) {
func (s *DockerSchema1RegistrySuite) TestConcurrentFailingPull(c *testing.T) {
testConcurrentFailingPull(c)
}

View File

@ -174,20 +174,6 @@ func inspectMountPointJSON(j, destination string) (types.MountPoint, error) {
return *m, nil
}
// Deprecated: use cli.Inspect
func inspectImage(c *testing.T, name, filter string) string {
c.Helper()
args := []string{"inspect", "--type", "image"}
if filter != "" {
format := fmt.Sprintf("{{%s}}", filter)
args = append(args, "-f", format)
}
args = append(args, name)
result := icmd.RunCommand(dockerBinary, args...)
result.Assert(c, icmd.Success)
return strings.TrimSpace(result.Combined())
}
func getIDByName(c *testing.T, name string) string {
c.Helper()
id, err := inspectFieldWithError(name, "Id")

View File

@ -192,15 +192,3 @@ func parseEvents(c *testing.T, out, match string) {
assert.Assert(c, matched, "Matcher: %s did not match %s", match, matches["action"])
}
}
func parseEventsWithID(c *testing.T, out, match, id string) {
events := strings.Split(strings.TrimSpace(out), "\n")
for _, event := range events {
matches := eventstestutils.ScanMap(event)
assert.Assert(c, matchEventID(matches, id))
matched, err := regexp.MatchString(match, matches["action"])
assert.NilError(c, err)
assert.Assert(c, matched, "Matcher: %s did not match %s", match, matches["action"])
}
}

View File

@ -14,15 +14,6 @@ import (
"gotest.tools/assert"
)
type testingT interface {
logT
Fatalf(string, ...interface{})
}
type logT interface {
Logf(string, ...interface{})
}
func ensureSyscallTest(c *testing.T) {
defer testEnv.ProtectImage(c, "syscall-test:latest")