summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/network_test.go29
-rw-r--r--test/e2e/pod_create_test.go20
-rw-r--r--test/e2e/run_networking_test.go7
3 files changed, 49 insertions, 7 deletions
diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go
index 124ee7e29..c6010ba43 100644
--- a/test/e2e/network_test.go
+++ b/test/e2e/network_test.go
@@ -487,7 +487,6 @@ var _ = Describe("Podman network", func() {
inspect := podmanTest.Podman([]string{"network", "inspect", net})
inspect.WaitWithDefaultTimeout()
Expect(inspect.ExitCode()).To(BeZero())
- fmt.Println(inspect.OutputToString())
out, err := inspect.jq(".[0].plugins[0].master")
Expect(err).To(BeNil())
@@ -513,4 +512,32 @@ var _ = Describe("Podman network", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(1))
})
+
+ It("podman network create macvlan with network info and options", func() {
+ net := "macvlan" + stringid.GenerateNonCryptoID()
+ nc := podmanTest.Podman([]string{"network", "create", "-d", "macvlan", "-o", "parent=lo", "-o", "mtu=1500", "--gateway", "192.168.1.254", "--subnet", "192.168.1.0/24", net})
+ nc.WaitWithDefaultTimeout()
+ defer podmanTest.removeCNINetwork(net)
+ Expect(nc.ExitCode()).To(Equal(0))
+
+ inspect := podmanTest.Podman([]string{"network", "inspect", net})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect.ExitCode()).To(BeZero())
+
+ mtu, err := inspect.jq(".[0].plugins[0].mtu")
+ Expect(err).To(BeNil())
+ Expect(mtu).To(Equal("1500"))
+
+ gw, err := inspect.jq(".[0].plugins[0].ipam.ranges[0][0].gateway")
+ Expect(err).To(BeNil())
+ Expect(gw).To(Equal("\"192.168.1.254\""))
+
+ subnet, err := inspect.jq(".[0].plugins[0].ipam.ranges[0][0].subnet")
+ Expect(err).To(BeNil())
+ Expect(subnet).To(Equal("\"192.168.1.0/24\""))
+
+ nc = podmanTest.Podman([]string{"network", "rm", net})
+ nc.WaitWithDefaultTimeout()
+ Expect(nc.ExitCode()).To(Equal(0))
+ })
})
diff --git a/test/e2e/pod_create_test.go b/test/e2e/pod_create_test.go
index fc634d36f..e57712f62 100644
--- a/test/e2e/pod_create_test.go
+++ b/test/e2e/pod_create_test.go
@@ -478,12 +478,7 @@ entrypoint ["/fromimage"]
})
It("podman create with unsupported network options", func() {
- podCreate := podmanTest.Podman([]string{"pod", "create", "--network", "none"})
- podCreate.WaitWithDefaultTimeout()
- Expect(podCreate.ExitCode()).To(Equal(125))
- Expect(podCreate.ErrorToString()).To(ContainSubstring("pods presently do not support network mode none"))
-
- podCreate = podmanTest.Podman([]string{"pod", "create", "--network", "container:doesnotmatter"})
+ podCreate := podmanTest.Podman([]string{"pod", "create", "--network", "container:doesnotmatter"})
podCreate.WaitWithDefaultTimeout()
Expect(podCreate.ExitCode()).To(Equal(125))
Expect(podCreate.ErrorToString()).To(ContainSubstring("pods presently do not support network mode container"))
@@ -493,4 +488,17 @@ entrypoint ["/fromimage"]
Expect(podCreate.ExitCode()).To(Equal(125))
Expect(podCreate.ErrorToString()).To(ContainSubstring("pods presently do not support network mode path"))
})
+
+ It("podman pod create with --net=none", func() {
+ podName := "testPod"
+ podCreate := podmanTest.Podman([]string{"pod", "create", "--network", "none", "--name", podName})
+ podCreate.WaitWithDefaultTimeout()
+ Expect(podCreate.ExitCode()).To(Equal(0))
+
+ session := podmanTest.Podman([]string{"run", "--pod", podName, ALPINE, "ip", "-o", "-4", "addr"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("inet 127.0.0.1/8 scope host lo"))
+ Expect(len(session.OutputToStringArray())).To(Equal(1))
+ })
})
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index ebea2132a..676f24e5d 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -376,6 +376,13 @@ var _ = Describe("Podman run networking", func() {
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman run slirp4netns network with mtu", func() {
+ session := podmanTest.Podman([]string{"run", "--network", "slirp4netns:mtu=9000", ALPINE, "ip", "addr"})
+ session.Wait(30)
+ Expect(session.ExitCode()).To(Equal(0))
+ Expect(session.OutputToString()).To(ContainSubstring("mtu 9000"))
+ })
+
It("podman run slirp4netns network with different cidr", func() {
slirp4netnsHelp := SystemExec("slirp4netns", []string{"--help"})
Expect(slirp4netnsHelp.ExitCode()).To(Equal(0))