summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-12 13:11:39 -0400
committerGitHub <noreply@github.com>2020-08-12 13:11:39 -0400
commit4ef4f522f9a2850e14a93186c647175685166d95 (patch)
tree90533eb1d43bae0f7880210233148676ed976539 /test
parent8e4842a14deff83cef7996e393cfc9fa932bfb30 (diff)
parent95e73c65ae01a83658619083f218ae8ebdbef906 (diff)
downloadpodman-4ef4f522f9a2850e14a93186c647175685166d95.tar.gz
podman-4ef4f522f9a2850e14a93186c647175685166d95.tar.bz2
podman-4ef4f522f9a2850e14a93186c647175685166d95.zip
Merge pull request #7308 from hamzadis/slirp4netns-cidr
Add support for setting the CIDR when using slirp4netns
Diffstat (limited to 'test')
-rw-r--r--test/e2e/run_networking_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/e2e/run_networking_test.go b/test/e2e/run_networking_test.go
index d735217d6..83befe730 100644
--- a/test/e2e/run_networking_test.go
+++ b/test/e2e/run_networking_test.go
@@ -293,6 +293,22 @@ var _ = Describe("Podman run networking", func() {
Expect(session.ExitCode()).To(Equal(0))
})
+ It("podman run slirp4netns network with different cidr", func() {
+ slirp4netnsHelp := SystemExec("slirp4netns", []string{"--help"})
+ Expect(slirp4netnsHelp.ExitCode()).To(Equal(0))
+
+ networkConfiguration := "slirp4netns:cidr=192.168.0.0/24,allow_host_loopback=true"
+ session := podmanTest.Podman([]string{"run", "--network", networkConfiguration, ALPINE, "ping", "-c1", "192.168.0.2"})
+ session.Wait(30)
+
+ if strings.Contains(slirp4netnsHelp.OutputToString(), "cidr") {
+ Expect(session.ExitCode()).To(Equal(0))
+ } else {
+ Expect(session.ExitCode()).ToNot(Equal(0))
+ Expect(session.ErrorToString()).To(ContainSubstring("cidr not supported"))
+ }
+ })
+
It("podman run network bind to 127.0.0.1", func() {
slirp4netnsHelp := SystemExec("slirp4netns", []string{"--help"})
Expect(slirp4netnsHelp.ExitCode()).To(Equal(0))