mirror of https://github.com/containers/podman.git
Add test to ensure symlinks are resolved in ctr scope
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
parent
32fc6b906c
commit
431e633b48
|
@ -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()))
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue