mirror of
https://github.com/containers/podman.git
synced 2025-06-26 04:46:57 +08:00
correct stats err with non-running containers
when doing stats -a|--all, if you have non-running containers, we should not error on not being able to get information like PID, etc on them. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -31,12 +31,6 @@ var _ = Describe("Podman stats", func() {
|
||||
GinkgoWriter.Write([]byte(timedResult))
|
||||
})
|
||||
|
||||
It("podman stats should run with no containers", func() {
|
||||
session := podmanTest.Podman([]string{"stats", "--no-stream"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman stats with bogus container", func() {
|
||||
session := podmanTest.Podman([]string{"stats", "--no-stream", "123"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
@ -53,15 +47,6 @@ var _ = Describe("Podman stats", func() {
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman stats on a running container no id", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
session = podmanTest.Podman([]string{"stats", "--no-stream"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
})
|
||||
|
||||
It("podman stats on all containers", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
@ -75,7 +60,7 @@ var _ = Describe("Podman stats", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
session = podmanTest.Podman([]string{"stats", "--no-stream", "--format", "\"{{.Container}}\""})
|
||||
session = podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "\"{{.Container}}\""})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
})
|
||||
@ -84,7 +69,7 @@ var _ = Describe("Podman stats", func() {
|
||||
session := podmanTest.RunTopContainer("")
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
session = podmanTest.Podman([]string{"stats", "--no-stream", "--format", "json"})
|
||||
session = podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "json"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(session.IsJSONOutputValid()).To(BeTrue())
|
||||
|
Reference in New Issue
Block a user