summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-06-30 12:01:40 -0400
committerGitHub <noreply@github.com>2020-06-30 12:01:40 -0400
commitc2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca (patch)
treedd7389bb37563a5636f34b3cf41f1cb2e37f2122 /test
parent83bde3bdaf7f7b24f9ad794154207a95e7747f28 (diff)
parentce74c20ebc07ea541b7cdccd272e34c0336ffbc3 (diff)
downloadpodman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.tar.gz
podman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.tar.bz2
podman-c2a0ccd39464a91b7ba5fdca3af3c2ed66f2cbca.zip
Merge pull request #6747 from giuseppe/fix-user-volumes
container: move volume chown after spec generation
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_userns_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go
index be0981408..3e55f56c0 100644
--- a/test/e2e/run_userns_test.go
+++ b/test/e2e/run_userns_test.go
@@ -245,4 +245,31 @@ var _ = Describe("Podman UserNS support", func() {
ok, _ := session.GrepString("4998")
Expect(ok).To(BeTrue())
})
+
+ It("podman --user with volume", func() {
+ tests := []struct {
+ uid, gid, arg, vol string
+ }{
+ {"0", "0", "0:0", "vol-0"},
+ {"1000", "0", "1000", "vol-1"},
+ {"1000", "1000", "1000:1000", "vol-2"},
+ }
+
+ for _, tt := range tests {
+ session := podmanTest.Podman([]string{"run", "-d", "--user", tt.arg, "--mount", "type=volume,src=" + tt.vol + ",dst=/home/user", "alpine", "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ inspectUID := podmanTest.Podman([]string{"volume", "inspect", "--format", "{{ .UID }}", tt.vol})
+ inspectUID.WaitWithDefaultTimeout()
+ Expect(inspectUID.ExitCode()).To(Equal(0))
+ Expect(inspectUID.OutputToString()).To(Equal(tt.uid))
+
+ // Make sure we're defaulting to 0.
+ inspectGID := podmanTest.Podman([]string{"volume", "inspect", "--format", "{{ .GID }}", tt.vol})
+ inspectGID.WaitWithDefaultTimeout()
+ Expect(inspectGID.ExitCode()).To(Equal(0))
+ Expect(inspectGID.OutputToString()).To(Equal(tt.gid))
+ }
+ })
})