dc944ea7 |
package main
import ( |
b78e4216 |
"fmt" |
dc944ea7 |
"testing"
|
b78e4216 |
"github.com/docker/docker/pkg/reexec" |
dc944ea7 |
"github.com/go-check/check"
)
|
ecccfa82 |
func Test(t *testing.T) { |
b78e4216 |
reexec.Init() // This is required for external graphdriver tests
if !isLocalDaemon {
fmt.Println("INFO: Testing against a remote daemon")
} else {
fmt.Println("INFO: Testing against a local daemon")
}
|
ecccfa82 |
check.TestingT(t)
} |
dc944ea7 |
|
f696b107 |
func init() {
check.Suite(&DockerSuite{})
}
|
dc944ea7 |
type DockerSuite struct {
}
func (s *DockerSuite) TearDownTest(c *check.C) { |
e732f4e6 |
unpauseAllContainers() |
dc944ea7 |
deleteAllContainers() |
a9688cdc |
deleteAllImages() |
b3b7eb27 |
deleteAllVolumes() |
28ad7c58 |
deleteAllNetworks() |
dc944ea7 |
}
|
f696b107 |
func init() {
check.Suite(&DockerRegistrySuite{
ds: &DockerSuite{},
})
}
type DockerRegistrySuite struct {
ds *DockerSuite
reg *testRegistryV2 |
39f2f15a |
d *Daemon |
f696b107 |
}
func (s *DockerRegistrySuite) SetUpTest(c *check.C) { |
39f2f15a |
testRequires(c, DaemonIsLinux) |
1fa2e311 |
s.reg = setupRegistry(c, false) |
39f2f15a |
s.d = NewDaemon(c) |
f696b107 |
}
func (s *DockerRegistrySuite) TearDownTest(c *check.C) { |
3d6617ff |
if s.reg != nil {
s.reg.Close()
} |
11a95b95 |
if s.d != nil {
s.d.Stop() |
3d6617ff |
} |
11a95b95 |
s.ds.TearDownTest(c) |
f696b107 |
} |
57464c32 |
func init() { |
1fa2e311 |
check.Suite(&DockerSchema1RegistrySuite{
ds: &DockerSuite{},
})
}
type DockerSchema1RegistrySuite struct {
ds *DockerSuite
reg *testRegistryV2
d *Daemon
}
func (s *DockerSchema1RegistrySuite) SetUpTest(c *check.C) {
testRequires(c, DaemonIsLinux)
s.reg = setupRegistry(c, true)
s.d = NewDaemon(c)
}
func (s *DockerSchema1RegistrySuite) TearDownTest(c *check.C) {
if s.reg != nil {
s.reg.Close()
} |
11a95b95 |
if s.d != nil {
s.d.Stop() |
1fa2e311 |
} |
11a95b95 |
s.ds.TearDownTest(c) |
1fa2e311 |
}
func init() { |
57464c32 |
check.Suite(&DockerDaemonSuite{
ds: &DockerSuite{},
})
}
type DockerDaemonSuite struct {
ds *DockerSuite
d *Daemon
}
func (s *DockerDaemonSuite) SetUpTest(c *check.C) { |
f9a3558a |
testRequires(c, DaemonIsLinux) |
57464c32 |
s.d = NewDaemon(c)
}
func (s *DockerDaemonSuite) TearDownTest(c *check.C) { |
f9a3558a |
testRequires(c, DaemonIsLinux) |
11a95b95 |
if s.d != nil {
s.d.Stop()
} |
57464c32 |
s.ds.TearDownTest(c)
} |
58a1de9b |
func init() {
check.Suite(&DockerTrustSuite{
ds: &DockerSuite{},
})
}
type DockerTrustSuite struct {
ds *DockerSuite
reg *testRegistryV2
not *testNotary
}
func (s *DockerTrustSuite) SetUpTest(c *check.C) { |
1fa2e311 |
s.reg = setupRegistry(c, false) |
58a1de9b |
s.not = setupNotary(c)
}
func (s *DockerTrustSuite) TearDownTest(c *check.C) { |
11a95b95 |
if s.reg != nil {
s.reg.Close()
}
if s.not != nil {
s.not.Close()
} |
58a1de9b |
s.ds.TearDownTest(c)
} |