diff --git a/test/e2e/attach_test.go b/test/e2e/attach_test.go index c8570da187..fd6d6e6b1a 100644 --- a/test/e2e/attach_test.go +++ b/test/e2e/attach_test.go @@ -20,9 +20,7 @@ var _ = Describe("Podman attach", func() { }) It("podman attach to non-running container", func() { - session := podmanTest.Podman([]string{"create", "--name", "test1", "-i", CITEST_IMAGE, "ls"}) - session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + podmanTest.PodmanExitCleanly("create", "--name", "test1", "-i", CITEST_IMAGE, "ls") results := podmanTest.Podman([]string{"attach", "test1"}) results.WaitWithDefaultTimeout() @@ -30,10 +28,7 @@ var _ = Describe("Podman attach", func() { }) It("podman container attach to non-running container", func() { - session := podmanTest.Podman([]string{"container", "create", "--name", "test1", "-i", CITEST_IMAGE, "ls"}) - - session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + podmanTest.PodmanExitCleanly("container", "create", "--name", "test1", "-i", CITEST_IMAGE, "ls") results := podmanTest.Podman([]string{"container", "attach", "test1"}) results.WaitWithDefaultTimeout() @@ -55,9 +50,7 @@ var _ = Describe("Podman attach", func() { }) It("podman attach to a running container", func() { - session := podmanTest.Podman([]string{"run", "-d", "--name", "test", CITEST_IMAGE, "/bin/sh", "-c", "while true; do echo test; sleep 1; done"}) - session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + podmanTest.PodmanExitCleanly("run", "-d", "--name", "test", CITEST_IMAGE, "/bin/sh", "-c", "while true; do echo test; sleep 1; done") results := podmanTest.Podman([]string{"attach", "test"}) time.Sleep(2 * time.Second) @@ -67,13 +60,8 @@ var _ = Describe("Podman attach", func() { }) It("podman attach to the latest container", func() { - session := podmanTest.Podman([]string{"run", "-d", "--name", "test1", CITEST_IMAGE, "/bin/sh", "-c", "while true; do echo test1; sleep 1; done"}) - session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) - - session = podmanTest.Podman([]string{"run", "-d", "--name", "test2", CITEST_IMAGE, "/bin/sh", "-c", "while true; do echo test2; sleep 1; done"}) - session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + podmanTest.PodmanExitCleanly("run", "-d", "--name", "test1", CITEST_IMAGE, "/bin/sh", "-c", "while true; do echo test1; sleep 1; done") + podmanTest.PodmanExitCleanly("run", "-d", "--name", "test2", CITEST_IMAGE, "/bin/sh", "-c", "while true; do echo test2; sleep 1; done") cid := "-l" if IsRemote() { @@ -87,9 +75,7 @@ var _ = Describe("Podman attach", func() { }) It("podman attach to a container with --sig-proxy set to false", func() { - session := podmanTest.Podman([]string{"run", "-d", "--name", "test", CITEST_IMAGE, "/bin/sh", "-c", "while true; do echo test; sleep 1; done"}) - session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + podmanTest.PodmanExitCleanly("run", "-d", "--name", "test", CITEST_IMAGE, "/bin/sh", "-c", "while true; do echo test; sleep 1; done") results := podmanTest.Podman([]string{"attach", "--sig-proxy=false", "test"}) time.Sleep(2 * time.Second)