summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/libpod_suite_test.go4
-rw-r--r--test/e2e/run_networking_test.go38
-rw-r--r--test/e2e/run_userns_test.go2
3 files changed, 38 insertions, 6 deletions
diff --git a/test/e2e/libpod_suite_test.go b/test/e2e/libpod_suite_test.go
index 1b0c16e4a..466f79ae9 100644
--- a/test/e2e/libpod_suite_test.go
+++ b/test/e2e/libpod_suite_test.go
@@ -14,13 +14,13 @@ import (
"testing"
"time"
+ "github.com/containers/libpod/libpod"
+ "github.com/containers/libpod/pkg/inspect"
"github.com/containers/storage/pkg/parsers/kernel"
"github.com/containers/storage/pkg/reexec"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
- "github.com/projectatomic/libpod/libpod"
- "github.com/projectatomic/libpod/pkg/inspect"
)
var (
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index f7a7f8d67..a4bdcdf89 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -10,9 +10,10 @@ import (
var _ = Describe("Podman rmi", func() {
var (
- tempdir string
- err error
- podmanTest PodmanTest
+ tempdir string
+ err error
+ podmanTest PodmanTest
+ hostname, _ = os.Hostname()
)
BeforeEach(func() {
@@ -98,4 +99,35 @@ var _ = Describe("Podman rmi", func() {
Expect(containerConfig[0].NetworkSettings.Ports[0].HostPort).ToNot(Equal("80"))
})
+ It("podman run hostname test", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "printenv", "HOSTNAME"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ := session.GrepString(hostname)
+ Expect(match).Should(BeFalse())
+ })
+
+ It("podman run --net host hostname test", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--net", "host", ALPINE, "printenv", "HOSTNAME"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ := session.GrepString(hostname)
+ Expect(match).Should(BeTrue())
+ })
+
+ It("podman run --net host --hostname ... hostname test", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--net", "host", "--hostname", "foobar", ALPINE, "printenv", "HOSTNAME"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ := session.GrepString("foobar")
+ Expect(match).Should(BeTrue())
+ })
+
+ It("podman run --hostname ... hostname test", func() {
+ session := podmanTest.Podman([]string{"run", "--rm", "--hostname", "foobar", ALPINE, "printenv", "HOSTNAME"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ match, _ := session.GrepString("foobar")
+ Expect(match).Should(BeTrue())
+ })
})
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go
index ae0785378..f2a9af6bf 100644
--- a/test/e2e/run_userns_test.go
+++ b/test/e2e/run_userns_test.go
@@ -48,7 +48,7 @@ var _ = Describe("Podman UserNS support", func() {
// It essentially repeats the test above but with the `-it` short option
// that broke execution at:
- // https://github.com/projectatomic/libpod/pull/1066#issuecomment-403562116
+ // https://github.com/containers/libpod/pull/1066#issuecomment-403562116
// To avoid a potential future regression, use this as a test.
It("podman uidmapping and gidmapping with short-opts", func() {
if os.Getenv("SKIP_USERNS") != "" {