summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-25 03:09:25 -0700
committerGitHub <noreply@github.com>2021-03-25 03:09:25 -0700
commit896ea085b1524750ce5ac4599dc3e2fd2972048c (patch)
tree7588deece106c66651e6b99676f2ef8249536a6b /test/e2e
parent95ef8a6f0398e8c62f9d1281638ec95823336c6a (diff)
parent452decf8a4e02c35413eb8dd691f2d4827972ec2 (diff)
downloadpodman-896ea085b1524750ce5ac4599dc3e2fd2972048c.tar.gz
podman-896ea085b1524750ce5ac4599dc3e2fd2972048c.tar.bz2
podman-896ea085b1524750ce5ac4599dc3e2fd2972048c.zip
Merge pull request #9768 from mheon/fix_9608
Ensure manually-created volumes have correct ownership
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_volume_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index 454dfdc83..85a4d6d52 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -643,4 +643,30 @@ VOLUME /test/`
found, _ = session.GrepString("888:888")
Expect(found).Should(BeTrue())
})
+
+ It("volume permissions after run", func() {
+ imgName := "testimg"
+ dockerfile := `FROM fedora-minimal
+RUN useradd -m testuser -u 1005
+USER testuser`
+ podmanTest.BuildImage(dockerfile, imgName, "false")
+
+ testString := "testuser testuser"
+
+ test1 := podmanTest.Podman([]string{"run", "-v", "testvol1:/test", imgName, "bash", "-c", "ls -al /test | grep -v root | grep -v total"})
+ test1.WaitWithDefaultTimeout()
+ Expect(test1.ExitCode()).To(Equal(0))
+ Expect(strings.Contains(test1.OutputToString(), testString)).To(BeTrue())
+
+ volName := "testvol2"
+ vol := podmanTest.Podman([]string{"volume", "create", volName})
+ vol.WaitWithDefaultTimeout()
+ Expect(vol.ExitCode()).To(Equal(0))
+
+ test2 := podmanTest.Podman([]string{"run", "-v", fmt.Sprintf("%s:/test", volName), imgName, "bash", "-c", "ls -al /test | grep -v root | grep -v total"})
+ test2.WaitWithDefaultTimeout()
+ Expect(test2.ExitCode()).To(Equal(0))
+ Expect(strings.Contains(test2.OutputToString(), testString)).To(BeTrue())
+
+ })
})