summaryrefslogtreecommitdiff
path: root/test/e2e/run_volume_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/run_volume_test.go')
-rw-r--r--test/e2e/run_volume_test.go35
1 files changed, 30 insertions, 5 deletions
diff --git a/test/e2e/run_volume_test.go b/test/e2e/run_volume_test.go
index 454dfdc83..9b77aaef8 100644
--- a/test/e2e/run_volume_test.go
+++ b/test/e2e/run_volume_test.go
@@ -308,9 +308,9 @@ var _ = Describe("Podman run with volumes", func() {
It("podman named volume copyup symlink", func() {
imgName := "testimg"
- dockerfile := `FROM alpine
+ dockerfile := fmt.Sprintf(`FROM %s
RUN touch /testfile
-RUN sh -c "cd /etc/apk && ln -s ../../testfile"`
+RUN sh -c "cd /etc/apk && ln -s ../../testfile"`, ALPINE)
podmanTest.BuildImage(dockerfile, imgName, "false")
baselineSession := podmanTest.Podman([]string{"run", "--rm", "-t", "-i", imgName, "ls", "/etc/apk/"})
@@ -479,9 +479,8 @@ RUN sh -c "cd /etc/apk && ln -s ../../testfile"`
It("Podman mount over image volume with trailing /", func() {
image := "podman-volume-test:trailing"
- dockerfile := `
-FROM alpine:latest
-VOLUME /test/`
+ dockerfile := fmt.Sprintf(`FROM %s
+VOLUME /test/`, ALPINE)
podmanTest.BuildImage(dockerfile, image, "false")
ctrName := "testCtr"
@@ -643,4 +642,30 @@ VOLUME /test/`
found, _ = session.GrepString("888:888")
Expect(found).Should(BeTrue())
})
+
+ It("volume permissions after run", func() {
+ imgName := "testimg"
+ dockerfile := fmt.Sprintf(`FROM %s
+RUN useradd -m testuser -u 1005
+USER testuser`, fedoraMinimal)
+ 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())
+
+ })
})