summaryrefslogtreecommitdiff
path: root/test/e2e/exec_test.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-09 09:56:26 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-09 10:17:42 +0200
commitd3cfa7a23c2343581185b8ddf9bab6f2ccf9eccc (patch)
treee30b6b865dc0f729ebb46cda232cd7dca0c80280 /test/e2e/exec_test.go
parent291ad7fbd9797340015b71b448c6637669176878 (diff)
downloadpodman-d3cfa7a23c2343581185b8ddf9bab6f2ccf9eccc.tar.gz
podman-d3cfa7a23c2343581185b8ddf9bab6f2ccf9eccc.tar.bz2
podman-d3cfa7a23c2343581185b8ddf9bab6f2ccf9eccc.zip
test: fix exec preserve-fds test
it specifies a fd is passed down but we are not really doing it, and it triggers the wrong fd to be closed by Podman after the OCI runtime invocation. Closes: https://github.com/containers/libpod/issues/5769 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'test/e2e/exec_test.go')
-rw-r--r--test/e2e/exec_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go
index 5d0d6e689..6a71a2114 100644
--- a/test/e2e/exec_test.go
+++ b/test/e2e/exec_test.go
@@ -252,7 +252,13 @@ var _ = Describe("Podman exec", func() {
setup.WaitWithDefaultTimeout()
Expect(setup.ExitCode()).To(Equal(0))
- session := podmanTest.Podman([]string{"exec", "--preserve-fds", "1", "test1", "ls"})
+ devNull, err := os.Open("/dev/null")
+ Expect(err).To(BeNil())
+ defer devNull.Close()
+ files := []*os.File{
+ devNull,
+ }
+ session := podmanTest.PodmanExtraFiles([]string{"exec", "--preserve-fds", "1", "test1", "ls"}, files)
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
})