summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-11-20 12:48:30 -0500
committerMatthew Heon <matthew.heon@pm.me>2019-11-26 09:56:14 -0500
commit01ae532a899997cb4c930003d4f2f5d5820ba7d7 (patch)
tree6abe3cfe142b406334d8867eaaa2f24670687301 /test/e2e
parentaef38585ed313d1096c1fa4f6281f36e5e47422b (diff)
downloadpodman-01ae532a899997cb4c930003d4f2f5d5820ba7d7.tar.gz
podman-01ae532a899997cb4c930003d4f2f5d5820ba7d7.tar.bz2
podman-01ae532a899997cb4c930003d4f2f5d5820ba7d7.zip
Allow --ip and --mac to be set when joining a CNI net
These only conflict when joining more than one network. We can still set a single CNI network and set a static IP and/or static MAC. Fixes #4500 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/run_networking_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index ec12f709a..5e587b198 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -232,4 +232,18 @@ var _ = Describe("Podman run networking", func() {
Expect(session).To(ExitWithError())
Expect(session.ErrorToString()).To(ContainSubstring("stat /run/netns/xxy: no such file or directory"))
})
+
+ It("podman run in custom CNI network with --static-ip", func() {
+ SkipIfRootless()
+ netName := "podmantestnetwork"
+ ipAddr := "10.20.30.128"
+ create := podmanTest.Podman([]string{"network", "create", "--subnet", "10.20.30.0/24", netName})
+ create.WaitWithDefaultTimeout()
+ Expect(create.ExitCode()).To(BeZero())
+
+ run := podmanTest.Podman([]string{"run", "-t", "-i", "--rm", "--net", netName, "--ip", ipAddr, ALPINE, "ip", "addr"})
+ run.WaitWithDefaultTimeout()
+ Expect(run.ExitCode()).To(BeZero())
+ Expect(run.OutputToString()).To(ContainSubstring(ipAddr))
+ })
})