summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2019-09-04 15:05:08 -0700
committerPeter Hunt <pehunt@redhat.com>2019-10-02 12:58:55 -0400
commit22b8ff24b6ae8994a04e6f3c23aaa93f3c41d954 (patch)
treed4c488c0548be564b75a8419ef29f741a973b345 /test
parentfc10d7d55f97daa500ff3148673dac7409b07d96 (diff)
downloadpodman-22b8ff24b6ae8994a04e6f3c23aaa93f3c41d954.tar.gz
podman-22b8ff24b6ae8994a04e6f3c23aaa93f3c41d954.tar.bz2
podman-22b8ff24b6ae8994a04e6f3c23aaa93f3c41d954.zip
Do not support wildcards on cp
* symlink processing and wildcarding led to unexpected files being copied Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/cp_test.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/e2e/cp_test.go b/test/e2e/cp_test.go
index f7596d77d..a5324004a 100644
--- a/test/e2e/cp_test.go
+++ b/test/e2e/cp_test.go
@@ -205,4 +205,40 @@ var _ = Describe("Podman cp", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})
+
+ It("podman cp from ctr chown ", func() {
+ setup := podmanTest.RunTopContainer("testctr")
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"exec", "testctr", "adduser", "-S", "testuser"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"exec", "-u", "testuser", "testctr", "touch", "testfile"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"cp", "--pause=false", "testctr:testfile", "testfile1"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // owner of the file copied to local machine is not testuser
+ cmd := exec.Command("ls", "-l", "testfile1")
+ cmdRet, err := cmd.Output()
+ Expect(err).To(BeNil())
+ Expect(strings.Contains(string(cmdRet), "testuser")).To(BeFalse())
+
+ session = podmanTest.Podman([]string{"cp", "--pause=false", "testfile1", "testctr:testfile2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // owner of the file copied to a container is the root user
+ session = podmanTest.Podman([]string{"exec", "-it", "testctr", "ls", "-l", "testfile2"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("root"))
+
+ os.Remove("testfile1")
+ })
})