summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-05-23 22:28:59 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-05-24 17:34:12 +0200
commitf09370c68b8b514aca80bfaa34f98fbc5b97d318 (patch)
tree703f156c0ead88361527575f6fd2ccfb2a13893e /test
parent6df320c3910da5600a611f8aed783a499430a75c (diff)
downloadpodman-f09370c68b8b514aca80bfaa34f98fbc5b97d318.tar.gz
podman-f09370c68b8b514aca80bfaa34f98fbc5b97d318.tar.bz2
podman-f09370c68b8b514aca80bfaa34f98fbc5b97d318.zip
userns: add new option --userns=keep-id
it creates a namespace where the current UID:GID on the host is mapped to the same UID:GID in the container. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_userns_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go
index f7f0e1c9a..ce6971cd1 100644
--- a/test/e2e/run_userns_test.go
+++ b/test/e2e/run_userns_test.go
@@ -3,6 +3,7 @@
package integration
import (
+ "fmt"
"os"
. "github.com/containers/libpod/test/utils"
@@ -76,4 +77,12 @@ var _ = Describe("Podman UserNS support", func() {
Expect(ok).To(BeTrue())
})
+ It("podman --userns=keep-id", func() {
+ session := podmanTest.Podman([]string{"run", "--userns=keep-id", "alpine", "id", "-u"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ uid := fmt.Sprintf("%d", os.Geteuid())
+ ok, _ := session.GrepString(uid)
+ Expect(ok).To(BeTrue())
+ })
})