diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-11 16:02:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-11 16:02:53 +0100 |
commit | 8440b0734cac68ddd13c0c9c7bd5d07394da38fd (patch) | |
tree | 6c4441ec9b900c9a70f6242acf7bde33edf69ff4 /test | |
parent | acf2e913730a27fcdc3fcd7c160aa19e071dde36 (diff) | |
parent | 4994fecd4604e17844d9e91fa710407701d6d85a (diff) | |
download | podman-8440b0734cac68ddd13c0c9c7bd5d07394da38fd.tar.gz podman-8440b0734cac68ddd13c0c9c7bd5d07394da38fd.tar.bz2 podman-8440b0734cac68ddd13c0c9c7bd5d07394da38fd.zip |
Merge pull request #2306 from baude/podstatsgotemplate
Podman pod stats -- fix GO template output
Diffstat (limited to 'test')
-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)) + }) }) |