summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-05 16:11:42 +0200
committerGitHub <noreply@github.com>2019-08-05 16:11:42 +0200
commitfff496436e89a290fd37b357419fd0f072ad5e88 (patch)
tree0ae2941e14666b2ca56a675af59eecefe5ab46ef /test
parent626dfdb6131a5f37c2f7cc93dbb98f33d495aca4 (diff)
parent0ad374af6a7552a68736e68fd4093809844a171f (diff)
downloadpodman-fff496436e89a290fd37b357419fd0f072ad5e88.tar.gz
podman-fff496436e89a290fd37b357419fd0f072ad5e88.tar.bz2
podman-fff496436e89a290fd37b357419fd0f072ad5e88.zip
Merge pull request #3171 from QiWang19/events_json
podman events format json
Diffstat (limited to 'test')
-rw-r--r--test/e2e/events_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go
index c5eedda3c..0636af74c 100644
--- a/test/e2e/events_test.go
+++ b/test/e2e/events_test.go
@@ -1,6 +1,7 @@
package integration
import (
+ "encoding/json"
"fmt"
"os"
"strings"
@@ -116,4 +117,25 @@ var _ = Describe("Podman events", func() {
Expect(result.ExitCode()).To(BeZero())
})
+ It("podman events format", func() {
+ info := GetHostDistributionInfo()
+ if info.Distribution != "fedora" {
+ Skip("need to verify images have correct packages for journald")
+ }
+ _, ec, _ := podmanTest.RunLsContainer("")
+ Expect(ec).To(Equal(0))
+ 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())
+ })
})