mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Add tests for podman attach
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #608 Approved by: baude
This commit is contained in:
@ -106,11 +106,11 @@ var _ = Describe("Podman run", func() {
|
|||||||
|
|
||||||
// This currently does not work
|
// This currently does not work
|
||||||
// Re-enable when hostname is an env variable
|
// Re-enable when hostname is an env variable
|
||||||
//session = podmanTest.Podman([]string{"run", "--rm", ALPINE, "sh", "-c", "printenv"})
|
session = podmanTest.Podman([]string{"run", "--rm", ALPINE, "sh", "-c", "printenv"})
|
||||||
//session.Wait(10)
|
session.Wait(10)
|
||||||
//Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
//match, _ = session.GrepString("HOSTNAME")
|
match, _ = session.GrepString("HOSTNAME")
|
||||||
//Expect(match).Should(BeTrue())
|
Expect(match).Should(BeTrue())
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman run limits test", func() {
|
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)"))
|
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))
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user