aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-04-12 13:11:32 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-13 18:43:44 +0000
commit5eb9ebcf597c0a658c6a2ea4ea1e970f014e3d78 (patch)
tree3011d54a61ed1064f8a35f361bd4ffd054bbba8c
parent8d7635b1ac3eaea83fcf481994294eb137110e96 (diff)
downloadpodman-5eb9ebcf597c0a658c6a2ea4ea1e970f014e3d78.tar.gz
podman-5eb9ebcf597c0a658c6a2ea4ea1e970f014e3d78.tar.bz2
podman-5eb9ebcf597c0a658c6a2ea4ea1e970f014e3d78.zip
Add tests for podman attach
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #608 Approved by: baude
-rw-r--r--test/e2e/run_test.go37
1 files changed, 32 insertions, 5 deletions
diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go
index a9b2a474f..b737c9a17 100644
--- a/test/e2e/run_test.go
+++ b/test/e2e/run_test.go
@@ -106,11 +106,11 @@ var _ = Describe("Podman run", func() {
// This currently does not work
// Re-enable when hostname is an env variable
- //session = podmanTest.Podman([]string{"run", "--rm", ALPINE, "sh", "-c", "printenv"})
- //session.Wait(10)
- //Expect(session.ExitCode()).To(Equal(0))
- //match, _ = session.GrepString("HOSTNAME")
- //Expect(match).Should(BeTrue())
+ session = podmanTest.Podman([]string{"run", "--rm", ALPINE, "sh", "-c", "printenv"})
+ session.Wait(10)
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ = session.GrepString("HOSTNAME")
+ Expect(match).Should(BeTrue())
})
It("podman run limits test", func() {
@@ -300,4 +300,31 @@ var _ = Describe("Podman run", func() {
Expect(session.OutputToString()).To(Equal("uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),18(audio),20(dialout),26(tape),27(video),777,65533(nogroup)"))
})
+ It("podman run with attach stdin has no output", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--attach", "stdin", ALPINE, "printenv"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal(""))
+ })
+
+ It("podman run with attach stdout does not print stderr", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--attach", "stdout", ALPINE, "ls", "/doesnotexist"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal(""))
+ })
+
+ It("podman run with attach stderr does not print stdout", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--attach", "stderr", ALPINE, "ls", "/"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(Equal(""))
+ })
+
+ It("podman run attach nonsense errors", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--attach", "asdfasdf", ALPINE, "ls", "/"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(125))
+ })
+
})