diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-05-30 21:17:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-30 21:17:28 +0200 |
commit | 2dcfd3df0b58463b050385c0ccd7929c540bce21 (patch) | |
tree | 0cfaee673b6b21c6e3f0645e38d0e205a8067308 /test/e2e | |
parent | 7358a4c590526cd656affd20db051dd6a852f3bb (diff) | |
parent | 5a07311d9e8f6c66d23b77a3b01abe1d3aa0676d (diff) | |
download | podman-2dcfd3df0b58463b050385c0ccd7929c540bce21.tar.gz podman-2dcfd3df0b58463b050385c0ccd7929c540bce21.tar.bz2 podman-2dcfd3df0b58463b050385c0ccd7929c540bce21.zip |
Merge pull request #3214 from mheon/resolve_symlinks_in_cp
Resolve symlinks in cp
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/cp_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go index f8df5d3d0..3c0288b19 100644 --- a/test/e2e/cp_test.go +++ b/test/e2e/cp_test.go @@ -158,4 +158,27 @@ var _ = Describe("Podman cp", func() { os.Remove("file.tar") os.RemoveAll(testDirPath) }) + + It("podman cp symlink", func() { + srcPath := filepath.Join(podmanTest.RunRoot, "cp_test.txt") + fromHostToContainer := []byte("copy from host to container") + err := ioutil.WriteFile(srcPath, fromHostToContainer, 0644) + Expect(err).To(BeNil()) + + session := podmanTest.Podman([]string{"run", "-d", ALPINE, "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + name := session.OutputToString() + + session = podmanTest.Podman([]string{"exec", name, "ln", "-s", "/tmp", "/test"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"cp", "--pause=false", srcPath, name + ":/test"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + _, err = os.Stat("/tmp/cp_test.txt") + Expect(err).To(Not(BeNil())) + }) }) |