|
@@ -2,12 +2,14 @@ package main
|
|
|
|
|
|
import (
|
|
import (
|
|
"context"
|
|
"context"
|
|
|
|
+ "flag"
|
|
"fmt"
|
|
"fmt"
|
|
"io/ioutil"
|
|
"io/ioutil"
|
|
"net/http/httptest"
|
|
"net/http/httptest"
|
|
"os"
|
|
"os"
|
|
"path"
|
|
"path"
|
|
"path/filepath"
|
|
"path/filepath"
|
|
|
|
+ "runtime"
|
|
"strconv"
|
|
"strconv"
|
|
"sync"
|
|
"sync"
|
|
"syscall"
|
|
"syscall"
|
|
@@ -22,6 +24,7 @@ import (
|
|
"github.com/docker/docker/internal/test/fakestorage"
|
|
"github.com/docker/docker/internal/test/fakestorage"
|
|
"github.com/docker/docker/internal/test/fixtures/plugin"
|
|
"github.com/docker/docker/internal/test/fixtures/plugin"
|
|
"github.com/docker/docker/internal/test/registry"
|
|
"github.com/docker/docker/internal/test/registry"
|
|
|
|
+ "github.com/docker/docker/internal/test/suite"
|
|
"github.com/docker/docker/pkg/reexec"
|
|
"github.com/docker/docker/pkg/reexec"
|
|
"gotest.tools/assert"
|
|
"gotest.tools/assert"
|
|
)
|
|
)
|
|
@@ -57,6 +60,9 @@ func init() {
|
|
}
|
|
}
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
func TestMain(m *testing.M) {
|
|
|
|
+ flag.Parse()
|
|
|
|
+
|
|
|
|
+ // Global set up
|
|
dockerBinary = testEnv.DockerBinary()
|
|
dockerBinary = testEnv.DockerBinary()
|
|
err := ienv.EnsureFrozenImagesLinux(&testEnv.Execution)
|
|
err := ienv.EnsureFrozenImagesLinux(&testEnv.Execution)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -72,11 +78,21 @@ func Test(t *testing.T) {
|
|
cli.SetTestEnvironment(testEnv)
|
|
cli.SetTestEnvironment(testEnv)
|
|
fakestorage.SetTestEnvironment(&testEnv.Execution)
|
|
fakestorage.SetTestEnvironment(&testEnv.Execution)
|
|
ienv.ProtectAll(t, &testEnv.Execution)
|
|
ienv.ProtectAll(t, &testEnv.Execution)
|
|
- /*check.TestingT(t)*/
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-func init() {
|
|
|
|
- /*check.Suite(&DockerSuite{})*/
|
|
|
|
|
|
+ suite.Run(t, &DockerSuite{})
|
|
|
|
+ suite.Run(t, &DockerRegistrySuite{ds: &DockerSuite{}})
|
|
|
|
+ suite.Run(t, &DockerSchema1RegistrySuite{ds: &DockerSuite{}})
|
|
|
|
+ suite.Run(t, &DockerRegistryAuthHtpasswdSuite{ds: &DockerSuite{}})
|
|
|
|
+ suite.Run(t, &DockerRegistryAuthTokenSuite{ds: &DockerSuite{}})
|
|
|
|
+ suite.Run(t, &DockerDaemonSuite{ds: &DockerSuite{}})
|
|
|
|
+ suite.Run(t, &DockerSwarmSuite{ds: &DockerSuite{}})
|
|
|
|
+ suite.Run(t, &DockerPluginSuite{ds: &DockerSuite{}})
|
|
|
|
+ if runtime.GOOS != "windows" {
|
|
|
|
+ suite.Run(t, &DockerExternalVolumeSuite{ds: &DockerSuite{}})
|
|
|
|
+ suite.Run(t, &DockerNetworkSuite{ds: &DockerSuite{}})
|
|
|
|
+ // FIXME. Temporarily turning this off for Windows as GH16039 was breaking
|
|
|
|
+ // Windows to Linux CI @icecrime
|
|
|
|
+ suite.Run(t, newDockerHubPullSuite())
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
type DockerSuite struct {
|
|
type DockerSuite struct {
|
|
@@ -107,10 +123,6 @@ func (s *DockerSuite) TearDownTest(c *testing.T) {
|
|
testEnv.Clean(c)
|
|
testEnv.Clean(c)
|
|
}
|
|
}
|
|
|
|
|
|
-func init() {
|
|
|
|
- /*check.Suite(&DockerRegistrySuite{ds: &DockerSuite{}})*/
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
type DockerRegistrySuite struct {
|
|
type DockerRegistrySuite struct {
|
|
ds *DockerSuite
|
|
ds *DockerSuite
|
|
reg *registry.V2
|
|
reg *registry.V2
|
|
@@ -138,10 +150,6 @@ func (s *DockerRegistrySuite) TearDownTest(c *testing.T) {
|
|
s.ds.TearDownTest(c)
|
|
s.ds.TearDownTest(c)
|
|
}
|
|
}
|
|
|
|
|
|
-func init() {
|
|
|
|
- /*check.Suite(&DockerSchema1RegistrySuite{ds: &DockerSuite{}})*/
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
type DockerSchema1RegistrySuite struct {
|
|
type DockerSchema1RegistrySuite struct {
|
|
ds *DockerSuite
|
|
ds *DockerSuite
|
|
reg *registry.V2
|
|
reg *registry.V2
|
|
@@ -169,10 +177,6 @@ func (s *DockerSchema1RegistrySuite) TearDownTest(c *testing.T) {
|
|
s.ds.TearDownTest(c)
|
|
s.ds.TearDownTest(c)
|
|
}
|
|
}
|
|
|
|
|
|
-func init() {
|
|
|
|
- /*check.Suite(&DockerRegistryAuthHtpasswdSuite{ds: &DockerSuite{}})*/
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
type DockerRegistryAuthHtpasswdSuite struct {
|
|
type DockerRegistryAuthHtpasswdSuite struct {
|
|
ds *DockerSuite
|
|
ds *DockerSuite
|
|
reg *registry.V2
|
|
reg *registry.V2
|
|
@@ -202,10 +206,6 @@ func (s *DockerRegistryAuthHtpasswdSuite) TearDownTest(c *testing.T) {
|
|
s.ds.TearDownTest(c)
|
|
s.ds.TearDownTest(c)
|
|
}
|
|
}
|
|
|
|
|
|
-func init() {
|
|
|
|
- /*check.Suite(&DockerRegistryAuthTokenSuite{ds: &DockerSuite{}})*/
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
type DockerRegistryAuthTokenSuite struct {
|
|
type DockerRegistryAuthTokenSuite struct {
|
|
ds *DockerSuite
|
|
ds *DockerSuite
|
|
reg *registry.V2
|
|
reg *registry.V2
|
|
@@ -241,10 +241,6 @@ func (s *DockerRegistryAuthTokenSuite) setupRegistryWithTokenService(c *testing.
|
|
s.reg.WaitReady(c)
|
|
s.reg.WaitReady(c)
|
|
}
|
|
}
|
|
|
|
|
|
-func init() {
|
|
|
|
- /*check.Suite(&DockerDaemonSuite{ds: &DockerSuite{}})*/
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
type DockerDaemonSuite struct {
|
|
type DockerDaemonSuite struct {
|
|
ds *DockerSuite
|
|
ds *DockerSuite
|
|
d *daemon.Daemon
|
|
d *daemon.Daemon
|
|
@@ -284,10 +280,6 @@ func (s *DockerDaemonSuite) TearDownSuite(c *testing.T) {
|
|
|
|
|
|
const defaultSwarmPort = 2477
|
|
const defaultSwarmPort = 2477
|
|
|
|
|
|
-func init() {
|
|
|
|
- /*check.Suite(&DockerSwarmSuite{ds: &DockerSuite{}})*/
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
type DockerSwarmSuite struct {
|
|
type DockerSwarmSuite struct {
|
|
server *httptest.Server
|
|
server *httptest.Server
|
|
ds *DockerSuite
|
|
ds *DockerSuite
|
|
@@ -346,10 +338,6 @@ func (s *DockerSwarmSuite) TearDownTest(c *testing.T) {
|
|
s.ds.TearDownTest(c)
|
|
s.ds.TearDownTest(c)
|
|
}
|
|
}
|
|
|
|
|
|
-func init() {
|
|
|
|
- /*check.Suite(&DockerPluginSuite{ds: &DockerSuite{}})*/
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
type DockerPluginSuite struct {
|
|
type DockerPluginSuite struct {
|
|
ds *DockerSuite
|
|
ds *DockerSuite
|
|
registry *registry.V2
|
|
registry *registry.V2
|