diff options
author | baude <bbaude@redhat.com> | 2019-02-10 08:58:46 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-02-10 11:27:09 -0600 |
commit | 4994fecd4604e17844d9e91fa710407701d6d85a (patch) | |
tree | 20bcb3c8e15f07a1c2a7d889d7c4813cd1d25086 /test/e2e | |
parent | c86e8f180c8b0cdbd1bafe327c4671370096c45f (diff) | |
download | podman-4994fecd4604e17844d9e91fa710407701d6d85a.tar.gz podman-4994fecd4604e17844d9e91fa710407701d6d85a.tar.bz2 podman-4994fecd4604e17844d9e91fa710407701d6d85a.zip |
Podman pod stats -- fix GO template output
Go templates were not being processed or printed correctly for podman
pod stats. Added the ability to do templates as well as honor the
table identifier.
Fixes #2258
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/pod_stats_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/e2e/pod_stats_test.go b/test/e2e/pod_stats_test.go index 43d089a24..e330c3a39 100644 --- a/test/e2e/pod_stats_test.go +++ b/test/e2e/pod_stats_test.go @@ -147,5 +147,28 @@ var _ = Describe("Podman pod stats", func() { Expect(stats.ExitCode()).To(Equal(0)) Expect(stats.IsJSONOutputValid()).To(BeTrue()) }) + It("podman stats with GO template", func() { + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) + + session := podmanTest.RunTopContainerInPod("", podid) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + stats := podmanTest.Podman([]string{"pod", "stats", "-a", "--no-reset", "--no-stream", "--format", "\"table {{.CID}} {{.Pod}} {{.Mem}} {{.MemUsage}} {{.CPU}} {{.NetIO}} {{.BlockIO}} {{.PIDS}} {{.Pod}}\""}) + stats.WaitWithDefaultTimeout() + Expect(stats.ExitCode()).To(Equal(0)) + }) + + It("podman stats with invalid GO template", func() { + _, ec, podid := podmanTest.CreatePod("") + Expect(ec).To(Equal(0)) + + session := podmanTest.RunTopContainerInPod("", podid) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + stats := podmanTest.Podman([]string{"pod", "stats", "-a", "--no-reset", "--no-stream", "--format", "\"table {{.ID}} \""}) + stats.WaitWithDefaultTimeout() + Expect(stats.ExitCode()).ToNot(Equal(0)) + }) }) |