summaryrefslogtreecommitdiff
path: root/integration-cli/docker_cli_cp_test.go
diff options
context:
space:
mode:
authorJosh Hawn <josh.hawn@docker.com>2015-05-14 13:44:29 -0700
committerJosh Hawn <josh.hawn@docker.com>2015-07-21 15:19:52 -0700
commit418135e7eac6e664834b8a9d09d8051ec296a48f (patch)
tree287fa48f61b1dedb84c4e7928cf5c76959a514fa /integration-cli/docker_cli_cp_test.go
parent93c3e6c91ec5eb4202b86b44b011d06f5e048dab (diff)
downloaddocker-418135e7eac6e664834b8a9d09d8051ec296a48f.tar.gz
integration-cli: New `docker cp` integration tests
Adds several integration tests for `docker cp` behavior with over a dozen tests for each of: container -> local local -> container Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Diffstat (limited to 'integration-cli/docker_cli_cp_test.go')
-rw-r--r--integration-cli/docker_cli_cp_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/integration-cli/docker_cli_cp_test.go b/integration-cli/docker_cli_cp_test.go
index 45340cf6c1..03c0a4a63e 100644
--- a/integration-cli/docker_cli_cp_test.go
+++ b/integration-cli/docker_cli_cp_test.go
@@ -23,6 +23,18 @@ const (
cpHostContents = "hello, i am the host"
)
+// Ensure that an all-local path case returns an error.
+func (s *DockerSuite) TestCpLocalOnly(c *check.C) {
+ err := runDockerCp(c, "foo", "bar")
+ if err == nil {
+ c.Fatal("expected failure, got success")
+ }
+
+ if !strings.Contains(err.Error(), "must specify at least one container source") {
+ c.Fatalf("unexpected output: %s", err.Error())
+ }
+}
+
// Test for #5656
// Check that garbage paths don't escape the container's rootfs
func (s *DockerSuite) TestCpGarbagePath(c *check.C) {