diff options
author | baude <bbaude@redhat.com> | 2021-01-25 13:58:04 -0600 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-01-29 15:23:24 -0500 |
commit | 2393dd304de3453fabfb7eac99ef6b2fb308bd29 (patch) | |
tree | b76826b786cde795aa0a52bcc0aad25969dd1edb /test/e2e/inspect_test.go | |
parent | b4aa54c7561f7093f795093a72c75248018f3517 (diff) | |
download | podman-2393dd304de3453fabfb7eac99ef6b2fb308bd29.tar.gz podman-2393dd304de3453fabfb7eac99ef6b2fb308bd29.tar.bz2 podman-2393dd304de3453fabfb7eac99ef6b2fb308bd29.zip |
Add default net info in container inspect
when inspecting a container that is only connected to the default
network, we should populate the default network in the container inspect
information.
Fixes: #6618
Signed-off-by: baude <bbaude@redhat.com>
MH: Small fixes, added another test
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/e2e/inspect_test.go')
-rw-r--r-- | test/e2e/inspect_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/inspect_test.go b/test/e2e/inspect_test.go index 97f77414e..8fc9721f9 100644 --- a/test/e2e/inspect_test.go +++ b/test/e2e/inspect_test.go @@ -443,4 +443,27 @@ var _ = Describe("Podman inspect", func() { Expect(inspect.OutputToString()).To(Equal(`"{"80/tcp":[{"HostIp":"","HostPort":"8080"}]}"`)) }) + It("Verify container inspect has default network", func() { + SkipIfRootless("Requires root CNI networking") + ctrName := "testctr" + session := podmanTest.Podman([]string{"run", "-d", "--name", ctrName, ALPINE, "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + + inspect := podmanTest.InspectContainer(ctrName) + Expect(len(inspect)).To(Equal(1)) + Expect(len(inspect[0].NetworkSettings.Networks)).To(Equal(1)) + }) + + It("Verify stopped container still has default network in inspect", func() { + SkipIfRootless("Requires root CNI networking") + ctrName := "testctr" + session := podmanTest.Podman([]string{"create", "--name", ctrName, ALPINE, "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(BeZero()) + + inspect := podmanTest.InspectContainer(ctrName) + Expect(len(inspect)).To(Equal(1)) + Expect(len(inspect[0].NetworkSettings.Networks)).To(Equal(1)) + }) }) |