diff options
author | Ed Santiago <santiago@redhat.com> | 2021-11-23 06:49:49 -0700 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2021-11-23 13:50:35 -0700 |
commit | 2fcb39586cd1a1b07afd561c1bbd7ba166c44879 (patch) | |
tree | 471567f8d2c063d3f388597969a0fc9232b1ecd4 /test | |
parent | cd59721de13e388bac706576057dc42c0853484d (diff) | |
download | podman-2fcb39586cd1a1b07afd561c1bbd7ba166c44879.tar.gz podman-2fcb39586cd1a1b07afd561c1bbd7ba166c44879.tar.bz2 podman-2fcb39586cd1a1b07afd561c1bbd7ba166c44879.zip |
Remove StringInSlice(), part 1
via: sed -i -e 's/Expect(StringInSlice(\(.*\), \(.*\))).To(BeTrue())/Expect(\2)\.To(ContainElement(\1))/' test/e2e/*_test.go
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/commit_test.go | 6 | ||||
-rw-r--r-- | test/e2e/generate_kube_test.go | 16 | ||||
-rw-r--r-- | test/e2e/tag_test.go | 12 |
3 files changed, 17 insertions, 17 deletions
diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go index d40faf54b..20e1360de 100644 --- a/test/e2e/commit_test.go +++ b/test/e2e/commit_test.go @@ -47,7 +47,7 @@ var _ = Describe("Podman commit", func() { check := podmanTest.Podman([]string{"inspect", "foobar.com/test1-image:latest"}) check.WaitWithDefaultTimeout() data := check.InspectImageJSON() - Expect(StringInSlice("foobar.com/test1-image:latest", data[0].RepoTags)).To(BeTrue()) + Expect(data[0].RepoTags).To(ContainElement("foobar.com/test1-image:latest")) }) It("podman commit single letter container", func() { @@ -62,7 +62,7 @@ var _ = Describe("Podman commit", func() { check := podmanTest.Podman([]string{"inspect", "localhost/a:latest"}) check.WaitWithDefaultTimeout() data := check.InspectImageJSON() - Expect(StringInSlice("localhost/a:latest", data[0].RepoTags)).To(BeTrue()) + Expect(data[0].RepoTags).To(ContainElement("localhost/a:latest")) }) It("podman container commit container", func() { @@ -77,7 +77,7 @@ var _ = Describe("Podman commit", func() { check := podmanTest.Podman([]string{"image", "inspect", "foobar.com/test1-image:latest"}) check.WaitWithDefaultTimeout() data := check.InspectImageJSON() - Expect(StringInSlice("foobar.com/test1-image:latest", data[0].RepoTags)).To(BeTrue()) + Expect(data[0].RepoTags).To(ContainElement("foobar.com/test1-image:latest")) }) It("podman commit container with message", func() { diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index d95555068..a148025e5 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -775,8 +775,8 @@ var _ = Describe("Podman generate kube", func() { err := yaml.Unmarshal(kube.Out.Contents(), pod) Expect(err).To(BeNil()) - Expect(StringInSlice("8.8.8.8", pod.Spec.DNSConfig.Nameservers)).To(BeTrue()) - Expect(StringInSlice("foobar.com", pod.Spec.DNSConfig.Searches)).To(BeTrue()) + Expect(pod.Spec.DNSConfig.Nameservers).To(ContainElement("8.8.8.8")) + Expect(pod.Spec.DNSConfig.Searches).To(ContainElement("foobar.com")) Expect(len(pod.Spec.DNSConfig.Options)).To(BeNumerically(">", 0)) Expect(pod.Spec.DNSConfig.Options[0].Name).To(Equal("color")) Expect(*pod.Spec.DNSConfig.Options[0].Value).To(Equal("blue")) @@ -799,10 +799,10 @@ var _ = Describe("Podman generate kube", func() { err := yaml.Unmarshal(kube.Out.Contents(), pod) Expect(err).To(BeNil()) - Expect(StringInSlice("8.8.8.8", pod.Spec.DNSConfig.Nameservers)).To(BeTrue()) - Expect(StringInSlice("8.7.7.7", pod.Spec.DNSConfig.Nameservers)).To(BeTrue()) - Expect(StringInSlice("foobar.com", pod.Spec.DNSConfig.Searches)).To(BeTrue()) - Expect(StringInSlice("homer.com", pod.Spec.DNSConfig.Searches)).To(BeTrue()) + Expect(pod.Spec.DNSConfig.Nameservers).To(ContainElement("8.8.8.8")) + Expect(pod.Spec.DNSConfig.Nameservers).To(ContainElement("8.7.7.7")) + Expect(pod.Spec.DNSConfig.Searches).To(ContainElement("foobar.com")) + Expect(pod.Spec.DNSConfig.Searches).To(ContainElement("homer.com")) }) It("podman generate kube on a pod with dns options", func() { @@ -818,8 +818,8 @@ var _ = Describe("Podman generate kube", func() { err := yaml.Unmarshal(kube.Out.Contents(), pod) Expect(err).To(BeNil()) - Expect(StringInSlice("8.8.8.8", pod.Spec.DNSConfig.Nameservers)).To(BeTrue()) - Expect(StringInSlice("foobar.com", pod.Spec.DNSConfig.Searches)).To(BeTrue()) + Expect(pod.Spec.DNSConfig.Nameservers).To(ContainElement("8.8.8.8")) + Expect(pod.Spec.DNSConfig.Searches).To(ContainElement("foobar.com")) Expect(len(pod.Spec.DNSConfig.Options)).To(BeNumerically(">", 0)) Expect(pod.Spec.DNSConfig.Options[0].Name).To(Equal("color")) Expect(*pod.Spec.DNSConfig.Options[0].Value).To(Equal("blue")) diff --git a/test/e2e/tag_test.go b/test/e2e/tag_test.go index b835d3776..743f58ea2 100644 --- a/test/e2e/tag_test.go +++ b/test/e2e/tag_test.go @@ -42,8 +42,8 @@ var _ = Describe("Podman tag", func() { results.WaitWithDefaultTimeout() Expect(results).Should(Exit(0)) inspectData := results.InspectImageJSON() - Expect(StringInSlice("quay.io/libpod/alpine:latest", inspectData[0].RepoTags)).To(BeTrue()) - Expect(StringInSlice("localhost/foobar:latest", inspectData[0].RepoTags)).To(BeTrue()) + Expect(inspectData[0].RepoTags).To(ContainElement("quay.io/libpod/alpine:latest")) + Expect(inspectData[0].RepoTags).To(ContainElement("localhost/foobar:latest")) }) It("podman tag shortname", func() { @@ -55,8 +55,8 @@ var _ = Describe("Podman tag", func() { results.WaitWithDefaultTimeout() Expect(results).Should(Exit(0)) inspectData := results.InspectImageJSON() - Expect(StringInSlice("quay.io/libpod/alpine:latest", inspectData[0].RepoTags)).To(BeTrue()) - Expect(StringInSlice("localhost/foobar:latest", inspectData[0].RepoTags)).To(BeTrue()) + Expect(inspectData[0].RepoTags).To(ContainElement("quay.io/libpod/alpine:latest")) + Expect(inspectData[0].RepoTags).To(ContainElement("localhost/foobar:latest")) }) It("podman tag shortname:tag", func() { @@ -68,8 +68,8 @@ var _ = Describe("Podman tag", func() { results.WaitWithDefaultTimeout() Expect(results).Should(Exit(0)) inspectData := results.InspectImageJSON() - Expect(StringInSlice("quay.io/libpod/alpine:latest", inspectData[0].RepoTags)).To(BeTrue()) - Expect(StringInSlice("localhost/foobar:new", inspectData[0].RepoTags)).To(BeTrue()) + Expect(inspectData[0].RepoTags).To(ContainElement("quay.io/libpod/alpine:latest")) + Expect(inspectData[0].RepoTags).To(ContainElement("localhost/foobar:new")) }) It("podman tag shortname image no tag", func() { |