diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-11-23 10:54:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 10:54:40 +0100 |
commit | a55473bea80c2d9e5d79ac97a2bfe313622033f9 (patch) | |
tree | 90d0bdcb144a8fb74d75c93fa518b573309cf74f /test/e2e/run_dns_test.go | |
parent | 1bfbb28b0365790552483b961b4bd48a69dd8070 (diff) | |
parent | 49d63ad5c120919ff6669baae2ebbd2b81f5c11a (diff) | |
download | podman-a55473bea80c2d9e5d79ac97a2bfe313622033f9.tar.gz podman-a55473bea80c2d9e5d79ac97a2bfe313622033f9.tar.bz2 podman-a55473bea80c2d9e5d79ac97a2bfe313622033f9.zip |
Merge pull request #12387 from edsantiago/remove_betrue
e2e tests: clean up antihelpful BeTrue()s
Diffstat (limited to 'test/e2e/run_dns_test.go')
-rw-r--r-- | test/e2e/run_dns_test.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/e2e/run_dns_test.go b/test/e2e/run_dns_test.go index 166160ad2..beb6390e0 100644 --- a/test/e2e/run_dns_test.go +++ b/test/e2e/run_dns_test.go @@ -37,7 +37,7 @@ var _ = Describe("Podman run dns", func() { session := podmanTest.Podman([]string{"run", "--dns-search=foobar.com", ALPINE, "cat", "/etc/resolv.conf"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session.LineInOutputStartsWith("search foobar.com") + Expect(session.OutputToStringArray()).To(ContainElement(HavePrefix("search foobar.com"))) }) It("podman run remove all search domain", func() { @@ -57,14 +57,15 @@ var _ = Describe("Podman run dns", func() { session := podmanTest.Podman([]string{"run", "--dns=1.2.3.4", ALPINE, "cat", "/etc/resolv.conf"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session.LineInOutputStartsWith("server 1.2.3.4") + Expect(session.OutputToStringArray()).To(ContainElement(HavePrefix("nameserver 1.2.3.4"))) + }) It("podman run add dns option", func() { session := podmanTest.Podman([]string{"run", "--dns-opt=debug", ALPINE, "cat", "/etc/resolv.conf"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session.LineInOutputStartsWith("options debug") + Expect(session.OutputToStringArray()).To(ContainElement(HavePrefix("options debug"))) }) It("podman run add bad host", func() { @@ -77,8 +78,8 @@ var _ = Describe("Podman run dns", func() { session := podmanTest.Podman([]string{"run", "--add-host=foobar:1.1.1.1", "--add-host=foobaz:2001:db8::68", ALPINE, "cat", "/etc/hosts"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session.LineInOutputStartsWith("1.1.1.1 foobar") - session.LineInOutputStartsWith("2001:db8::68 foobaz") + Expect(session.OutputToStringArray()).To(ContainElement(HavePrefix("1.1.1.1 foobar"))) + Expect(session.OutputToStringArray()).To(ContainElement(HavePrefix("2001:db8::68 foobaz"))) }) It("podman run add hostname", func() { @@ -97,7 +98,7 @@ var _ = Describe("Podman run dns", func() { session := podmanTest.Podman([]string{"run", "-t", "-i", "--hostname=foobar", ALPINE, "cat", "/etc/hosts"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - Expect(session.LineInOutputContains("foobar")).To(BeTrue()) + Expect(session.OutputToString()).To(ContainSubstring("foobar")) }) It("podman run mutually excludes --dns* and --network", func() { |