summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-01-27 09:31:15 +0100
committerGitHub <noreply@github.com>2021-01-27 09:31:15 +0100
commit2102e26506f392499b78297d25e24d591dee3bc8 (patch)
treecce7e76231cb2a109e81d043372392eade965a14 /test
parentc3b39842ce76e3e3bfc843abfebeeb603f04591d (diff)
parent02ec5299f619494d9e194492b6d3266daf0a5a6c (diff)
downloadpodman-2102e26506f392499b78297d25e24d591dee3bc8.tar.gz
podman-2102e26506f392499b78297d25e24d591dee3bc8.tar.bz2
podman-2102e26506f392499b78297d25e24d591dee3bc8.zip
Merge pull request #9109 from mheon/issue6618
Fix #6618
Diffstat (limited to 'test')
-rw-r--r--test/e2e/inspect_test.go23
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))
+ })
})