diff options
Diffstat (limited to 'test/e2e/pod_create_test.go')
-rw-r--r-- | test/e2e/pod_create_test.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go index a3dde3650..41a017a52 100644 --- a/test/e2e/pod_create_test.go +++ b/test/e2e/pod_create_test.go @@ -49,7 +49,7 @@ var _ = Describe("Podman pod create", func() { check := podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc"}) check.WaitWithDefaultTimeout() Expect(check.OutputToString()).To(ContainSubstring(podID)) - Expect(len(check.OutputToStringArray())).To(Equal(1)) + Expect(check.OutputToStringArray()).To(HaveLen(1)) }) It("podman create pod with name", func() { @@ -72,7 +72,7 @@ var _ = Describe("Podman pod create", func() { check := podmanTest.Podman([]string{"pod", "ps", "-q"}) check.WaitWithDefaultTimeout() - Expect(len(check.OutputToStringArray())).To(Equal(1)) + Expect(check.OutputToStringArray()).To(HaveLen(1)) }) It("podman create pod with same name as ctr", func() { @@ -86,7 +86,7 @@ var _ = Describe("Podman pod create", func() { check := podmanTest.Podman([]string{"pod", "ps", "-q"}) check.WaitWithDefaultTimeout() - Expect(len(check.OutputToStringArray())).To(Equal(0)) + Expect(check.OutputToStringArray()).To(BeEmpty()) }) It("podman create pod without network portbindings", func() { @@ -173,7 +173,7 @@ var _ = Describe("Podman pod create", func() { podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "cat", "/etc/hosts"}) podResolvConf.WaitWithDefaultTimeout() Expect(podResolvConf).Should(Exit(0)) - Expect(strings.Contains(podResolvConf.OutputToString(), "12.34.56.78 test.example.com")).To(BeTrue()) + Expect(podResolvConf.OutputToString()).To(ContainSubstring("12.34.56.78 test.example.com")) }) It("podman create pod with --add-host and no infra should fail", func() { @@ -193,7 +193,7 @@ var _ = Describe("Podman pod create", func() { podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "cat", "/etc/resolv.conf"}) podResolvConf.WaitWithDefaultTimeout() Expect(podResolvConf).Should(Exit(0)) - Expect(strings.Contains(podResolvConf.OutputToString(), fmt.Sprintf("nameserver %s", server))).To(BeTrue()) + Expect(podResolvConf.OutputToString()).To(ContainSubstring("nameserver %s", server)) }) It("podman create pod with DNS server set and no infra should fail", func() { @@ -214,7 +214,7 @@ var _ = Describe("Podman pod create", func() { podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "cat", "/etc/resolv.conf"}) podResolvConf.WaitWithDefaultTimeout() Expect(podResolvConf).Should(Exit(0)) - Expect(strings.Contains(podResolvConf.OutputToString(), fmt.Sprintf("options %s", option))).To(BeTrue()) + Expect(podResolvConf.OutputToString()).To(ContainSubstring(fmt.Sprintf("options %s", option))) }) It("podman create pod with DNS option set and no infra should fail", func() { @@ -235,7 +235,7 @@ var _ = Describe("Podman pod create", func() { podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "cat", "/etc/resolv.conf"}) podResolvConf.WaitWithDefaultTimeout() Expect(podResolvConf).Should(Exit(0)) - Expect(strings.Contains(podResolvConf.OutputToString(), fmt.Sprintf("search %s", search))).To(BeTrue()) + Expect(podResolvConf.OutputToString()).To(ContainSubstring(fmt.Sprintf("search %s", search))) }) It("podman create pod with DNS search domain set and no infra should fail", func() { @@ -259,7 +259,7 @@ var _ = Describe("Podman pod create", func() { podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "ip", "addr"}) podResolvConf.WaitWithDefaultTimeout() Expect(podResolvConf).Should(Exit(0)) - Expect(strings.Contains(podResolvConf.OutputToString(), ip)).To(BeTrue()) + Expect(podResolvConf.OutputToString()).To(ContainSubstring(ip)) } }) @@ -302,7 +302,7 @@ var _ = Describe("Podman pod create", func() { podResolvConf := podmanTest.Podman([]string{"run", "--pod", name, "-ti", "--rm", ALPINE, "ip", "addr"}) podResolvConf.WaitWithDefaultTimeout() Expect(podResolvConf).Should(Exit(0)) - Expect(strings.Contains(podResolvConf.OutputToString(), mac)).To(BeTrue()) + Expect(podResolvConf.OutputToString()).To(ContainSubstring(mac)) } }) @@ -474,7 +474,7 @@ entrypoint ["/fromimage"] status1 := podmanTest.Podman([]string{"pod", "inspect", "--format", "{{ .State }}", podName}) status1.WaitWithDefaultTimeout() Expect(status1).Should(Exit(0)) - Expect(strings.Contains(status1.OutputToString(), "Created")).To(BeTrue()) + Expect(status1.OutputToString()).To(ContainSubstring("Created")) ctr1 := podmanTest.Podman([]string{"run", "--pod", podName, "-d", ALPINE, "top"}) ctr1.WaitWithDefaultTimeout() @@ -483,7 +483,7 @@ entrypoint ["/fromimage"] status2 := podmanTest.Podman([]string{"pod", "inspect", "--format", "{{ .State }}", podName}) status2.WaitWithDefaultTimeout() Expect(status2).Should(Exit(0)) - Expect(strings.Contains(status2.OutputToString(), "Running")).To(BeTrue()) + Expect(status2.OutputToString()).To(ContainSubstring("Running")) ctr2 := podmanTest.Podman([]string{"create", "--pod", podName, ALPINE, "top"}) ctr2.WaitWithDefaultTimeout() @@ -492,7 +492,7 @@ entrypoint ["/fromimage"] status3 := podmanTest.Podman([]string{"pod", "inspect", "--format", "{{ .State }}", podName}) status3.WaitWithDefaultTimeout() Expect(status3).Should(Exit(0)) - Expect(strings.Contains(status3.OutputToString(), "Degraded")).To(BeTrue()) + Expect(status3.OutputToString()).To(ContainSubstring("Degraded")) }) It("podman create with unsupported network options", func() { @@ -517,7 +517,7 @@ entrypoint ["/fromimage"] session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) Expect(session.OutputToString()).To(ContainSubstring("inet 127.0.0.1/8 scope host lo")) - Expect(len(session.OutputToStringArray())).To(Equal(1)) + Expect(session.OutputToStringArray()).To(HaveLen(1)) }) It("podman pod create --infra-image w/untagged image", func() { @@ -725,11 +725,11 @@ ENTRYPOINT ["sleep","99999"] session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) l := session.OutputToString() - Expect(strings.Contains(l, "1024")).To(BeTrue()) + Expect(l).To(ContainSubstring("1024")) m[l] = l } // check for no duplicates - Expect(len(m)).To(Equal(5)) + Expect(m).To(HaveLen(5)) }) It("podman pod create --userns=auto:size=%d", func() { |