diff options
Diffstat (limited to 'test/e2e/pod_restart_test.go')
-rw-r--r-- | test/e2e/pod_restart_test.go | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/test/e2e/pod_restart_test.go b/test/e2e/pod_restart_test.go index 006421b93..448c110ce 100644 --- a/test/e2e/pod_restart_test.go +++ b/test/e2e/pod_restart_test.go @@ -6,6 +6,7 @@ import ( . "github.com/containers/podman/v3/test/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gexec" ) var _ = Describe("Podman pod restart", func() { @@ -35,7 +36,7 @@ var _ = Describe("Podman pod restart", func() { It("podman pod restart bogus pod", func() { session := podmanTest.Podman([]string{"pod", "restart", "123"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(125)) + Expect(session).Should(Exit(125)) }) It("podman pod restart single empty pod", func() { @@ -44,7 +45,7 @@ var _ = Describe("Podman pod restart", func() { session := podmanTest.Podman([]string{"pod", "restart", podid}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(125)) + Expect(session).Should(Exit(125)) }) It("podman pod restart single pod by name", func() { @@ -53,14 +54,14 @@ var _ = Describe("Podman pod restart", func() { session := podmanTest.RunTopContainerInPod("test1", "foobar99") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1"}) startTime.WaitWithDefaultTimeout() session = podmanTest.Podman([]string{"pod", "restart", "foobar99"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1"}) restartTime.WaitWithDefaultTimeout() @@ -73,29 +74,29 @@ var _ = Describe("Podman pod restart", func() { session := podmanTest.RunTopContainerInPod("test1", "foobar99") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) _, ec, _ = podmanTest.CreatePod(map[string][]string{"--name": {"foobar100"}}) Expect(ec).To(Equal(0)) session = podmanTest.RunTopContainerInPod("test2", "foobar100") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) session = podmanTest.RunTopContainerInPod("test3", "foobar100") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) session = podmanTest.RunTopContainerInPod("test4", "foobar100") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2", "test3", "test4"}) startTime.WaitWithDefaultTimeout() session = podmanTest.Podman([]string{"pod", "restart", "foobar99", "foobar100"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2", "test3", "test4"}) restartTime.WaitWithDefaultTimeout() @@ -111,21 +112,21 @@ var _ = Describe("Podman pod restart", func() { session := podmanTest.RunTopContainerInPod("test1", "foobar99") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) _, ec, _ = podmanTest.CreatePod(map[string][]string{"--name": {"foobar100"}}) Expect(ec).To(Equal(0)) session = podmanTest.RunTopContainerInPod("test2", "foobar100") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"}) startTime.WaitWithDefaultTimeout() session = podmanTest.Podman([]string{"pod", "restart", "-a"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"}) restartTime.WaitWithDefaultTimeout() @@ -139,14 +140,14 @@ var _ = Describe("Podman pod restart", func() { session := podmanTest.RunTopContainerInPod("test1", "foobar99") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) _, ec, _ = podmanTest.CreatePod(map[string][]string{"--name": {"foobar100"}}) Expect(ec).To(Equal(0)) session = podmanTest.RunTopContainerInPod("test2", "foobar100") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"}) startTime.WaitWithDefaultTimeout() @@ -157,7 +158,7 @@ var _ = Describe("Podman pod restart", func() { } session = podmanTest.Podman([]string{"pod", "restart", podid}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) restartTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", "test1", "test2"}) restartTime.WaitWithDefaultTimeout() @@ -171,10 +172,10 @@ var _ = Describe("Podman pod restart", func() { session := podmanTest.RunTopContainerInPod("", "foobar99") session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) session = podmanTest.Podman([]string{"pod", "restart", podid1, "doesnotexist"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(125)) + Expect(session).Should(Exit(125)) }) }) |