summaryrefslogtreecommitdiff
path: root/test/e2e/run_dns_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/run_dns_test.go')
-rw-r--r--test/e2e/run_dns_test.go19
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))
})
})