summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-26 15:06:06 +0200
committerGitHub <noreply@github.com>2019-07-26 15:06:06 +0200
commit0c4dfcfe57559d55786818b027ad12ad94574e71 (patch)
treef80b22ab5ccad6e896e4f96021891c81ec12b853 /test
parentb212daa92f3a596efa87b6ccaa097f70cd34bb10 (diff)
parent1d72f651e4c5118c020a1ab7281d3de0bf31899e (diff)
downloadpodman-0c4dfcfe57559d55786818b027ad12ad94574e71.tar.gz
podman-0c4dfcfe57559d55786818b027ad12ad94574e71.tar.bz2
podman-0c4dfcfe57559d55786818b027ad12ad94574e71.zip
Merge pull request #3639 from giuseppe/user-ns-container
podman: support --userns=ns|container
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_userns_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go
index be3f7df49..e873f5abe 100644
--- a/test/e2e/run_userns_test.go
+++ b/test/e2e/run_userns_test.go
@@ -85,4 +85,19 @@ var _ = Describe("Podman UserNS support", func() {
ok, _ := session.GrepString(uid)
Expect(ok).To(BeTrue())
})
+
+ It("podman --userns=container:CTR", func() {
+ ctrName := "userns-ctr"
+ session := podmanTest.Podman([]string{"run", "-d", "--uidmap=0:0:1", "--uidmap=1:1:4998", "--name", ctrName, "alpine", "top"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ // runc has an issue and we also need to join the IPC namespace.
+ session = podmanTest.Podman([]string{"run", "--rm", "--userns=container:" + ctrName, "--ipc=container:" + ctrName, "alpine", "cat", "/proc/self/uid_map"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ ok, _ := session.GrepString("4998")
+ Expect(ok).To(BeTrue())
+ })
})