summaryrefslogtreecommitdiff
path: root/test/e2e/search_test.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2019-08-01 15:35:26 -0400
committerQi Wang <qiwan@redhat.com>2019-08-01 16:15:15 -0400
commit619a39f7bb2275a086651fcf31619959f6d15c6b (patch)
tree095cfbdab8e08b7c2258cd358d832627565a99e8 /test/e2e/search_test.go
parenta622f8d345b1853401de2e533e9fbf14ef169fa2 (diff)
downloadpodman-619a39f7bb2275a086651fcf31619959f6d15c6b.tar.gz
podman-619a39f7bb2275a086651fcf31619959f6d15c6b.tar.bz2
podman-619a39f7bb2275a086651fcf31619959f6d15c6b.zip
fix search output limit
close https://bugzilla.redhat.com/show_bug.cgi?id=1732280 From the bug Podman search returns 25 results even when limit option `--limit` is larger than 25(maxQueries). They want Podman to return `--limit` results. This PR fixes the number of output result. if --limit not set, return MIN(maxQueries, len(res)) if --limit is set, return MIN(option, len(res)) Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'test/e2e/search_test.go')
-rw-r--r--test/e2e/search_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go
index 3b1da859c..9c28849f0 100644
--- a/test/e2e/search_test.go
+++ b/test/e2e/search_test.go
@@ -118,10 +118,20 @@ registries = ['{{.Host}}:{{.Port}}']`
})
It("podman search limit flag", func() {
- search := podmanTest.Podman([]string{"search", "--limit", "3", "docker.io/alpine"})
+ search := podmanTest.Podman([]string{"search", "docker.io/alpine"})
+ search.WaitWithDefaultTimeout()
+ Expect(search.ExitCode()).To(Equal(0))
+ Expect(len(search.OutputToStringArray())).To(Equal(26))
+
+ search = podmanTest.Podman([]string{"search", "--limit", "3", "docker.io/alpine"})
search.WaitWithDefaultTimeout()
Expect(search.ExitCode()).To(Equal(0))
Expect(len(search.OutputToStringArray())).To(Equal(4))
+
+ search = podmanTest.Podman([]string{"search", "--limit", "30", "docker.io/alpine"})
+ search.WaitWithDefaultTimeout()
+ Expect(search.ExitCode()).To(Equal(0))
+ Expect(len(search.OutputToStringArray())).To(Equal(31))
})
It("podman search with filter stars", func() {