github.com/chenchun/docker@v1.3.2-0.20150629222414-20467faf132b/integration-cli/check_test.go (about) 1 package main 2 3 import ( 4 "testing" 5 6 "github.com/go-check/check" 7 ) 8 9 func Test(t *testing.T) { 10 check.TestingT(t) 11 } 12 13 func init() { 14 check.Suite(&DockerSuite{}) 15 } 16 17 type DockerSuite struct { 18 } 19 20 func (s *DockerSuite) TearDownTest(c *check.C) { 21 deleteAllContainers() 22 deleteAllImages() 23 } 24 25 func init() { 26 check.Suite(&DockerRegistrySuite{ 27 ds: &DockerSuite{}, 28 }) 29 } 30 31 type DockerRegistrySuite struct { 32 ds *DockerSuite 33 reg *testRegistryV2 34 } 35 36 func (s *DockerRegistrySuite) SetUpTest(c *check.C) { 37 s.reg = setupRegistry(c) 38 } 39 40 func (s *DockerRegistrySuite) TearDownTest(c *check.C) { 41 s.reg.Close() 42 s.ds.TearDownTest(c) 43 } 44 45 func init() { 46 check.Suite(&DockerDaemonSuite{ 47 ds: &DockerSuite{}, 48 }) 49 } 50 51 type DockerDaemonSuite struct { 52 ds *DockerSuite 53 d *Daemon 54 } 55 56 func (s *DockerDaemonSuite) SetUpTest(c *check.C) { 57 s.d = NewDaemon(c) 58 } 59 60 func (s *DockerDaemonSuite) TearDownTest(c *check.C) { 61 s.d.Stop() 62 s.ds.TearDownTest(c) 63 }