top: make output tabular

Make the output of top tabular to be compatible with Docker.  Please
note, that any user-input for `GetContainerPidInformation(...)` will be
ignored until we have found a way to generically and reliably parse ps-1
output or until there is a go-lib to extract all the data from /proc in
a ps-1 compatible fashion.

Fixes: #458
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #939
Approved by: rhatdan
This commit is contained in:
Valentin Rothberg
2018-06-13 08:59:59 +02:00
committed by Atomic Bot
parent 9e134576e8
commit b1e709806d
3 changed files with 38 additions and 13 deletions

View File

@ -59,7 +59,14 @@ var _ = Describe("Podman top", func() {
Expect(len(result.OutputToStringArray())).To(BeNumerically(">", 1))
})
// XXX(ps-issue): for the time being, podman-top and the libpod API
// GetContainerPidInformation(...) will ignore any arguments passed to ps,
// so we have to disable the tests below. Please refer to
// https://github.com/projectatomic/libpod/pull/939 for more background
// information.
It("podman top with options", func() {
Skip("podman-top with options: options are temporarily ignored")
session := podmanTest.Podman([]string{"run", "-d", ALPINE, "top", "-d", "2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@ -71,6 +78,7 @@ var _ = Describe("Podman top", func() {
})
It("podman top on container invalid options", func() {
Skip("podman-top with invalid options: options are temporarily ignored")
top := podmanTest.RunTopContainer("")
top.WaitWithDefaultTimeout()
Expect(top.ExitCode()).To(Equal(0))