diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-09-21 17:42:22 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-09-22 06:19:59 -0400 |
commit | f949cfddaa0ff47247df8424d7ddb793088b49e2 (patch) | |
tree | 5b98eb6c0e90b268a7a0ab571f191deceb371ab6 /test/e2e/attach_test.go | |
parent | fffcc25d8dfab8c6059c229177286f462d909b8d (diff) | |
download | podman-f949cfddaa0ff47247df8424d7ddb793088b49e2.tar.gz podman-f949cfddaa0ff47247df8424d7ddb793088b49e2.tar.bz2 podman-f949cfddaa0ff47247df8424d7ddb793088b49e2.zip |
Fix up attach tests for podman remote
When we execute podman-remote attach, we were not checking if the
container was in the correct state, this is leading to timeouts and
we had turned off remote testing.
Also added an IfRemote() function so we can turn on more tests when
using the "-l" flag for local, but use container name for remote.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e/attach_test.go')
-rw-r--r-- | test/e2e/attach_test.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/e2e/attach_test.go b/test/e2e/attach_test.go index 7b18f71ac..8065f6298 100644 --- a/test/e2e/attach_test.go +++ b/test/e2e/attach_test.go @@ -40,7 +40,6 @@ var _ = Describe("Podman attach", func() { }) It("podman attach to non-running container", func() { - SkipIfRemote() session := podmanTest.Podman([]string{"create", "--name", "test1", "-d", "-i", ALPINE, "ls"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -51,8 +50,8 @@ var _ = Describe("Podman attach", func() { }) It("podman container attach to non-running container", func() { - SkipIfRemote() session := podmanTest.Podman([]string{"container", "create", "--name", "test1", "-d", "-i", ALPINE, "ls"}) + session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -87,7 +86,6 @@ var _ = Describe("Podman attach", func() { Expect(podmanTest.NumberOfContainersRunning()).To(Equal(1)) }) It("podman attach to the latest container", func() { - SkipIfRemote() session := podmanTest.Podman([]string{"run", "-d", "--name", "test1", ALPINE, "/bin/sh", "-c", "while true; do echo test1; sleep 1; done"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) @@ -96,7 +94,11 @@ var _ = Describe("Podman attach", func() { session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - results := podmanTest.Podman([]string{"attach", "-l"}) + cid := "-l" + if IsRemote() { + cid = "test2" + } + results := podmanTest.Podman([]string{"attach", cid}) time.Sleep(2 * time.Second) results.Signal(syscall.SIGTSTP) Expect(results.OutputToString()).To(ContainSubstring("test2")) |