aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-05-28 13:53:25 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-05-29 22:53:51 -0400
commit431e633b48fbfc486c332c8374d14fd6e0073840 (patch)
tree4f9a7680e1036358a19c6ea2aa5d47360accde3e
parent32fc6b906cf6641ecdb64be04e15b0abf93ecde4 (diff)
downloadpodman-431e633b48fbfc486c332c8374d14fd6e0073840.tar.gz
podman-431e633b48fbfc486c332c8374d14fd6e0073840.tar.bz2
podman-431e633b48fbfc486c332c8374d14fd6e0073840.zip
Add test to ensure symlinks are resolved in ctr scope
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
-rw-r--r--test/e2e/cp_test.go23
1 files changed, 23 insertions, 0 deletions
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()))
+ })
})