diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-12-01 22:41:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-01 22:41:11 +0100 |
commit | fbcebcb46a2444ce078dee10d8d51555bee8f177 (patch) | |
tree | e6140cedf57ebb7c7d79f214a9b42690639c3549 /test/e2e/search_test.go | |
parent | 1422cdbac192c7c9c907f88f11969c028d1e9611 (diff) | |
parent | 9ce7ade8c8dedb6a082614e45aa10d0e37c725cc (diff) | |
download | podman-fbcebcb46a2444ce078dee10d8d51555bee8f177.tar.gz podman-fbcebcb46a2444ce078dee10d8d51555bee8f177.tar.bz2 podman-fbcebcb46a2444ce078dee10d8d51555bee8f177.zip |
Merge pull request #12458 from edsantiago/remove_betrue
e2e: yet more cleanup of BeTrue/BeFalse
Diffstat (limited to 'test/e2e/search_test.go')
-rw-r--r-- | test/e2e/search_test.go | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go index 54bc5252e..c67ef7ed2 100644 --- a/test/e2e/search_test.go +++ b/test/e2e/search_test.go @@ -6,7 +6,6 @@ import ( "fmt" "io/ioutil" "os" - "regexp" "strconv" "text/template" @@ -107,10 +106,8 @@ registries = ['{{.Host}}:{{.Port}}']` search.WaitWithDefaultTimeout() Expect(search).Should(Exit(0)) output := string(search.Out.Contents()) - match, _ := regexp.MatchString(`(?m)NAME\s+DESCRIPTION$`, output) - Expect(match).To(BeTrue()) - match, _ = regexp.MatchString(`(?m)quay.io/libpod/whalesay\s+Static image used for automated testing.+$`, output) - Expect(match).To(BeTrue()) + Expect(output).To(MatchRegexp(`(?m)NAME\s+DESCRIPTION$`)) + Expect(output).To(MatchRegexp(`(?m)quay.io/libpod/whalesay\s+Static image used for automated testing.+$`)) }) It("podman search image with --compatible", func() { @@ -118,8 +115,7 @@ registries = ['{{.Host}}:{{.Port}}']` search.WaitWithDefaultTimeout() Expect(search).Should(Exit(0)) output := string(search.Out.Contents()) - match, _ := regexp.MatchString(`(?m)NAME\s+DESCRIPTION\s+STARS\s+OFFICIAL\s+AUTOMATED$`, output) - Expect(match).To(BeTrue()) + Expect(output).To(MatchRegexp(`(?m)NAME\s+DESCRIPTION\s+STARS\s+OFFICIAL\s+AUTOMATED$`)) }) It("podman search format flag", func() { @@ -354,8 +350,7 @@ registries = ['{{.Host}}:{{.Port}}']` Expect(search).Should(Exit(125)) Expect(search.OutputToString()).Should(BeEmpty()) - match, _ := search.ErrorGrepString("error") - Expect(match).Should(BeTrue()) + Expect(search.ErrorToString()).To(ContainSubstring("error")) // cleanup resetRegistriesConfigEnv() @@ -397,8 +392,7 @@ registries = ['{{.Host}}:{{.Port}}']` Expect(search).Should(Exit(125)) Expect(search.OutputToString()).Should(BeEmpty()) - match, _ := search.ErrorGrepString("error") - Expect(match).Should(BeTrue()) + Expect(search.ErrorToString()).To(ContainSubstring("error")) // cleanup resetRegistriesConfigEnv() @@ -451,8 +445,7 @@ registries = ['{{.Host}}:{{.Port}}']` Expect(search).Should(Exit(125)) Expect(search.OutputToString()).Should(BeEmpty()) - match, _ := search.ErrorGrepString("error") - Expect(match).Should(BeTrue()) + Expect(search.ErrorToString()).To(ContainSubstring("error")) // cleanup resetRegistriesConfigEnv() @@ -474,7 +467,7 @@ registries = ['{{.Host}}:{{.Port}}']` search = podmanTest.Podman([]string{"search", "registry.redhat.io/*openshift*"}) search.WaitWithDefaultTimeout() Expect(search).Should(Exit(0)) - Expect(len(search.OutputToStringArray()) > 1).To(BeTrue()) + Expect(len(search.OutputToStringArray())).To(BeNumerically(">", 1)) }) It("podman search repository tags", func() { @@ -494,7 +487,7 @@ registries = ['{{.Host}}:{{.Port}}']` search = podmanTest.Podman([]string{"search", "--list-tags", "docker.io/library/"}) search.WaitWithDefaultTimeout() - Expect(len(search.OutputToStringArray()) == 0).To(BeTrue()) + Expect(search.OutputToStringArray()).To(BeEmpty()) }) It("podman search with limit over 100", func() { |