summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-05-28 16:44:58 +0200
committerGitHub <noreply@github.com>2019-05-28 16:44:58 +0200
commit7b6dac300d91a8634e3180fcc71213fb825974e3 (patch)
tree917c23b3509dcecbef953812efb7a2d7a332539d /test/e2e
parent335a1ef1606734e4735a810e839032297cc89060 (diff)
parentbb7b0aad0eb7874c97911d8a27532100f1a32232 (diff)
downloadpodman-7b6dac300d91a8634e3180fcc71213fb825974e3.tar.gz
podman-7b6dac300d91a8634e3180fcc71213fb825974e3.tar.bz2
podman-7b6dac300d91a8634e3180fcc71213fb825974e3.zip
Merge pull request #3194 from QiWang19/cptar
fix bug dest path of copying tar
Diffstat (limited to 'test/e2e')
-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 71fc064a5..f8df5d3d0 100644
--- a/test/e2e/cp_test.go
+++ b/test/e2e/cp_test.go
@@ -131,4 +131,31 @@ var _ = Describe("Podman cp", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
+
+ It("podman cp tar", func() {
+ path, err := os.Getwd()
+ Expect(err).To(BeNil())
+ testDirPath := filepath.Join(path, "TestDir")
+ err = os.Mkdir(testDirPath, 0777)
+ Expect(err).To(BeNil())
+ cmd := exec.Command("tar", "-cvf", "file.tar", testDirPath)
+ _, err = cmd.Output()
+ Expect(err).To(BeNil())
+
+ session := podmanTest.Podman([]string{"create", "--name", "testctr", ALPINE, "ls", "-l", "foo"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"cp", "file.tar", "testctr:/foo/"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"start", "-a", "testctr"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("file.tar"))
+
+ os.Remove("file.tar")
+ os.RemoveAll(testDirPath)
+ })
})