diff options
author | cdoern <cdoern@redhat.com> | 2022-06-03 11:01:22 -0400 |
---|---|---|
committer | cdoern <cdoern@redhat.com> | 2022-06-09 10:30:48 -0400 |
commit | b13fc1bf983860d0627155ddbbbf28bf09e29a9e (patch) | |
tree | b527f316d0a1cca506a3a6cbc6e508705aa40ea6 /test | |
parent | 0dda4681927b3428a113c81d851d962da8dd7302 (diff) | |
download | podman-b13fc1bf983860d0627155ddbbbf28bf09e29a9e.tar.gz podman-b13fc1bf983860d0627155ddbbbf28bf09e29a9e.tar.bz2 podman-b13fc1bf983860d0627155ddbbbf28bf09e29a9e.zip |
patch for pod host networking & other host namespace handling
this patch included additonal host namespace checks when creating a ctr as well
as fixing of the tests to check /proc/self/ns/net
see #14461
Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/pod_infra_container_test.go | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/e2e/pod_infra_container_test.go b/test/e2e/pod_infra_container_test.go index ad2db2411..20794a29c 100644 --- a/test/e2e/pod_infra_container_test.go +++ b/test/e2e/pod_infra_container_test.go @@ -130,14 +130,24 @@ var _ = Describe("Podman pod create", func() { session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session = podmanTest.Podman([]string{"run", "-dt", "--pod", session.OutputToString(), ALPINE}) + session = podmanTest.Podman([]string{"run", "--name", "hostCtr", "--pod", session.OutputToString(), ALPINE, "readlink", "/proc/self/ns/net"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session = podmanTest.Podman([]string{"inspect", "--format", "'{{.NetworkSettings.SandboxKey}}'", session.OutputToString()}) + ns := SystemExec("readlink", []string{"/proc/self/ns/net"}) + ns.WaitWithDefaultTimeout() + Expect(ns).Should(Exit(0)) + netns := ns.OutputToString() + Expect(netns).ToNot(BeEmpty()) + + Expect(session.OutputToString()).To(Equal(netns)) + + // Sanity Check for podman inspect + session = podmanTest.Podman([]string{"inspect", "--format", "'{{.NetworkSettings.SandboxKey}}'", "hostCtr"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(session.OutputToString()).Should(ContainSubstring("''")) // no network path... host + Expect(session.OutputToString()).Should(Equal("''")) // no network path... host + }) It("podman pod correctly sets up IPCNS", func() { |