diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-07-15 10:37:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 10:37:11 -0400 |
commit | bc98c2003d36f9ce5650c1e0f4445be97ca0fa18 (patch) | |
tree | 9c3a777a89c015266578b7349a0f1233c2f325d0 /test/e2e/run_dns_test.go | |
parent | 47f351769bbf9e06ec47d340943e5a494d586e79 (diff) | |
parent | 547fff27033a294d1639ee3f9125f775032f39f5 (diff) | |
download | podman-bc98c2003d36f9ce5650c1e0f4445be97ca0fa18.tar.gz podman-bc98c2003d36f9ce5650c1e0f4445be97ca0fa18.tar.bz2 podman-bc98c2003d36f9ce5650c1e0f4445be97ca0fa18.zip |
Merge pull request #10932 from edsantiago/e2e_exit_checks
e2e tests: use Should(Exit()) and ExitWithError()
Diffstat (limited to 'test/e2e/run_dns_test.go')
-rw-r--r-- | test/e2e/run_dns_test.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/e2e/run_dns_test.go b/test/e2e/run_dns_test.go index 05f8c3f99..166160ad2 100644 --- a/test/e2e/run_dns_test.go +++ b/test/e2e/run_dns_test.go @@ -6,6 +6,7 @@ import ( . "github.com/containers/podman/v3/test/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gexec" ) var _ = Describe("Podman run dns", func() { @@ -35,14 +36,14 @@ var _ = Describe("Podman run dns", func() { It("podman run add search domain", func() { session := podmanTest.Podman([]string{"run", "--dns-search=foobar.com", ALPINE, "cat", "/etc/resolv.conf"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) session.LineInOutputStartsWith("search foobar.com") }) It("podman run remove all search domain", func() { session := podmanTest.Podman([]string{"run", "--dns-search=.", ALPINE, "cat", "/etc/resolv.conf"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) Expect(session.LineInOutputStartsWith("search")).To(BeFalse()) }) @@ -55,14 +56,14 @@ var _ = Describe("Podman run dns", func() { It("podman run add dns server", func() { session := podmanTest.Podman([]string{"run", "--dns=1.2.3.4", ALPINE, "cat", "/etc/resolv.conf"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) session.LineInOutputStartsWith("server 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.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) session.LineInOutputStartsWith("options debug") }) @@ -75,7 +76,7 @@ var _ = Describe("Podman run dns", func() { It("podman run add host", 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.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) session.LineInOutputStartsWith("1.1.1.1 foobar") session.LineInOutputStartsWith("2001:db8::68 foobaz") }) @@ -83,19 +84,19 @@ var _ = Describe("Podman run dns", func() { It("podman run add hostname", func() { session := podmanTest.Podman([]string{"run", "--hostname=foobar", ALPINE, "cat", "/etc/hostname"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) Expect(session.OutputToString()).To(Equal("foobar")) session = podmanTest.Podman([]string{"run", "--hostname=foobar", ALPINE, "hostname"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) Expect(session.OutputToString()).To(Equal("foobar")) }) It("podman run add hostname sets /etc/hosts", func() { session := podmanTest.Podman([]string{"run", "-t", "-i", "--hostname=foobar", ALPINE, "cat", "/etc/hosts"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) + Expect(session).Should(Exit(0)) Expect(session.LineInOutputContains("foobar")).To(BeTrue()) }) @@ -114,6 +115,6 @@ var _ = Describe("Podman run dns", func() { session = podmanTest.Podman([]string{"run", "--dns=1.2.3.4", "--network", "host", ALPINE}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To((Equal(0))) + Expect(session).Should(Exit(0)) }) }) |