summaryrefslogtreecommitdiff
path: root/test/e2e/network_create_test.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-10-12 22:36:24 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-10-12 22:36:24 +0200
commitcead185373b0dabe2226d56bbd8d9e2b4edeb8eb (patch)
treebae2d9daf6aec7e2f94072afc1f712b86a85bd7e /test/e2e/network_create_test.go
parentc90beedbe160eb6e8094b492091231f3c5838006 (diff)
downloadpodman-cead185373b0dabe2226d56bbd8d9e2b4edeb8eb.tar.gz
podman-cead185373b0dabe2226d56bbd8d9e2b4edeb8eb.tar.bz2
podman-cead185373b0dabe2226d56bbd8d9e2b4edeb8eb.zip
CNI: fix network create --ip-range
The --ip-range option did not work correctly. The endIP was accidentally assigned to the start IP. New tests are added to make sure it works. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'test/e2e/network_create_test.go')
-rw-r--r--test/e2e/network_create_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/e2e/network_create_test.go b/test/e2e/network_create_test.go
index ae9f112b5..c9e13e7d2 100644
--- a/test/e2e/network_create_test.go
+++ b/test/e2e/network_create_test.go
@@ -43,7 +43,7 @@ var _ = Describe("Podman network create", func() {
It("podman network create with name and subnet", func() {
netName := "subnet-" + stringid.GenerateNonCryptoID()
- nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/24", netName})
+ nc := podmanTest.Podman([]string{"network", "create", "--subnet", "10.11.12.0/24", "--ip-range", "10.11.12.0/26", netName})
nc.WaitWithDefaultTimeout()
defer podmanTest.removeCNINetwork(netName)
Expect(nc).Should(Exit(0))
@@ -61,7 +61,11 @@ var _ = Describe("Podman network create", func() {
result := results[0]
Expect(result.Name).To(Equal(netName))
Expect(result.Subnets).To(HaveLen(1))
+ Expect(result.Subnets[0].Subnet.String()).To(Equal("10.11.12.0/24"))
Expect(result.Subnets[0].Gateway.String()).To(Equal("10.11.12.1"))
+ Expect(result.Subnets[0].LeaseRange).ToNot(BeNil())
+ Expect(result.Subnets[0].LeaseRange.StartIP.String()).To(Equal("10.11.12.1"))
+ Expect(result.Subnets[0].LeaseRange.EndIP.String()).To(Equal("10.11.12.63"))
// Once a container executes a new network, the nic will be created. We should clean those up
// best we can