summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-07 08:58:19 -0800
committerGitHub <noreply@github.com>2018-11-07 08:58:19 -0800
commit90662c2fa3c4069dcf34c01dd3011a20cecde6ee (patch)
tree10a0ff437ed2eb676eefefe5cde7a62aae0d2bce /test/e2e
parent48914d67aed53ad793d86c98a6a4e96cfefe7333 (diff)
parent879f9116de8a186558fb4e7b6a259b1b8ad1aaca (diff)
downloadpodman-90662c2fa3c4069dcf34c01dd3011a20cecde6ee.tar.gz
podman-90662c2fa3c4069dcf34c01dd3011a20cecde6ee.tar.bz2
podman-90662c2fa3c4069dcf34c01dd3011a20cecde6ee.zip
Merge pull request #1751 from QiWang19/issue1745
Add hostname to /etc/hosts
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_dns_test.go21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/e2e/run_dns_test.go b/test/e2e/run_dns_test.go
index c5a02c776..674a57aeb 100644
--- a/test/e2e/run_dns_test.go
+++ b/test/e2e/run_dns_test.go
@@ -1,9 +1,10 @@
package integration
import (
+ "fmt"
"os"
+ "strings"
- "fmt"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
@@ -82,5 +83,23 @@ var _ = Describe("Podman run dns", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expect(session.OutputToString()).To(Equal("foobar"))
+
+ session = podmanTest.Podman([]string{"run", "-d", "--hostname=foobar", ALPINE, "cat", "/etc/hosts"})
+ session.WaitWithDefaultTimeout()
+ cid := session.OutputToString()
+ session = podmanTest.Podman([]string{"start", "-ia", cid})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session.LineInOutputContains("foobar")
+ line := strings.Split(session.OutputToStringArray()[len(session.OutputToStringArray())-1], "\t")
+ ip1 := line[0]
+
+ session = podmanTest.Podman([]string{"start", "-ia", cid})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ session.LineInOutputContains("foobar")
+ line = strings.Split(session.OutputToStringArray()[len(session.OutputToStringArray())-1], "\t")
+ ip2 := line[0]
+ Expect(ip2).To(Not(Equal(ip1)))
})
})