Skip to content

Commit

Permalink
Merge pull request moby#19294 from runcom/fix-check-test
Browse files Browse the repository at this point in the history
integration-cli: check nil before Close'ing
  • Loading branch information
LK4D4 committed Jan 13, 2016
2 parents 22f4dad + 11a95b9 commit ba15b6f
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions integration-cli/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ func (s *DockerRegistrySuite) TearDownTest(c *check.C) {
if s.reg != nil {
s.reg.Close()
}
if s.ds != nil {
s.ds.TearDownTest(c)
if s.d != nil {
s.d.Stop()
}
s.d.Stop()
s.ds.TearDownTest(c)
}

func init() {
Expand All @@ -85,10 +85,10 @@ func (s *DockerSchema1RegistrySuite) TearDownTest(c *check.C) {
if s.reg != nil {
s.reg.Close()
}
if s.ds != nil {
s.ds.TearDownTest(c)
if s.d != nil {
s.d.Stop()
}
s.d.Stop()
s.ds.TearDownTest(c)
}

func init() {
Expand All @@ -109,7 +109,9 @@ func (s *DockerDaemonSuite) SetUpTest(c *check.C) {

func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
testRequires(c, DaemonIsLinux)
s.d.Stop()
if s.d != nil {
s.d.Stop()
}
s.ds.TearDownTest(c)
}

Expand All @@ -131,7 +133,11 @@ func (s *DockerTrustSuite) SetUpTest(c *check.C) {
}

func (s *DockerTrustSuite) TearDownTest(c *check.C) {
s.reg.Close()
s.not.Close()
if s.reg != nil {
s.reg.Close()
}
if s.not != nil {
s.not.Close()
}
s.ds.TearDownTest(c)
}

0 comments on commit ba15b6f

Please sign in to comment.