summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/e2e/create_staticip_test.go6
-rw-r--r--test/e2e/network_connect_disconnect_test.go11
-rw-r--r--test/e2e/run_staticip_test.go20
-rw-r--r--test/system/030-run.bats4
4 files changed, 30 insertions, 11 deletions
diff --git a/test/e2e/create_staticip_test.go b/test/e2e/create_staticip_test.go
index 205855fd6..ded4c03e0 100644
--- a/test/e2e/create_staticip_test.go
+++ b/test/e2e/create_staticip_test.go
@@ -43,12 +43,6 @@ var _ = Describe("Podman create with --ip flag", func() {
Expect(result).To(ExitWithError())
})
- It("Podman create --ip with v6 address", func() {
- result := podmanTest.Podman([]string{"create", "--name", "test", "--ip", "2001:db8:bad:beef::1", ALPINE, "ls"})
- result.WaitWithDefaultTimeout()
- Expect(result).To(ExitWithError())
- })
-
It("Podman create --ip with non-allocatable IP", func() {
SkipIfRootless("--ip not supported without network in rootless mode")
result := podmanTest.Podman([]string{"create", "--name", "test", "--ip", "203.0.113.124", ALPINE, "ls"})
diff --git a/test/e2e/network_connect_disconnect_test.go b/test/e2e/network_connect_disconnect_test.go
index be94ecb2d..23281fe05 100644
--- a/test/e2e/network_connect_disconnect_test.go
+++ b/test/e2e/network_connect_disconnect_test.go
@@ -8,6 +8,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
+ "github.com/onsi/gomega/types"
)
var _ = Describe("Podman network connect and disconnect", func() {
@@ -330,11 +331,17 @@ var _ = Describe("Podman network connect and disconnect", func() {
exec := podmanTest.Podman([]string{"exec", "-it", "test", "ip", "addr", "show", "eth0"})
exec.WaitWithDefaultTimeout()
- Expect(exec).Should(Exit(0))
+
+ // because the network interface order is not guaranteed to be the same we have to check both eth0 and eth1
+ // if eth0 did not exists eth1 has to exists
+ var exitMatcher types.GomegaMatcher = ExitWithError()
+ if exec.ExitCode() > 0 {
+ exitMatcher = Exit(0)
+ }
exec = podmanTest.Podman([]string{"exec", "-it", "test", "ip", "addr", "show", "eth1"})
exec.WaitWithDefaultTimeout()
- Expect(exec).Should(ExitWithError())
+ Expect(exec).Should(exitMatcher)
})
It("podman network disconnect and run with network ID", func() {
diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go
index 6dd7a14d0..eb7dc9d11 100644
--- a/test/e2e/run_staticip_test.go
+++ b/test/e2e/run_staticip_test.go
@@ -65,6 +65,26 @@ var _ = Describe("Podman run with --ip flag", func() {
Expect(result.OutputToString()).To(ContainSubstring(ip + "/16"))
})
+ It("Podman run with --network bridge:ip=", func() {
+ ip := GetRandomIPAddress()
+ result := podmanTest.Podman([]string{"run", "-ti", "--network", "bridge:ip=" + ip, ALPINE, "ip", "addr"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(ip + "/16"))
+ })
+
+ It("Podman run with --network net:ip=,mac=,interface_name=", func() {
+ ip := GetRandomIPAddress()
+ mac := "44:33:22:11:00:99"
+ intName := "myeth"
+ result := podmanTest.Podman([]string{"run", "-ti", "--network", "bridge:ip=" + ip + ",mac=" + mac + ",interface_name=" + intName, ALPINE, "ip", "addr"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(ip + "/16"))
+ Expect(result.OutputToString()).To(ContainSubstring(mac))
+ Expect(result.OutputToString()).To(ContainSubstring(intName))
+ })
+
It("Podman run two containers with the same IP", func() {
ip := GetRandomIPAddress()
result := podmanTest.Podman([]string{"run", "-dt", "--ip", ip, nginx})
diff --git a/test/system/030-run.bats b/test/system/030-run.bats
index 5937d38f8..6f1fa600a 100644
--- a/test/system/030-run.bats
+++ b/test/system/030-run.bats
@@ -586,9 +586,7 @@ json-file | f
@test "podman run with --net=host and --port prints warning" {
rand=$(random_string 10)
- # Please keep the duplicate "--net" options; this tests against #8507,
- # a regression in which subsequent --net options did not override earlier.
- run_podman run --rm -p 8080 --net=none --net=host $IMAGE echo $rand
+ run_podman run --rm -p 8080 --net=host $IMAGE echo $rand
is "${lines[0]}" \
"Port mappings have been discarded as one of the Host, Container, Pod, and None network modes are in use" \
"Warning is emitted before container output"