コード例 #1
0
func (i IpRangeToStaticIps) ReserveStaticIpsInPool(ipPool *bftinput.IpPool) {
	staticIps, ok := i[ipPool.IpRange]
	if !ok {
		return
	}

	for _, ip := range staticIps {
		ipPool.ReserveStaticIp(ip)
	}
}
コード例 #2
0
	fakebftdecider "github.com/cloudfoundry-incubator/bosh-fuzz-tests/decider/fakes"
	bftinput "github.com/cloudfoundry-incubator/bosh-fuzz-tests/input"
	fakebftnamegen "github.com/cloudfoundry-incubator/bosh-fuzz-tests/name_generator/fakes"
	fakebftnetwork "github.com/cloudfoundry-incubator/bosh-fuzz-tests/parameter/network/fakes"
	boshlog "github.com/cloudfoundry/bosh-utils/logger"

	. "github.com/cloudfoundry-incubator/bosh-fuzz-tests/parameter/network"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("NetworksAssigner", func() {
	var (
		networksAssigner Assigner
		networks         [][]string
		expectedIpPool   *bftinput.IpPool
		decider          *fakebftdecider.FakeDecider
	)

	BeforeEach(func() {
		rand.Seed(64)

		networks = [][]string{[]string{"manual", "vip"}}
		nameGenerator := &fakebftnamegen.FakeNameGenerator{}
		nameGenerator.Names = []string{"foo-net", "bar-net", "baz-net", "qux-net"}
		ipPoolProvider := &fakebftnetwork.FakeIpPoolProvider{}
		vipPool := &bftinput.IpPool{}
		ipPoolProvider.RegisterIpPool(vipPool)

		ipPool := bftinput.NewIpPool(
			"192.168.0",