summaryrefslogtreecommitdiff
path: root/test/e2e/events_test.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-10-09 09:13:22 -0700
committerJhon Honce <jhonce@redhat.com>2020-10-13 17:28:45 -0700
commiteb4a746efcb9e76e29942461b97da797fd67109f (patch)
tree980663ba01f79bd107980fd0c3205fe833503a41 /test/e2e/events_test.go
parent7ad631b819d991559ba20e4728a6803a2546158f (diff)
downloadpodman-eb4a746efcb9e76e29942461b97da797fd67109f.tar.gz
podman-eb4a746efcb9e76e29942461b97da797fd67109f.tar.bz2
podman-eb4a746efcb9e76e29942461b97da797fd67109f.zip
Restore --format table support
* system df * events * fix error handling from go routine * update tests to use gomega matchers for better error messages * system info * version * volume inspect Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test/e2e/events_test.go')
-rw-r--r--test/e2e/events_test.go26
1 files changed, 16 insertions, 10 deletions
diff --git a/test/e2e/events_test.go b/test/e2e/events_test.go
index bea8caa93..b37bd584e 100644
--- a/test/e2e/events_test.go
+++ b/test/e2e/events_test.go
@@ -10,6 +10,7 @@ import (
. "github.com/containers/podman/v2/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
+ . "github.com/onsi/gomega/gexec"
)
var _ = Describe("Podman events", func() {
@@ -126,26 +127,31 @@ var _ = Describe("Podman events", func() {
SkipIfNotFedora()
_, ec, _ := podmanTest.RunLsContainer("")
Expect(ec).To(Equal(0))
+
test := podmanTest.Podman([]string{"events", "--stream=false", "--format", "json"})
test.WaitWithDefaultTimeout()
- Expect(test.ExitCode()).To(BeZero())
+ Expect(test).To(Exit(0))
+
jsonArr := test.OutputToStringArray()
- Expect(len(jsonArr)).To(Not(BeZero()))
+ Expect(test.OutputToStringArray()).ShouldNot(BeEmpty())
+
eventsMap := make(map[string]string)
err := json.Unmarshal([]byte(jsonArr[0]), &eventsMap)
- Expect(err).To(BeNil())
- _, exist := eventsMap["Status"]
- Expect(exist).To(BeTrue())
+ Expect(err).ToNot(HaveOccurred())
+
+ Expect(eventsMap).To(HaveKey("Status"))
test = podmanTest.Podman([]string{"events", "--stream=false", "--format", "{{json.}}"})
test.WaitWithDefaultTimeout()
- Expect(test.ExitCode()).To(BeZero())
+ Expect(test).To(Exit(0))
+
jsonArr = test.OutputToStringArray()
- Expect(len(jsonArr)).To(Not(BeZero()))
+ Expect(test.OutputToStringArray()).ShouldNot(BeEmpty())
+
eventsMap = make(map[string]string)
err = json.Unmarshal([]byte(jsonArr[0]), &eventsMap)
- Expect(err).To(BeNil())
- _, exist = eventsMap["Status"]
- Expect(exist).To(BeTrue())
+ Expect(err).ToNot(HaveOccurred())
+
+ Expect(eventsMap).To(HaveKey("Status"))
})
})