From e58d3abea82d35cbbd83c9d60fe720593e8e7e3e Mon Sep 17 00:00:00 2001 From: Corbin Date: Tue, 3 Oct 2017 14:02:17 -0700 Subject: [PATCH] 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 --- .../engine/integration-cli/docker_cli_cp_from_container_test.go | 2 +- components/engine/integration-cli/docker_cli_stats_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/engine/integration-cli/docker_cli_cp_from_container_test.go b/components/engine/integration-cli/docker_cli_cp_from_container_test.go index 687aec8b5f..c274a9b942 100644 --- a/components/engine/integration-cli/docker_cli_cp_from_container_test.go +++ b/components/engine/integration-cli/docker_cli_cp_from_container_test.go @@ -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) diff --git a/components/engine/integration-cli/docker_cli_stats_test.go b/components/engine/integration-cli/docker_cli_stats_test.go index 9d40ce028e..b83a8d4186 100644 --- a/components/engine/integration-cli/docker_cli_stats_test.go +++ b/components/engine/integration-cli/docker_cli_stats_test.go @@ -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")