summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2022-05-05 20:12:44 -0400
committerMatthew Heon <mheon@redhat.com>2022-06-14 16:12:10 -0400
commit51f9a3d67a611de9ea840bbdc2e879905e76d948 (patch)
treecf25fcfd05640f494b72d88824332d3c95258705 /test/e2e
parent919c8beae1ab17355e81b550f688b6efb58de33a (diff)
downloadpodman-51f9a3d67a611de9ea840bbdc2e879905e76d948.tar.gz
podman-51f9a3d67a611de9ea840bbdc2e879905e76d948.tar.bz2
podman-51f9a3d67a611de9ea840bbdc2e879905e76d948.zip
fix pod network handling with a host network
the function `GetDefaultNamespaceMode` for pods checks if we are sharing each namespace and if not, returns the default which in the case of a network is slirp. add a switch case for explicitly checking if the pod's network mode is host and if so, return specgen.Host for the container resolves #13763 Signed-off-by: cdoern <cbdoer23@g.holycross.edu> Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/pod_infra_container_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go
index ab204992c..ad2db2411 100644
--- a/test/e2e/pod_infra_container_test.go
+++ b/test/e2e/pod_infra_container_test.go
@@ -125,6 +125,19 @@ var _ = Describe("Podman pod create", func() {
session = podmanTest.Podman([]string{"run", fedoraMinimal, "curl", "-f", "localhost"})
session.WaitWithDefaultTimeout()
Expect(session).To(ExitWithError())
+
+ session = podmanTest.Podman([]string{"pod", "create", "--network", "host"})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"run", "-dt", "--pod", session.OutputToString(), ALPINE})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+
+ session = podmanTest.Podman([]string{"inspect", "--format", "'{{.NetworkSettings.SandboxKey}}'", session.OutputToString()})
+ session.WaitWithDefaultTimeout()
+ Expect(session).Should(Exit(0))
+ Expect(session.OutputToString()).Should(ContainSubstring("''")) // no network path... host
})
It("podman pod correctly sets up IPCNS", func() {