2015-04-18 16:46:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/go-check/check"
|
|
|
|
)
|
|
|
|
|
2015-04-22 18:20:32 +00:00
|
|
|
func Test(t *testing.T) {
|
|
|
|
check.TestingT(t)
|
|
|
|
}
|
2015-04-18 16:46:47 +00:00
|
|
|
|
2015-04-24 21:16:56 +00:00
|
|
|
func init() {
|
|
|
|
check.Suite(&DockerSuite{})
|
|
|
|
}
|
|
|
|
|
2015-04-18 16:46:47 +00:00
|
|
|
type DockerSuite struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerSuite) TearDownTest(c *check.C) {
|
|
|
|
deleteAllContainers()
|
2015-04-23 21:39:31 +00:00
|
|
|
deleteAllImages()
|
2015-04-18 16:46:47 +00:00
|
|
|
}
|
|
|
|
|
2015-04-24 21:16:56 +00:00
|
|
|
func init() {
|
|
|
|
check.Suite(&DockerRegistrySuite{
|
|
|
|
ds: &DockerSuite{},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type DockerRegistrySuite struct {
|
|
|
|
ds *DockerSuite
|
|
|
|
reg *testRegistryV2
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerRegistrySuite) SetUpTest(c *check.C) {
|
|
|
|
s.reg = setupRegistry(c)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerRegistrySuite) TearDownTest(c *check.C) {
|
|
|
|
s.reg.Close()
|
|
|
|
s.ds.TearDownTest(c)
|
|
|
|
}
|
2015-04-26 02:47:42 +00:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
check.Suite(&DockerDaemonSuite{
|
|
|
|
ds: &DockerSuite{},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type DockerDaemonSuite struct {
|
|
|
|
ds *DockerSuite
|
|
|
|
d *Daemon
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerDaemonSuite) SetUpTest(c *check.C) {
|
|
|
|
s.d = NewDaemon(c)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
|
|
|
|
s.d.Stop()
|
|
|
|
s.ds.TearDownTest(c)
|
|
|
|
}
|
2015-07-20 05:56:10 +00:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
check.Suite(&DockerTrustSuite{
|
|
|
|
ds: &DockerSuite{},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type DockerTrustSuite struct {
|
|
|
|
ds *DockerSuite
|
|
|
|
reg *testRegistryV2
|
|
|
|
not *testNotary
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerTrustSuite) SetUpTest(c *check.C) {
|
|
|
|
s.reg = setupRegistry(c)
|
|
|
|
s.not = setupNotary(c)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *DockerTrustSuite) TearDownTest(c *check.C) {
|
|
|
|
s.reg.Close()
|
|
|
|
s.not.Close()
|
|
|
|
s.ds.TearDownTest(c)
|
|
|
|
}
|