aboutsummaryrefslogtreecommitdiff
path: root/test/e2e/events_test.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-05-14 14:12:24 -0400
committerQi Wang <qiwan@redhat.com>2020-05-14 14:28:51 -0400
commit28ffe74e4441d96cb36abb58344824bfc4701c47 (patch)
tree72dfda68acbe15c07c91a856f83b327c45cc72da /test/e2e/events_test.go
parent7e9ed37c0997d6dd2d6fc6ed6476039ee954286c (diff)
downloadpodman-28ffe74e4441d96cb36abb58344824bfc4701c47.tar.gz
podman-28ffe74e4441d96cb36abb58344824bfc4701c47.tar.bz2
podman-28ffe74e4441d96cb36abb58344824bfc4701c47.zip
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 <qiwan@redhat.com>
Diffstat (limited to 'test/e2e/events_test.go')
-rw-r--r--test/e2e/events_test.go14
1 files changed, 14 insertions, 0 deletions
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())
})
})