aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-01-02 00:52:51 -0500
committerQi Wang <qiwan@redhat.com>2020-01-02 00:53:02 -0500
commitb6e1689ff23777b91fdfe72823a9a4e10360c6c0 (patch)
tree3fd42ddf9ac9f05a179743b3f3e3cde9dcb12968 /test
parent6a370cbbc7da9b7232bafed5e1afbe05ae88bcad (diff)
downloadpodman-b6e1689ff23777b91fdfe72823a9a4e10360c6c0.tar.gz
podman-b6e1689ff23777b91fdfe72823a9a4e10360c6c0.tar.bz2
podman-b6e1689ff23777b91fdfe72823a9a4e10360c6c0.zip
fix bug copy from container directory
Keep the original input source path with "/." so podman can copy the content of the directory when copying from container to host. Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'test')
-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() {