summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-12-13 15:56:20 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-12-14 15:23:40 +0100
commit3e9af2029f1f92fbc069f81ba9ca90c090617e9c (patch)
tree2722625080848dd49e91ac60c93b10f5e5cda565 /test/e2e
parent535818414c2a6bdcf6434e36c33775ea1a43f1cf (diff)
downloadpodman-3e9af2029f1f92fbc069f81ba9ca90c090617e9c.tar.gz
podman-3e9af2029f1f92fbc069f81ba9ca90c090617e9c.tar.bz2
podman-3e9af2029f1f92fbc069f81ba9ca90c090617e9c.zip
play kube add support for multiple networks
Allow the same --network options for play kube as for podman run/create. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/play_kube_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 36010704f..f79710ee6 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -2136,6 +2136,41 @@ spec:
}
})
+ It("podman play kube with multiple networks", func() {
+ ctr := getCtr(withImage(ALPINE))
+ pod := getPod(withCtr(ctr))
+ err := generateKubeYaml("pod", pod, kubeYaml)
+ Expect(err).To(BeNil())
+
+ net1 := "net1" + stringid.GenerateNonCryptoID()
+ net2 := "net2" + stringid.GenerateNonCryptoID()
+
+ net := podmanTest.Podman([]string{"network", "create", "--subnet", "10.0.11.0/24", net1})
+ net.WaitWithDefaultTimeout()
+ defer podmanTest.removeCNINetwork(net1)
+ Expect(net).Should(Exit(0))
+
+ net = podmanTest.Podman([]string{"network", "create", "--subnet", "10.0.12.0/24", net2})
+ net.WaitWithDefaultTimeout()
+ defer podmanTest.removeCNINetwork(net2)
+ Expect(net).Should(Exit(0))
+
+ ip1 := "10.0.11.5"
+ ip2 := "10.0.12.10"
+
+ kube := podmanTest.Podman([]string{"play", "kube", "--network", net1 + ":ip=" + ip1, "--network", net2 + ":ip=" + ip2, kubeYaml})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube).Should(Exit(0))
+
+ inspect := podmanTest.Podman([]string{"exec", getCtrNameInPod(pod), "ip", "addr"})
+ inspect.WaitWithDefaultTimeout()
+ Expect(inspect).Should(Exit(0))
+ Expect(inspect.OutputToString()).To(ContainSubstring(ip1))
+ Expect(inspect.OutputToString()).To(ContainSubstring(ip2))
+ Expect(inspect.OutputToString()).To(ContainSubstring("eth0"))
+ Expect(inspect.OutputToString()).To(ContainSubstring("eth1"))
+ })
+
It("podman play kube test with network portbindings", func() {
ip := "127.0.0.100"
port := "5000"