@@ -20,7 +20,7 @@ func TestLeasePoolBasic(t *testing.T) {
2020 defer pool .Close ()
2121
2222 mac := net.HardwareAddr {0x00 , 0x11 , 0x22 , 0x33 , 0x44 , 0x55 }
23- ip , err := pool .Allocate (& net.Interface {Name : "lo" }, mac )
23+ ip , err := pool .Allocate (& net.Interface {Name : "lo" }, mac , false )
2424 if err != nil {
2525 t .Fatalf ("Failed to allocate IP for MAC=%s: %v" , mac , err )
2626 }
@@ -61,14 +61,14 @@ func TestLeasePoolExhaustion(t *testing.T) {
6161 {0xDE , 0xAD , 0xBE , 0xEF , 0x03 , 0x30 },
6262 }
6363 for _ , mac := range macs {
64- _ , err := pool .Allocate (& net.Interface {Name : "lo" }, mac )
64+ _ , err := pool .Allocate (& net.Interface {Name : "lo" }, mac , false )
6565 if err != nil {
6666 t .Fatalf ("Unexpected error allocating IP: %v" , err )
6767 }
6868 }
6969
7070 // next allocation should fail
71- _ , err = pool .Allocate (& net.Interface {Name : "lo" }, net.HardwareAddr {0xDE , 0xAD , 0xBE , 0xEF , 0x04 , 0x40 })
71+ _ , err = pool .Allocate (& net.Interface {Name : "lo" }, net.HardwareAddr {0xDE , 0xAD , 0xBE , 0xEF , 0x04 , 0x40 }, false )
7272 if err == nil {
7373 t .Fatal ("Expected an error due to IP exhaustion, but got nil" )
7474 }
@@ -85,7 +85,7 @@ func TestLeasePoolExpiry(t *testing.T) {
8585 defer pool .Close ()
8686
8787 mac := net.HardwareAddr {0xCA , 0xFE , 0xBA , 0xBE , 0xBC , 0x01 }
88- ip , err := pool .Allocate (& net.Interface {Name : "lo" }, mac )
88+ ip , err := pool .Allocate (& net.Interface {Name : "lo" }, mac , false )
8989 if err != nil {
9090 t .Fatalf ("Failed to allocate IP=%v" , err )
9191 }
@@ -98,7 +98,7 @@ func TestLeasePoolExpiry(t *testing.T) {
9898 }
9999
100100 // allocation should return the same IP
101- ip2 , err := pool .Allocate (& net.Interface {Name : "lo" }, mac )
101+ ip2 , err := pool .Allocate (& net.Interface {Name : "lo" }, mac , false )
102102 if err != nil {
103103 t .Fatalf ("Failed to re-allocate IP after expiry: %v" , err )
104104 }
@@ -125,7 +125,7 @@ func TestLeaseWrapAround(t *testing.T) {
125125 mac4 , _ := net .ParseMAC ("00:11:22:33:44:04" )
126126
127127 //(offset 0)
128- ip1 , err := pool .Allocate (iface , mac1 )
128+ ip1 , err := pool .Allocate (iface , mac1 , false )
129129 if err != nil {
130130 t .Fatalf ("Allocate(mac1) failed: %v" , err )
131131 }
@@ -134,7 +134,7 @@ func TestLeaseWrapAround(t *testing.T) {
134134 }
135135
136136 //(offset 1)
137- ip2 , err := pool .Allocate (iface , mac2 )
137+ ip2 , err := pool .Allocate (iface , mac2 , false )
138138 if err != nil {
139139 t .Fatalf ("Allocate(mac2) failed: %v" , err )
140140 }
@@ -143,7 +143,7 @@ func TestLeaseWrapAround(t *testing.T) {
143143 }
144144
145145 //(offset 2)
146- ip3 , err := pool .Allocate (iface , mac3 )
146+ ip3 , err := pool .Allocate (iface , mac3 , false )
147147 if err != nil {
148148 t .Fatalf ("Allocate(mac3) failed: %v" , err )
149149 }
@@ -156,7 +156,7 @@ func TestLeaseWrapAround(t *testing.T) {
156156 t .Fatalf ("Release(ip2) failed: %v" , err )
157157 }
158158
159- mac4IP , err := pool .Allocate (iface , mac4 )
159+ mac4IP , err := pool .Allocate (iface , mac4 , false )
160160 if err != nil {
161161 t .Fatalf ("Allocate(mac4) failed: %v" , err )
162162 }
@@ -165,7 +165,7 @@ func TestLeaseWrapAround(t *testing.T) {
165165 }
166166
167167 mac5 , _ := net .ParseMAC ("00:11:22:33:44:05" )
168- ip5 , err := pool .Allocate (iface , mac5 )
168+ ip5 , err := pool .Allocate (iface , mac5 , false )
169169 if err != nil {
170170 t .Fatalf ("Allocate(mac5) failed: %v" , err )
171171 }
@@ -174,7 +174,7 @@ func TestLeaseWrapAround(t *testing.T) {
174174 }
175175
176176 mac6 , _ := net .ParseMAC ("00:11:22:33:44:06" )
177- ip6 , err := pool .Allocate (iface , mac6 )
177+ ip6 , err := pool .Allocate (iface , mac6 , false )
178178 if err != nil {
179179 t .Fatalf ("Allocate(mac6) failed: %v" , err )
180180 }
0 commit comments