summaryrefslogtreecommitdiff
path: root/test/e2e/generate_kube_test.go
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2021-11-23 06:49:49 -0700
committerEd Santiago <santiago@redhat.com>2021-11-23 13:50:35 -0700
commit2fcb39586cd1a1b07afd561c1bbd7ba166c44879 (patch)
tree471567f8d2c063d3f388597969a0fc9232b1ecd4 /test/e2e/generate_kube_test.go
parentcd59721de13e388bac706576057dc42c0853484d (diff)
downloadpodman-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/e2e/generate_kube_test.go')
-rw-r--r--test/e2e/generate_kube_test.go16
1 files changed, 8 insertions, 8 deletions
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"))