From 431e633b48fbfc486c332c8374d14fd6e0073840 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 28 May 2019 13:53:25 -0400 Subject: Add test to ensure symlinks are resolved in ctr scope Signed-off-by: Matthew Heon --- test/e2e/cp_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/e2e') diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go index f8df5d3d0..529e01c99 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{"create", ALPINE, "cat", "foo"}) + 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", srcPath, name + ":/test"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + _, err = os.Stat("/tmp/cp_test.txt") + Expect(err).To(Not(BeNil())) + }) }) -- cgit v1.2.3-54-g00ecf