From e95c493fec5cab6e487d73649641cec0c1567d2c Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Fri, 28 Feb 2020 11:40:14 -0500 Subject: Fix wrong condition in bindings test Thanks for Brent Baude for the fix. Signed-off-by: Chris Evich --- pkg/bindings/test/common_test.go | 4 ++++ pkg/bindings/test/containers_test.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'pkg/bindings/test') diff --git a/pkg/bindings/test/common_test.go b/pkg/bindings/test/common_test.go index 38f5014ca..1fc774074 100644 --- a/pkg/bindings/test/common_test.go +++ b/pkg/bindings/test/common_test.go @@ -240,3 +240,7 @@ func createCache() { } b.cleanup() } + +func isStopped(state string) bool { + return state == "exited" || state == "stopped" +} diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go index 6756e81c7..5a0bdebe6 100644 --- a/pkg/bindings/test/containers_test.go +++ b/pkg/bindings/test/containers_test.go @@ -232,7 +232,7 @@ var _ = Describe("Podman containers ", func() { // Ensure container is stopped data, err := containers.Inspect(connText, name, nil) Expect(err).To(BeNil()) - Expect(data.State.Status).To(Equal("exited")) + Expect(isStopped(data.State.Status)).To(BeTrue()) }) It("podman stop a running container by ID", func() { @@ -247,7 +247,7 @@ var _ = Describe("Podman containers ", func() { // Ensure container is stopped data, err = containers.Inspect(connText, name, nil) Expect(err).To(BeNil()) - Expect(data.State.Status).To(Equal("exited")) + Expect(isStopped(data.State.Status)).To(BeTrue()) }) }) -- cgit v1.2.3-54-g00ecf