Merge pull request #26344 from tophj-ibm/change-test-daemon-id-generation
Integration-cli: change daemon id generation from time to rand Upstream-commit: 6ae6739af445ec59d9cb9f35f1729ab55a6d3f7a Component: engine
This commit is contained in:
@ -17,6 +17,7 @@ import (
|
||||
"github.com/docker/docker/opts"
|
||||
"github.com/docker/docker/pkg/integration/checker"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
"github.com/docker/docker/pkg/stringid"
|
||||
"github.com/docker/engine-api/types/events"
|
||||
"github.com/docker/go-connections/sockets"
|
||||
"github.com/docker/go-connections/tlsconfig"
|
||||
@ -61,7 +62,7 @@ func NewDaemon(c *check.C) *Daemon {
|
||||
err := os.MkdirAll(daemonSockRoot, 0700)
|
||||
c.Assert(err, checker.IsNil, check.Commentf("could not create daemon socket root"))
|
||||
|
||||
id := fmt.Sprintf("d%d", time.Now().UnixNano()%100000000)
|
||||
id := fmt.Sprintf("d%s", stringid.TruncateID(stringid.GenerateRandomID()))
|
||||
dir := filepath.Join(dest, id)
|
||||
daemonFolder, err := filepath.Abs(dir)
|
||||
c.Assert(err, check.IsNil, check.Commentf("Could not make %q an absolute path", dir))
|
||||
|
||||
Reference in New Issue
Block a user