diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-02-17 07:52:42 -0500 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-02-18 10:18:24 -0500 |
commit | af62cb3ca9ab516627c5fb991d541555f8af13f4 (patch) | |
tree | 3e3028bc07149e9d33530cde524c8bceba1d5811 /test | |
parent | 59d2eac78a2a8e619d9c1c53b065f34f0e19795c (diff) | |
download | podman-af62cb3ca9ab516627c5fb991d541555f8af13f4.tar.gz podman-af62cb3ca9ab516627c5fb991d541555f8af13f4.tar.bz2 podman-af62cb3ca9ab516627c5fb991d541555f8af13f4.zip |
podman ps --format '{{ .Size }}' requires --size option
Podman -s crashes when the user specifies the '{{ .Size }}` format
on the podman ps command, without specifying the --size option.
This PR will stop the crash and print out a logrus.Error stating that
the caller should add the --size option.
Fixes: https://github.com/containers/podman/issues/9408
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/ps_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go index 225bd538e..016b4c8cd 100644 --- a/test/e2e/ps_test.go +++ b/test/e2e/ps_test.go @@ -350,6 +350,21 @@ var _ = Describe("Podman ps", func() { Expect(session).To(ExitWithError()) }) + It("podman --format by size", func() { + session := podmanTest.Podman([]string{"create", "busybox", "ls"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"create", "-t", ALPINE, "top"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"ps", "-a", "--format", "{{.Size}}"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.ErrorToString()).To(ContainSubstring("Size format requires --size option")) + }) + It("podman --sort by size", func() { session := podmanTest.Podman([]string{"create", "busybox", "ls"}) session.WaitWithDefaultTimeout() |