summaryrefslogtreecommitdiff
path: root/integration-cli/docker_cli_cp_test.go
diff options
context:
space:
mode:
authorLei Jitang <leijitang@huawei.com>2015-07-08 11:15:09 +0800
committerLei Jitang <leijitang@huawei.com>2015-07-08 11:15:09 +0800
commit289ee90b04a2315cd36d6ff363b41c89f8ebf2aa (patch)
tree0c924c7b5b4a6f2efa60228c99ef17eacc1c3612 /integration-cli/docker_cli_cp_test.go
parent2fe51ecee75801b6a937801ccd2839335a3f8c88 (diff)
downloaddocker-289ee90b04a2315cd36d6ff363b41c89f8ebf2aa.tar.gz
Fix copy from a "created" container. Fixes #14420
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Diffstat (limited to 'integration-cli/docker_cli_cp_test.go')
-rw-r--r--integration-cli/docker_cli_cp_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/integration-cli/docker_cli_cp_test.go b/integration-cli/docker_cli_cp_test.go
index fd63bdbf2b..7bd3356b65 100644
--- a/integration-cli/docker_cli_cp_test.go
+++ b/integration-cli/docker_cli_cp_test.go
@@ -632,3 +632,20 @@ func (s *DockerSuite) TestCopyAndRestart(c *check.C) {
c.Fatalf("expected %q but got %q", expectedMsg, msg)
}
}
+
+func (s *DockerSuite) TestCopyCreatedContainer(c *check.C) {
+ out, err := exec.Command(dockerBinary, "create", "--name", "test_cp", "-v", "/test", "busybox").CombinedOutput()
+ if err != nil {
+ c.Fatalf(string(out), err)
+ }
+
+ tmpDir, err := ioutil.TempDir("", "test")
+ if err != nil {
+ c.Fatalf("unable to make temporary directory: %s", err)
+ }
+ defer os.RemoveAll(tmpDir)
+ out, err = exec.Command(dockerBinary, "cp", "test_cp:/bin/sh", tmpDir).CombinedOutput()
+ if err != nil {
+ c.Fatalf(string(out), err)
+ }
+}