Switch from using lstat to stat in docker cp test. Use the first 12 characters of the ID for the stats test substring.

Signed-off-by: Corbin <corbin.coleman@docker.com>
This commit is contained in:
Corbin
2017-10-03 14:02:17 -07:00
parent 4f818dd6f7
commit e58d3abea8
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ func (s *DockerSuite) TestCpFromErrDstParentNotExists(c *check.C) {
// Try with a file source.
srcPath := containerCpPath(containerID, "/file1")
dstPath := cpPath(tmpDir, "notExists", "file1")
_, dstStatErr := os.Lstat(filepath.Dir(dstPath))
_, dstStatErr := os.Stat(filepath.Dir(dstPath))
c.Assert(os.IsNotExist(dstStatErr), checker.True)
err := runDockerCp(c, srcPath, dstPath, nil)

View File

@ -34,7 +34,7 @@ func (s *DockerSuite) TestStatsNoStream(c *check.C) {
select {
case outerr := <-ch:
c.Assert(outerr.err, checker.IsNil, check.Commentf("Error running stats: %v", outerr.err))
c.Assert(string(outerr.out), checker.Contains, id) //running container wasn't present in output
c.Assert(string(outerr.out), checker.Contains, id[:12]) //running container wasn't present in output
case <-time.After(3 * time.Second):
statsCmd.Process.Kill()
c.Fatalf("stats did not return immediately when not streaming")