summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-04-08 07:48:54 -0700
committerGitHub <noreply@github.com>2019-04-08 07:48:54 -0700
commit7f8e9bd54c7a1c46ea19b58296f6629d55988e0d (patch)
tree72242231e3fda573a840d726b936d36710a0fa10 /test/e2e
parent995c5d854f5fbceae61cfe3fa81ee47924539055 (diff)
parent84620021b09778d64d7516e693301d0a08f082c9 (diff)
downloadpodman-7f8e9bd54c7a1c46ea19b58296f6629d55988e0d.tar.gz
podman-7f8e9bd54c7a1c46ea19b58296f6629d55988e0d.tar.bz2
podman-7f8e9bd54c7a1c46ea19b58296f6629d55988e0d.zip
Merge pull request #2845 from QiWang19/cpdir
fix bug podman cp directory
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/cp_test.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go
index f89865264..591f533d6 100644
--- a/test/e2e/cp_test.go
+++ b/test/e2e/cp_test.go
@@ -112,4 +112,37 @@ var _ = Describe("Podman cp", func() {
}
Expect(string(output)).To(Equal("copy from host to container directory"))
})
+
+ It("podman cp dir to dir", func() {
+ path, err := os.Getwd()
+ if err != nil {
+ os.Exit(1)
+ }
+ testDirPath := filepath.Join(path, "TestDir")
+ err = os.Mkdir(testDirPath, 0777)
+ if err != nil {
+ os.Exit(1)
+ }
+
+ session := podmanTest.Podman([]string{"create", ALPINE, "ls", "/foodir"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ name := session.OutputToString()
+
+ session = podmanTest.Podman([]string{"cp", testDirPath, name + ":/foodir"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"start", "-a", name})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(len(session.OutputToStringArray())).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"cp", testDirPath, name + ":/foodir"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session = podmanTest.Podman([]string{"start", "-a", name})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal("TestDir"))
+ })
})