|
@@ -442,6 +442,7 @@ func (s *DockerSuite) TestCpSpecialFiles(c *check.C) {
|
|
|
|
|
|
expected, err = readContainerFile(containerID, "hostname")
|
|
expected, err = readContainerFile(containerID, "hostname")
|
|
actual, err = ioutil.ReadFile(outDir + "/hostname")
|
|
actual, err = ioutil.ReadFile(outDir + "/hostname")
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
|
|
|
|
// Expected copied file to be duplicate of the container resolvconf
|
|
// Expected copied file to be duplicate of the container resolvconf
|
|
c.Assert(bytes.Equal(actual, expected), checker.True)
|
|
c.Assert(bytes.Equal(actual, expected), checker.True)
|
|
@@ -534,6 +535,7 @@ func (s *DockerSuite) TestCpToDot(c *check.C) {
|
|
c.Assert(os.Chdir(tmpdir), checker.IsNil)
|
|
c.Assert(os.Chdir(tmpdir), checker.IsNil)
|
|
dockerCmd(c, "cp", containerID+":/test", ".")
|
|
dockerCmd(c, "cp", containerID+":/test", ".")
|
|
content, err := ioutil.ReadFile("./test")
|
|
content, err := ioutil.ReadFile("./test")
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
c.Assert(string(content), checker.Equals, "lololol\n")
|
|
c.Assert(string(content), checker.Equals, "lololol\n")
|
|
}
|
|
}
|
|
|
|
|
|
@@ -572,6 +574,7 @@ func (s *DockerSuite) TestCpNameHasColon(c *check.C) {
|
|
defer os.RemoveAll(tmpdir)
|
|
defer os.RemoveAll(tmpdir)
|
|
dockerCmd(c, "cp", containerID+":/te:s:t", tmpdir)
|
|
dockerCmd(c, "cp", containerID+":/te:s:t", tmpdir)
|
|
content, err := ioutil.ReadFile(tmpdir + "/te:s:t")
|
|
content, err := ioutil.ReadFile(tmpdir + "/te:s:t")
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
c.Assert(string(content), checker.Equals, "lololol\n")
|
|
c.Assert(string(content), checker.Equals, "lololol\n")
|
|
}
|
|
}
|
|
|
|
|
|
@@ -653,6 +656,7 @@ func (s *DockerSuite) TestCpSymlinkFromConToHostFollowSymlink(c *check.C) {
|
|
dockerCmd(c, "cp", "-L", cleanedContainerID+":"+"/dir_link", expectedPath)
|
|
dockerCmd(c, "cp", "-L", cleanedContainerID+":"+"/dir_link", expectedPath)
|
|
|
|
|
|
actual, err = ioutil.ReadFile(expectedPath)
|
|
actual, err = ioutil.ReadFile(expectedPath)
|
|
|
|
+ c.Assert(err, checker.IsNil)
|
|
|
|
|
|
if !bytes.Equal(actual, expected) {
|
|
if !bytes.Equal(actual, expected) {
|
|
c.Fatalf("Expected copied file to be duplicate of the container symbol link target")
|
|
c.Fatalf("Expected copied file to be duplicate of the container symbol link target")
|