diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-15 04:50:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-15 04:50:40 -0400 |
commit | 6224f3f5d5f651a5bbfdc15407288d08d7af33ea (patch) | |
tree | 56476ca94445886e46f55f574fb5ad4e752ab95b /test | |
parent | c4843d4e9ce395f1bbcaae848e6172f5a4519a35 (diff) | |
parent | fbc1167c4d7861013001d0c2460c6e1c1e1ad66d (diff) | |
download | podman-6224f3f5d5f651a5bbfdc15407288d08d7af33ea.tar.gz podman-6224f3f5d5f651a5bbfdc15407288d08d7af33ea.tar.bz2 podman-6224f3f5d5f651a5bbfdc15407288d08d7af33ea.zip |
Merge pull request #6956 from mheon/add_ports_to_pod_inspect
Include infra container information in `pod inspect`
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/pod_inspect_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/pod_inspect_test.go b/test/e2e/pod_inspect_test.go index 5e3634435..16bf1c4c9 100644 --- a/test/e2e/pod_inspect_test.go +++ b/test/e2e/pod_inspect_test.go @@ -1,8 +1,11 @@ package integration import ( + "encoding/json" "os" + "github.com/containers/libpod/v2/libpod/define" + . "github.com/containers/libpod/v2/test/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -79,4 +82,22 @@ var _ = Describe("Podman pod inspect", func() { index := len(inspectCreateCommand) - len(createCommand) Expect(inspectCreateCommand[index:]).To(Equal(createCommand)) }) + + It("podman pod inspect outputs port bindings", func() { + podName := "testPod" + create := podmanTest.Podman([]string{"pod", "create", "--name", podName, "-p", "8080:80"}) + create.WaitWithDefaultTimeout() + Expect(create.ExitCode()).To(Equal(0)) + + inspectOut := podmanTest.Podman([]string{"pod", "inspect", podName}) + inspectOut.WaitWithDefaultTimeout() + Expect(inspectOut.ExitCode()).To(Equal(0)) + + inspectJSON := new(define.InspectPodData) + err := json.Unmarshal(inspectOut.Out.Contents(), inspectJSON) + Expect(err).To(BeNil()) + Expect(inspectJSON.InfraConfig).To(Not(BeNil())) + Expect(len(inspectJSON.InfraConfig.PortBindings["80/tcp"])).To(Equal(1)) + Expect(inspectJSON.InfraConfig.PortBindings["80/tcp"][0].HostPort).To(Equal("8080")) + }) }) |