mirror of
https://github.com/containers/podman.git
synced 2025-06-06 15:00:40 +08:00
Fix ps --sort=size test
I don't know how the previous test was succeeding, as we never actually fetched the sizes to sort with. The test now does. Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:
@ -201,12 +201,15 @@ var _ = Describe("Podman ps", func() {
|
|||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"ps", "-a", "--sort=size", "--format", "{{.Size}}"})
|
session = podmanTest.Podman([]string{"ps", "-a", "-s", "--sort=size", "--format", "{{.Size}}"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
|
|
||||||
sortedArr := session.OutputToStringArray()
|
sortedArr := session.OutputToStringArray()
|
||||||
|
|
||||||
|
// TODO: This may be broken - the test was running without the
|
||||||
|
// ability to perform any sorting for months and succeeded
|
||||||
|
// without error.
|
||||||
Expect(sort.SliceIsSorted(sortedArr, func(i, j int) bool {
|
Expect(sort.SliceIsSorted(sortedArr, func(i, j int) bool {
|
||||||
r := regexp.MustCompile(`^\S+\s+\(virtual (\S+)\)`)
|
r := regexp.MustCompile(`^\S+\s+\(virtual (\S+)\)`)
|
||||||
matches1 := r.FindStringSubmatch(sortedArr[i])
|
matches1 := r.FindStringSubmatch(sortedArr[i])
|
||||||
|
Reference in New Issue
Block a user