diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-11 04:22:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 04:22:30 -0400 |
commit | a90ae00df1c2be0f3d46d4e7cd292599c93ded0f (patch) | |
tree | 3d7f7c2915d3420c124cf27114d63291c391f064 /test/e2e | |
parent | 92b088b4a52a14126c8af2870b4b587abd49f7cb (diff) | |
parent | 6ebd257245a611246bb3ce9c6712c5eb19a9efb4 (diff) | |
download | podman-a90ae00df1c2be0f3d46d4e7cd292599c93ded0f.tar.gz podman-a90ae00df1c2be0f3d46d4e7cd292599c93ded0f.tar.bz2 podman-a90ae00df1c2be0f3d46d4e7cd292599c93ded0f.zip |
Merge pull request #7261 from zhangguanzhang/ps-format-add-field
Add the `Status` field in the ps --format=json
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/ps_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go index f10ef5c99..a734d399d 100644 --- a/test/e2e/ps_test.go +++ b/test/e2e/ps_test.go @@ -188,6 +188,21 @@ var _ = Describe("Podman ps", func() { Expect(result.IsJSONOutputValid()).To(BeTrue()) }) + It("podman ps print a human-readable `Status` with json format", func() { + _, ec, _ := podmanTest.RunLsContainer("test1") + Expect(ec).To(Equal(0)) + + result := podmanTest.Podman([]string{"ps", "-a", "--format", "json"}) + result.WaitWithDefaultTimeout() + Expect(result.ExitCode()).To(Equal(0)) + Expect(result.IsJSONOutputValid()).To(BeTrue()) + // must contain "Status" + match, StatusLine := result.GrepString(`Status`) + Expect(match).To(BeTrue()) + // container is running or exit, so it must contain `ago` + Expect(StatusLine[0]).To(ContainSubstring("ago")) + }) + It("podman ps namespace flag with go template format", func() { Skip(v2fail) _, ec, _ := podmanTest.RunLsContainer("test1") |