Merge pull request #25583 from cpuguy83/fix_missing_daemon_sock_test
Ignore socket rm errors on daemon suite teardown
This commit is contained in:
commit
79b7062f0a
1 changed files with 5 additions and 6 deletions
|
@ -9,7 +9,6 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/docker/docker/cliconfig"
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/docker/docker/pkg/reexec"
|
||||
"github.com/docker/engine-api/types/swarm"
|
||||
"github.com/go-check/check"
|
||||
|
@ -189,18 +188,18 @@ func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
|
|||
}
|
||||
|
||||
func (s *DockerDaemonSuite) TearDownSuite(c *check.C) {
|
||||
err := filepath.Walk(daemonSockRoot, func(path string, fi os.FileInfo, err error) error {
|
||||
filepath.Walk(daemonSockRoot, func(path string, fi os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
// ignore errors here
|
||||
// not cleaning up sockets is not really an error
|
||||
return nil
|
||||
}
|
||||
if fi.Mode() == os.ModeSocket {
|
||||
syscall.Unlink(path)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
c.Assert(err, checker.IsNil, check.Commentf("error while cleaning up daemon sockets"))
|
||||
err = os.RemoveAll(daemonSockRoot)
|
||||
c.Assert(err, checker.IsNil, check.Commentf("could not cleanup daemon socket root"))
|
||||
os.RemoveAll(daemonSockRoot)
|
||||
}
|
||||
|
||||
const defaultSwarmPort = 2477
|
||||
|
|
Loading…
Reference in a new issue