From 6aa8d14745dd778211fcf2941ce8fe5b5a95d5d9 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 18 Mar 2019 09:37:01 -0500 Subject: support GO template {{ json . }} for podman version, we now support a GO template for json output. fixes #2671 Signed-off-by: baude --- test/e2e/version_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/e2e/version_test.go') diff --git a/test/e2e/version_test.go b/test/e2e/version_test.go index b66291734..f546158a9 100644 --- a/test/e2e/version_test.go +++ b/test/e2e/version_test.go @@ -36,4 +36,24 @@ var _ = Describe("Podman version", func() { Expect(session.ExitCode()).To(Equal(0)) Expect(len(session.OutputToStringArray())).To(BeNumerically(">", 2)) }) + + It("podman version --format json", func() { + session := podmanTest.Podman([]string{"version", "--format", "json"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.IsJSONOutputValid()).To(BeTrue()) + }) + + It("podman version --format json", func() { + session := podmanTest.Podman([]string{"version", "--format", "{{ json .}}"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.IsJSONOutputValid()).To(BeTrue()) + }) + + It("podman version --format GO template", func() { + session := podmanTest.Podman([]string{"version", "--format", "{{ .Version }}"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + }) }) -- cgit v1.2.3-54-g00ecf