From 28ffe74e4441d96cb36abb58344824bfc4701c47 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Thu, 14 May 2020 14:12:24 -0400 Subject: fix bug --format {{json.}} of events Allow the `podman events --format` accept {{json.}} and complete small fix podman-events.1.md Signed-off-by: Qi Wang --- test/e2e/events_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/e2e/events_test.go') diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go index 0636af74c..289f23b54 100644 --- a/test/e2e/events_test.go +++ b/test/e2e/events_test.go @@ -137,5 +137,19 @@ var _ = Describe("Podman events", func() { _, exist := eventsMap["Status"] Expect(exist).To(BeTrue()) Expect(test.ExitCode()).To(BeZero()) + + test = podmanTest.Podman([]string{"events", "--stream=false", "--format", "{{json.}}"}) + test.WaitWithDefaultTimeout() + fmt.Println(test.OutputToStringArray()) + jsonArr = test.OutputToStringArray() + Expect(len(jsonArr)).To(Not(BeZero())) + eventsMap = make(map[string]string) + err = json.Unmarshal([]byte(jsonArr[0]), &eventsMap) + if err != nil { + os.Exit(1) + } + _, exist = eventsMap["Status"] + Expect(exist).To(BeTrue()) + Expect(test.ExitCode()).To(BeZero()) }) }) -- cgit v1.2.3-54-g00ecf