From 0d2d52339058a19e66ecc75f78c52596054c7dad Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 29 Apr 2019 11:21:55 +0200 Subject: top: fallback to execing ps(1) Fallback to executing ps(1) in case we hit an unknown psgo descriptor. This ensures backwards compatibility with docker-top, which was purely ps(1) driven. Also support comma-separated descriptors as input. Signed-off-by: Valentin Rothberg --- test/e2e/pod_top_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/e2e/pod_top_test.go') diff --git a/test/e2e/pod_top_test.go b/test/e2e/pod_top_test.go index 964ee075f..420e4aca9 100644 --- a/test/e2e/pod_top_test.go +++ b/test/e2e/pod_top_test.go @@ -93,7 +93,11 @@ var _ = Describe("Podman top", func() { session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - result := podmanTest.Podman([]string{"pod", "top", podid, "invalid"}) + // We need to pass -eo to force executing ps in the Alpine container. + // Alpines stripped down ps(1) is accepting any kind of weird input in + // contrast to others, such that a `ps invalid` will silently ignore + // the wrong input and still print the -ef output instead. + result := podmanTest.Podman([]string{"pod", "top", podid, "-eo", "invalid"}) result.WaitWithDefaultTimeout() Expect(result.ExitCode()).To(Equal(125)) }) -- cgit v1.2.3-54-g00ecf