summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-07-24 11:20:31 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-07-25 23:04:55 +0200
commit1d72f651e4c5118c020a1ab7281d3de0bf31899e (patch)
tree349a0ac5be0a70963448420ede6bc84f8f51ece5 /test
parentba5741e3986bff0974989a3c662895aabb329f4c (diff)
downloadpodman-1d72f651e4c5118c020a1ab7281d3de0bf31899e.tar.gz
podman-1d72f651e4c5118c020a1ab7281d3de0bf31899e.tar.bz2
podman-1d72f651e4c5118c020a1ab7281d3de0bf31899e.zip
podman: support --userns=ns|container
allow to join the user namespace of another container. Closes: https://github.com/containers/libpod/issues/3629 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
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())
+ })
})