mirror of
https://github.com/containers/podman.git
synced 2025-06-17 06:57:43 +08:00
Add test case for description being present in search result
Test for a specific static image and match the description to avoid regression like https://github.com/containers/podman/pull/7131 Signed-off-by: Ralf Haferkamp <rhafer@suse.com>
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
@ -98,6 +99,15 @@ registries = ['{{.Host}}:{{.Port}}']`
|
|||||||
Expect(search.LineInOutputContains("quay.io/libpod/gate")).To(BeTrue())
|
Expect(search.LineInOutputContains("quay.io/libpod/gate")).To(BeTrue())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("podman search image with description", func() {
|
||||||
|
search := podmanTest.Podman([]string{"search", "quay.io/libpod/whalesay"})
|
||||||
|
search.WaitWithDefaultTimeout()
|
||||||
|
Expect(search.ExitCode()).To(Equal(0))
|
||||||
|
output := fmt.Sprintf("%s", search.Out.Contents())
|
||||||
|
match, _ := regexp.MatchString(`(?m)^quay.io\s+quay.io/libpod/whalesay\s+Static image used for automated testing.+$`, output)
|
||||||
|
Expect(match).To(BeTrue())
|
||||||
|
})
|
||||||
|
|
||||||
It("podman search format flag", func() {
|
It("podman search format flag", func() {
|
||||||
search := podmanTest.Podman([]string{"search", "--format", "table {{.Index}} {{.Name}}", "alpine"})
|
search := podmanTest.Podman([]string{"search", "--format", "table {{.Index}} {{.Name}}", "alpine"})
|
||||||
search.WaitWithDefaultTimeout()
|
search.WaitWithDefaultTimeout()
|
||||||
|
Reference in New Issue
Block a user