diff options
Diffstat (limited to 'test/e2e/exec_test.go')
-rw-r--r-- | test/e2e/exec_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index f3190978c..13fdabb81 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -2,6 +2,7 @@ package integration import ( "os" + "strings" . "github.com/containers/libpod/test/utils" . "github.com/onsi/ginkgo" @@ -120,6 +121,18 @@ var _ = Describe("Podman exec", func() { Expect(session.ExitCode()).To(Equal(100)) }) + It("podman exec pseudo-terminal sanity check", func() { + setup := podmanTest.Podman([]string{"run", "--detach", "--name", "test1", fedoraMinimal, "sleep", "+Inf"}) + setup.WaitWithDefaultTimeout() + Expect(setup.ExitCode()).To(Equal(0)) + + session := podmanTest.Podman([]string{"exec", "--interactive", "--tty", "test1", "/usr/bin/stty", "--all"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + match, _ := session.GrepString(" onlcr") + Expect(match).Should(BeTrue()) + }) + It("podman exec simple command with user", func() { setup := podmanTest.RunTopContainer("test1") setup.WaitWithDefaultTimeout() @@ -216,4 +229,18 @@ var _ = Describe("Podman exec", func() { session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(127)) }) + + It("podman exec preserve fds sanity check", func() { + // TODO: add this test once crun adds the --preserve-fds flag for exec + if strings.Contains(podmanTest.OCIRuntime, "crun") { + Skip("Test only works on crun") + } + setup := podmanTest.RunTopContainer("test1") + setup.WaitWithDefaultTimeout() + Expect(setup.ExitCode()).To(Equal(0)) + + session := podmanTest.Podman([]string{"exec", "--preserve-fds", "1", "test1", "ls"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + }) }) |