1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #28668 from anusha-ragunathan/fix_teardown

Check for valid daemon in TearDownTest.
This commit is contained in:
Brian Goff 2016-11-22 13:26:08 -05:00 committed by GitHub
commit 39e2e07567
6 changed files with 30 additions and 18 deletions

View file

@ -302,14 +302,16 @@ func (s *DockerSwarmSuite) TearDownTest(c *check.C) {
testRequires(c, DaemonIsLinux)
s.daemonsLock.Lock()
for _, d := range s.daemons {
d.Stop()
// raft state file is quite big (64MB) so remove it after every test
walDir := filepath.Join(d.root, "swarm/raft/wal")
if err := os.RemoveAll(walDir); err != nil {
c.Logf("error removing %v: %v", walDir, err)
}
if d != nil {
d.Stop()
// raft state file is quite big (64MB) so remove it after every test
walDir := filepath.Join(d.root, "swarm/raft/wal")
if err := os.RemoveAll(walDir); err != nil {
c.Logf("error removing %v: %v", walDir, err)
}
cleanupExecRoot(c, d.execRoot)
cleanupExecRoot(c, d.execRoot)
}
}
s.daemons = nil
s.daemonsLock.Unlock()

View file

@ -36,8 +36,10 @@ func (s *DockerAuthzV2Suite) SetUpTest(c *check.C) {
}
func (s *DockerAuthzV2Suite) TearDownTest(c *check.C) {
s.d.Stop()
s.ds.TearDownTest(c)
if s.d != nil {
s.d.Stop()
s.ds.TearDownTest(c)
}
}
func (s *DockerAuthzV2Suite) TestAuthZPluginAllowNonVolumeRequest(c *check.C) {

View file

@ -68,9 +68,11 @@ func (s *DockerAuthzSuite) SetUpTest(c *check.C) {
}
func (s *DockerAuthzSuite) TearDownTest(c *check.C) {
s.d.Stop()
s.ds.TearDownTest(c)
s.ctrl = nil
if s.d != nil {
s.d.Stop()
s.ds.TearDownTest(c)
s.ctrl = nil
}
}
func (s *DockerAuthzSuite) SetUpSuite(c *check.C) {

View file

@ -55,8 +55,10 @@ func (s *DockerExternalGraphdriverSuite) SetUpTest(c *check.C) {
}
func (s *DockerExternalGraphdriverSuite) TearDownTest(c *check.C) {
s.d.Stop()
s.ds.TearDownTest(c)
if s.d != nil {
s.d.Stop()
s.ds.TearDownTest(c)
}
}
func (s *DockerExternalGraphdriverSuite) SetUpSuite(c *check.C) {

View file

@ -54,8 +54,10 @@ func (s *DockerExternalVolumeSuite) SetUpTest(c *check.C) {
}
func (s *DockerExternalVolumeSuite) TearDownTest(c *check.C) {
s.d.Stop()
s.ds.TearDownTest(c)
if s.d != nil {
s.d.Stop()
s.ds.TearDownTest(c)
}
}
func (s *DockerExternalVolumeSuite) SetUpSuite(c *check.C) {

View file

@ -51,8 +51,10 @@ func (s *DockerNetworkSuite) SetUpTest(c *check.C) {
}
func (s *DockerNetworkSuite) TearDownTest(c *check.C) {
s.d.Stop()
s.ds.TearDownTest(c)
if s.d != nil {
s.d.Stop()
s.ds.TearDownTest(c)
}
}
func (s *DockerNetworkSuite) SetUpSuite(c *check.C) {