github.com/csfrancis/docker@v1.8.0-rc2/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  }
    64  
    65  func init() {
    66  	check.Suite(&DockerTrustSuite{
    67  		ds: &DockerSuite{},
    68  	})
    69  }
    70  
    71  type DockerTrustSuite struct {
    72  	ds  *DockerSuite
    73  	reg *testRegistryV2
    74  	not *testNotary
    75  }
    76  
    77  func (s *DockerTrustSuite) SetUpTest(c *check.C) {
    78  	s.reg = setupRegistry(c)
    79  	s.not = setupNotary(c)
    80  }
    81  
    82  func (s *DockerTrustSuite) TearDownTest(c *check.C) {
    83  	s.reg.Close()
    84  	s.not.Close()
    85  	s.ds.TearDownTest(c)
    86  }