summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-03-31 11:15:13 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-02 09:15:56 +0200
commit4c02aa46c2873eaa89060f97f28a0c41c500ff90 (patch)
treea75c8de438eff4f040faf04d5c2cb2c35f42cb03 /test
parent88455fe704023d65b782e70fc774128b3ec76569 (diff)
downloadpodman-4c02aa46c2873eaa89060f97f28a0c41c500ff90.tar.gz
podman-4c02aa46c2873eaa89060f97f28a0c41c500ff90.tar.bz2
podman-4c02aa46c2873eaa89060f97f28a0c41c500ff90.zip
attach: fix hang if control path is deleted
if the control path file is deleted, libpod hangs waiting for a reader to open it. Attempt to open it as non blocking until it returns an error different than EINTR or EAGAIN. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/exec_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index ab806f683..5d0d6e689 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -122,6 +122,18 @@ var _ = Describe("Podman exec", func() {
Expect(session.ExitCode()).To(Equal(100))
})
+ It("podman exec terminal doesn't hang", func() {
+ setup := podmanTest.Podman([]string{"run", "-dti", fedoraMinimal, "sleep", "+Inf"})
+ setup.WaitWithDefaultTimeout()
+ Expect(setup.ExitCode()).To(Equal(0))
+
+ for i := 0; i < 5; i++ {
+ session := podmanTest.Podman([]string{"exec", "-lti", "true"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ }
+ })
+
It("podman exec pseudo-terminal sanity check", func() {
setup := podmanTest.Podman([]string{"run", "--detach", "--name", "test1", fedoraMinimal, "sleep", "+Inf"})
setup.WaitWithDefaultTimeout()