summaryrefslogtreecommitdiff
path: root/test/e2e/cp_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-07 16:10:05 +0100
committerGitHub <noreply@github.com>2020-01-07 16:10:05 +0100
commitf85b3a01f050e4f8af8471f396013f18647d9241 (patch)
treec84efb35627130073164c770a13d0708b813bde9 /test/e2e/cp_test.go
parente3622209716ad1494531cd3cd38114081ec90f87 (diff)
parentb6e1689ff23777b91fdfe72823a9a4e10360c6c0 (diff)
downloadpodman-f85b3a01f050e4f8af8471f396013f18647d9241.tar.gz
podman-f85b3a01f050e4f8af8471f396013f18647d9241.tar.bz2
podman-f85b3a01f050e4f8af8471f396013f18647d9241.zip
Merge pull request #4774 from QiWang19/cp_src_path
fix bug copy from container directory
Diffstat (limited to 'test/e2e/cp_test.go')
-rw-r--r--test/e2e/cp_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go
index 8d4c3dee7..b71897cfd 100644
--- a/test/e2e/cp_test.go
+++ b/test/e2e/cp_test.go
@@ -112,6 +112,33 @@ var _ = Describe("Podman cp", func() {
session = podmanTest.Podman([]string{"cp", testDirPath, name + ":/foodir"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
+
+ testctr := "testctr"
+ setup := podmanTest.RunTopContainer(testctr)
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"exec", testctr, "mkdir", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"cp", testDirPath + "/.", testctr + ":/foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"exec", testctr, "ls", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToString())).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"cp", testctr + ":/foo/.", testDirPath})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ cmd := exec.Command("ls", testDirPath)
+ res, err := cmd.Output()
+ Expect(err).To(BeNil())
+ Expect(len(res)).To(Equal(0))
+
+ os.RemoveAll(testDirPath)
})
It("podman cp stdin/stdout", func() {