|
@@ -10,7 +10,7 @@ import (
|
|
|
)
|
|
|
|
|
|
func getAllocator(subnet *net.IPNet) *Allocator {
|
|
|
- a := NewAllocator()
|
|
|
+ a := NewAllocator(nil)
|
|
|
a.AddSubnet("default", &SubnetInfo{Subnet: subnet})
|
|
|
return a
|
|
|
}
|
|
@@ -58,7 +58,7 @@ func TestGetAddressVersion(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func TestAddSubnets(t *testing.T) {
|
|
|
- a := NewAllocator()
|
|
|
+ a := NewAllocator(nil)
|
|
|
|
|
|
_, sub0, _ := net.ParseCIDR("10.0.0.0/8")
|
|
|
err := a.AddSubnet("default", &SubnetInfo{Subnet: sub0})
|
|
@@ -133,7 +133,7 @@ func TestAdjustAndCheckSubnet(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func TestRemoveSubnet(t *testing.T) {
|
|
|
- a := NewAllocator()
|
|
|
+ a := NewAllocator(nil)
|
|
|
|
|
|
input := []struct {
|
|
|
addrSpace AddressSpace
|
|
@@ -247,7 +247,7 @@ func TestGetAddress(t *testing.T) {
|
|
|
}
|
|
|
|
|
|
func TestGetSubnetList(t *testing.T) {
|
|
|
- a := NewAllocator()
|
|
|
+ a := NewAllocator(nil)
|
|
|
input := []struct {
|
|
|
addrSpace AddressSpace
|
|
|
subnet string
|
|
@@ -295,7 +295,7 @@ func TestGetSubnetList(t *testing.T) {
|
|
|
|
|
|
func TestRequestSyntaxCheck(t *testing.T) {
|
|
|
var (
|
|
|
- a = NewAllocator()
|
|
|
+ a = NewAllocator(nil)
|
|
|
subnet = "192.168.0.0/16"
|
|
|
addSpace = AddressSpace("green")
|
|
|
)
|
|
@@ -462,7 +462,7 @@ func assertGetAddress(t *testing.T, subnet string) {
|
|
|
|
|
|
bm := &bitmask{
|
|
|
subnet: sub,
|
|
|
- addressMask: bitseq.NewHandle("default/192.168.0.0/24", uint32(numAddresses)),
|
|
|
+ addressMask: bitseq.NewHandle("ipam_test", nil, "default/192.168.0.0/24", uint32(numAddresses)),
|
|
|
freeAddresses: numAddresses,
|
|
|
}
|
|
|
numBlocks := bm.addressMask.Head.Count
|
|
@@ -513,7 +513,7 @@ func assertNRequests(t *testing.T, subnet string, numReq int, lastExpectedIP str
|
|
|
func benchmarkRequest(subnet *net.IPNet) {
|
|
|
var err error
|
|
|
|
|
|
- a := NewAllocator()
|
|
|
+ a := NewAllocator(nil)
|
|
|
a.internalHostSize = 20
|
|
|
a.AddSubnet("default", &SubnetInfo{Subnet: subnet})
|
|
|
|