summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-12-15 18:28:40 +0100
committerPaul Holzinger <pholzing@redhat.com>2022-01-03 14:26:34 +0100
commitc496001d03f9eac87dfd6f3e3d655c40267b3837 (patch)
tree0859a51d3b1873d049dd0b0797ee719cd5ae62d8 /test/e2e
parent172d4eb40031a11d50c8198a569604f4bc915550 (diff)
downloadpodman-c496001d03f9eac87dfd6f3e3d655c40267b3837.tar.gz
podman-c496001d03f9eac87dfd6f3e3d655c40267b3837.tar.bz2
podman-c496001d03f9eac87dfd6f3e3d655c40267b3837.zip
add --ip6 flag to podman create/run
Add the --ipv6 flag to podman create/run and pod create. We support the --network name:ip6=<ip> syntax now but for docker compat we should also support the --ip6 flag. Note that there is no validation if the ip is actually a v6 or v4 address because the backend does not care either. Fixes #7511 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_staticip_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/e2e/run_staticip_test.go b/test/e2e/run_staticip_test.go
index eb7dc9d11..2f3c3025a 100644
--- a/test/e2e/run_staticip_test.go
+++ b/test/e2e/run_staticip_test.go
@@ -7,6 +7,7 @@ import (
"time"
. "github.com/containers/podman/v3/test/utils"
+ "github.com/containers/storage/pkg/stringid"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gexec"
@@ -65,6 +66,20 @@ var _ = Describe("Podman run with --ip flag", func() {
Expect(result.OutputToString()).To(ContainSubstring(ip + "/16"))
})
+ It("Podman run with specified static IPv6 has correct IP", func() {
+ netName := "ipv6-" + stringid.GenerateNonCryptoID()
+ ipv6 := "fd46:db93:aa76:ac37::10"
+ net := podmanTest.Podman([]string{"network", "create", "--subnet", "fd46:db93:aa76:ac37::/64", netName})
+ net.WaitWithDefaultTimeout()
+ defer podmanTest.removeCNINetwork(netName)
+ Expect(net).To(Exit(0))
+
+ result := podmanTest.Podman([]string{"run", "-ti", "--network", netName, "--ip6", ipv6, ALPINE, "ip", "addr"})
+ result.WaitWithDefaultTimeout()
+ Expect(result).Should(Exit(0))
+ Expect(result.OutputToString()).To(ContainSubstring(ipv6 + "/64"))
+ })
+
It("Podman run with --network bridge:ip=", func() {
ip := GetRandomIPAddress()
result := podmanTest.Podman([]string{"run", "-ti", "--network", "bridge:ip=" + ip, ALPINE, "ip", "addr"})