summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-12-08 15:31:49 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-12-14 15:23:39 +0100
commit4791595b5cb3b2350c66b0d1ba91a6a171652409 (patch)
tree8b14ea4bdf587b2ace2debd49c51b76977b9bdd6 /test
parent9ce6b64133bc37433efac391bcaf9234c3890fc5 (diff)
downloadpodman-4791595b5cb3b2350c66b0d1ba91a6a171652409.tar.gz
podman-4791595b5cb3b2350c66b0d1ba91a6a171652409.tar.bz2
podman-4791595b5cb3b2350c66b0d1ba91a6a171652409.zip
network connect allow ip, ipv6 and mac address
Network connect now supports setting a static ipv4, ipv6 and mac address for the container network. The options are added to the cli and api. Fixes #9883 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/e2e/network_connect_disconnect_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/e2e/network_connect_disconnect_test.go b/test/e2e/network_connect_disconnect_test.go
index 2205a1263..be94ecb2d 100644
--- a/test/e2e/network_connect_disconnect_test.go
+++ b/test/e2e/network_connect_disconnect_test.go
@@ -176,12 +176,14 @@ var _ = Describe("Podman network connect and disconnect", func() {
// Create a second network
newNetName := "aliasTest" + stringid.GenerateNonCryptoID()
- session = podmanTest.Podman([]string{"network", "create", newNetName})
+ session = podmanTest.Podman([]string{"network", "create", newNetName, "--subnet", "10.11.100.0/24"})
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
defer podmanTest.removeCNINetwork(newNetName)
- connect := podmanTest.Podman([]string{"network", "connect", newNetName, "test"})
+ ip := "10.11.100.99"
+ mac := "44:11:44:11:44:11"
+ connect := podmanTest.Podman([]string{"network", "connect", "--ip", ip, "--mac-address", mac, newNetName, "test"})
connect.WaitWithDefaultTimeout()
Expect(connect).Should(Exit(0))
Expect(connect.ErrorToString()).Should(Equal(""))
@@ -200,6 +202,8 @@ var _ = Describe("Podman network connect and disconnect", func() {
exec = podmanTest.Podman([]string{"exec", "-it", "test", "ip", "addr", "show", "eth1"})
exec.WaitWithDefaultTimeout()
Expect(exec).Should(Exit(0))
+ Expect(exec.OutputToString()).Should(ContainSubstring(ip))
+ Expect(exec.OutputToString()).Should(ContainSubstring(mac))
// make sure no logrus errors are shown https://github.com/containers/podman/issues/9602
rm := podmanTest.Podman([]string{"rm", "--time=0", "-f", "test"})