diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-02-18 14:53:53 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-04-01 17:27:03 +0200 |
commit | 00b2ec5e6f8ad332411271df1bdd968493cab2c2 (patch) | |
tree | 69485fd451bdb144ce8914af23a746639b21a745 /test/e2e | |
parent | 54b588c07d05858c9bbc523eeff0badb85d53f76 (diff) | |
download | podman-00b2ec5e6f8ad332411271df1bdd968493cab2c2.tar.gz podman-00b2ec5e6f8ad332411271df1bdd968493cab2c2.tar.bz2 podman-00b2ec5e6f8ad332411271df1bdd968493cab2c2.zip |
Add rootless support for cni and --uidmap
This is supported with the new rootless cni logic.
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/run_networking_test.go | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go index 0e6e636bc..43eb8fe4e 100644 --- a/test/e2e/run_networking_test.go +++ b/test/e2e/run_networking_test.go @@ -641,22 +641,26 @@ var _ = Describe("Podman run networking", func() { Expect(run.OutputToString()).To(ContainSubstring(ipAddr)) }) - It("podman rootless fails custom CNI network with --uidmap", func() { - SkipIfNotRootless("The configuration works with rootless") - + It("podman cni network works across user ns", func() { netName := stringid.GenerateNonCryptoID() create := podmanTest.Podman([]string{"network", "create", netName}) create.WaitWithDefaultTimeout() Expect(create.ExitCode()).To(BeZero()) defer podmanTest.removeCNINetwork(netName) - run := podmanTest.Podman([]string{"run", "--rm", "--net", netName, "--uidmap", "0:1:4096", ALPINE, "true"}) + name := "nc-server" + run := podmanTest.Podman([]string{"run", "-d", "--name", name, "--net", netName, ALPINE, "nc", "-l", "-p", "8080"}) + run.WaitWithDefaultTimeout() + Expect(run.ExitCode()).To(Equal(0)) + + run = podmanTest.Podman([]string{"run", "--rm", "--net", netName, "--uidmap", "0:1:4096", ALPINE, "sh", "-c", fmt.Sprintf("echo podman | nc -w 1 %s.dns.podman 8080", name)}) run.WaitWithDefaultTimeout() - Expect(run.ExitCode()).To(Equal(125)) + Expect(run.ExitCode()).To(Equal(0)) - remove := podmanTest.Podman([]string{"network", "rm", netName}) - remove.WaitWithDefaultTimeout() - Expect(remove.ExitCode()).To(BeZero()) + log := podmanTest.Podman([]string{"logs", name}) + log.WaitWithDefaultTimeout() + Expect(log.ExitCode()).To(Equal(0)) + Expect(log.OutputToString()).To(Equal("podman")) }) It("podman run with new:pod and static-ip", func() { |