summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-02-11 16:02:53 +0100
committerGitHub <noreply@github.com>2019-02-11 16:02:53 +0100
commit8440b0734cac68ddd13c0c9c7bd5d07394da38fd (patch)
tree6c4441ec9b900c9a70f6242acf7bde33edf69ff4 /test
parentacf2e913730a27fcdc3fcd7c160aa19e071dde36 (diff)
parent4994fecd4604e17844d9e91fa710407701d6d85a (diff)
downloadpodman-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.go23
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))
+ })
})