test: add test for logs -f

discussion here:
https://github.com/containers/libpod/issues/3325#issuecomment-502214492

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2019-06-17 10:52:04 +02:00
parent 670fc03088
commit 6b7649e4ba
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
1 changed files with 17 additions and 0 deletions

View File

@ -218,4 +218,21 @@ var _ = Describe("Podman logs", func() {
Expect(results.ExitCode()).To(Equal(0))
Expect(len(results.OutputToStringArray())).To(Equal(3))
})
It("podman logs -f two lines", func() {
containerName := "logs-f-rm"
logc := podmanTest.Podman([]string{"run", "--rm", "--name", containerName, "-dt", ALPINE, "sh", "-c", "echo podman; sleep 1; echo podman"})
logc.WaitWithDefaultTimeout()
Expect(logc.ExitCode()).To(Equal(0))
results := podmanTest.Podman([]string{"logs", "-f", containerName})
results.WaitWithDefaultTimeout()
Expect(results.ExitCode()).To(Equal(0))
// Verify that the cleanup process worked correctly and we can recreate a container with the same name
logc = podmanTest.Podman([]string{"run", "--rm", "--name", containerName, "-dt", ALPINE, "true"})
logc.WaitWithDefaultTimeout()
Expect(logc.ExitCode()).To(Equal(0))
})
})